From 82da7767a387b43ee3ccedf8cf8a82f3b5eb2c4d Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Wed, 23 Jan 2019 15:19:11 +0100
Subject: [PATCH 001/404] Fix whitespace in EFMissingETFlags.cxx

---
 .../TrigEFMissingET/src/EFMissingETFlags.cxx  | 142 +++++++++---------
 1 file changed, 71 insertions(+), 71 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
index 4f6693baaff..5b639df6906 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
@@ -254,58 +254,58 @@ StatusCode EFMissingETFlags::execute(xAOD::TrigMissingET *met ,
 
       // compute auxiliary quantities
       if (i<4) { // EMB
-	if (Name.substr(0,3)=="EMB" || Name=="PreSamplB" ) {
-	  EM_SumE += sumE;
-	  EMB_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find EMB!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,3)=="EMB" || Name=="PreSamplB" ) {
+      	  EM_SumE += sumE;
+      	  EMB_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find EMB!  Skipping check" );
+      	  break;
+      	}
       } else if (i<8) { // EME
-	if (Name.substr(0,3)=="EME" || Name=="PreSamplE" ) {
-	  EM_SumE += sumE;
-	  EME_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find EME!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,3)=="EME" || Name=="PreSamplE" ) {
+      	  EM_SumE += sumE;
+      	  EME_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find EME!  Skipping check" );
+      	  break;
+      	}
       } else if (i<12) { // HEC
-	if (Name.substr(0,3)=="HEC") {
-	  HEC_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find HEC!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,3)=="HEC") {
+      	  HEC_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find HEC!  Skipping check" );
+      	  break;
+      	}
       } else if (i<15) { // TileBar
-	if (Name.substr(0,7)=="TileBar") {
-	  TileBar_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find TileBar!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,7)=="TileBar") {
+      	  TileBar_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find TileBar!  Skipping check" );
+      	  break;
+      	}
       } else if (i<18) { // TileGap
-	if (Name.substr(0,7)=="TileGap") {
-	  TileGap_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find TileGap!  Skipping check" );
-	break;
-	}
+      	if (Name.substr(0,7)=="TileGap") {
+      	  TileGap_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find TileGap!  Skipping check" );
+      	break;
+      	}
       } else if (i<21) { // TileExt
-	if (Name.substr(0,7)=="TileExt") {
-	  TileExt_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find TileExt!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,7)=="TileExt") {
+      	  TileExt_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find TileExt!  Skipping check" );
+      	  break;
+      	}
       } else { // FCal
         // note: i must be < 28 because i < elem-18 = 42-14 = 28
-	if (Name.substr(0,4)=="FCal") {
-	  if (Name == "FCalEM") EM_SumE += sumE;
-	  FCal_SumE += sumE;
-	} else {
-    ATH_MSG_WARNING( "Cannot find FCal!  Skipping check" );
-	  break;
-	}
+      	if (Name.substr(0,4)=="FCal") {
+      	  if (Name == "FCalEM") EM_SumE += sumE;
+      	  FCal_SumE += sumE;
+      	} else {
+          ATH_MSG_WARNING( "Cannot find FCal!  Skipping check" );
+      	  break;
+      	}
       }  // end loop over i
 
      }  //end elem == 42
@@ -363,45 +363,45 @@ StatusCode EFMissingETFlags::execute(xAOD::TrigMissingET *met ,
     // flag component if SumE/SumE_subdet is outside the allowed range
     if (i<4) {
       if (EMB_SumE != 0) {
-	float ratio = sumE / EMB_SumE;
-	if (ratio<m_MinSumEratioInEMB || ratio>m_MaxSumEratioInEMB) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+      	float ratio = sumE / EMB_SumE;
+      	if (ratio<m_MinSumEratioInEMB || ratio>m_MaxSumEratioInEMB) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<8) {
       if (EME_SumE != 0) {
-	float ratio = sumE / EME_SumE;
-	if (ratio<m_MinSumEratioInEME || ratio>m_MaxSumEratioInEME) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+      	float ratio = sumE / EME_SumE;
+      	if (ratio<m_MinSumEratioInEME || ratio>m_MaxSumEratioInEME) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<12) {
       if (HEC_SumE != 0) {
-	float ratio = sumE / HEC_SumE;
-	if (ratio<m_MinSumEratioInHEC || ratio>m_MaxSumEratioInHEC) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+      	float ratio = sumE / HEC_SumE;
+      	if (ratio<m_MinSumEratioInHEC || ratio>m_MaxSumEratioInHEC) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<15) {
       if (TileBar_SumE != 0) {
-	float ratio = sumE / TileBar_SumE;
-	if (ratio<m_MinSumEratioInTileBar || ratio>m_MaxSumEratioInTileBar) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+      	float ratio = sumE / TileBar_SumE;
+      	if (ratio<m_MinSumEratioInTileBar || ratio>m_MaxSumEratioInTileBar) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<18) {
-      if (TileGap_SumE != 0) {
-	float ratio = sumE / TileGap_SumE;
-	if (ratio<m_MinSumEratioInTileGap || ratio>m_MaxSumEratioInTileGap) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+            if (TileGap_SumE != 0) {
+      	float ratio = sumE / TileGap_SumE;
+      	if (ratio<m_MinSumEratioInTileGap || ratio>m_MaxSumEratioInTileGap) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<21) {
-      if (TileExt_SumE != 0) {
-	float ratio = sumE / TileExt_SumE;
-	if (ratio<m_MinSumEratioInTileExt || ratio>m_MaxSumEratioInTileExt) {
-	  metComp->m_status |= m_maskBadEnergyRatio;
-	}
+            if (TileExt_SumE != 0) {
+      	float ratio = sumE / TileExt_SumE;
+      	if (ratio<m_MinSumEratioInTileExt || ratio>m_MaxSumEratioInTileExt) {
+      	  metComp->m_status |= m_maskBadEnergyRatio;
+      	}
       }
     } else if (i<24) {
        if (FCal_SumE != 0) {
-- 
GitLab


From 0cb02ccfb68d0d199a59c7a3205bfe4c3497f671 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 24 Jan 2019 15:45:07 +0100
Subject: [PATCH 002/404] Factorize code in EFMissingETFromHelper

---
 .../TrigEFMissingET/EFMissingETFromHelper.h   |  20 ++
 .../src/EFMissingETFromHelper.cxx             | 288 +++++-------------
 2 files changed, 95 insertions(+), 213 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
index f5ac2f4ffe2..b48d8c3d5c0 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
@@ -56,6 +56,26 @@ class EFMissingETFromHelper : public EFMissingETBaseTool
 
 
     StatusCode executeMT(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper);
+
+  private:
+    void setMET(xAOD::TrigMissingET *met, 
+                float ex, float ey, float ez,
+                float sumE, float sumEt, 
+                short sumOfSigns, float c0, float c1);
+
+    void setMETComp(xAOD::TrigMissingET *met, int comp_i, char* comp_name,
+                    float ex, float ey, float ez,
+                    float sumE, float sumEt,
+                    short sumOfSigns, float c0, float c1,
+                    short status, unsigned short Ntot,
+                    bool update=false);
+
+    void updateMETComp(xAOD::TrigEFMissingET *met, const int comp_i
+                      float ex, float ey, float ez,
+                      float sumE, float sumEt,
+                      short sumOfSigns, float c0, float c1,
+                      short status, unsigned short Ntot);
+
 };
 
 #endif // TRIGEFMISSINGET_EFMISSINGETFROMHELPER
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index c7b01da03dc..123fd72080c 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -69,8 +69,61 @@ StatusCode EFMissingETFromHelper::finalize()
   return StatusCode::SUCCESS;
 }
 
+void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *met, 
+                                  const float ex, const float ey, const float ez,
+                                  const float sumE, const float sumEt, 
+                                  const short sumOfSigns, const float c0, const float c1)
+{
+  met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
+  met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
+  met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
+  met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
+  met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+  return;
+}
 
+void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *met, const int comp_i, const char* comp_name,
+                                      const float ex, const float ey, const float ez,
+                                      const float sumE, float sumEt,
+                                      const short sumOfSigns, const float c0, const float c1,
+                                      const short status, const unsigned short Ntot,
+                                      bool update)
+{
+  if (comp_name && !update) 
+    met->setNameOfComponent(        comp_i, comp_name );
+  met->setExComponent(              comp_i, ex );
+  met->setEyComponent(              comp_i, ey );
+  met->setEzComponent(              comp_i, ez );
+  met->setSumEtComponent(           comp_i, sumEt );
+  met->setSumEComponent(            comp_i, sumE );
+  met->setCalib0Component(          comp_i, c0 );
+  met->setCalib1Component(          comp_i, c1 );
+  met->setStatusComponent(          comp_i, status );
+  met->setSumOfSignsComponent(      comp_i, sumOfSigns );
+  met->setUsedChannelsComponent(    comp_i, Ntot );
+  return;
+}
 
+void EFMissingETFromHelper::updateMETComp(xAOD::TrigEFMissingET *met, const int comp_i,
+                                          float ex, float ey, float ez,
+                                          float sumE, float sumEt,
+                                          short sumOfSigns, float c0, float c1,
+                                          short status, unsigned short Ntot)
+{
+  setMETComp(met, comp_i, nullptr, 
+            ex         + met->exComponent(comp_i+1),
+            ey         + met->eyComponent(comp_i+1),
+            ez         + met->ezComponent(comp_i+1),
+            sumE       + met->sumEComponent(comp_i+1),
+            sumEt      + met->sumEtComponent(comp_i+1),
+            sumOfSigns + met->sumOfSignsComponent(comp_i+1),
+            c0, c1,
+            status     | met->statusComponent(comp_i+1),
+            Ntot       + met->usedChannelsComponent(comp_i+1),
+            true
+            )
+
+}
 StatusCode EFMissingETFromHelper::execute()
 {
   return StatusCode::SUCCESS;
@@ -162,169 +215,56 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
     // basic info - DK calibration
     if (i<elem-18){  // skip muon or Had Topo granular or EM Topo correction for all quantities
-      met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
-      met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
-      met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
-      met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
-      met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
     }
 
     if(save9comp && i == 24) { // Save summed HAD MET
-      met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
-      met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
-      met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
-      met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
-      met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
     }
 
     if( (save2comp || save6comp) && i == 34) { // Save JET MET
-      met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
-      met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
-      met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
-      met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
-      met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
     }
 
     if(save3comp && i == 39) { // Save PUC MET
-      met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
-      met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
-      met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
-      met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
-      met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
     }
 
     if (skipAuxInfo) continue;
 
     // auxiliary info - uncorrected
     if (comp == unsigned(elem-17) && i < 24) { // finest granularity
-      met->setNameOfComponent( i, metComp->m_name );
-      met->setExComponent(     i, ex );
-      met->setEyComponent(     i, ey );
-      met->setEzComponent(     i, ez );
-      met->setSumEtComponent(  i, sumEt );
-      met->setSumEComponent(   i, sumE );
-      met->setCalib0Component( i, c0 );
-      met->setCalib1Component( i, c1 );
-      met->setStatusComponent(          i, status );
-      met->setSumOfSignsComponent(      i, sumOfSigns );
-      met->setUsedChannelsComponent(    i, Ntot );
+      setMETComp(met, i, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
     } else if(comp == unsigned(elem-17) && i == 41) { // save muons
-      met->setNameOfComponent( i-17, metComp->m_name );
-      met->setExComponent(     i-17, ex );
-      met->setEyComponent(     i-17, ey );
-      met->setEzComponent(     i-17, ez );
-      met->setSumEtComponent(  i-17, sumEt );
-      met->setSumEComponent(   i-17, sumE );
-      met->setCalib0Component( i-17, c0 );
-      met->setCalib1Component( i-17, c1 );
-      met->setStatusComponent(          i-17, status );
-      met->setSumOfSignsComponent(      i-17, sumOfSigns );
-      met->setUsedChannelsComponent(    i-17, Ntot );
+      setMETComp(met, i-17, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
     } else if (save6comp) {
       if (i>=34 && i < 39) { // Central and Forward Jets
-        met->setNameOfComponent( i-34, metComp->m_name );
-        met->setExComponent(     i-34, ex );
-        met->setEyComponent(     i-34, ey );
-        met->setEzComponent(     i-34, ez );
-        met->setSumEtComponent(  i-34, sumEt );
-        met->setSumEComponent(   i-34, sumE );
-        met->setCalib0Component( i-34, c0 );
-        met->setCalib1Component( i-34, c1 );
-        met->setStatusComponent(          i-34, status );
-        met->setSumOfSignsComponent(      i-34, sumOfSigns );
-        met->setUsedChannelsComponent(    i-34, Ntot );
+        setMETComp(met, i-34, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
       if (i==41) { // Muons
-        met->setNameOfComponent( 5, metComp->m_name );
-        met->setExComponent(     5, ex );
-        met->setEyComponent(     5, ey );
-        met->setEzComponent(     5, ez );
-        met->setSumEtComponent(  5, sumEt );
-        met->setSumEComponent(   5, sumE );
-        met->setCalib0Component( 5, c0 );
-        met->setCalib1Component( 5, c1 );
-        met->setStatusComponent(          5, status );
-        met->setSumOfSignsComponent(      5, sumOfSigns );
-        met->setUsedChannelsComponent(    5, Ntot );
+        setMETComp(met, 5, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
 
     } else if (save9comp) {
       if (i > 24 && i < 29 ) { // HAD scale quantities
-      met->setNameOfComponent( i-25, metComp->m_name );
-      met->setExComponent(     i-25, ex );
-      met->setEyComponent(     i-25, ey );
-      met->setEzComponent(     i-25, ez );
-      met->setSumEtComponent(  i-25, sumEt );
-      met->setSumEComponent(   i-25, sumE );
-      met->setCalib0Component( i-25, c0 );
-      met->setCalib1Component( i-25, c1 );
-      met->setStatusComponent(          i-25, status );
-      met->setSumOfSignsComponent(      i-25, sumOfSigns );
-      met->setUsedChannelsComponent(    i-25, Ntot );
+        setMETComp(met, metComp, i-25, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       } else if( i > 29 && i < 34) {     // EM scale quantities
-      met->setNameOfComponent( i-25-1, metComp->m_name );
-      met->setExComponent(     i-25-1, ex );
-      met->setEyComponent(     i-25-1, ey );
-      met->setEzComponent(     i-25-1, ez );
-      met->setSumEtComponent(  i-25-1, sumEt );
-      met->setSumEComponent(   i-25-1, sumE );
-      met->setCalib0Component( i-25-1, c0 );
-      met->setCalib1Component( i-25-1, c1 );
-      met->setStatusComponent(          i-25-1, status );
-      met->setSumOfSignsComponent(      i-25-1, sumOfSigns );
-      met->setUsedChannelsComponent(    i-25-1, Ntot );
+        setMETComp(met, metComp, i-25-1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       } else if( i == 41) {    // Muon
-      met->setNameOfComponent( i-25-8, metComp->m_name );
-      met->setExComponent(     i-25-8, ex );
-      met->setEyComponent(     i-25-8, ey );
-      met->setEzComponent(     i-25-8, ez );
-      met->setSumEtComponent(  i-25-8, sumEt );
-      met->setSumEComponent(   i-25-8, sumE );
-      met->setCalib0Component( i-25-8, c0 );
-      met->setCalib1Component( i-25-8, c1 );
-      met->setStatusComponent(          i-25-8, status );
-      met->setSumOfSignsComponent(      i-25-8, sumOfSigns );
-      met->setUsedChannelsComponent(    i-25-8, Ntot );
+      setMETComp(met, metComp, i-25-8, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
     } else if (save5comp) {
       switch (i) {
         case 0: case 1: case 2: case 3: // LAr, barrel
-          met->setExComponent(     0, ex         + met->exComponent(1)    );
-          met->setEyComponent(     0, ey         + met->eyComponent(1)    );
-          met->setEzComponent(     0, ez         + met->ezComponent(1)    );
-          met->setSumEtComponent(  0, sumEt      + met->sumEtComponent(1) );
-          met->setSumEComponent(   0, sumE       + met->sumEComponent(1)  );
-          met->setSumOfSignsComponent(      0, sumOfSigns + met->sumOfSignsComponent(1)     );
-          met->setUsedChannelsComponent(    0, Ntot       + met->usedChannelsComponent(1)   );
-          met->setStatusComponent(          0, status     | met->statusComponent(1)         );
-          met->setCalib0Component( 0, c0 );
-          met->setCalib1Component( 0, c1 );
+          updateMETComp(met, 0, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         case 4: case 5: case 6: case 7: // LAr, end-cap
         case 21:                        // + FCalEM
-          met->setExComponent(     1, ex         + met->exComponent(2)    );
-          met->setEyComponent(     1, ey         + met->eyComponent(2)    );
-          met->setEzComponent(     1, ez         + met->ezComponent(2)    );
-          met->setSumEtComponent(  1, sumEt      + met->sumEtComponent(2) );
-          met->setSumEComponent(   1, sumE       + met->sumEComponent(2)  );
-          met->setSumOfSignsComponent(      1, sumOfSigns + met->sumOfSignsComponent(2)     );
-          met->setUsedChannelsComponent(    1, Ntot       + met->usedChannelsComponent(2)   );
-          met->setStatusComponent(          1, status     | met->statusComponent(2)         );
-          met->setCalib0Component( 1, c0 );
-          met->setCalib1Component( 1, c1 );
+          updateMETComp(met, 1, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         case 12: case 13: case 14: // Tile, barrel +
         case 18: case 19: case 20: // Tile, extended barrel
-          met->setExComponent(     2, ex         + met->exComponent(3)    );
-          met->setEyComponent(     2, ey         + met->eyComponent(3)    );
-          met->setEzComponent(     2, ez         + met->ezComponent(3)    );
-          met->setSumEtComponent(  2, sumEt      + met->sumEtComponent(3) );
-          met->setSumEComponent(   2, sumE       + met->sumEComponent(3)  );
-          met->setSumOfSignsComponent(      2, sumOfSigns + met->sumOfSignsComponent(3)     );
-          met->setUsedChannelsComponent(    2, Ntot       + met->usedChannelsComponent(3)   );
-          met->setStatusComponent(          2, status     | met->statusComponent(3)         );
-          met->setCalib0Component( 2, c0 );
-          met->setCalib1Component( 2, c1 );
+          updateMETComp(met, 2, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         case 24: case 25: case 26: case 27: case 28:
         case 29: case 30: case 31: case 32: case 33:
@@ -332,110 +272,32 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
         case 39: case 40 :             // Topo. cluster elements or jets - do nothing.
           break;
         case 41: // muons
-          met->setExComponent(     4, ex );
-          met->setEyComponent(     4, ey );
-          met->setEzComponent(     4, ez );
-          met->setSumEtComponent(  4, sumEt );
-          met->setSumEComponent(   4, sumE  );
-          met->setCalib0Component( 4, c0 );
-          met->setCalib1Component( 4, c1 );
-          met->setStatusComponent(          4, status );
-          met->setSumOfSignsComponent(      4, sumOfSigns );
-          met->setUsedChannelsComponent(    4, Ntot );
+          setMETComp(met, 4, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         default: // Hadr. end-cap + Tile gap + FCalHad
-          met->setExComponent(     3, ex         + met->exComponent(4)    );
-          met->setEyComponent(     3, ey         + met->eyComponent(4)    );
-          met->setEzComponent(     3, ez         + met->ezComponent(4)    );
-          met->setSumEtComponent(  3, sumEt      + met->sumEtComponent(4) );
-          met->setSumEComponent(   3, sumE       + met->sumEComponent(4)  );
-          met->setSumOfSignsComponent(      3, sumOfSigns + met->sumOfSignsComponent(4)     );
-          met->setUsedChannelsComponent(    3, Ntot       + met->usedChannelsComponent(4)   );
-          met->setStatusComponent(          3, status     | met->statusComponent(4)         );
-          met->setCalib0Component( 3, c0 );
-          met->setCalib1Component( 3, c1 );
+          updateMETComp(met, 3, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
     } else if (save3comp) {
       switch (i) {
         case 39: // Corrected MET
-          met->setNameOfComponent( 0, metComp->m_name );
-          met->setExComponent(     0, ex );
-          met->setEyComponent(     0, ey );
-          met->setEzComponent(     0, ez );
-          met->setSumEtComponent(  0, sumEt );
-          met->setSumEComponent(   0, sumE );
-          met->setCalib0Component( 0, c0 );
-          met->setCalib1Component( 0, c1 );
-          met->setStatusComponent(          0, status );
-          met->setSumOfSignsComponent(      0, sumOfSigns );
-          met->setUsedChannelsComponent(    0, Ntot );
+          setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         case 40: // Original MET
-          met->setNameOfComponent( 1, metComp->m_name );
-          met->setExComponent(     1, ex );
-          met->setEyComponent(     1, ey );
-          met->setEzComponent(     1, ez );
-          met->setSumEtComponent(  1, sumEt );
-          met->setSumEComponent(   1, sumE );
-          met->setCalib0Component( 1, c0 );
-          met->setCalib1Component( 1, c1 );
-          met->setStatusComponent(          1, status );
-          met->setSumOfSignsComponent(      1, sumOfSigns );
-          met->setUsedChannelsComponent(    1, Ntot );
+          setMETComp(met, 1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
           break;
         case 41: // Muons
-          met->setNameOfComponent( 2, metComp->m_name );
-          met->setExComponent(     2, ex );
-          met->setEyComponent(     2, ey );
-          met->setEzComponent(     2, ez );
-          met->setSumEtComponent(  2, sumEt );
-          met->setSumEComponent(   2, sumE );
-          met->setCalib0Component( 2, c0 );
-          met->setCalib1Component( 2, c1 );
-          met->setStatusComponent(          2, status );
-          met->setSumOfSignsComponent(      2, sumOfSigns );
-          met->setUsedChannelsComponent(    2, Ntot );
+          setMETComp(met, 2, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
     } else if (save2comp) { // Jets + muons only
       if (i==34) { // Jets
-        met->setNameOfComponent( 0, metComp->m_name );
-        met->setExComponent(     0, ex );
-        met->setEyComponent(     0, ey );
-        met->setEzComponent(     0, ez );
-        met->setSumEtComponent(  0, sumEt );
-        met->setSumEComponent(   0, sumE );
-        met->setCalib0Component( 0, c0 );
-        met->setCalib1Component( 0, c1 );
-        met->setStatusComponent(          0, status );
-        met->setSumOfSignsComponent(      0, sumOfSigns );
-        met->setUsedChannelsComponent(    0, Ntot );
+        setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
       if (i==41) { // Muons
-        met->setNameOfComponent( 1, metComp->m_name );
-        met->setExComponent(     1, ex );
-        met->setEyComponent(     1, ey );
-        met->setEzComponent(     1, ez );
-        met->setSumEtComponent(  1, sumEt );
-        met->setSumEComponent(   1, sumE );
-        met->setCalib0Component( 1, c0 );
-        met->setCalib1Component( 1, c1 );
-        met->setStatusComponent(          1, status );
-        met->setSumOfSignsComponent(      1, sumOfSigns );
-        met->setUsedChannelsComponent(    1, Ntot );
+        setMETComp(met, 1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
     } else if (save1comp) { // muons only
       if (i==41) { // REPLACE WITH A TEST OVER COMP. NAME
-        met->setNameOfComponent( 0, metComp->m_name );
-        met->setExComponent(     0, ex );
-        met->setEyComponent(     0, ey );
-        met->setEzComponent(     0, ez );
-        met->setSumEtComponent(  0, sumEt );
-        met->setSumEComponent(   0, sumE );
-        met->setCalib0Component( 0, c0 );
-        met->setCalib1Component( 0, c1 );
-        met->setStatusComponent(          0, status );
-        met->setSumOfSignsComponent(      0, sumOfSigns );
-        met->setUsedChannelsComponent(    0, Ntot );
+        setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
       }
     }
 
-- 
GitLab


From 75abce51d22da8f7d1b5f6b5ee652f785e586d60 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 24 Jan 2019 15:45:36 +0100
Subject: [PATCH 003/404] Update whitespace in EFMissingETFlags.cxx

---
 .../TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
index 5b639df6906..a0da0b4f20f 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFlags.cxx
@@ -475,8 +475,8 @@ StatusCode EFMissingETFlags::execute(xAOD::TrigMissingET *met ,
     for (unsigned char c=0; c<elem; ++c) {
       TrigEFMissingEtComponent* metComp = metHelper->GetComponent(c);
       for (int b=0; b<16; ++b) {
-	unsigned short mask = (1<<b);
-	if (metComp->m_status & mask) m_hCompFlags->Fill(c,b);
+      	unsigned short mask = (1<<b);
+      	if (metComp->m_status & mask) m_hCompFlags->Fill(c,b);
       }
     }
   }
-- 
GitLab


From e80dfd34394e4bc9f523c7c2c73437b37757be5c Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 25 Jan 2019 14:35:37 +0100
Subject: [PATCH 004/404] Factorize EFMissingETFromHelper more for increased
 readability

---
 .../TrigEFMissingET/EFMissingETFromHelper.h   |  24 +---
 .../src/EFMissingETFromHelper.cxx             | 135 +++++++++---------
 2 files changed, 76 insertions(+), 83 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
index b48d8c3d5c0..0b2f17d2d09 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
@@ -18,7 +18,8 @@ PURPOSE:  Updates TrigMissingET using TrigMissingETHelper info
  ********************************************************************/
 
 #include "TrigEFMissingET/EFMissingETBaseTool.h"
-//#include "TrigCaloEvent/TrigMissingET.h"
+#include "TrigEFMissingET/EFMissingETHelper.h"
+// #include "TrigMissingEtEvent/TrigMissingET.h"
 #include "TrigMissingEtEvent/TrigMissingET.h"
 
 
@@ -58,23 +59,10 @@ class EFMissingETFromHelper : public EFMissingETBaseTool
     StatusCode executeMT(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper);
 
   private:
-    void setMET(xAOD::TrigMissingET *met, 
-                float ex, float ey, float ez,
-                float sumE, float sumEt, 
-                short sumOfSigns, float c0, float c1);
-
-    void setMETComp(xAOD::TrigMissingET *met, int comp_i, char* comp_name,
-                    float ex, float ey, float ez,
-                    float sumE, float sumEt,
-                    short sumOfSigns, float c0, float c1,
-                    short status, unsigned short Ntot,
-                    bool update=false);
-
-    void updateMETComp(xAOD::TrigEFMissingET *met, const int comp_i
-                      float ex, float ey, float ez,
-                      float sumE, float sumEt,
-                      short sumOfSigns, float c0, float c1,
-                      short status, unsigned short Ntot);
+    void setMET(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
+                unsigned char comp_i);
+    void setMETComp(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
+                    unsigned char comp_i, char add_i=-1);
 
 };
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 123fd72080c..27a114da11d 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -10,7 +10,7 @@ PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
 AUTHORS:  Gabriel Gallardo, Manfredi Ronzani
 CREATED:  September 27, 2018
 
-PURPOSE:  Updates TrigMissingET using TrigEFMissingETHelper info for AthenaMT.
+PURPOSE:  Updates TrigMissingET using TrigEFMissingEtHelper info for AthenaMT.
 
 Components are left uncorrected when saved into
 TrigMissingET as auxiliary information.
@@ -69,11 +69,22 @@ StatusCode EFMissingETFromHelper::finalize()
   return StatusCode::SUCCESS;
 }
 
-void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *met, 
-                                  const float ex, const float ey, const float ez,
-                                  const float sumE, const float sumEt, 
-                                  const short sumOfSigns, const float c0, const float c1)
+void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *const met, TrigEFMissingEtHelper *metHelper, 
+                                  const unsigned char comp_i)
 {
+  TrigEFMissingEtComponent* metComp = metHelper->GetComponent(comp_i);
+
+  float ex =            metComp->m_ex;
+  float ey =            metComp->m_ey;
+  float ez =            metComp->m_ez;
+  float sumE =          metComp->m_sumE;
+  float sumEt =         metComp->m_sumEt;
+  float c0 =            metComp->m_calib0;
+  float c1 =            metComp->m_calib1;
+  // short status =        metComp->m_status;
+  short sumOfSigns =    metComp->m_sumOfSigns;
+  // unsigned short Ntot = metComp->m_usedChannels;
+
   met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
   met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
   met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
@@ -82,14 +93,39 @@ void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *met,
   return;
 }
 
-void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *met, const int comp_i, const char* comp_name,
-                                      const float ex, const float ey, const float ez,
-                                      const float sumE, float sumEt,
-                                      const short sumOfSigns, const float c0, const float c1,
-                                      const short status, const unsigned short Ntot,
-                                      bool update)
+
+void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *const met, TrigEFMissingEtHelper *metHelper, 
+                                        const unsigned char comp_i, const char add_i)
 {
-  if (comp_name && !update) 
+  TrigEFMissingEtComponent* metComp = metHelper->GetComponent(comp_i);
+
+  float ex =            metComp->m_ex;
+  float ey =            metComp->m_ey;
+  float ez =            metComp->m_ez;
+  float sumE =          metComp->m_sumE;
+  float sumEt =         metComp->m_sumEt;
+  float c0 =            metComp->m_calib0;
+  float c1 =            metComp->m_calib1;
+  short status =        metComp->m_status;
+  short sumOfSigns =    metComp->m_sumOfSigns;
+  unsigned short Ntot = metComp->m_usedChannels;
+  char comp_name[10]="";
+  strcpy(comp_name, metComp->m_name);
+
+  bool addComponent = (add_i>=0);
+  if (addComponent)
+  {
+    ex         += met->exComponent(add_i);
+    ey         += met->eyComponent(add_i);
+    ez         += met->ezComponent(add_i);
+    sumE       += met->sumEComponent(add_i);
+    sumEt      += met->sumEtComponent(add_i);
+    sumOfSigns += met->sumOfSignsComponent(add_i);
+    status     |= met->statusComponent(add_i);
+    Ntot       += met->usedChannelsComponent(add_i);
+  }
+
+  if (!strcmp(comp_name, "") && !addComponent) 
     met->setNameOfComponent(        comp_i, comp_name );
   met->setExComponent(              comp_i, ex );
   met->setEyComponent(              comp_i, ey );
@@ -104,26 +140,7 @@ void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *met, const int comp_
   return;
 }
 
-void EFMissingETFromHelper::updateMETComp(xAOD::TrigEFMissingET *met, const int comp_i,
-                                          float ex, float ey, float ez,
-                                          float sumE, float sumEt,
-                                          short sumOfSigns, float c0, float c1,
-                                          short status, unsigned short Ntot)
-{
-  setMETComp(met, comp_i, nullptr, 
-            ex         + met->exComponent(comp_i+1),
-            ey         + met->eyComponent(comp_i+1),
-            ez         + met->ezComponent(comp_i+1),
-            sumE       + met->sumEComponent(comp_i+1),
-            sumEt      + met->sumEtComponent(comp_i+1),
-            sumOfSigns + met->sumOfSignsComponent(comp_i+1),
-            c0, c1,
-            status     | met->statusComponent(comp_i+1),
-            Ntot       + met->usedChannelsComponent(comp_i+1),
-            true
-            )
 
-}
 StatusCode EFMissingETFromHelper::execute()
 {
   return StatusCode::SUCCESS;
@@ -200,71 +217,59 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
   // take info from *metHelper and update *met
   for (unsigned char  i=0; i<elem; ++i) { // loop over transient components
-    TrigEFMissingEtComponent* metComp = metHelper->GetComponent(i);
-
-    float ex =            metComp->m_ex;
-    float ey =            metComp->m_ey;
-    float ez =            metComp->m_ez;
-    float sumE =          metComp->m_sumE;
-    float sumEt =         metComp->m_sumEt;
-    float c0 =            metComp->m_calib0;
-    float c1 =            metComp->m_calib1;
-    short status =        metComp->m_status;
-    short sumOfSigns =    metComp->m_sumOfSigns;
-    unsigned short Ntot = metComp->m_usedChannels;
 
     // basic info - DK calibration
     if (i<elem-18){  // skip muon or Had Topo granular or EM Topo correction for all quantities
-      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
+      setMET(met, metHelper, i);
     }
 
     if(save9comp && i == 24) { // Save summed HAD MET
-      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
+      setMET(met, metHelper, i);
     }
 
     if( (save2comp || save6comp) && i == 34) { // Save JET MET
-      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
+      setMET(met, metHelper, i);
     }
 
     if(save3comp && i == 39) { // Save PUC MET
-      setMET(met, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1);
+      setMET(met, metHelper, i);
     }
 
     if (skipAuxInfo) continue;
 
     // auxiliary info - uncorrected
     if (comp == unsigned(elem-17) && i < 24) { // finest granularity
-      setMETComp(met, i, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+      setMETComp(met, metHelper, i);
     } else if(comp == unsigned(elem-17) && i == 41) { // save muons
-      setMETComp(met, i-17, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+      setMETComp(met, metHelper, i-17);
     } else if (save6comp) {
       if (i>=34 && i < 39) { // Central and Forward Jets
-        setMETComp(met, i-34, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+        setMETComp(met, metHelper, i-34);
       }
       if (i==41) { // Muons
-        setMETComp(met, 5, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+        setMETComp(met, metHelper, i-5);
       }
 
     } else if (save9comp) {
       if (i > 24 && i < 29 ) { // HAD scale quantities
-        setMETComp(met, metComp, i-25, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+      setMETComp(met, metHelper, i-25);
       } else if( i > 29 && i < 34) {     // EM scale quantities
-        setMETComp(met, metComp, i-25-1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+      setMETComp(met, metHelper, i-25-1);
       } else if( i == 41) {    // Muon
-      setMETComp(met, metComp, i-25-8, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+      setMETComp(met, metHelper, i-25-8);
       }
     } else if (save5comp) {
       switch (i) {
         case 0: case 1: case 2: case 3: // LAr, barrel
-          updateMETComp(met, 0, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 0, 1);
           break;
         case 4: case 5: case 6: case 7: // LAr, end-cap
         case 21:                        // + FCalEM
-          updateMETComp(met, 1, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 1, 2);
           break;
         case 12: case 13: case 14: // Tile, barrel +
         case 18: case 19: case 20: // Tile, extended barrel
-          updateMETComp(met, 2, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 2, 3);
           break;
         case 24: case 25: case 26: case 27: case 28:
         case 29: case 30: case 31: case 32: case 33:
@@ -272,32 +277,32 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
         case 39: case 40 :             // Topo. cluster elements or jets - do nothing.
           break;
         case 41: // muons
-          setMETComp(met, 4, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 4);
           break;
         default: // Hadr. end-cap + Tile gap + FCalHad
-          updateMETComp(met, 3, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 3, 4);
       }
     } else if (save3comp) {
       switch (i) {
         case 39: // Corrected MET
-          setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 0);
           break;
         case 40: // Original MET
-          setMETComp(met, 1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 1);
           break;
         case 41: // Muons
-          setMETComp(met, 2, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+          setMETComp(met, metHelper, 2);
       }
     } else if (save2comp) { // Jets + muons only
       if (i==34) { // Jets
-        setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+        setMETComp(met, metHelper, 0);
       }
       if (i==41) { // Muons
-        setMETComp(met, 1, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+        setMETComp(met, metHelper, 1);
       }
     } else if (save1comp) { // muons only
       if (i==41) { // REPLACE WITH A TEST OVER COMP. NAME
-        setMETComp(met, 0, metComp->m_name, ex, ey, ez, sumE, sumEt, sumOfSigns, c0, c1, status, Ntot);
+        setMETComp(met, metHelper, 0);
       }
     }
 
-- 
GitLab


From bdc23fdb69b02b830973ac8a35ddc8d23fdd6fe2 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 25 Jan 2019 15:37:58 +0100
Subject: [PATCH 005/404] Correct author attribution and mistake in
 EFMissingETFromHelper

---
 .../TrigEFMissingET/src/EFMissingETFromHelper.cxx        | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 27a114da11d..2b7d379e1c0 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -7,8 +7,11 @@
 NAME:     EFMissingETFromHelper.cxx
 PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
 
-AUTHORS:  Gabriel Gallardo, Manfredi Ronzani
-CREATED:  September 27, 2018
+AUTHORS:  Diego Casadei
+CREATED:  March 12, 2008
+
+UPDATERS: Gabriel Gallardo, Manfredi Ronzani
+DATE:     January 25, 2019
 
 PURPOSE:  Updates TrigMissingET using TrigEFMissingEtHelper info for AthenaMT.
 
@@ -247,7 +250,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
         setMETComp(met, metHelper, i-34);
       }
       if (i==41) { // Muons
-        setMETComp(met, metHelper, i-5);
+        setMETComp(met, metHelper, 5);
       }
 
     } else if (save9comp) {
-- 
GitLab


From 983201505e69661aef686279b77260e8788ba59b Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Tue, 29 Jan 2019 17:38:11 +0100
Subject: [PATCH 006/404] Add debug message to TrigMissingETMuon

---
 .../TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 8d2fd60d94b..289998aca97 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -353,6 +353,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   // Suggested by Diego: Checking the component name of the input
   if( (m_met->nameOfComponent(muonComp)).substr(0,4)!="Muon") {
     msg() << MSG::ERROR << "Could not find MET container with muon information!!! Exit..." << endmsg;
+    msg() << MSG::ERROR << "MET component name: " << m_met->nameOfComponent(muonComp) << endmsg;
     return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);    
   }
   // Fetch Muon Components
-- 
GitLab


From ae7e2dcf8d3849cb5a79cb021463207b6603e683 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Tue, 29 Jan 2019 17:39:54 +0100
Subject: [PATCH 007/404] Require explicity signed char to setMETComp to
 prevent potential casting issues

---
 .../TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h     | 2 +-
 .../TrigEFMissingET/src/EFMissingETFromHelper.cxx               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
index 0b2f17d2d09..372f967c004 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
@@ -62,7 +62,7 @@ class EFMissingETFromHelper : public EFMissingETBaseTool
     void setMET(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
                 unsigned char comp_i);
     void setMETComp(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
-                    unsigned char comp_i, char add_i=-1);
+                    unsigned char comp_i, signed char add_i=-1);
 
 };
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 2b7d379e1c0..aa9c1c3e666 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -98,7 +98,7 @@ void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *const met, TrigEFMissing
 
 
 void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *const met, TrigEFMissingEtHelper *metHelper, 
-                                        const unsigned char comp_i, const char add_i)
+                                        const unsigned char comp_i, const signed char add_i)
 {
   TrigEFMissingEtComponent* metComp = metHelper->GetComponent(comp_i);
 
-- 
GitLab


From 10c71a77c688117675297015ded1eb169ae57b23 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Fri, 15 Feb 2019 13:39:05 -0600
Subject: [PATCH 008/404] - Add a component-ized Filtered Algorithm
 (DecisionAlg) to allow declarations to DecisionSvc using standard
 accept/require/veto interface. - Update test in AthenaPoolMultiTest to
 include DecisionAlg

---
 .../share/EventSplit_jo.py                    | 23 ++++++--
 Control/AthenaServices/src/DecisionAlg.cxx    | 21 +++++++
 Control/AthenaServices/src/DecisionAlg.h      | 58 +++++++++++++++++++
 .../src/components/AthenaServices_entries.cxx |  2 +
 4 files changed, 99 insertions(+), 5 deletions(-)
 create mode 100644 Control/AthenaServices/src/DecisionAlg.cxx
 create mode 100644 Control/AthenaServices/src/DecisionAlg.h

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
index 2fe289221e6..c46f8d480d1 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
@@ -96,6 +96,12 @@ topSequence+=Splitter7
 topSequence+=Splitter48
 topSequence+=Triggered
 
+# Add a non-outputstream decision
+from AthenaServices.AthenaServicesConf import DecisionAlg
+dummy = DecisionAlg("Dummy")
+dummy.AcceptAlgs  = ["Splitter2"]
+topSequence += dummy
+
 #--------------------------------------------------------------
 #---  Set up the streams for the filters
 #     Note that this uses a cascading exclusive stream model
@@ -109,17 +115,24 @@ from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
 
 ToolSvc = Service( "ToolSvc" )
 
-# We use 5 test output streams
-# Define them
+# Filtered stream 2
 Stream2 = AthenaPoolOutputStream( "Stream2", "AthenaPoolMultiTest_Split2.root", False, noTag=False )
 Stream2.CheckNumberOfWrites = False
+# Filtered stream 1
 Stream1 = AthenaPoolOutputStream( "Stream1", "AthenaPoolMultiTest_Split1.root", False, noTag=False )
 Stream1.WritingTool.AttributeListKey="SimpleTagDecisions"
 Stream1.CheckNumberOfWrites = False
+# Filtered stream 3
 Stream3 = AthenaPoolOutputStream( "Stream3", "AthenaPoolMultiTest_Split3.root", False, noTag=False )
 Stream3.CheckNumberOfWrites = False
+# Unfiltered stream
+StreamAll = AthenaPoolOutputStream( "StreamAll", "AthenaPoolMultiTest_StreamAll.root", False, noTag=False )
+StreamAll.CheckNumberOfWrites = False
+StreamAll.WritingTool.AttributeListKey="SimpleTagDecisions"
+# Events that didn't satisfy any filters
 Others  = AthenaPoolOutputStream( "Others", "AthenaPoolMultiTest_Missed.root", False, noTag=False )
 Others.CheckNumberOfWrites = False
+# Events that failed at least one filter
 Bad     = AthenaPoolOutputStream( "Bad", "AthenaPoolMultiTest_Missed.root", False, noTag=False )
 Bad.CheckNumberOfWrites = False
 
@@ -129,22 +142,22 @@ Bad.CheckNumberOfWrites = False
 
 # bit 2
 Stream2.TakeItemsFromInput = True
-#Stream2.MetadataItemList   += exampleMetadataList
 Stream2.ForceRead=TRUE
 Stream2.AcceptAlgs  = ["Splitter2"]
 Stream2.VetoAlgs    = ["Splitter1"]
 # bit 1
 Stream1.TakeItemsFromInput = True
-#Stream1.MetadataItemList   += exampleMetadataList
 Stream1.ForceRead=TRUE
 Stream1.AcceptAlgs = ["Splitter1"]
 # bit 3
 Stream3.TakeItemsFromInput = True
-#Stream3.MetadataItemList   += exampleMetadataList
 Stream3.ForceRead=TRUE
 Stream3.AcceptAlgs = ["Splitter3"]
 Stream3.VetoAlgs   = ["Splitter1"]
 Stream3.VetoAlgs  += ["Splitter2"]
+# Unfiltered
+StreamAll.TakeItemsFromInput = True
+StreamAll.ForceRead=TRUE
 # missed
 Others.TakeItemsFromInput = True
 Others.ForceRead=TRUE
diff --git a/Control/AthenaServices/src/DecisionAlg.cxx b/Control/AthenaServices/src/DecisionAlg.cxx
new file mode 100644
index 00000000000..6d7d98992fe
--- /dev/null
+++ b/Control/AthenaServices/src/DecisionAlg.cxx
@@ -0,0 +1,21 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "DecisionAlg.h"
+
+
+//****************************************************************************
+
+
+// Standard Constructor
+DecisionAlg::DecisionAlg(const std::string& name, ISvcLocator* pSvcLocator)
+        : FilteredAlgorithm(name, pSvcLocator)
+{
+   assert(pSvcLocator);
+}
+
+// Standard Destructor
+DecisionAlg::~DecisionAlg() {
+}
+
diff --git a/Control/AthenaServices/src/DecisionAlg.h b/Control/AthenaServices/src/DecisionAlg.h
new file mode 100644
index 00000000000..9bb6f38c75e
--- /dev/null
+++ b/Control/AthenaServices/src/DecisionAlg.h
@@ -0,0 +1,58 @@
+// Dear emacs, this is -*- C++ -*-
+
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ATHENASERVICES_DECISIONALG_H
+#define ATHENASERVICES_DECISIONALG_H
+
+// STL include files
+#include <memory>
+#include <map>
+#include <set>
+#include <vector>
+#include <string>
+
+// Required for inheritance
+#include "GaudiKernel/IDataSelector.h"
+#include "GaudiKernel/Property.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+
+#include "GaudiKernel/IIncidentListener.h"
+#include "AthenaBaseComps/FilteredAlgorithm.h"
+#include "GaudiKernel/IIoComponent.h"
+
+// forward declarations
+class IClassIDSvc;
+class OutputStreamSequencerSvc;
+class StoreGateSvc;
+class IDecisionAlgTool;
+class IAthenaOutputTool;
+class IItemListSvc;
+
+namespace SG {
+   class DataProxy;
+   class IFolder;
+   class FolderItem;
+}
+
+/** @class DecisionAlg
+   * @brief Call through interface to FilteredAlgorithm
+   * 
+   * @author srinir@bnl.gov
+   * $Id: DecisionAlg.h,v 1.12 2008-12-15 19:14:58 binet Exp $
+   */
+class DecisionAlg : public FilteredAlgorithm
+{
+public:
+   
+   /// Standard algorithm Constructor
+   DecisionAlg(const std::string& name, ISvcLocator* pSvcLocator); 
+   /// Standard Destructor
+   virtual ~DecisionAlg();
+
+};
+
+#endif // ATHENASERVICES_OUTPUTSTREAM_H
diff --git a/Control/AthenaServices/src/components/AthenaServices_entries.cxx b/Control/AthenaServices/src/components/AthenaServices_entries.cxx
index 532c89025e0..494766df6ee 100644
--- a/Control/AthenaServices/src/components/AthenaServices_entries.cxx
+++ b/Control/AthenaServices/src/components/AthenaServices_entries.cxx
@@ -34,6 +34,7 @@
 #include "../ToyNextPassFilterTool.h"
 #include "../ConditionsCleanerSvc.h"
 #include "../DelayedConditionsCleanerSvc.h"
+#include "../DecisionAlg.h"
 
 DECLARE_COMPONENT( AthenaOutputStream )
 DECLARE_COMPONENT( AthenaConditionStream )
@@ -71,3 +72,4 @@ DECLARE_COMPONENT( ToyNextPassFilterAlg )
 DECLARE_COMPONENT( ToyNextPassFilterTool )
 DECLARE_COMPONENT( Athena::ConditionsCleanerSvc )
 DECLARE_COMPONENT( Athena::DelayedConditionsCleanerSvc )
+DECLARE_COMPONENT( DecisionAlg )
-- 
GitLab


From a971566386589e76bf2d8cc29e14a717f55e8b8b Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Fri, 15 Feb 2019 13:46:08 -0600
Subject: [PATCH 009/404] For createOutputStream make noTag default to False
 Build the event info attribute list by default

---
 .../OutputStreamAthenaPool/python/OutputStreamAthenaPool.py     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamAthenaPool.py b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamAthenaPool.py
index c41a7489a6d..c5a1718132d 100644
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamAthenaPool.py
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamAthenaPool.py
@@ -11,7 +11,7 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 from AthenaServices.AthenaServicesConf import AthenaOutputStream
 from AthenaServices.AthenaServicesConf import AthenaOutputStreamTool
 
-def createOutputStream( streamName, fileName = "", asAlg = False, noTag = True ):
+def createOutputStream( streamName, fileName = "", asAlg = False, noTag = False ):
    # define athena output stream
    writingTool = AthenaOutputStreamTool( streamName + "Tool" )
    outputStream = AthenaOutputStream(
-- 
GitLab


From da5b0eccfa9aa6e1ae861ff53966ba37b4c3b8e7 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Fri, 15 Feb 2019 13:53:36 -0600
Subject: [PATCH 010/404] Update reference file.

---
 .../share/AthenaPoolMultiTestEventSplit.ref   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
index 77527fea7ae..48476e7ed44 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
@@ -46,6 +46,12 @@ Bad.Bad_MakeEve...   INFO Initializing Bad.Bad_MakeEventStreamInfo - package ver
 Bad                  INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Bad_MakeEventStreamInfo'])
 Bad                  INFO Data output: AthenaPoolMultiTest_Missed.root
 Bad                  INFO I/O reinitialization...
+DecisionSvc          INFO Inserting stream: StreamAll with no Algs
+StreamAll.Strea...   INFO Initializing StreamAll.StreamAllTool - package version AthenaServices-00-00-00
+StreamAll.Strea...   INFO Initializing StreamAll.StreamAll_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
+StreamAll            INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll_MakeEventStreamInfo'])
+StreamAll            INFO Data output: AthenaPoolMultiTest_StreamAll.root
+StreamAll            INFO I/O reinitialization...
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 0 run: 0
 Splitter1           DEBUG Trigmask = 1
@@ -64,6 +70,8 @@ Splitter48           INFO EventInfo event: 0 run: 0
 Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 0 run: 0
 Triggered            INFO L1 passed
+Domain[ROOT_All]     INFO                           AthenaPoolMultiTest_StreamAll.root
+RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll.root File version:61404
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 1 run: 0
 Splitter1           DEBUG Trigmask = 2
@@ -412,6 +420,7 @@ Stream2              INFO Records written: 8
 Stream3              INFO Records written: 6
 Others               INFO Records written: 2
 Bad                  INFO Records written: 1
+StreamAll            INFO Records written: 21
 Splitter1            INFO in finalize()
 Splitter2            INFO in finalize()
 Splitter3            INFO in finalize()
@@ -426,18 +435,28 @@ ItemListSvc         DEBUG    - EventStreamInfo_Others
 ItemListSvc         DEBUG  --> Overlap with Stream1 (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (6) items
+ItemListSvc         DEBUG  --> Overlap with StreamAll (6) items
 ItemListSvc         DEBUG STREAM Stream1 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream1
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
+ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
 ItemListSvc         DEBUG STREAM Stream2 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream2
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
+ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
 ItemListSvc         DEBUG STREAM Stream3 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream3
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
+ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
+ItemListSvc         DEBUG STREAM StreamAll has (8) items
+ItemListSvc         DEBUG    - EventStreamInfo_StreamAll
+ItemListSvc         DEBUG  --> Overlap with Others (6) items
+ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
+ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
+ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
-- 
GitLab


From 8cf076ddbbc5d668f4f146b69d4ab03c3d88d287 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Mon, 18 Feb 2019 15:28:16 -0600
Subject: [PATCH 011/404] Check if ReadHandle is valid for xAOD::EventInfo
 before dereferencing

---
 .../src/EventInfoTagBuilder.cxx                  | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/src/EventInfoTagBuilder.cxx b/Database/AthenaPOOL/OutputStreamAthenaPool/src/EventInfoTagBuilder.cxx
index e0eb8f6e5b4..4478e948f71 100755
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/src/EventInfoTagBuilder.cxx
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/src/EventInfoTagBuilder.cxx
@@ -35,12 +35,16 @@ StatusCode EventInfoTagBuilder::execute() {
   SG::ReadHandle<xAOD::EventInfo> h_evt(m_evtKey);
 
   /** create a EventInfo Tag and ask the tool to fill it */ 
-  auto attribList = std::make_unique<AthenaAttributeList>
-    ( m_tool->getAttributeList( *h_evt ) );
-
-  /** record attribute list to SG */
-  SG::WriteHandle<AthenaAttributeList> wh(m_attributeListName);
-  ATH_CHECK( wh.record(std::move(attribList)) );
+  if (h_evt.isValid()) {
+    auto attribList = std::make_unique<AthenaAttributeList>
+      ( m_tool->getAttributeList( *h_evt ) );
+
+    /** record attribute list to SG */
+    SG::WriteHandle<AthenaAttributeList> wh(m_attributeListName);
+    ATH_CHECK( wh.record(std::move(attribList)) );
+  } else {
+    ATH_MSG_WARNING("Did not find xAOD::EventInfo");
+  }
 
   ATH_MSG_DEBUG( "Finished " << name() );
 
-- 
GitLab


From 37419e7c7fa1b46b804e7d750f6e29e0149c1976 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Mon, 18 Feb 2019 15:28:59 -0600
Subject: [PATCH 012/404] Update EventSplit test

---
 .../share/AthenaPoolMultiTestEventSplit.ref   | 145 ------------------
 .../share/EventSplit_jo.py                    |  30 ----
 2 files changed, 175 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
index 48476e7ed44..3958b375eb9 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
@@ -11,9 +11,6 @@ Splitter3            INFO in initialize()
 Splitter3           DEBUG input handles: 0
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
-Splitter456          INFO in initialize()
-Splitter7            INFO in initialize()
-Splitter48           INFO in initialize()
 Triggered            INFO in initialize()
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
 OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
@@ -46,12 +43,6 @@ Bad.Bad_MakeEve...   INFO Initializing Bad.Bad_MakeEventStreamInfo - package ver
 Bad                  INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Bad_MakeEventStreamInfo'])
 Bad                  INFO Data output: AthenaPoolMultiTest_Missed.root
 Bad                  INFO I/O reinitialization...
-DecisionSvc          INFO Inserting stream: StreamAll with no Algs
-StreamAll.Strea...   INFO Initializing StreamAll.StreamAllTool - package version AthenaServices-00-00-00
-StreamAll.Strea...   INFO Initializing StreamAll.StreamAll_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
-StreamAll            INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll_MakeEventStreamInfo'])
-StreamAll            INFO Data output: AthenaPoolMultiTest_StreamAll.root
-StreamAll            INFO I/O reinitialization...
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 0 run: 0
 Splitter1           DEBUG Trigmask = 1
@@ -62,16 +53,8 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 0 run: 0
 Splitter3           DEBUG Trigmask = 1
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 0 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 0 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 0 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 0 run: 0
 Triggered            INFO L1 passed
-Domain[ROOT_All]     INFO                           AthenaPoolMultiTest_StreamAll.root
-RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll.root File version:61404
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 1 run: 0
 Splitter1           DEBUG Trigmask = 2
@@ -82,12 +65,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 1 run: 0
 Splitter3           DEBUG Trigmask = 2
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 1 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 1 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 1 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 1 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -100,12 +77,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 2 run: 0
 Splitter3           DEBUG Trigmask = 4
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 2 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 2 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 2 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 2 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -118,12 +89,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 3 run: 0
 Splitter3           DEBUG Trigmask = 256
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 3 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 3 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 3 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 3 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -136,12 +101,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 4 run: 0
 Splitter3           DEBUG Trigmask = 18
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 4 run: 0
-Splitter456          INFO L1 passed
-Splitter7            INFO EventInfo event: 4 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 4 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 4 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -154,12 +113,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 5 run: 0
 Splitter3           DEBUG Trigmask = 36
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 5 run: 0
-Splitter456          INFO L1 passed
-Splitter7            INFO EventInfo event: 5 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 5 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 5 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -172,12 +125,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 6 run: 0
 Splitter3           DEBUG Trigmask = 65
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 6 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 6 run: 0
-Splitter7            INFO L1 passed
-Splitter48           INFO EventInfo event: 6 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 6 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -190,12 +137,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 7 run: 0
 Splitter3           DEBUG Trigmask = 130
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 7 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 7 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 7 run: 0
-Splitter48           INFO L1 passed
 Triggered            INFO EventInfo event: 7 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -208,12 +149,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 8 run: 0
 Splitter3           DEBUG Trigmask = 260
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 8 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 8 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 8 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 8 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -226,12 +161,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 9 run: 0
 Splitter3           DEBUG Trigmask = 513
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 9 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 9 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 9 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 9 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -244,12 +173,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 10 run: 0
 Splitter3           DEBUG Trigmask = 1026
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 10 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 10 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 10 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 10 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -262,12 +185,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 11 run: 0
 Splitter3           DEBUG Trigmask = 2052
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 11 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 11 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 11 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 11 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -280,12 +197,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 12 run: 0
 Splitter3           DEBUG Trigmask = 4097
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 12 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 12 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 12 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 12 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -298,12 +209,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 13 run: 0
 Splitter3           DEBUG Trigmask = 8194
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 13 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 13 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 13 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 13 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -316,12 +221,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 14 run: 0
 Splitter3           DEBUG Trigmask = 16388
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 14 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 14 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 14 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 14 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -334,12 +233,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 15 run: 0
 Splitter3           DEBUG Trigmask = 32769
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 15 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 15 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 15 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 15 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -352,12 +245,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 16 run: 0
 Splitter3           DEBUG Trigmask = 3
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 16 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 16 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 16 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 16 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -370,12 +257,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 17 run: 0
 Splitter3           DEBUG Trigmask = 6
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 17 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 17 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 17 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 17 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -388,12 +269,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 18 run: 0
 Splitter3           DEBUG Trigmask = 5
 Splitter3            INFO L1 passed
-Splitter456          INFO EventInfo event: 18 run: 0
-Splitter456          INFO L1 failed
-Splitter7            INFO EventInfo event: 18 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 18 run: 0
-Splitter48           INFO L1 failed
 Triggered            INFO EventInfo event: 18 run: 0
 Triggered            INFO L1 passed
 Splitter1           DEBUG in execute()
@@ -406,12 +281,6 @@ Splitter3           DEBUG in execute()
 Splitter3            INFO EventInfo event: 19 run: 0
 Splitter3           DEBUG Trigmask = 10
 Splitter3            INFO L1 failed
-Splitter456          INFO EventInfo event: 19 run: 0
-Splitter456          INFO L1 passed
-Splitter7            INFO EventInfo event: 19 run: 0
-Splitter7            INFO L1 failed
-Splitter48           INFO EventInfo event: 19 run: 0
-Splitter48           INFO L1 passed
 Triggered            INFO EventInfo event: 19 run: 0
 Triggered            INFO L1 passed
 StorageSvc           INFO EventStreamInfo_p3 [11DF1B8C-0DEE-4687-80D7-E74B520ACBB4]
@@ -420,13 +289,9 @@ Stream2              INFO Records written: 8
 Stream3              INFO Records written: 6
 Others               INFO Records written: 2
 Bad                  INFO Records written: 1
-StreamAll            INFO Records written: 21
 Splitter1            INFO in finalize()
 Splitter2            INFO in finalize()
 Splitter3            INFO in finalize()
-Splitter456          INFO in finalize()
-Splitter7            INFO in finalize()
-Splitter48           INFO in finalize()
 Triggered            INFO in finalize()
 ItemListSvc         DEBUG STREAM Bad has (1) items
 ItemListSvc         DEBUG    - EventStreamInfo_Bad
@@ -435,28 +300,18 @@ ItemListSvc         DEBUG    - EventStreamInfo_Others
 ItemListSvc         DEBUG  --> Overlap with Stream1 (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (6) items
-ItemListSvc         DEBUG  --> Overlap with StreamAll (6) items
 ItemListSvc         DEBUG STREAM Stream1 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream1
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
-ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
 ItemListSvc         DEBUG STREAM Stream2 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream2
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
-ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
 ItemListSvc         DEBUG STREAM Stream3 has (8) items
 ItemListSvc         DEBUG    - EventStreamInfo_Stream3
 ItemListSvc         DEBUG  --> Overlap with Others (6) items
 ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
 ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
-ItemListSvc         DEBUG  --> Overlap with StreamAll (7) items
-ItemListSvc         DEBUG STREAM StreamAll has (8) items
-ItemListSvc         DEBUG    - EventStreamInfo_StreamAll
-ItemListSvc         DEBUG  --> Overlap with Others (6) items
-ItemListSvc         DEBUG  --> Overlap with Stream1 (7) items
-ItemListSvc         DEBUG  --> Overlap with Stream2 (7) items
-ItemListSvc         DEBUG  --> Overlap with Stream3 (7) items
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
index c46f8d480d1..8b8eb9cb995 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplit_jo.py
@@ -19,7 +19,6 @@
 from AthenaCommon.AlgSequence import AthSequencer
 topSequence = AthSequencer("AthAlgSeq")
 athOutSeq = AthSequencer("AthOutSeq")
-athRegSeq = AthSequencer("AthRegSeq")
 
 from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
 alg = xAODMaker__EventInfoCnvAlg()
@@ -46,8 +45,6 @@ svcMgr.PoolSvc.ReadCatalog = [ "XMLFileCatalog_file:SplittableData.xml" ]
 svcMgr.PoolSvc.WriteCatalog = "XMLFileCatalog_file:EventSplit.xml"
 #PoolSvc.FileOpen = "update"
  
-#svcMgr.EventSelector.InputCollections =  ["AthenaPoolMultiTest_Splittable0.root"]; # The input file name
-#svcMgr.EventSelector.InputCollections =  ["PFN:SplittableCollection.root"]; # The input file name
 svcMgr.EventSelector.InputCollections =  ["AthenaPoolMultiTest_Splittable0.root"]
 #svcMgr.EventSelector.CollectionType = "ExplicitROOT"
 svcMgr.AthenaPoolAddressProviderSvc.DataHeaderIterator = False
@@ -73,17 +70,6 @@ Splitter2.OutputLevel = INFO
 Splitter3 = EventSplit("Splitter3")  # Accept bit 3
 Splitter3.L1bitmask = 4 
 Splitter3.OutputLevel = DEBUG
-Splitter456 = EventSplit("Splitter456")  # Accept bits 4,5,6
-Splitter456.L1bitmask = 8
-Splitter456.L1bitmask += 16
-Splitter456.L1bitmask += 32
-Splitter456.OutputLevel = INFO
-Splitter7 = EventSplit("Splitter7")  # Accept bit 7
-Splitter7.L1bitmask = 64
-Splitter7.OutputLevel = INFO
-Splitter48 = EventSplit("Splitter48") # Accept bits 4,8
-Splitter48.L1bitmask = 136
-Splitter48.OutputLevel = INFO
 Triggered = EventSplit("Triggered")   # Accept all bits
 Triggered.L1bitmask = 65535   # assume -1 will set all bits on
 Triggered.OutputLevel = INFO
@@ -91,17 +77,8 @@ Triggered.OutputLevel = INFO
 topSequence+=Splitter1
 topSequence+=Splitter2
 topSequence+=Splitter3
-topSequence+=Splitter456
-topSequence+=Splitter7
-topSequence+=Splitter48
 topSequence+=Triggered
 
-# Add a non-outputstream decision
-from AthenaServices.AthenaServicesConf import DecisionAlg
-dummy = DecisionAlg("Dummy")
-dummy.AcceptAlgs  = ["Splitter2"]
-topSequence += dummy
-
 #--------------------------------------------------------------
 #---  Set up the streams for the filters
 #     Note that this uses a cascading exclusive stream model
@@ -125,10 +102,6 @@ Stream1.CheckNumberOfWrites = False
 # Filtered stream 3
 Stream3 = AthenaPoolOutputStream( "Stream3", "AthenaPoolMultiTest_Split3.root", False, noTag=False )
 Stream3.CheckNumberOfWrites = False
-# Unfiltered stream
-StreamAll = AthenaPoolOutputStream( "StreamAll", "AthenaPoolMultiTest_StreamAll.root", False, noTag=False )
-StreamAll.CheckNumberOfWrites = False
-StreamAll.WritingTool.AttributeListKey="SimpleTagDecisions"
 # Events that didn't satisfy any filters
 Others  = AthenaPoolOutputStream( "Others", "AthenaPoolMultiTest_Missed.root", False, noTag=False )
 Others.CheckNumberOfWrites = False
@@ -155,9 +128,6 @@ Stream3.ForceRead=TRUE
 Stream3.AcceptAlgs = ["Splitter3"]
 Stream3.VetoAlgs   = ["Splitter1"]
 Stream3.VetoAlgs  += ["Splitter2"]
-# Unfiltered
-StreamAll.TakeItemsFromInput = True
-StreamAll.ForceRead=TRUE
 # missed
 Others.TakeItemsFromInput = True
 Others.ForceRead=TRUE
-- 
GitLab


From 8ab43624932dc001ee824adeb85714d777565d6c Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Wed, 20 Feb 2019 09:37:34 -0600
Subject: [PATCH 013/404] Add test which uses DecisionAlg to define streams
 without using AthenaOutputStream.

---
 .../AthenaPoolMultiTest/CMakeLists.txt        |   3 +
 .../AthenaPoolMultiTestEventSplitDecision.ref | 232 ++++++++++++++++++
 .../share/EventSplitDecision_jo.py            | 121 +++++++++
 3 files changed, 356 insertions(+)
 create mode 100644 AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
 create mode 100755 AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/CMakeLists.txt b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/CMakeLists.txt
index 7a432641df7..21d4d5c0de6 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/CMakeLists.txt
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/CMakeLists.txt
@@ -61,6 +61,9 @@ athenapoolmultitest_run_test( AthenaPoolMultiTestBuildInput SplittableData_jo
 athenapoolmultitest_run_test( AthenaPoolMultiTestEventSplit EventSplit_jo
                               post_check_es
                               DEPENDS AthenaPoolMultiTestBuildInput )
+athenapoolmultitest_run_test( AthenaPoolMultiTestEventSplitDecision EventSplitDecision_jo
+                              post_check_es
+                              DEPENDS AthenaPoolMultiTestBuildInput )
 #athenapoolmultitest_run_test( AthenaPoolMultiTestCheckNull CheckNull_jo
 #                              post_check_cn
 #                              DEPENDS AthenaPoolMultiTestEventSplit )
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
new file mode 100644
index 00000000000..78338d879b8
--- /dev/null
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
@@ -0,0 +1,232 @@
+Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfig.py"
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+Splitter1           DEBUG Property update for OutputLevel : new value = 2
+Splitter1            INFO in initialize()
+Splitter1           DEBUG input handles: 0
+Splitter1           DEBUG output handles: 0
+Splitter1           DEBUG Data Deps for Splitter1
+Splitter2            INFO in initialize()
+Splitter3           DEBUG Property update for OutputLevel : new value = 2
+Splitter3            INFO in initialize()
+Splitter3           DEBUG input handles: 0
+Splitter3           DEBUG output handles: 0
+Splitter3           DEBUG Data Deps for Splitter3
+DecisionSvc          INFO Inserting stream: Stream1 with no Algs
+DecisionSvc          INFO Inserting stream: Stream2 with no Algs
+DecisionSvc          INFO Inserting stream: Stream3 with no Algs
+DecisionSvc          INFO Inserting stream: StreamAll2 with no Algs
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+StreamAll2.Stre...   INFO Initializing StreamAll2.StreamAll2Tool - package version AthenaServices-00-00-00
+StreamAll2.Stre...   INFO Initializing StreamAll2.StreamAll2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
+StreamAll2           INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/StreamAll2_MakeEventStreamInfo'])
+StreamAll2           INFO Data output: AthenaPoolMultiTest_StreamAll2.root
+StreamAll2           INFO I/O reinitialization...
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 0 run: 0
+Splitter1           DEBUG Trigmask = 1
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 0 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 0 run: 0
+Splitter3           DEBUG Trigmask = 1
+Splitter3            INFO L1 failed
+Domain[ROOT_All]     INFO                           AthenaPoolMultiTest_StreamAll2.root
+RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll2.root File version:61408
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 1 run: 0
+Splitter1           DEBUG Trigmask = 2
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 1 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 1 run: 0
+Splitter3           DEBUG Trigmask = 2
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 2 run: 0
+Splitter1           DEBUG Trigmask = 4
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 2 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 2 run: 0
+Splitter3           DEBUG Trigmask = 4
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 3 run: 0
+Splitter1           DEBUG Trigmask = 256
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 3 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 3 run: 0
+Splitter3           DEBUG Trigmask = 256
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 4 run: 0
+Splitter1           DEBUG Trigmask = 18
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 4 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 4 run: 0
+Splitter3           DEBUG Trigmask = 18
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 5 run: 0
+Splitter1           DEBUG Trigmask = 36
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 5 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 5 run: 0
+Splitter3           DEBUG Trigmask = 36
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 6 run: 0
+Splitter1           DEBUG Trigmask = 65
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 6 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 6 run: 0
+Splitter3           DEBUG Trigmask = 65
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 7 run: 0
+Splitter1           DEBUG Trigmask = 130
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 7 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 7 run: 0
+Splitter3           DEBUG Trigmask = 130
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 8 run: 0
+Splitter1           DEBUG Trigmask = 260
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 8 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 8 run: 0
+Splitter3           DEBUG Trigmask = 260
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 9 run: 0
+Splitter1           DEBUG Trigmask = 513
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 9 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 9 run: 0
+Splitter3           DEBUG Trigmask = 513
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 10 run: 0
+Splitter1           DEBUG Trigmask = 1026
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 10 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 10 run: 0
+Splitter3           DEBUG Trigmask = 1026
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 11 run: 0
+Splitter1           DEBUG Trigmask = 2052
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 11 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 11 run: 0
+Splitter3           DEBUG Trigmask = 2052
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 12 run: 0
+Splitter1           DEBUG Trigmask = 4097
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 12 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 12 run: 0
+Splitter3           DEBUG Trigmask = 4097
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 13 run: 0
+Splitter1           DEBUG Trigmask = 8194
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 13 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 13 run: 0
+Splitter3           DEBUG Trigmask = 8194
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 14 run: 0
+Splitter1           DEBUG Trigmask = 16388
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 14 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 14 run: 0
+Splitter3           DEBUG Trigmask = 16388
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 15 run: 0
+Splitter1           DEBUG Trigmask = 32769
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 15 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 15 run: 0
+Splitter3           DEBUG Trigmask = 32769
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 16 run: 0
+Splitter1           DEBUG Trigmask = 3
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 16 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 16 run: 0
+Splitter3           DEBUG Trigmask = 3
+Splitter3            INFO L1 failed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 17 run: 0
+Splitter1           DEBUG Trigmask = 6
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 17 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 17 run: 0
+Splitter3           DEBUG Trigmask = 6
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 18 run: 0
+Splitter1           DEBUG Trigmask = 5
+Splitter1            INFO L1 passed
+Splitter2            INFO EventInfo event: 18 run: 0
+Splitter2            INFO L1 failed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 18 run: 0
+Splitter3           DEBUG Trigmask = 5
+Splitter3            INFO L1 passed
+Splitter1           DEBUG in execute()
+Splitter1            INFO EventInfo event: 19 run: 0
+Splitter1           DEBUG Trigmask = 10
+Splitter1            INFO L1 failed
+Splitter2            INFO EventInfo event: 19 run: 0
+Splitter2            INFO L1 passed
+Splitter3           DEBUG in execute()
+Splitter3            INFO EventInfo event: 19 run: 0
+Splitter3           DEBUG Trigmask = 10
+Splitter3            INFO L1 failed
+StorageSvc           INFO EventStreamInfo_p3 [11DF1B8C-0DEE-4687-80D7-E74B520ACBB4]
+StreamAll2           INFO Records written: 21
+Splitter1            INFO in finalize()
+Splitter2            INFO in finalize()
+Splitter3            INFO in finalize()
+ItemListSvc         DEBUG STREAM StreamAll2 has (8) items
+ItemListSvc         DEBUG    - EventStreamInfo_StreamAll2
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
new file mode 100755
index 00000000000..6bcfdb06b1a
--- /dev/null
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
@@ -0,0 +1,121 @@
+#####################################################################
+#
+## @file EventSplitDecision_jo.py
+## @brief
+## Second part of AthenaPoolMultiTest gmake check
+##<br><br>
+## @author JackCranshaw (Jack.Cranshaw@cern.ch)
+## $Id: EventNoSplit_jo.py,v 1.27 2009-05-20 13:34:21 cranshaw Exp $
+#====================================================================
+
+#--------------------------------------------------------------
+# Event related parameters
+#--------------------------------------------------------------
+from AthenaCommon.AlgSequence import AthSequencer
+topSequence = AthSequencer("AthAlgSeq")
+athOutSeq = AthSequencer("AthOutSeq")
+
+from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
+alg = xAODMaker__EventInfoCnvAlg()
+topSequence += alg
+
+
+from AthenaCommon.AppMgr import theApp
+theApp.EvtMax = 200000
+
+#--------------------------------------------------------------
+# Load POOL support
+#--------------------------------------------------------------
+import AthenaPoolCnvSvc.ReadAthenaPool
+
+from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+
+# If you need to change or add input file catalogs
+from PoolSvc.PoolSvcConf import PoolSvc
+svcMgr += PoolSvc()
+svcMgr.PoolSvc.ReadCatalog = [ "XMLFileCatalog_file:SplittableData.xml" ]
+# Or if you need to change the name of the output file catalog
+svcMgr.PoolSvc.WriteCatalog = "XMLFileCatalog_file:EventSplit.xml"
+ 
+svcMgr.EventSelector.InputCollections =  ["AthenaPoolMultiTest_Splittable0.root"]
+svcMgr.AthenaPoolAddressProviderSvc.DataHeaderIterator = False
+
+#--------------------------------------------------------------
+# Private Application Configuration options
+#--------------------------------------------------------------
+# include stream transform
+include( "AthenaPoolMultiTest/ExampleStreamConfig.py" )
+
+#--------------------------------------------------------------
+# Configure the filters
+#--------------------------------------------------------------
+#theApp.TopAlg += [ "ReadData" ]  # print out some data to chk its there
+from AthenaPoolMultiTest.AthenaPoolMultiTestConf import EventSplit
+
+Splitter1 = EventSplit("Splitter1")  # Accept bit 1
+Splitter1.L1bitmask = 1 
+Splitter1.OutputLevel = DEBUG 
+Splitter2 = EventSplit("Splitter2")  # Accept bit 2
+Splitter2.L1bitmask = 2 
+Splitter2.OutputLevel = INFO
+Splitter3 = EventSplit("Splitter3")  # Accept bit 3
+Splitter3.L1bitmask = 4 
+Splitter3.OutputLevel = DEBUG
+
+topSequence+=Splitter1
+topSequence+=Splitter2
+topSequence+=Splitter3
+
+#--------------------------------------------------------------
+#---  Set up the streams for the filters
+#     Note that this uses a cascading exclusive stream model
+#     for the outstreams and uses inclusive only for the collections.
+#     Cascading means that the first stream in the list for which an 
+#     event qualifies gets it. Another exclusive model that has been 
+#     explored puts all multistream events in a single overlap stream.
+#--------------------------------------------------------------
+
+ToolSvc = Service( "ToolSvc" )
+
+from AthenaServices.AthenaServicesConf import DecisionAlg
+
+Stream1 = DecisionAlg( "Stream1" )
+Stream1.AcceptAlgs = ["Splitter1"]
+Stream2 = DecisionAlg( "Stream2" )
+Stream2.AcceptAlgs  = ["Splitter2"]
+Stream2.VetoAlgs    = ["Splitter1"]
+Stream3 = DecisionAlg( "Stream3" )
+Stream3.AcceptAlgs = ["Splitter3"]
+Stream3.VetoAlgs   = ["Splitter2"]
+
+topSequence += Stream1
+topSequence += Stream2
+topSequence += Stream3
+
+from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
+# Unfiltered stream
+StreamAll = AthenaPoolOutputStream( "StreamAll2", "AthenaPoolMultiTest_StreamAll2.root", False, noTag=False )
+StreamAll.CheckNumberOfWrites = False
+StreamAll.WritingTool.AttributeListKey="SimpleTagDecisions"
+StreamAll.TakeItemsFromInput = True
+StreamAll.ForceRead=TRUE
+
+# Add the outputstreams to the execution sequence
+athOutSeq+=StreamAll
+
+#--------------------------------------------------------------
+# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
+#--------------------------------------------------------------
+svcMgr.MessageSvc.OutputLevel = INFO
+svcMgr.MessageSvc.debugLimit = 5000
+import AthenaCommon.CfgMgr as CfgMgr
+if not hasattr(svcMgr, 'DecisionSvc'): svcMgr += CfgMgr.DecisionSvc()
+svcMgr.DecisionSvc.CalcStats = True
+svcMgr.DecisionSvc.SaveDecisions = True
+if not hasattr(svcMgr, 'ItemListSvc'): svcMgr += CfgMgr.ItemListSvc()
+svcMgr.ItemListSvc.OutputLevel = DEBUG
+#==============================================================
+#
+# End of job options file
+#
+###############################################################
-- 
GitLab


From de64bc01594b1001eeb32ce7e36217e94ba42b1a Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 22 Feb 2019 10:36:05 +0100
Subject: [PATCH 014/404] Add enum of MET components

---
 .../TrigEFMissingET/EFMissingETHelper.h       | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
index d7de6638206..5b82ab09b47 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
@@ -28,6 +28,30 @@
 
 class TrigEFMissingEtComponent {
   public: // all attributes are public: like a struct
+    enum Component 
+    { 
+        PreSamplB, EMB1     , EMB2     , EMB3     ,     // LAr barrel
+        PreSamplE, EME1     , EME2     , EME3     ,     // LAr EM endcap 
+        HEC0     , HEC1     , HEC2     , HEC3     ,     // Hadronic end cap cal.
+        TileBar0 , TileBar1 , TileBar2 ,                // Tile barrel
+        TileGap1 , TileGap2 , TileGap3 ,                // Tile gap (ITC & scint)
+        TileExt0 , TileExt1 , TileExt2 ,                // Tile extended barrel
+        FCalEM   , FCalHad1 , FCalHad2 ,                // Forward cal endcap
+        TCLCW    ,                                      // Topo. clusters Had
+        TCLCWB1  , TCLCWB2  ,                           // pos. and neg. eta barrel 
+        TCLCWE1  , TCLCWE2  ,                           // pos. and neg. eta endcap 
+        TCEM     ,                                      // Topo. clusters EM
+        TCEMB1   , TCEMB2   ,                           // pos. and neg. eta barrel 
+        TCEME1   , TCEME2   ,                           // pos. and neg. eta endcap 
+        JET      ,                                      // Jet 
+        JETB1    , JETB2    ,                           //
+        JETE1    , JETE2    ,                           // 
+        TCPUC    ,                                      // Topo. cluster Fit 
+        TCPUCUnc ,                                      // Topo. cluster Fit -- uncorrected
+        Muons                                           // Muons 
+  };
+
+
     unsigned short m_usedChannels; //<! counter for channels
     short m_sumOfSigns;            //<! sum of energy signs (-1, +1)
     float m_ex, m_ey, m_ez; //<! 3 components of the missing energy
-- 
GitLab


From 4ce9e9715a6efb129b3a3c64bbd2fc02f8e0735d Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 22 Feb 2019 11:01:48 +0100
Subject: [PATCH 015/404] Add debug/warning messages to TrigMissingETMuon

---
 .../src/TrigMissingETMuon.cxx                 | 54 +++++++++++--------
 1 file changed, 32 insertions(+), 22 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 289998aca97..f07dcaf5c4b 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -108,6 +108,10 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
     msg() << MSG::DEBUG << "Executing xAOD::TrigMissingETMuon::hltExecute()" << endmsg;
   }
 
+  if(msgLvl() <= MSG::WARNING) {
+    msg() << MSG::WARNING << "Executing xAOD::TrigMissingETMuon::hltExecute()" << endmsg;
+  }
+
   if (msgLvl() <= MSG::DEBUG) {
     msg() << MSG::DEBUG << "REGTEST: tes_in.size() = " << tes_in_size << endmsg;
 
@@ -115,6 +119,9 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
       msg() << MSG::DEBUG << "REGTEST: tes_in[" << u << "].size() = " << tes_in[u].size() << endmsg;
     }
   }
+  if(msgLvl() <= MSG::WARNING) {
+    msg() << MSG::WARNING << "tes_in_size" << tes_in_size << endmsg;
+  }
   //algorithm is muon seeded, therefore:
   //    algorithm has TrigMissingET as only seed if in unseeded mode
   //                  muon as second seed of in seeded mode  
@@ -138,16 +145,16 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
     else{
       std::vector<const xAOD::TrigMissingET*> vectorOfMET;
       for (HLT::TEVec::const_iterator met_it = tes_in[0].begin(); met_it != tes_in[0].end(); ++met_it) {
-	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
-	if(status != HLT::OK) {
-	  msg() << MSG::ERROR 
-		<< "no TrigMissingET object found for this TE ... ?!?"
-		<< endmsg;
-	  return HLT::NAV_ERROR;
-	}
+      	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
+      	if(status != HLT::OK) {
+      	  msg() << MSG::ERROR 
+      		<< "no TrigMissingET object found for this TE ... ?!?"
+      		<< endmsg;
+      	  return HLT::NAV_ERROR;
+      	}
       }
-      if (msgLvl() <= MSG::DEBUG) {
-	msg() << MSG::DEBUG << "REGTEST: Florian: No muon input. Will save the input TE without updating it " << endmsg;
+      if (msgLvl() <= MSG::WARNING) {
+      	msg() << MSG::WARNING << "REGTEST: No muon input. Will save the input TE without updating it " << endmsg;
       }
 
       // Check if EDM is there
@@ -172,20 +179,20 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
     }
     if (tes_in1_size == 0) {
       if (msgLvl() <= MSG::DEBUG){
-	msg() << MSG::DEBUG
+      	msg() << MSG::DEBUG
 	      << "No muon feature found: skipping muon correction" << endmsg;
       }
 
       // Save ouput TE before leaving.
       std::vector<const xAOD::TrigMissingET*> vectorOfMET;
       for (HLT::TEVec::const_iterator met_it = tes_in[0].begin(); met_it != tes_in[0].end(); ++met_it) {
-	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
-	if(status != HLT::OK) {
-	  msg() << MSG::ERROR 
-		<< "no TrigMissingET object found for this TE ... ?!?"
-		<< endmsg;
-	  return HLT::NAV_ERROR;
-	}
+      	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
+      	if(status != HLT::OK) {
+      	  msg() << MSG::ERROR 
+      		<< "no TrigMissingET object found for this TE ... ?!?"
+      		<< endmsg;
+      	  return HLT::NAV_ERROR;
+      	}
       }
 
       // Check if EDM is there
@@ -226,10 +233,10 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   const xAOD::TrigMissingET *met_temp=vectorOfMET[0];
   m_met = const_cast<xAOD::TrigMissingET *>(met_temp);
   // ++++++++++++++++++++++++++++++++++++++++++
-  msg() << MSG::DEBUG << "xAOD::TrigMissingET object retrieved." <<endmsg;
+  msg() << MSG::WARNING << "xAOD::TrigMissingET object retrieved." <<endmsg;
 
   flag=m_met->flag();
-  msg() << MSG::DEBUG << "Flag got." <<endmsg;
+  msg() << MSG::WARNING << "Flag got." <<endmsg;
 
   // Now we loop over all the muons
   float muon_ex=0;
@@ -241,7 +248,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   unsigned int Nmuons=0;
   bool MuonError=false;
 
-  msg() << MSG::DEBUG << "REGTEST: Ready to access xAOD::MuonContainer  muons " << endmsg;
+  msg() << MSG::WARNING << "REGTEST: Ready to access xAOD::MuonContainer  muons " << endmsg;
 
   std::vector<const xAOD::TrackParticle*> vecOfMuonTrk;
 
@@ -250,8 +257,8 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
         << "REGTEST: Using muon pt threshold "<<m_muonptcut<<" GeV."<< endmsg;
   }
 
-  for (HLT::TEVec::const_iterator muon_it = tes_in[muonIndex].begin();
-       muon_it != tes_in[muonIndex].end(); ++muon_it) {
+  for (HLT::TEVec::const_iterator muon_it = tes_in[muonIndex].begin();muon_it != tes_in[muonIndex].end(); ++muon_it) 
+  {
 
     // Get the muon container linked to the TE
     const xAOD::MuonContainer* muonContainer(0);
@@ -351,8 +358,11 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   if ( msgLvl() <= MSG::DEBUG ) msg()  << MSG::DEBUG << "Setting energies and flag" << endmsg;
   unsigned int muonComp = m_met->getNumberOfComponents() - 1;
   // Suggested by Diego: Checking the component name of the input
+  msg() << MSG::WARNING << "MET component number: " << muonComp << endmsg;
+  msg() << MSG::WARNING << "MET component name: " << m_met->nameOfComponent(muonComp) << endmsg;
   if( (m_met->nameOfComponent(muonComp)).substr(0,4)!="Muon") {
     msg() << MSG::ERROR << "Could not find MET container with muon information!!! Exit..." << endmsg;
+    msg() << MSG::ERROR << "MET component number: " << muonComp << endmsg;
     msg() << MSG::ERROR << "MET component name: " << m_met->nameOfComponent(muonComp) << endmsg;
     return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);    
   }
-- 
GitLab


From 650c40d4bf3ff8620f154fd873348468e4a47960 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 22 Feb 2019 11:52:36 +0100
Subject: [PATCH 016/404] Clean up initialization of met helper

---
 .../TrigEFMissingET/EFMissingETHelper.h       | 93 ++++++++++++++++++-
 .../TrigEFMissingET/src/EFMissingETHelper.cxx | 87 +++--------------
 2 files changed, 102 insertions(+), 78 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
index 5b82ab09b47..219415974df 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
@@ -44,12 +44,100 @@ class TrigEFMissingEtComponent {
         TCEMB1   , TCEMB2   ,                           // pos. and neg. eta barrel 
         TCEME1   , TCEME2   ,                           // pos. and neg. eta endcap 
         JET      ,                                      // Jet 
-        JETB1    , JETB2    ,                           //
+        JETB1    , JETB2    ,                           // 
         JETE1    , JETE2    ,                           // 
         TCPUC    ,                                      // Topo. cluster Fit 
         TCPUCUnc ,                                      // Topo. cluster Fit -- uncorrected
         Muons                                           // Muons 
-  };
+    };
+
+
+    static std::string ComponentToName(const Component c)
+    {
+        std::string name;
+        switch(c)
+        {
+            // LAr barrel
+            case PreSamplB:  name="PreSamplB";    break;
+            case EMB1:       name="EMB1";         break;
+            case EMB2:       name="EMB2";         break;
+            case EMB3:       name="EMB3";         break;
+      
+            // LAr EM endcap 
+            case PreSamplE:  name="PreSamplE";    break;
+            case EME1:       name="EME1";         break;
+            case EME2:       name="EME2";         break;
+            case EME3:       name="EME3";         break;
+      
+            // Hadronic end cap cal.
+            case HEC0:       name="HEC0";         break;
+            case HEC1:       name="HEC1";         break;
+            case HEC2:       name="HEC2";         break;
+            case HEC3:       name="HEC3";         break;
+
+            // Tile barrel
+            case TileBar0:   name="TileBar0";     break;
+            case TileBar1:   name="TileBar1";     break;
+            case TileBar2:   name="TileBar2";     break;
+
+            // Tile gap (ITC & scint)  
+            case TileGap1:   name="TileGap1";     break;
+            case TileGap2:   name="TileGap2";     break;
+            case TileGap3:   name="TileGap3";     break;
+
+            // Tile extended barrel 
+            case TileExt0:   name="TileExt0";     break;
+            case TileExt1:   name="TileExt1";     break;
+            case TileExt2:   name="TileExt2";     break;
+
+            // Forward cal endcap  
+            case FCalEM:     name="FCalEM";       break;
+            case FCalHad1:   name="FCalHad1";     break;
+            case FCalHad2:   name="FCalHad2";     break;
+
+            // Topo. clusters Had  
+            case TCLCW:      name="TCLCW";        break;
+
+            // pos. and neg. eta barrel                         
+            case TCLCWB1:    name="TCLCWB1";      break;
+            case TCLCWB2:    name="TCLCWB2";      break;
+
+            // pos. and neg. eta endcap             
+            case TCLCWE1:    name="TCLCWE1";      break;
+            case TCLCWE2:    name="TCLCWE2";      break;
+
+            // Topo. clusters EM             
+            case TCEM:       name="TCEM";         break;
+
+            // pos. and neg. eta barrel                         
+            case TCEMB1:     name="TCEMB1";       break;
+            case TCEMB2:     name="TCEMB2";       break;
+
+            // pos. and neg. eta endcap              
+            case TCEME1:     name="TCEME1";       break;
+            case TCEME2:     name="TCEME2";       break;
+
+            // Jet              
+            case JET:        name="JET";          break;
+            case JETB1:      name="JETB1";        break;
+            case JETB2:      name="JETB2";        break;
+            case JETE1:      name="JETE1";        break;
+            case JETE2:      name="JETE2";        break;
+
+            // Topo. cluster Fit              
+            case TCPUC:      name="TCPUC";        break;
+
+            // Topo. cluster Fit -- uncorrected                         
+            case TCPUCUnc:   name="TCPUCUnc";     break;
+
+            // Muons                         
+            case Muons:      name="Muons";        break;
+
+            default:         name="Unknown";
+        }
+        return name;
+                                         
+    }
 
 
     unsigned short m_usedChannels; //<! counter for channels
@@ -118,7 +206,6 @@ class TrigEFMissingEtHelper {
     TrigEFMissingEtComponent* GetComponent(unsigned char c);
 
   private:
-    // (the following 2 integer attributes should be packed into a single word)
     int           m_status;                                  //<! global status flag
     unsigned char m_elements;                                //<! length of the vector of components
     float         m_ex, m_ey, m_ez, m_sumEt, m_sumE; //<! global information
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
index e5878666aa4..d0c35b0ab11 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
@@ -77,77 +77,14 @@ TrigEFMissingEtHelper::TrigEFMissingEtHelper(unsigned char len){
   len>REASONABLE_MAX ? m_elements=REASONABLE_MAX : m_elements=len;
   m_vecOfComponents.resize(m_elements);
 
-  char names[42][10] = { // from CaloSampling::CaloSample, apart from muons
-    "PreSamplB", "EMB1     ", "EMB2     ", "EMB3     ",   // LAr barrel
-    "PreSamplE", "EME1     ", "EME2     ", "EME3     ",   // LAr EM endcap 
-    "HEC0     ", "HEC1     ", "HEC2     ", "HEC3     ",   // Hadronic end cap cal.
-    "TileBar0 ", "TileBar1 ", "TileBar2 ",                // Tile barrel
-    "TileGap1 ", "TileGap2 ", "TileGap3 ",                // Tile gap (ITC & scint)
-    "TileExt0 ", "TileExt1 ", "TileExt2 ",                // Tile extended barrel
-    "FCalEM   ", "FCalHad1 ", "FCalHad2 ",                // Forward cal endcap
-    "TCLCW    ",										  // Topo. clusters Had
-    "TCLCWB1  ", "TCLCWB2  ",						      // pos. and neg. eta barrel 
-    "TCLCWE1  ", "TCLCWE2  ",							  // pos. and neg. eta endcap 
-    "TCEM     ",                                          // Topo. clusters EM
-    "TCEMB1   ", "TCEMB2   ",							  // pos. and neg. eta barrel 
-    "TCEME1   ", "TCEME2   ",							  // pos. and neg. eta endcap 
-    "JET      ",                                          // Jet 
-    "JETB1   ", "JETB2   ",							      //
-    "JETE1   ", "JETE2   ",						     	  // 
-    "TCPUC    ",                                          // Topo. cluster Fit 
-    "TCPUCUnc ",                                          // Topo. cluster Fit -- uncorrected
-    "Muons    "                                           // Muons 
-  };
-  // calibration: constant term, MeV
-  float c0[42] = { 0.0,   0.0,   0.0,   0.0,    // LAr barrel
-		   0.0,   0.0,   0.0,   0.0,    // LAr EM endcap
-		   0.0,   0.0,   0.0,   0.0,    // Hadronic end cap cal.
-		   0.0,   0.0,   0.0,           // Tile barrel
-		   0.0,   0.0,   0.0,           // Tile gap (ITC & scint)
-		   0.0,   0.0,   0.0,           // Tile extended barrel
-		   0.0,                         // FCal EM
-		   0.0,   0.0,                  // FCal Had
-		   0.0,                         // Topo. clusters EM
-		   0.0,   0.0,                  // 
-		   0.0,   0.0,                  // 
-		   0.0,                         // Topo. clusters Had
-		   0.0,   0.0,                  // 
-		   0.0,   0.0,                  // 		   
-		   0.0,                         // Jet
-		   0.0,   0.0,                  // 
-		   0.0,   0.0,                  // 		   
-		   0.0,                         // Topo. cluster Fit 
-		   0.0,                         // Topo. cluster Fit -- uncorrected
-		   0.0                          // Muons
-  };
-  // calibration: linear term (slope)
-  float c1[42] = { 1.0,  1.0,  1.0,  1.0,    // LAr barrel
-		   1.0,  1.0,  1.0,  1.0,    // LAr EM endcap
-		   1.0,  1.0,  1.0,  1.0,    // Hadronic end cap cal.
-		   1.0,  1.0,  1.0,           // Tile barrel
-		   1.0,  1.0,  1.0,           // Tile gap (ITC & scint)
-		   1.0,  1.0,  1.0,           // Tile extended barrel
-		   1.0,                         // FCal EM
-		   1.0,  1.0,                  // FCal Had
-		   1.0,                          // Topo. clusters EM
-		   1.0, 1.0,                     // 
-		   1.0, 1.0,                     // 
-		   1.0,                          // Topo. clusters Had
-		   1.0, 1.0,                     // 
-		   1.0, 1.0,                     // 
-		   1.0,                          // Jet
-		   1.0, 1.0,                     // 
-		   1.0, 1.0,                     // 
-		   1.0,                          // Topo. cluster Fit 
-		   1.0,                          // Topo. cluster Fit -- uncorrected
-		   1.0                           // Muons
-  };
-
+  // Initialize component names and calibration constants (c0, c1) = (0, 1)
   for (unsigned char i=0; i<m_elements; ++i){
     if(m_elements==42){ // finest granularity
-      std::snprintf(m_vecOfComponents[i].m_name,10, "%s", names[i]);
-      m_vecOfComponents[i].m_calib0 = c0[i];
-      m_vecOfComponents[i].m_calib1 = c1[i];
+      strcpy(m_vecOfComponents[i].m_name, 
+        TrigEFMissingEtComponent::ComponentToName((TrigEFMissingEtComponent::Component) i).c_str());
+      // std::snprintf(m_vecOfComponents[i].m_name,10, "%s", TrigEFMissingEtComponent::ComponentToName(i));
+      m_vecOfComponents[i].m_calib0 = 0.0;
+      m_vecOfComponents[i].m_calib1 = 1.0;
     } else {
       std::snprintf(m_vecOfComponents[i].m_name,10, "comp%03d  ", i);
       m_vecOfComponents[i].m_calib0 = 0;
@@ -174,12 +111,12 @@ void TrigEFMissingEtHelper::Reset(){
 
 //---
 
-  TrigEFMissingEtComponent* TrigEFMissingEtHelper::GetComponent(unsigned char c){
-    if (c<m_elements)
-      return &(m_vecOfComponents[c]);
-    else
-      return 0;
-  }
+TrigEFMissingEtComponent* TrigEFMissingEtHelper::GetComponent(unsigned char c){
+  if (c<m_elements)
+    return &(m_vecOfComponents[c]);
+  else
+    return 0;
+}
 
 //---
 
-- 
GitLab


From 8b22e481276085c91ba3a04dc1fe86cee27cab2d Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Mon, 25 Feb 2019 14:48:12 +0100
Subject: [PATCH 017/404] Fix graphviz base path to pick up the dot program
 from LCG

Details in ATLINFR-2883
---
 Projects/WorkDir/Doxyfile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/WorkDir/Doxyfile.in b/Projects/WorkDir/Doxyfile.in
index 8b4f83debe5..4f86f96918a 100644
--- a/Projects/WorkDir/Doxyfile.in
+++ b/Projects/WorkDir/Doxyfile.in
@@ -17,5 +17,5 @@ RECURSIVE              = YES
 SOURCE_BROWSER         = YES
 INLINE_SOURCES         = YES
 GENERATE_LATEX         = NO
-DOT_PATH               = @GRAPHVIZ_DIR@/bin
+DOT_PATH               = @GRAPHVIZ_LCGROOT@/bin
 HAVE_DOT               = YES
-- 
GitLab


From f09042c6d563b38069b95ae26f5a239d95961c4b Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 15 Feb 2019 14:44:14 +0100
Subject: [PATCH 018/404] self-tester

work in progress on decorations serialisation

fixed deserialisation and added packed containers support

Small butifications
---
 .../TrigOutputHandling/CMakeLists.txt         |  15 +-
 .../TrigOutputHandling/share/test.txt         |  10 +-
 .../src/TriggerEDMDeserialiserAlg.cxx         | 228 ++++++++++++++----
 .../src/TriggerEDMDeserialiserAlg.h           |  38 ++-
 .../src/TriggerEDMSerialiserTool.cxx          | 181 ++++++++------
 .../src/TriggerEDMSerialiserTool.h            |  70 ++++--
 .../test/serial_deserial_test.cxx             | 227 +++++++++++++++++
 .../TrigUpgradeTest/share/egamma.withViews.py |  21 +-
 .../TrigUpgradeTest/test/test_decodeBS.sh     |   6 +-
 9 files changed, 640 insertions(+), 156 deletions(-)
 create mode 100644 Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx

diff --git a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
index 739f95147a9..3f575d8bf99 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
@@ -25,6 +25,8 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaMonitoring
                           Trigger/TrigMonitoring/TrigCostMonitorMT
                           Trigger/TrigAlgorithms/TrigPartialEventBuilding
+			  Trigger/TrigDataAccess/TrigSerializeTP
+			  Control/AthContainersRoot/AthContainersRoot
                           )
 find_package( tdaq-common COMPONENTS eformat )
 find_package( Boost )
@@ -35,7 +37,7 @@ atlas_add_library( TrigOutputHandlingLib
                    PUBLIC_HEADERS TrigOutputHandling
                    INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
                    LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES}  GaudiKernel AthViews AthenaBaseComps TrigSteeringEvent TrigSerializeResultLib
-                   xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib TrigPartialEventBuildingLib )
+                   xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTracking xAODTrigMuon xAODMuon DecisionHandlingLib AthenaMonitoringLib TrigPartialEventBuildingLib TrigSerializeTPLib AthContainersRoot )
 
 atlas_add_component( TrigOutputHandling
                      src/components/*.cxx
@@ -54,3 +56,14 @@ atlas_add_test( void_record_test
       POST_EXEC_SCRIPT nopost.sh
       PROPERTIES TIMEOUT 300
       )
+
+
+atlas_add_test( serial_deserial_test
+      SOURCES test/serial_deserial_test.cxx
+      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS}
+      LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} xAODTrigEgamma
+            AthLinks AthenaKernel StoreGateLib GaudiKernel TestTools xAODCore TrigOutputHandlingLib
+      ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
+      POST_EXEC_SCRIPT nopost.sh
+      PROPERTIES TIMEOUT 300
+      ) 
diff --git a/Trigger/TrigSteer/TrigOutputHandling/share/test.txt b/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
index 8c483aaab2d..65ed49fc4dd 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
+++ b/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
@@ -1 +1,9 @@
-StoreGateSvc.OutputLevel=0;
+StoreGateSvc.OutputLevel=7;
+serial_deserial_test.OutputLevel=1;
+deserialiser.OutputLevel=1;
+deserialiser.Prefix="DESERIALISED_";
+ToolSvc.serialiser.OutputLevel=1;
+ToolSvc.serialiser.CollectionsToSerialize = ["xAOD::TrigEMClusterContainer_v1#EMClusters", 
+                                        "xAOD::TrigEMClusterAuxContainer_v2#EMClustersAux.viewIndex.testFloat.rawEt.testSmallFloat", 
+					"xAOD::TrigCompositeContainer_v1#EMClustersDecisions",
+					"xAOD::TrigCompositeAuxContainer_v2#EMClustersDecisionsAux.detail1.detail2"	 ];
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
index 4de3368cb92..29ac298ab5e 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
@@ -1,43 +1,103 @@
 /*
-  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 <cstring>
 #include "AthenaKernel/StorableConversions.h"
 #include "AthenaKernel/DataBucketBase.h"
 #include "SGTools/DataProxy.h"
 #include "TrigSerializeResult/StringSerializer.h"
-#include "TriggerEDMDeserialiserAlg.h"
 #include "BareDataBucket.h"
 #include "TBufferFile.h"
+#include "TVirtualCollectionProxy.h"
 #include "TClass.h"
+#include "AthContainers/AuxStoreInternal.h"
+#include "AthContainers/AuxTypeRegistry.h"
+#include "AthContainersInterfaces/AuxTypes.h"
+#include "xAODCore/AuxContainerBase.h"
+#include "AthContainersRoot/getDynamicAuxID.h"
+#include "RootUtils/Type.h"
 
+#include "TriggerEDMDeserialiserAlg.h"
 
 
-TriggerEDMDeserialiserAlg::TriggerEDMDeserialiserAlg(const std::string& name, ISvcLocator* pSvcLocator) :
-  AthReentrantAlgorithm(name, pSvcLocator)
-{
-}
+class TriggerEDMDeserialiserAlg::WritableAuxStore : public SG::AuxStoreInternal {
+public:
+  WritableAuxStore() {}
+  using SG::AuxStoreInternal::addVector;
+};
+
+
+namespace  {
+  /**
+   * @brief Find the type of an element of a vector.
+   * @param[in] tname The name of the type to analyze.
+   * @param[out] elementTypeName The name of the type of an element of the vector.
+   *
+   * Returns the @c type_info for an element of the vector.
+   */
+  const std::type_info* getElementType ( const std::string& tname,
+					 std::string& elementTypeName ) {
+    TClass* cls = TClass::GetClass( tname.c_str() );
+    if ( !cls ) return nullptr;
+    TVirtualCollectionProxy* prox = cls->GetCollectionProxy();
+    if ( !prox ) return nullptr;
+    if ( prox->GetValueClass() ) {
+      elementTypeName = prox->GetValueClass()->GetName();
+      return prox->GetValueClass()->GetTypeInfo();
+    }
+    RootUtils::Type type ( prox->GetType() );
+    elementTypeName = type.getTypeName();
+    return type.getTypeInfo();
+  }
 
-TriggerEDMDeserialiserAlg::~TriggerEDMDeserialiserAlg()
-{
+  
+  std::string stripStdVec (const std::string& s_in) {
+    std::string s = s_in;
+    std::string::size_type pos;
+    while ((pos = s.find ("std::vector<")) != std::string::npos) {
+      s.erase (pos, 5);
+    }
+    return s;
+  }
+  
 }
 
-StatusCode TriggerEDMDeserialiserAlg::initialize()
-{
+
+TriggerEDMDeserialiserAlg::TriggerEDMDeserialiserAlg(const std::string& name, ISvcLocator* pSvcLocator) :
+  AthReentrantAlgorithm(name, pSvcLocator) {}
+
+TriggerEDMDeserialiserAlg::~TriggerEDMDeserialiserAlg() {}
+
+StatusCode TriggerEDMDeserialiserAlg::initialize() {
   ATH_CHECK( m_resultKey.initialize() );
   ATH_CHECK( m_clidSvc.retrieve() );
   ATH_CHECK( m_serializerSvc.retrieve() );
-  
+  ATH_CHECK( m_tpTool.retrieve() );
   return StatusCode::SUCCESS;
 }
 
-StatusCode TriggerEDMDeserialiserAlg::finalize()
-{
+StatusCode TriggerEDMDeserialiserAlg::finalize() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode TriggerEDMDeserialiserAlg::execute(const EventContext& context) const
-{
+StatusCode TriggerEDMDeserialiserAlg::execute(const EventContext& context) const {    
+
+  auto resultHandle = SG::makeHandle( m_resultKey, context );
+  if ( resultHandle.isValid() )
+    ATH_MSG_DEBUG("Obtained HLTResultMT " << m_resultKey.key() );
+  
+  const Payload* dataptr = nullptr;
+  // TODO: check if there are use cases where result may be not available in some events and this is not an issue at all
+  if ( resultHandle->getSerialisedData( m_moduleID, dataptr ).isFailure() ) {
+    ATH_MSG_WARNING("No payload available with moduleId " << m_moduleID << " in this event");
+    return StatusCode::SUCCESS;
+  }
+  ATH_CHECK( deserialise( dataptr ) );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TriggerEDMDeserialiserAlg::deserialise(   const Payload* dataptr  ) const {
 
   size_t  buffSize = m_initialSerialisationBufferSize;
   std::unique_ptr<char[]> buff( new char[buffSize] );
@@ -48,65 +108,142 @@ StatusCode TriggerEDMDeserialiserAlg::execute(const EventContext& context) const
 		    buffSize = neededSize;
 		    buff.reset( new char[buffSize] );
 		  }
-		};
-    
-  auto resultHandle = SG::makeHandle( m_resultKey, context );
-  if ( resultHandle.isValid() )
-    ATH_MSG_DEBUG("Obtained HLTResultMT " << m_resultKey.key() );
-  
-  const Payload* dataptr = nullptr;
-  // TODO: revise if there are use cases where result may be not available in some events
-  if ( resultHandle->getSerialisedData( m_moduleID, dataptr ).isFailure() ) {
-    ATH_MSG_DEBUG("No payload available with moduleId " << m_moduleID << " in this event");
-    return StatusCode::SUCCESS;
-  }
+		};  
+
+
+  WritableAuxStore* currentAuxStore = nullptr; // set when decoding Aux
+  int fragmentCount = 0;
   PayloadIterator start = dataptr->begin();
-  
   while ( start != dataptr->end() )  {
+    fragmentCount++;
     const CLID clid{ collectionCLID( start ) };
-    const std::string name{ collectionName( start ) };
+    const std::vector<std::string> descr{ collectionDescription( start ) };
+    ATH_CHECK( descr.size() == 3 );
+    std::string transientTypeName{ descr[0] };
+    std::string persistentTypeName{ descr[1] };
+    const std::string key{ descr[2] };
     const size_t bsize{ dataSize( start ) };
-    std::string transientType;
-    ATH_CHECK( m_clidSvc->getTypeNameOfID( clid, transientType ) );
-    const std::string actualTypeName{ name.substr(0, name.find('#')) };
-    const std::string key{ name.substr( name.find('#')+1 ) };
-        
-    ATH_MSG_DEBUG( "fragment: clid, type, key, size " << clid << " " << transientType<< " " << actualTypeName << " " << key << " " << bsize );
+
+    ATH_MSG_DEBUG( "" );
+    ATH_MSG_DEBUG( "fragment: " << fragmentCount << " type: "<< transientTypeName << " persistent type: " <<  persistentTypeName << " key: " << key << " size: " << bsize );
     resize( bsize );
     toBuffer( start, buff.get() );
+
+    start = toNextFragment( start ); // point the start to the next chunk, irrespectively of what happens in deserialisation below
         
-    RootType classDesc = RootType::ByName( actualTypeName );
+    RootType classDesc = RootType::ByName( persistentTypeName );
     size_t usedBytes{ bsize };
     void* obj = m_serializerSvc->deserialize( buff.get(), usedBytes, classDesc );
-    ATH_MSG_DEBUG( "Obtained object " << obj << " which used " << usedBytes << " bytes from available " << bsize  );
-    // for the moment I do not know what do with the raw prt
 
-    if ( obj ) {
+    ATH_MSG_DEBUG( "Deserialised object of ptr: " << obj << " which used: " << usedBytes << " bytes from available: " << bsize );
+    if ( obj == nullptr ) {
+      ATH_MSG_ERROR( "Deserialisation of object of CLID " << clid << " and transientTypeName " << transientTypeName << "#" << key << " failed, moving one to the next fragment" );
+      ATH_CHECK(false);
+    }
+    const bool isxAODInterfaceContainer = transientTypeName.find("xAOD")   != std::string::npos and transientTypeName.find("Aux") == std::string::npos;
+    const bool isxAODAuxContainer       = transientTypeName.find("xAOD")   != std::string::npos and transientTypeName.find("Aux") != std::string::npos;
+    const bool isxAODDecoration	        = transientTypeName.find("vector") != std::string::npos;
+    const bool isTPContainer	        = persistentTypeName.find("_p")	   != std::string::npos;
+    
+    ATH_CHECK( checkSanity( transientTypeName, isxAODInterfaceContainer, isxAODAuxContainer, isxAODDecoration, isTPContainer ) );
+    
+    if ( isTPContainer ) {
+      std::string decodedTransientName;
+      void * converted = m_tpTool->convertPT( persistentTypeName, obj, decodedTransientName );
+      ATH_CHECK( converted != nullptr );
+      ATH_CHECK( decodedTransientName == transientTypeName );      
+      classDesc.Destruct( obj );
+      obj = converted;      
+    }
+
+    if ( isxAODInterfaceContainer or isxAODAuxContainer or isTPContainer ) {
       BareDataBucket* dataBucket = new BareDataBucket( obj, clid, classDesc);
       const std::string outputName = m_prefix + key;
       auto proxyPtr = evtStore()->recordObject( SG::DataObjectSharedPtr<BareDataBucket>( dataBucket ), outputName, false, false );
       if ( proxyPtr == nullptr )  {
 	ATH_MSG_WARNING( "Recording of object of CLID " << clid << " and name " << outputName << " failed" );
       }
-    } else {
-      ATH_MSG_WARNING( "Deserialisation of object of CLID " << clid << " and type#name " << name << " failed" );
-    }
+      
+      if ( isxAODAuxContainer )  {
+	xAOD::AuxContainerBase* auxHolder = reinterpret_cast<xAOD::AuxContainerBase*>(dataBucket->object());
+	ATH_CHECK( auxHolder != nullptr );	
+	currentAuxStore = new WritableAuxStore();
+	auxHolder->setStore( currentAuxStore );
+      }  else {
+	currentAuxStore = nullptr;
+      }
 
-    start = toNextFragment( start );
+    } else if ( isxAODDecoration ) {      
+      ATH_CHECK( deserialiseDynAux( transientTypeName, persistentTypeName, key, obj, currentAuxStore) );
+    }
   }
+  return StatusCode::SUCCESS;
+}
+
+
+
+StatusCode TriggerEDMDeserialiserAlg::deserialiseDynAux( const std::string& transientTypeName, const std::string& persistentTypeName, const std::string& decorationName,
+							 void* obj,   WritableAuxStore* currentAuxStore ) const {
+  const bool isPacked = persistentTypeName.find("SG::PackedContainer") != std::string::npos;      
+
+  SG::AuxTypeRegistry& registry = SG::AuxTypeRegistry::instance();     
+  SG::auxid_t id = registry.findAuxID ( decorationName );
+  if (id != SG::null_auxid ) {
+    if ( stripStdVec( registry.getVecTypeName(id) ) != stripStdVec(transientTypeName) ) {
+      ATH_MSG_INFO( "Schema evolution required for decoration " << decorationName << " from " << transientTypeName << " to "  <<  registry.getVecTypeName( id ) << " not handled yet"); 
+      return StatusCode::SUCCESS;
+    }
+  } else {
+      std::string elementTypeName;
+      const std::type_info* elt_tinfo = getElementType( transientTypeName, elementTypeName );
+      ATH_CHECK( elt_tinfo != nullptr );
+      ATH_MSG_DEBUG( "Dynamic decoration: " << decorationName << " of type " << transientTypeName << " will create a dynamic ID, stored type" << elementTypeName );    
+      id = SG::getDynamicAuxID ( *elt_tinfo, decorationName, elementTypeName, transientTypeName, false );
+  }        
+  ATH_MSG_DEBUG( "Unstreaming decoration " << decorationName << " of type " << transientTypeName  << " aux ID " << id << " class " << persistentTypeName << " packed " << isPacked  );  
+  std::unique_ptr<SG::IAuxTypeVector> vec( registry.makeVectorFromData (id, obj, isPacked, true) );
+  ATH_CHECK( vec.get() != nullptr );
+  ATH_CHECK( currentAuxStore != nullptr );
+  currentAuxStore->addVector(id, std::move(vec), false);
+    
+  return StatusCode::SUCCESS;  
+}
+
+StatusCode TriggerEDMDeserialiserAlg::checkSanity( const std::string& transientTypeName, bool isxAODInterfaceContainer, bool isxAODAuxContainer, bool isDecoration, bool isTPContainer ) const {
+  ATH_MSG_DEBUG( "Recognised type " << transientTypeName <<" as: " 
+		 << (isxAODInterfaceContainer ?" xAOD Interface Container":"" ) 
+		 << (isxAODAuxContainer ?" xAOD Aux Container ":"" ) 
+		 << ( isDecoration ? " xAOD Decoration" : "") 
+		 << ( isTPContainer ? " T/P Contianer " : "") );
   
+  const std::vector<bool> typeOfContainer( { isxAODInterfaceContainer, isxAODAuxContainer, isDecoration, isTPContainer } );			     
+  const size_t count = std::count( typeOfContainer.begin(), typeOfContainer.end(), true );
+  if ( count == 0 ) {
+    ATH_MSG_ERROR( "Could not recognise the kind of container " << transientTypeName );
+    return StatusCode::FAILURE;
+  } else if (count > 1 ) {
+    ATH_MSG_ERROR( "Ambigous kind serialised content deduced from the transient type name " << transientTypeName );
+    ATH_MSG_ERROR( "Recognised type as: " 
+		   << (isxAODInterfaceContainer ?" xAOD Interface Context":"" ) 
+		   << (isxAODAuxContainer ?" xAOD Aux Container ":"" ) 
+		   << ( isDecoration ? " xAOD Decoration" : "") 
+		   << ( isTPContainer ? " T/P Contianer " : "") );
+    return StatusCode::FAILURE;
+    
+  }
   return StatusCode::SUCCESS;
 }
 
+
 size_t TriggerEDMDeserialiserAlg::nameLength( TriggerEDMDeserialiserAlg::PayloadIterator start ) const {
   return *( start + NameLengthOffset);
 }
 
-std::string TriggerEDMDeserialiserAlg::collectionName( TriggerEDMDeserialiserAlg::PayloadIterator start ) const {
+std::vector<std::string> TriggerEDMDeserialiserAlg::collectionDescription( TriggerEDMDeserialiserAlg::PayloadIterator start ) const {
   StringSerializer ss;
   std::vector<std::string> labels;
   ss.deserialize( start + NameOffset, start + NameOffset + nameLength(start), labels );
-  return labels[0];
+  return labels;
 }
 size_t TriggerEDMDeserialiserAlg::dataSize( TriggerEDMDeserialiserAlg::PayloadIterator start ) const {
   return *( start + NameOffset + nameLength( start ) );
@@ -118,4 +255,3 @@ void TriggerEDMDeserialiserAlg::toBuffer( TriggerEDMDeserialiserAlg::PayloadIter
   // we rely on continous memory layout of std::vector ...
   std::memcpy( buffer, &(*dataStart), dataSize( start ) );
 }
-
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.h
index 9e73bdebd71..3d9963daa44 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.h
@@ -10,7 +10,7 @@
 #include "TrigSteeringEvent/HLTResultMT.h"
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "AthenaKernel/IAthenaSerializeSvc.h"
-
+#include "TrigSerializeTP/TrigSerTPTool.h"
 
 
 
@@ -23,8 +23,14 @@
  * [fragment size in words][CLID][size of serialised colection name][...serialised collection name ...][data payload in bytes][....data paload...]
  * It follows form the TrigEDMSerialisationTool implemetation.
  **/
+
+
+
+
 class TriggerEDMDeserialiserAlg : public AthReentrantAlgorithm {
 public:
+  class WritableAuxStore;
+
   enum Offsets {
     CLIDOffset = 1,
     NameLengthOffset = 2,
@@ -38,6 +44,8 @@ public:
   virtual StatusCode finalize() override;
 
 private:
+
+
   SG::ReadHandleKey<HLT::HLTResultMT> m_resultKey { this, "ResultKey", "HLTResultMT", "Key of object that is read"  };
   Gaudi::Property<std::string> m_prefix{ this, "Prefix", "", "Set for testing to avoid clash with the input collections" };
   Gaudi::Property<int> m_moduleID{ this, "ModuleID", 0, "Module ID of HLT result ROB, default 0 is the main HLT result, others are for TLA, calibration etc." };
@@ -47,6 +55,8 @@ private:
 
   ServiceHandle<IAthenaSerializeSvc> m_serializerSvc{ this, "Serializer", "AthenaRootSerializeSvc", "Service that translates persistent to transient respresenation" };
   
+  ToolHandle<TrigSerTPTool> m_tpTool{ this, "TPTool", "TrigSerTPTool/TrigSerTPTool", "Tool to do Transient/Persistent conversion (Old EDM)"};
+
   typedef  std::vector<uint32_t> Payload;
   typedef  std::vector<uint32_t>::const_iterator PayloadIterator;
   
@@ -69,9 +79,11 @@ private:
   size_t nameLength( TriggerEDMDeserialiserAlg::PayloadIterator start ) const;
 
   /**
-   * name of the collection stored in the next fragment
+   * string description of the collection stored in the next fragment, 
+   * returns transient type name, persistent type name and the SG key
    **/
-  std::string collectionName( PayloadIterator start ) const;
+  std::vector<std::string> collectionDescription( PayloadIterator start ) const;
+
   /**
    * size of the buffer that is needed to decode next fragment data content
    * @warning measured in bytes
@@ -82,7 +94,27 @@ private:
    * copies fragment to the buffer, no size checking, use above to do so
    **/  
   void toBuffer( PayloadIterator start, char* buffer ) const;
+
+
+  /**
+   * Performs actual deserialisation loop
+   */ 
+  StatusCode deserialise(   const Payload* dataptr  ) const;
+
+  /**
+   * Handle decoration
+   */
+  StatusCode deserialiseDynAux( const std::string& transientTypeName, const std::string& persistentTypeName, const std::string& decorationName, 
+				void* data,  WritableAuxStore* currentAuxStore ) const;
+
+
+  /**
+   * Checker for data iniegrity, one and only one of the passed booleans can be true, else FAILURE is returned and relevant diagnostics printed
+   */
+  StatusCode checkSanity( const std::string& tn, bool isxAODInterfaceContainer, bool isxAODAuxContainer, bool isDecoration, bool isTPContainer ) const;
   
+
+
 };
 
 #endif // TRIGOUTPUTHANDLING_TRIGGEREDMDESERIALISERALG_H
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
index b599509d412..ee767ebbe7f 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
@@ -1,10 +1,7 @@
 /*
-  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 <cstring>
 #include <boost/algorithm/string.hpp>
 #include "GaudiKernel/IToolSvc.h"
@@ -14,7 +11,6 @@
 #include "AthContainers/AuxTypeRegistry.h"
 #include "AthContainers/debug.h"
 #include "xAODCore/AuxContainerBase.h"
-
 #include "TrigSerializeResult/StringSerializer.h"
 
 #include "TriggerEDMSerialiserTool.h"
@@ -31,43 +27,47 @@ StatusCode TriggerEDMSerialiserTool::initialize() {
   
   ATH_CHECK( m_serializerSvc.retrieve() );
   ATH_CHECK( m_clidSvc.retrieve() );
+  ATH_CHECK( m_tpTool.retrieve() );
   for ( std::string typeKeyAux: m_collectionsToSerialize ) {
-    const std::string type = typeKeyAux.substr( 0, typeKeyAux.find('#') );
-    if ( type.find('_') == std::string::npos ) {
-      ATH_MSG_ERROR( "Unversioned object to be recorded " << typeKeyAux );
+    const std::string persistentType = typeKeyAux.substr( 0, typeKeyAux.find('#') );    
+    if ( persistentType.find('_') == std::string::npos ) {
+      ATH_MSG_ERROR( "Unversioned object can not be serialised " << typeKeyAux );
       return StatusCode::FAILURE;
     }
-    const std::string transientType = typeKeyAux.substr( 0, typeKeyAux.find('_') );
-
+    const std::string transientType  = persistentType.substr( 0, typeKeyAux.find('_') );
     const std::string key = typeKeyAux.substr( typeKeyAux.find('#')+1, typeKeyAux.find('.')-typeKeyAux.find('#') );    
+
     CLID clid;
     if ( m_clidSvc->getIDOfTypeName(transientType, clid).isFailure() )  {
-      ATH_MSG_ERROR( "Can not find CLID for " << transientType << " that is needed to stream " << key );
+      ATH_MSG_ERROR( "Can not find CLID for " << transientType << " that is needed for serialisation " << key );
       return StatusCode::FAILURE;
     } 
 
-    RootType classDesc = RootType::ByName( type );
+    RootType classDesc = RootType::ByName( persistentType );
     if ( ! classDesc.IsComplete() ) {
-      ATH_MSG_ERROR( "The type " << type <<  " is not known" );
+      ATH_MSG_ERROR( "The type " << persistentType <<  " is not known to ROOT serialiser" );
       return StatusCode::FAILURE;
     }
     
-    ATH_MSG_DEBUG( "Type " << type << " key " << key <<  " serializable" );
-
-    xAOD::AuxSelection sel;
-    if ( typeKeyAux.find('.') != std::string::npos ) {
-      ATH_MSG_DEBUG( "with aux content: "  );
-      std::string allVars = typeKeyAux.substr( typeKeyAux.find('.')+1 );
-      std::set<std::string> variableNames;
-      boost::split( variableNames, allVars, [](const char c){ return c == '.'; } );
-      for ( auto el: variableNames ) 
-	ATH_MSG_DEBUG( " " << el  );
-      sel.selectAux( variableNames );
+    ATH_MSG_DEBUG( "Type " << persistentType << " key " << key <<  " serializable, deducing kind of processing needed" );
+
+    if ( persistentType.find("xAOD") != std::string::npos ) { // xAOD - either interface of Aux
+      xAOD::AuxSelection sel;
+      if ( typeKeyAux.find('.') != std::string::npos ) { // Aux, possibly with selection of varaibles
+	ATH_MSG_DEBUG( "with aux content: "  );
+	std::string allVars = typeKeyAux.substr( typeKeyAux.find('.')+1 );
+	std::set<std::string> variableNames;
+	boost::split( variableNames, allVars, [](const char c){ return c == '.'; } );
+	for ( auto el: variableNames ) 
+	  ATH_MSG_DEBUG( " " << el  );
+	sel.selectAux( variableNames );
+	m_toSerialise.emplace_back(transientType, persistentType, clid, key, Address::xAODAux, sel );      
+      } else {
+	m_toSerialise.emplace_back(transientType, persistentType, clid, key, Address::xAODInterface, xAOD::AuxSelection() );      
+      }
+    } else { // an old T/P type
+      m_toSerialise.emplace_back( transientType, persistentType, clid, key, Address::OldTP, xAOD::AuxSelection() );      
     }
-
-    const bool isAux = key.find("Aux") != std::string::npos;
-
-    m_toSerialize.push_back( Address{ type+"#"+key, type, clid, key, isAux, sel } );      
   }
   return StatusCode::SUCCESS;
 }
@@ -79,7 +79,8 @@ StatusCode TriggerEDMSerialiserTool::makeHeader(const Address& address, std::vec
   
   std::vector<uint32_t> serializedLabel;
   StringSerializer ss;
-  ss.serialize( address.typeKey, serializedLabel );
+  std::vector<std::string> descr({ address.transType, address.persType, address.key });
+  ss.serialize( descr, serializedLabel );
   buffer.push_back( serializedLabel.size() );
   buffer.insert( buffer.end(), serializedLabel.begin(), serializedLabel.end() ); // plain SG key
   return StatusCode::SUCCESS;
@@ -101,9 +102,10 @@ StatusCode TriggerEDMSerialiserTool::fillPayload( const void* data, size_t sz, s
   return StatusCode::SUCCESS;
 }
 
-StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObject* dObj, std::vector<uint32_t>& buffer ) const {
-  // TODO, check if we can cache this informion after it is filled once
-  ATH_MSG_DEBUG("About to start streaming aux data of " << address.key );
+
+StatusCode TriggerEDMSerialiserTool::serialiseDynAux( DataObject* dObj, const Address& address, std::vector<uint32_t>& buffer ) const {
+  ATH_MSG_DEBUG( "" );
+  ATH_MSG_DEBUG( "About to start streaming aux data of " << address.key );
   DataBucketBase* dObjAux = dynamic_cast<DataBucketBase*>(dObj);
   ATH_CHECK( dObjAux != nullptr );  
 
@@ -112,8 +114,6 @@ StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObj
     ATH_MSG_DEBUG( "Can't obtain AuxContainerBase of " << address.key <<  " no dynamic variables presumably" );
     return StatusCode::SUCCESS;
   }
-  //  ATH_MSG_DEBUG( "dump aux store" );
-  //  SGdebug::dump_aux_vars( *auxStore );
   
   const SG::auxid_set_t& selected = address.sel.getSelectedAuxIDs( auxStoreIO->getDynamicAuxIDs() );
   
@@ -126,9 +126,15 @@ StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObj
   for (SG::auxid_t auxVarID : selected ) {
     
     const std::string typeName = SG::AuxTypeRegistry::instance().getVecTypeName(auxVarID);
-    const std::string name = SG::AuxTypeRegistry::instance().getName(auxVarID);
-    ATH_MSG_DEBUG("Streaming " << name << " of type " << typeName );
+    const std::string decorationName = SG::AuxTypeRegistry::instance().getName(auxVarID);
+    const std::type_info* tinfo = auxStoreIO->getIOType (auxVarID);
+
+    ATH_CHECK( tinfo != nullptr );
+    TClass* cls = TClass::GetClass (*tinfo);
+    ATH_CHECK( cls != nullptr );
+    ATH_MSG_DEBUG( "" );
 
+    ATH_MSG_DEBUG( "Streaming " << decorationName << " of type " << typeName  << " aux ID " << auxVarID << " class " << cls->GetName() );
 
     CLID clid;
     if ( m_clidSvc->getIDOfTypeName(typeName, clid).isFailure() )  {
@@ -137,7 +143,7 @@ StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObj
     }
     ATH_MSG_DEBUG( "CLID " << clid );
 
-    RootType classDesc = RootType::ByName( typeName );  
+    RootType classDesc = RootType::ByName( cls->GetName() );  
 
     const void* rawptr = auxStoreIO->getIOData( auxVarID );
     ATH_CHECK( rawptr != nullptr );
@@ -146,12 +152,14 @@ StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObj
     void* mem = m_serializerSvc->serialize( rawptr, classDesc, sz );
     
     if ( mem == nullptr or sz == 0 ) {
-      ATH_MSG_ERROR( "Serialisation of " << address.type <<"#" << address.key << "."<< name << " unsuccessful" );
+      ATH_MSG_ERROR( "Serialisation of " << address.persType <<"#" << address.key << "."<< decorationName << " unsuccessful" );
       return StatusCode::FAILURE;
+    } else {
+      ATH_MSG_DEBUG( "Serialised " << address.persType <<"#" << address.key << "."<< decorationName  << " memory size " << sz );
     }
 
     std::vector<uint32_t> fragment;
-    Address auxAddress = { "", typeName, clid, address.key+"."+name, false };
+    Address auxAddress = { typeName, cls->GetName(), clid, decorationName, Address::xAODDecoration };
     ATH_CHECK( makeHeader( auxAddress, fragment ) );
     ATH_CHECK( fillPayload( mem, sz, fragment ) );
     fragment[0] = fragment.size();
@@ -160,45 +168,22 @@ StatusCode TriggerEDMSerialiserTool::fillDynAux( const Address& address, DataObj
     
     ATH_MSG_DEBUG("Fragment size " << fragment.size() );
     
-    buffer.insert( buffer.end(), fragment.begin(), fragment.end() );        
-    
+    buffer.insert( buffer.end(), fragment.begin(), fragment.end() );            
   }
-  
-  
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) const {
-  
-  std::vector<uint32_t> payload;    
-  for ( const Address& address: m_toSerialize ) {
-    ATH_MSG_DEBUG( "Streaming " << address.typeKey  );
-    // obtain object
-    DataObject* dObj = evtStore()->accessData( address.clid, address.key );
-    if ( dObj == nullptr ) {
-      ATH_MSG_DEBUG("Data Object with the CLID " << address.clid <<" and the key " << address.key << " is missing");
-      continue;
-    }
-
-
-    const void* rawptr = SG::fromStorable( dObj, address.clid, nullptr, msgLvl(MSG::DEBUG) );
-    if ( rawptr == nullptr ) {
-      ATH_MSG_DEBUG( "Data Object with key " << address.key <<
-		     " can not be converted to void* for streaming" );
-      continue;      
-    }
-    ATH_MSG_DEBUG("Obtained raw pointer " << rawptr );
-
+StatusCode TriggerEDMSerialiserTool::serialiseContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const {
 
-    RootType classDesc = RootType::ByName( address.type );    
+    RootType classDesc = RootType::ByName( address.persType );    
     size_t sz=0;    
-    void* mem = m_serializerSvc->serialize( rawptr, classDesc, sz );
+    void* mem = m_serializerSvc->serialize( data, classDesc, sz );
 
     ATH_MSG_DEBUG( "Streamed to buffer at address " << mem << " of " << sz << " bytes" );
     
     if ( mem == nullptr or sz == 0 ) {
-      ATH_MSG_ERROR( "Serialisation of " << address.typeKey << " unsuccessful" );
+      ATH_MSG_ERROR( "Serialisation of " << address.persType << " " << address.key << " unsuccessful" );
       return StatusCode::FAILURE;
     }
         
@@ -206,20 +191,67 @@ StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) cons
     std::vector<uint32_t> fragment;
     ATH_CHECK( makeHeader( address, fragment ) );
     ATH_CHECK( fillPayload( mem, sz, fragment ) );
-
     
     if ( mem ) delete [] static_cast<const char*>( mem );
     
     ATH_MSG_DEBUG("Fragment size " << fragment.size() );
+    fragment[0] = fragment.size();    
+    buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
+    
+    return StatusCode::SUCCESS;    
+}
+
+StatusCode TriggerEDMSerialiserTool::serialisexAODAuxContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const { 
+  ATH_MSG_DEBUG("xAOD Aux Contianer");
+  ATH_CHECK( serialiseContainer( data, address, buffer ) );
+  DataObject* dObj = evtStore()->accessData( address.clid, address.key );
+  ATH_CHECK( dObj != nullptr );
+  ATH_CHECK( serialiseDynAux( dObj, address, buffer ) );
+
+  return StatusCode::SUCCESS;    
+}
+
+StatusCode TriggerEDMSerialiserTool::serialiseTPContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const {
+
+  ATH_MSG_DEBUG("TP Contianer, converting from: " <<  address.transType << " to " << address.persType  );    
+  std::string converterPersistentType;
+  void * persistent = m_tpTool->convertTP( address.transType,  data, converterPersistentType );
+  ATH_CHECK( persistent != 0 );  
+  ATH_CHECK ( converterPersistentType == address.persType );
+
+  ATH_CHECK( serialiseContainer( persistent, address, buffer ) );
+  return StatusCode::SUCCESS;    
+}
+
+StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) const {
+  
+  std::vector<uint32_t> payload;    
+  for ( const Address& address: m_toSerialise ) {
+    ATH_MSG_DEBUG( "Streaming " << address.persType );
+    // obtain object
+    DataObject* dObj = evtStore()->accessData( address.clid, address.key );
+    if ( dObj == nullptr ) {
+      ATH_MSG_DEBUG("Data Object with the CLID " << address.clid <<" and the key " << address.key << " is missing");
+      continue;
+    }
 
-    if ( address.isAux ) {
-      ATH_CHECK( fillDynAux( address, dObj, fragment ) );
-      ATH_MSG_DEBUG("Fragment size with Aux data " << fragment.size() );
+    void* rawptr = SG::fromStorable( dObj, address.clid, nullptr, msgLvl(MSG::DEBUG) );
+    if ( rawptr == nullptr ) {
+      ATH_MSG_DEBUG( "Data Object with key " << address.key <<
+		     " can not be converted to void* for streaming" );
+      continue;      
     }
-    fragment[0] = fragment.size();
+    ATH_MSG_DEBUG("Obtained raw pointer " << rawptr );
     
-    payload.insert( payload.end(), fragment.begin(), fragment.end() );
-    ATH_MSG_DEBUG( "Payload size after inserting " << address.typeKey << " " << payload.size()*sizeof(uint32_t) << " bytes" );
+    if ( address.category == Address::xAODInterface ) {
+      ATH_CHECK( serialiseContainer( rawptr, address, payload ) );
+    } else if ( address.category == Address::xAODAux ) {
+      ATH_CHECK(  serialisexAODAuxContainer( rawptr, address, payload ) );
+    } else if ( address.category == Address::OldTP ) {
+      ATH_CHECK( serialiseTPContainer( rawptr, address, payload ) );
+    }
+ 
+    ATH_MSG_DEBUG( "Payload size after inserting " << address.persType << "#" <<  address.key << " " << payload.size()*sizeof(uint32_t) << " bytes" );
     
   }
   
@@ -227,4 +259,3 @@ StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) cons
   
   return StatusCode::SUCCESS;
 }
-
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
index 66c8617a3ae..3b3b2dc897c 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
@@ -13,6 +13,7 @@
 #include "AthenaKernel/IAthenaSerializeSvc.h"
 #include "AthenaKernel/IDictLoaderSvc.h"
 #include "TrigOutputHandling/HLTResultMTMakerTool.h"
+#include "TrigSerializeTP/TrigSerTPTool.h"
 
 /**
  * @class TriggerEDMSerialiserTool is tool responsible for creation of HLT Result filled with streamed EDM collections
@@ -21,39 +22,56 @@
 class DataObject;
 
 class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
-{ 
-  
- public: 
+{
+
+ public:
 
   TriggerEDMSerialiserTool( const std::string& type,
-	     const std::string& name, 
+	     const std::string& name,
 	     const IInterface* parent );
 
-  virtual ~TriggerEDMSerialiserTool(); 
+  virtual ~TriggerEDMSerialiserTool();
   virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override;
 
   virtual StatusCode  initialize() override;
 
- private: 
+ private:
   Gaudi::Property<std::vector<std::string>> m_collectionsToSerialize { this, "CollectionsToSerialize", {}, "TYPE#SG.aux1.aux2..etc key of collections to be streamed (like in StreamAOD), the type has to be an exact type i.e. with _vN not the alias type" };
 
   Gaudi::Property<int> m_moduleID { this, "ModuleID", 0, "The HLT result fragment to which the output should be added"};
-  
+
   // internal structure to keep configuration organised conveniently
   struct Address {
-    std::string typeKey;
-    std::string type;
+    enum Catrgory { xAODInterface, xAODAux, OldTP, xAODDecoration, None };
+    Address( const std::string& transType_,
+	     const std::string& persType_,
+	     const CLID clid_,
+	     const std::string& key_,
+	     const Catrgory category_ = None,
+	     const xAOD::AuxSelection& sel_ = {} )
+    : transType(transType_),
+      persType(persType_),
+      clid(clid_),
+      key(key_),
+      category(category_),
+      sel(sel_){}
+
+    std::string transType;
+    std::string persType; // actuall versioned type
     CLID clid;
     std::string key;
-    bool isAux = false;
-    xAOD::AuxSelection sel = {}; // xAOD dynamic varaibles selection
+    Catrgory category;
+    xAOD::AuxSelection sel = {}; // xAOD dynamic varaibles selection, relevant only for xAODAux category
+
   };
-  
-  std::vector< Address > m_toSerialize; // postprocessed configuration info
-  
+
+  std::vector< Address > m_toSerialise; // postprocessed configuration info
+
   ServiceHandle<IClassIDSvc> m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc", "Service to translate class name to CLID" };
   ServiceHandle<IAthenaSerializeSvc> m_serializerSvc{ this, "Serializer", "AthenaRootSerializeSvc", "Service that translates transient to persistent respresenation" };
 
+  ToolHandle<TrigSerTPTool> m_tpTool{ this, "TPTool", "TrigSerTPTool/TrigSerTPTool", "Tool to do Transient/Persistent conversion (Old EDM)"};
+
 
   /**
    * Given the ID if the collection (in address arg) insert basic streaming info into the buffer.
@@ -64,15 +82,33 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
    * For copy bytest from the memory into the buffer converting from char[] to uint32_t[]
    * This function is candidate to be made global function at some point
    * and we will need also readPayload function
-   */  
+   */
   StatusCode fillPayload( const void* data, size_t sz, std::vector<uint32_t>& buffer ) const;
 
+  /**
+   * Place inside the buffer the serialised container (can be either TP, xAOD)
+   * invloves simple involcation of serialiser
+   */
+  StatusCode serialiseContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const;
+  /**
+   * Place inside the buffer serialised the xOAD Aux container
+   * invloves selection and recording of dynamic variables
+   */
+  StatusCode serialisexAODAuxContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const;
+
+  /**
+   * Place inside the buffer the serialised old type of container
+   * invloves T/P conversion
+   */
+  StatusCode serialiseTPContainer( void* data, const Address& address, std::vector<uint32_t>& buffer ) const;
+
+
 
   /**
    * Adds dynamic variables to the payload
    */
-  StatusCode fillDynAux( const Address& address, DataObject* dObject, std::vector<uint32_t>& buffer ) const;
-}; 
+  StatusCode serialiseDynAux( DataObject* dObject, const Address& address, std::vector<uint32_t>& buffer ) const;
+};
 
 
 #endif //> !TRIGOUTPUTHANDLING_TriggerEDMSerialiserTool_H
diff --git a/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx b/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx
new file mode 100644
index 00000000000..eeccc4113c6
--- /dev/null
+++ b/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx
@@ -0,0 +1,227 @@
+
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+#include <iostream>
+
+
+
+
+
+#include "TestTools/expect.h"
+#include "TestTools/initGaudi.h"
+#include "GaudiKernel/IToolSvc.h"
+#include "AthenaKernel/getMessageSvc.h"
+#include "GaudiKernel/MsgStream.h"
+#include "StoreGate/StoreGate.h"
+#include "StoreGate/StoreGateSvc.h"
+#include "../src/BareDataBucket.h"
+#include "xAODTrigCalo/TrigEMClusterContainer.h"
+#include "xAODTrigCalo/TrigEMClusterAuxContainer.h"
+#include "xAODTrigger/TrigCompositeContainer.h"
+#include "xAODTrigger/TrigCompositeAuxContainer.h"
+//#include "AthContainers/AuxTypeRegistry.h"
+
+#include "../src/TriggerEDMSerialiserTool.h"
+#include "../src/TriggerEDMDeserialiserAlg.h"
+
+
+void testTrigEMContiner(  const EventContext &ctx );
+void testTrigCompositeContiner(  const EventContext &ctx );
+
+void testTrigEMContinerInsert();
+void testTrigCompositeContinerInsert();
+
+
+void testTrigEMContinerReadAndCheck();
+void testTrigCompositeContinerReadAndCheck();
+
+
+
+StoreGateSvc* pStore = nullptr;
+int main() {
+  using namespace std;
+  ISvcLocator* pSvcLoc;
+  if( !Athena_test::initGaudi("test.txt",  pSvcLoc) ) {
+    cerr << "ERROR This test can not be run" << endl;
+    return -1;
+  }
+  assert(pSvcLoc);
+  MsgStream log(Athena::getMessageSvc(), "serial_deserial_test");
+  
+
+  VALUE( pSvcLoc->service("StoreGateSvc", pStore, true).isSuccess() ) EXPECTED ( true );
+
+  IToolSvc * toolSvc = nullptr;
+  VALUE( pSvcLoc->service("ToolSvc", toolSvc, true) ) EXPECTED ( StatusCode::SUCCESS );
+  
+  IAlgTool* algTool;
+  VALUE( toolSvc->retrieveTool("TriggerEDMSerialiserTool/serialiser", algTool) ) EXPECTED( StatusCode::SUCCESS );
+  TriggerEDMSerialiserTool* ser = dynamic_cast< TriggerEDMSerialiserTool*>(algTool);
+
+  
+
+
+  VALUE( ser == nullptr ) EXPECTED ( false );
+
+  TriggerEDMDeserialiserAlg deser ("deserialiser", pSvcLoc);  deser.addRef();
+  deser.sysInitialize();
+  // TDOD simplify :-) ?
+  IProxyDict* xdict = &*deser.evtStore();
+  xdict = deser.evtStore()->hiveProxyDict();
+  EventContext ctx;
+  ctx.setExtension( Atlas::ExtendedEventContext(xdict) );
+  Gaudi::Hive::setCurrentContext (ctx);  
+
+
+  for ( int rep = 0; rep < 50 ; ++ rep ) {
+    testTrigEMContinerInsert();
+    testTrigCompositeContinerInsert();
+
+    auto hltres = new HLT::HLTResultMT();
+    VALUE( ser->fill( *hltres ) ) EXPECTED ( StatusCode::SUCCESS );  
+    
+    pStore->clearStore();
+    // now objects are only in serialised form in HLTResultMT object
+    SG::AuxTypeRegistry& registry = SG::AuxTypeRegistry::instance();     
+    
+    VALUE( pStore->record( hltres, "HLTResultMT" ) ) EXPECTED ( StatusCode::SUCCESS );
+    VALUE( deser.execute( ctx ) ) EXPECTED ( StatusCode::SUCCESS );
+    
+    testTrigEMContinerReadAndCheck();
+    testTrigCompositeContinerReadAndCheck();
+    
+    // see if we do nto have owneship issues
+    pStore->clearStore();  
+  }
+
+  delete ser;
+  std::cout <<"ok"<< std::endl;
+  return 0;
+}
+
+
+void testTrigEMContinerInsert() {
+  
+  // place test data
+  auto em = new xAOD::TrigEMClusterContainer();
+  auto emAux = new xAOD::TrigEMClusterAuxContainer();
+  em->setStore( emAux );
+  SG::AuxElement::Accessor< int >   viewIndex( "viewIndex" );
+  SG::AuxElement::Accessor< float > testFloat( "testFloat" );
+  SG::AuxElement::Accessor< float > testSmallFloat( "testSmallFloat" );
+
+  
+  auto fill = [&]( double x) {
+      auto cluster = new xAOD::TrigEMCluster();
+      em->push_back( cluster );
+      cluster->setEnergy(0.0);
+      cluster->setEt(0.0);
+      cluster->setRawEnergy(0.0);
+      cluster->setRawEt(x - 0.2);
+      cluster->setE277(0);
+      cluster->setEmaxs1(0);
+      cluster->setE2tsts1(0);
+      cluster->setEhad1(-999);
+      cluster->setWeta2(-999);
+      cluster->setFracs1(-999);
+      cluster->setE233(-999);
+      cluster->setE237(-999);
+      cluster->setWstot(-999);
+      cluster->setEta1(-999);
+      cluster->setNCells( x );
+      cluster->setRawEta(-999);
+      cluster->setRawPhi(-999);
+      viewIndex( *cluster ) = x+1; // for sake of change add 1    
+      testFloat( *cluster ) = float(x)+0.1; // for sake of change add 0.1          
+      testSmallFloat( *cluster ) = float(x);
+    };
+
+
+  VALUE( em->setOption ("testSmallFloat", SG::AuxDataOption ("nbits", 13)) ) NOT_EXPECTED( 0 );
+  VALUE( em->setOption ("testSmallFloat", SG::AuxDataOption ("signed", 0))) NOT_EXPECTED( 0 );
+  VALUE( em->setOption ("testSmallFloat", SG::AuxDataOption ("nmantissa", 13)) ) NOT_EXPECTED( 0 );
+
+
+  
+  const size_t count = 30;
+  for ( size_t i = 0; i < count; i++ ) {
+    fill(i);
+  }
+  
+  VALUE( pStore->record( em, "EMClusters" ) ) EXPECTED ( StatusCode::SUCCESS );
+  VALUE( pStore->record( emAux, "EMClustersAux." ) ) EXPECTED ( StatusCode::SUCCESS );
+  
+}
+
+void testTrigEMContinerReadAndCheck() {
+
+  const xAOD::TrigEMClusterContainer *emback = nullptr;
+  VALUE( pStore->retrieve( emback, "DESERIALISED_EMClusters") ) EXPECTED ( StatusCode::SUCCESS );
+
+  VALUE( emback ) NOT_EXPECTED ( nullptr );
+  
+
+  SG::AuxElement::ConstAccessor< int > viewIndexReader( "viewIndex" );  
+  SG::AuxElement::ConstAccessor< float > testFloatReader( "testFloat" );  
+  SG::AuxElement::ConstAccessor< float > testSmallFloatReader( "testSmallFloat" );  
+
+  VALUE ( emback->size() ) EXPECTED ( 30 ); // as many fills were made
+
+  for ( size_t i = 0;  i < emback->size(); i++ ) {
+    const xAOD::TrigEMCluster* cl = emback->at( i );
+    VALUE( cl ) NOT_EXPECTED ( nullptr );
+    VALUE( cl->nCells() ) EXPECTED( i ); // test regular Aux content
+    int vi = viewIndexReader( *cl );
+    float fl = testFloatReader( *cl );
+    float smallFl = testSmallFloatReader( *cl );
+    float rawEt = cl->rawEt();
+
+    std::cout << vi << " " << fl << " " << rawEt << " ";
+    VALUE( vi ) EXPECTED ( i + 1 );
+    VALUE( fl ) EXPECTED ( 0.1 + i );    
+    VALUE( (smallFl - i) < 0.1 ) EXPECTED ( true );  // precission is poor because we decided to reduce space for this variable
+    VALUE( rawEt ) EXPECTED ( i - 0.2 );    
+  }
+  std::cout << std::endl;
+}
+
+void testTrigCompositeContinerInsert() {
+
+  auto m = new xAOD::TrigCompositeContainer();
+  auto mAux = new xAOD::TrigCompositeAuxContainer();
+  m->setStore( mAux );
+  m->push_back( new xAOD::TrigComposite() );
+  m->push_back( new xAOD::TrigComposite() );
+  {
+    m->at(0)->setDetail<float>("detail1", 0.1);
+    m->at(0)->setDetail<int>("detail2", 5);
+    m->at(1)->setDetail<float>("detail1", 1.7);
+    m->at(1)->setDetail<int>("detail2", 7);
+  }
+  
+  VALUE( pStore->record( m, "EMClustersDecisions" ) ) EXPECTED ( StatusCode::SUCCESS );
+  VALUE( pStore->record( mAux, "EMClustersDecisionsAux." ) ) EXPECTED ( StatusCode::SUCCESS );
+
+  
+  
+}
+
+void testTrigCompositeContinerReadAndCheck() {
+
+  const xAOD::TrigCompositeContainer *decisions = nullptr;
+  VALUE( pStore->retrieve( decisions, "DESERIALISED_EMClustersDecisions") ) EXPECTED ( StatusCode::SUCCESS );
+  VALUE ( decisions ) NOT_EXPECTED ( nullptr );
+
+  
+  VALUE( decisions->size() ) EXPECTED( 2 );
+  VALUE( decisions->at(0)->getDetail<float>("detail1") ) EXPECTED( 0.1 );
+  VALUE( decisions->at(1)->getDetail<float>("detail1") ) EXPECTED( 1.7 );
+  VALUE( decisions->at(0)->getDetail<int>("detail2") ) EXPECTED( 5 );
+  VALUE( decisions->at(1)->getDetail<int>("detail2") ) EXPECTED( 7 );
+
+
+
+  
+  
+}
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
index c7ba9262e19..d1c035d9191 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
@@ -347,14 +347,15 @@ print summMaker
 
 serialiser = TriggerEDMSerialiserTool(name="Serialiser", OutputLevel=VERBOSE)
 
-serialiser.CollectionsToSerialize = [ "xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions",
-                                      "xAOD::TrigCompositeAuxContainer_v1#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",
+serialiser.CollectionsToSerialize = ["xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters",
+                                     "xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux.viewIndex",
+                                     "xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions",
+                                      "xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux.decisions",
+                                      "xAOD::TrigCompositeContainer_v1#remap_ElectronL2Decisions",
+                                      "xAOD::TrigCompositeAuxContainer_v2#remap_ElectronL2DecisionsAux.decisions",
                                       "xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex",
-                                      "xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux.pt.eta.phi.rawEnergy.rawEt.rawEta.nCells.energy.et.e237.e277.fracs1.weta2.ehad1.e232.wstot"  ]
-                                      #"xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux."  ]
-
+                                      "xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux.viewIndex"  
+                                      ]
 streamPhysicsMain = ['Main', 'physics', "True", "True"]
 streamPhotonPerf = ['PhotonPerf', 'calibration', "True", "True"] # just made up the name
 
@@ -395,8 +396,8 @@ deserialiser.Prefix="SERIALISED_"
 deserialiser.OutputLevel=DEBUG
 
 # # add prefix + remove version to class name
-# l = [ c.split("#")[0].split("_")[0] + "#" + deserialiser.Prefix + c.split("#")[1] for c in serialiser.CollectionsToSerialize ] 
-#StreamESD.ItemList += l
+l = [ c.split("#")[0].split("_")[0] + "#" + deserialiser.Prefix + c.split("#")[1] for c in serialiser.CollectionsToSerialize ] 
+StreamESD.ItemList += l
 
 
 
@@ -424,7 +425,7 @@ svcMgr.ByteStreamEventStorageOutputSvc.OutputLevel = VERBOSE
 
 ################################################################################
 # assemble top list of algorithms
-hltTop = seqOR( "hltTop", [ steps,  summMaker, mon, edmMakerAlg, hltResultMakerAlg, StreamESD, streamBS, deserialiser ] )
+hltTop = seqOR( "hltTop", [ steps,  summMaker, mon, edmMakerAlg, hltResultMakerAlg, deserialiser, StreamESD, streamBS ] )
 
 
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_decodeBS.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_decodeBS.sh
index b045f5aa72b..2566b0a94fb 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_decodeBS.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_decodeBS.sh
@@ -9,10 +9,10 @@
 # art-include: master/Athena
 
 #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
-
+rm -rf  data_test.*
+athena  --threads=1 --skipEvents=10 --evtMax=5 --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
 
+rm -rf  myESDfromBS.pool.root
 
 FNAME=data_test.00327265.Single_Stream.daq.RAW._lb0100._Athena._0000.data 
 if [ -f ${FNAME} ]
-- 
GitLab


From 21416db6da0e1c9acb311d0bb70966d57615240e Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Mon, 25 Feb 2019 14:54:47 +0100
Subject: [PATCH 019/404] Don't generate bootstrap, use CA bootstrap

---
 .../TrigUpgradeTest/share/newJOtest.py              |  2 +-
 .../TrigUpgradeTest/test/test_newJO.sh              | 13 -------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 21bd5aa00cd..b1499af0299 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -81,7 +81,7 @@ acc.printConfig()
 fname = "newJOtest.pkl"
 print "Storing config in the config", fname
 with file(fname, "w") as p:
-    acc.store( p )
+    acc.store( p, nEvents=10, useBootStrapFile=False, threaded=True )
     p.close()
 
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
index 88a15a401b9..e7b93b615c8 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
@@ -2,19 +2,6 @@
 # art-type: build
 # art-include: master/Athena
 
-rm -rf newJOtest.py bootstrap.pkl bootstrap.py
-
-# this is a hack to pre-confgure scheduler and other MT services, 
-#will be taken away once NEW system has better means to influence the bootstrap content
-cat <<EOF >> bootstrap.py
-from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
-svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True
-svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True
-EOF
-
-athena --threads=1 --config-only=bootstrap.pkl bootstrap.py
-
-
 get_files -jo TrigUpgradeTest/newJOtest.py
 python newJOtest.py # generate pickle
 status=$?
-- 
GitLab


From 9be1c269a19ccf8726947a16358957d898d5a86e Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 25 Feb 2019 18:15:04 +0100
Subject: [PATCH 020/404] Only run AutoConfiguration if input file list
 non-empty

In athenaHLT.py we will have an empty input file list. And indeed we
don't want to run the AutoConfiguration in that case.
---
 Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
index 0da0d0e7bab..4b92672035b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
@@ -62,7 +62,7 @@ from TriggerJobOpts.TriggerFlags import TriggerFlags
 import TriggerRelease.Modifiers
 
 # Input format and file for athena running
-if athenaCommonFlags.FilesInput is not None:
+if len(athenaCommonFlags.FilesInput())>0:
     from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
     ConfigureFromListOfKeys(['everything'])
     TriggerRelease.Modifiers._run_number = GetRunNumber()
-- 
GitLab


From 2cf7f614d3eb087ca4894ca87971732c0b8dc3c9 Mon Sep 17 00:00:00 2001
From: scott snyder <scott.snyder@cern.ch>
Date: Mon, 25 Feb 2019 15:12:23 +0100
Subject: [PATCH 021/404] MuonCSC_CnvTools: Clean up error handling.

Use ATH_CHECK.
---
 .../src/CSC_RawDataProviderTool.cxx           | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderTool.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderTool.cxx
index 8d02fe1992f..c512769a624 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderTool.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CSC_RawDataProviderTool.cxx
@@ -52,22 +52,10 @@ Muon::CSC_RawDataProviderTool::~CSC_RawDataProviderTool()
 StatusCode Muon::CSC_RawDataProviderTool::initialize()
 {
   
-  if (detStore()->retrieve( m_muonMgr ).isFailure()) {
-    ATH_MSG_ERROR ( " Cannot retrieve MuonReadoutGeometry " );
-    return StatusCode::FAILURE;
-  }
-
-  // get the cabling service
-  if (m_cabling.retrieve().isFailure()) {
-    ATH_MSG_ERROR ( "Can't get CSCcablingSvc " );
-    return StatusCode::FAILURE;
-  }
-
-  if (m_robDataProvider.retrieve().isFailure()) {
-    ATH_MSG_FATAL ( "Failed to retrieve serive " << m_robDataProvider );
-    return StatusCode::FAILURE;
-  } else
-    ATH_MSG_INFO ( "Retrieved service " << m_robDataProvider );
+  ATH_CHECK( detStore()->retrieve( m_muonMgr ) );
+  ATH_CHECK( m_cabling.retrieve() );
+  ATH_CHECK( m_robDataProvider.retrieve() );
+  ATH_MSG_INFO ( "Retrieved service " << m_robDataProvider );
   
   
   const CscIdHelper* idHelper = m_muonMgr->cscIdHelper();
-- 
GitLab


From 8b1a3798e993ff31ef3d400cd470e4c2b15a8862 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 26 Feb 2019 10:19:52 +0100
Subject: [PATCH 022/404] Remove external symbol ByteStream_StorageType

Accessing the storageType is now done via
`ByteStreamAddress::strorageType()`.
---
 .../ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx |  3 ---
 .../src/EventInfoByteStreamCnv.cxx            |  8 ++++++--
 .../src/EventInfoByteStreamCnv.h              | 19 +++++++------------
 .../ByteStreamCnvSvcBase.h                    | 12 ++++++------
 .../CollectionByteStreamCnv.h                 | 15 ++++++---------
 .../CollectionByteStreamCnv.icc               | 11 ++++++++---
 .../src/ByteStreamAddress.cxx                 | 10 +++-------
 .../src/ByteStreamAddressL1R.cxx              |  9 ++++-----
 .../src/ByteStreamCnvSvcBase.cxx              |  8 +++-----
 9 files changed, 43 insertions(+), 52 deletions(-)

diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx b/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx
index 1717f26c348..b86ed1261fd 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamCnvSvc.cxx
@@ -21,9 +21,6 @@
 
 #include <algorithm>
 
-/// External definitions (TODO: remove this once all "extern" references are removed)
-long ByteStream_StorageType = ByteStreamAddress::storageType();
-
 /// Standard constructor
 ByteStreamCnvSvc::ByteStreamCnvSvc(const std::string& name, ISvcLocator* pSvcLocator)
   : ByteStreamCnvSvcBase(name, pSvcLocator),
diff --git a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx
index 221a2a0d700..61cc2e641a7 100644
--- a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx
+++ b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.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 "EventInfoByteStreamCnv.h"
@@ -36,7 +36,7 @@
 // const  ICnvFactory& EventInfoByteStreamCnvFactory = s_factory;
 
 EventInfoByteStreamCnv::EventInfoByteStreamCnv(ISvcLocator* svcloc)
-	: Converter(ByteStream_StorageType, classID(), svcloc),
+    : Converter(storageType(), classID(), svcloc),
 		m_ByteStreamCnvSvc(0),
 		m_robDataProvider("ROBDataProviderSvc", "EventInfoByteStreamCnv"),
 		m_mdSvc("InputMetaDataStore", "EventInfoByteStreamCnv"),
@@ -50,6 +50,10 @@ const CLID& EventInfoByteStreamCnv::classID() {
    return(ClassID_traits<EventInfo>::ID());
 }
 
+long EventInfoByteStreamCnv::storageType() {
+   return ByteStreamAddress::storageType();
+}
+
 StatusCode EventInfoByteStreamCnv::initialize() {
   StatusCode sc = Converter::initialize();
   if (StatusCode::SUCCESS != sc) {
diff --git a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.h b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.h
index edd6117e761..90f726f44cc 100644
--- a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.h
+++ b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.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 EVENTINFOBYTESTREAMCNV_H
@@ -18,9 +18,6 @@
 #include <string>
 
 class IOpaqueAddress;
-//class DataObject;
-//class StatusCode;
-//class IAddressCreator;
 class ByteStreamCnvSvc;
 class IROBDataProviderSvc;
 class StoreGateSvc;
@@ -28,8 +25,6 @@ class StoreGateSvc;
 // Abstract factory to create the converter
 template <class TYPE> class CnvFactory;
 
-// Externals
-extern long ByteStream_StorageType;
 
 /** @class EventInfoByteStreamCnv
  *  @brief This class implements the ByteStream Converter for EventInfo.
@@ -40,17 +35,17 @@ class EventInfoByteStreamCnv : public Converter {
 public:
    EventInfoByteStreamCnv(ISvcLocator* svcloc);
 
-   virtual StatusCode initialize();
-   virtual StatusCode finalize();
+   virtual StatusCode initialize() override;
+   virtual StatusCode finalize() override;
 
    /// converter method to create object
-   virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj);
+   virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
    /// converter method to write object
-   virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr);
+   virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
 
    /// Storage type and class ID
-   virtual long repSvcType() const    { return ByteStream_StorageType; }
-   static long storageType()          { return ByteStream_StorageType; }
+   virtual long repSvcType() const override { return i_repSvcType(); }
+   static long storageType();
    static const CLID& classID();
 
 private:
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
index d296bb4f1f9..eb20d2b92ea 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.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 BYTESTREAMCNVSVCBASE_BYTESTREAMCNVSVCBASE_H
@@ -29,19 +29,19 @@ public:
 
    virtual ~ByteStreamCnvSvcBase();
    /// Required of all Gaudi Services
-   StatusCode initialize();
+   virtual StatusCode initialize() override;
 
    /// Required of all Gaudi services:  see Gaudi documentation for details
-   virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
+   virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override;
 
    /// Checks whether an IOpaqueAddress is a GenericAddress
-   virtual StatusCode updateServiceState(IOpaqueAddress* pAddress);
+   virtual StatusCode updateServiceState(IOpaqueAddress* pAddress) override;
 
    /// Implementation of IByteStreamEventAccess: Get RawEvent
-   virtual RawEventWrite* getRawEvent() { return m_rawEventWrite; }
+   virtual RawEventWrite* getRawEvent() override { return m_rawEventWrite; }
 
    /// Implementation of IIncidentListener: Handle for EndEvent incidence
-   virtual void handle(const Incident&);
+   virtual void handle(const Incident&) override;
 
 protected: // data
    RawEventWrite* m_rawEventWrite;
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.h
index bae641fbeb9..243505121ab 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.h
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.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 BYTESTRAMCNVSVC_COLLECTIONBYTESTREAMCNV_H
@@ -19,9 +19,6 @@ class IROBDataProviderSvc;
 // Abstract factory to create the converter
 template <class TYPE> class CnvFactory;
 
-// Externals 
-extern long ByteStream_StorageType;
-
 /**
  * @class CollectionByteStreamCnv
  * @brief template class for BS converter for Collections
@@ -43,23 +40,23 @@ class CollectionByteStreamCnv: public Converter {
 
   /** @brief initialize the converter
    */
-  virtual StatusCode initialize();
+  virtual StatusCode initialize() override;
 
   /** @brief create data object from Address
    */
-  virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); 
+  virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
   
   /** @brief write data object to Bytestream
    */
-  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr);
+  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
 
   /** @brief  Storage type for BS 
    */
-  virtual long repSvcType() const { return ByteStream_StorageType; }
+  virtual long repSvcType() const override { return i_repSvcType(); }
 
   /** @brief  Storage type for BS 
    */
-  static long storageType()       { return ByteStream_StorageType; }
+  static long storageType();
 
   /** @brief  CLID for the data type 
    */
diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc
index bbf4ac7f8ff..eed763b0712 100755
--- a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc
+++ b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/CollectionByteStreamCnv.icc
@@ -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 "ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h" 
@@ -18,17 +18,22 @@
 
 template< typename TOOL> 
 CollectionByteStreamCnv< TOOL>::CollectionByteStreamCnv(ISvcLocator* svcloc) :
-    Converter(ByteStream_StorageType, classID(), svcloc), m_robDataProvider(0), m_tool(0)
+   Converter(storageType(), classID(), svcloc), m_robDataProvider(0), m_tool(0)
 {
 
 
 }
 
-template< typename TOOL> 
+template< typename TOOL>
 const CLID& CollectionByteStreamCnv<TOOL>::classID(){
  return ClassID_traits<COLLECTION>::ID() ;
 } 
 
+template< typename TOOL>
+long CollectionByteStreamCnv<TOOL>::storageType(){
+ return ByteStreamAddress::storageType();
+}
+
 template< typename TOOL> 
 StatusCode
 CollectionByteStreamCnv<TOOL>::initialize()
diff --git a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddress.cxx b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddress.cxx
index ce3dbcf1243..8ec169e945c 100755
--- a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddress.cxx
+++ b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddress.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
 */
 
 //====================================================================
@@ -23,18 +23,14 @@
 // Framework include files
 #include "GaudiKernel/GenericAddress.h"
 
-// Externals
-extern long ByteStream_StorageType;
-
-
 /// Standard Constructor
 ByteStreamAddress::ByteStreamAddress(const CLID& clid,
 		const std::string& fname , const std::string& cname, int p1, int p2)
-	: GenericAddress(ByteStream_StorageType, clid, fname, cname, p1, p2), m_eid(0,0) {
+    : GenericAddress(storageType(), clid, fname, cname, p1, p2), m_eid(0,0) {
 }
 
 ByteStreamAddress::ByteStreamAddress(const CLID& clid)
-	: GenericAddress(ByteStream_StorageType, clid, "", "") {
+    : GenericAddress(storageType(), clid, "", "") {
 }
 
 /** Add ROBID
diff --git a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressL1R.cxx b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressL1R.cxx
index 604c610c657..2f65b968ee2 100755
--- a/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressL1R.cxx
+++ b/Event/ByteStreamCnvSvcBase/src/ByteStreamAddressL1R.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
 */
 
 //====================================================================
@@ -16,21 +16,20 @@
 //====================================================================
 
 #include "ByteStreamCnvSvcBase/ByteStreamAddressL1R.h"
+#include "ByteStreamCnvSvcBase/ByteStreamAddress.h"
 
 // Framework include files
 #include "GaudiKernel/GenericAddress.h"
 
-// Externals
-extern long ByteStream_StorageType;
 
 /// Standard Constructor
 ByteStreamAddressL1R::ByteStreamAddressL1R(const CLID& clid,
 		const std::string& fname , const std::string& cname, int p1, int p2)
-	: GenericAddress(ByteStream_StorageType, clid, fname, cname, p1, p2) {
+    : GenericAddress(ByteStreamAddress::storageType(), clid, fname, cname, p1, p2) {
 }
 
 ByteStreamAddressL1R::ByteStreamAddressL1R(const CLID& clid)
-	: GenericAddress(ByteStream_StorageType, clid, "", "") {
+    : GenericAddress(ByteStreamAddress::storageType(), clid, "", "") {
 }
 
 /** Add pointer
diff --git a/Event/ByteStreamCnvSvcBase/src/ByteStreamCnvSvcBase.cxx b/Event/ByteStreamCnvSvcBase/src/ByteStreamCnvSvcBase.cxx
index a829435e7c1..c231f5d8535 100755
--- a/Event/ByteStreamCnvSvcBase/src/ByteStreamCnvSvcBase.cxx
+++ b/Event/ByteStreamCnvSvcBase/src/ByteStreamCnvSvcBase.cxx
@@ -1,8 +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 "ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h"
+#include "ByteStreamCnvSvcBase/ByteStreamAddress.h"
 
 #include "GaudiKernel/IOpaqueAddress.h"
 #include "GaudiKernel/GenericAddress.h"
@@ -13,12 +14,9 @@
 #include "AthenaKernel/IClassIDSvc.h"
 #include "StoreGate/StoreGate.h" 
 
-//External definitions
-long ByteStream_StorageType = 0x43;
-
 //______________________________________________________________________________
 ByteStreamCnvSvcBase::ByteStreamCnvSvcBase(const std::string& name, ISvcLocator* pSvcLocator) :
-	::AthCnvSvc(name, pSvcLocator, ByteStream_StorageType),
+   ::AthCnvSvc(name, pSvcLocator, ByteStreamAddress::storageType()),
 	m_rawEventWrite(0) {
    declareProperty("InitCnvs", m_initCnvs); 
    // This property is used by Tile BS converter, not by this class.
-- 
GitLab


From f0f77008e5ed9b48c1b5963ccb00868aa5b36bc0 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 26 Feb 2019 10:26:38 +0100
Subject: [PATCH 023/404] Configure RegionSelector according to the
 Detector.Geometry* flags

---
 .../RegionSelector/python/RegSelConfig.py     | 205 ++++++++++--------
 .../TrigUpgradeTest/share/newJOtest.py        |  23 +-
 2 files changed, 133 insertions(+), 95 deletions(-)

diff --git a/DetectorDescription/RegionSelector/python/RegSelConfig.py b/DetectorDescription/RegionSelector/python/RegSelConfig.py
index 844eca624c1..504d020394f 100644
--- a/DetectorDescription/RegionSelector/python/RegSelConfig.py
+++ b/DetectorDescription/RegionSelector/python/RegSelConfig.py
@@ -1,10 +1,15 @@
 #
-#  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
 
-
 def RegSelConfig( flags ):
+    from AthenaCommon.Logging import logging
+    log = logging.getLogger ('RegSelConfig')
+    log.warning("Please use regSeCfg - that name matches ComponentAccumulator generator functions naming convention ")
+    return regSelCfg( flags ) 
+
+def regSelCfg( flags ):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     from RegionSelector.RegionSelectorConf import RegSelSvc
     from AthenaCommon.SystemOfUnits import mm
@@ -13,92 +18,113 @@ def RegSelConfig( flags ):
     regSel = RegSelSvc()
     regSel.DeltaZ = 225 * mm
 
-    # there will be ifology here enabling only the configured detectors
-    from LArRegionSelector.LArRegionSelectorConf import LArRegionSelectorTable
-    larTable =  LArRegionSelectorTable(name="LArRegionSelectorTable")
-    acc.addPublicTool( larTable )
-    regSel.LArRegionSelectorTable      = larTable
-
-    from IOVDbSvc.IOVDbSvcConfig import addFolders
-    acc.merge( addFolders(flags, ['/LAR/Identifier/FebRodMap'], 'LAR' ))
-
-
-    from TileRawUtils.TileRawUtilsConf import TileRegionSelectorTable
-    tileTable =  TileRegionSelectorTable(name="TileRegionSelectorTable")
-    acc.addPublicTool( tileTable )
-    # ??? that is puzzle, the RegSelSvc seems not to ahev such a property
-    # while it is set in:RegSelSvcDefault.py
-    #regSel.TileRegionSelectorTable     = tileTable
-
-    regSel.enableCalo = True
-    regSel.enableID = True
-    regSel.enablePixel = True
-    regSel.enableSCT = True
-    regSel.enableTRT = True
-
-    # Setup RegSelSvc for muon detector based on RegSelSvcDefault.py
-    from MuonRegionSelector.MuonRegionSelectorConf import RPC_RegionSelectorTable
-    rpcTable = RPC_RegionSelectorTable(name = "RPC_RegionSelectorTable")
-    acc.addPublicTool( rpcTable )
-
-    from MuonRegionSelector.MuonRegionSelectorConf import MDT_RegionSelectorTable
-    mdtTable = MDT_RegionSelectorTable(name = "MDT_RegionSelectorTable")
-    acc.addPublicTool( mdtTable )
+    if flags.Detector.GeometryLAr:
+        regSel.enableCalo = True
+
+        from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+        acc.merge( LArGMCfg(  flags ) )
+
+        from LArRegionSelector.LArRegionSelectorConf import LArRegionSelectorTable
+        larTable =  LArRegionSelectorTable(name="LArRegionSelectorTable")
+        acc.addPublicTool( larTable )
+        regSel.LArRegionSelectorTable      = larTable
+        
+        from IOVDbSvc.IOVDbSvcConfig import addFolders
+        acc.merge( addFolders(flags, ['/LAR/Identifier/FebRodMap'], 'LAR' ))
+
+    if flags.Detector.GeometryTile:
+        regSel.enableCalo = True
+
+        from TileGeoModel.TileGMConfig import TileGMCfg
+        acc.merge( TileGMCfg( flags ) )
+
+        from TileRawUtils.TileRawUtilsConf import TileRegionSelectorTable
+        tileTable =  TileRegionSelectorTable(name="TileRegionSelectorTable")
+        acc.addPublicTool( tileTable )
+        # ??? that is puzzle, the RegSelSvc seems not to have such a property
+        # while it is set in:RegSelSvcDefault.py
+        # regSel.TileRegionSelectorTable     = tileTable
+
+    if flags.Detector.GeometryPixel:
+        regSel.enableID = True
+        regSel.enablePixel = True        
+        from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable
+        pixTable = SiRegionSelectorTable(name        = "PixelRegionSelectorTable",
+                                         ManagerName = "Pixel",
+                                         OutputFile  = "RoITablePixel.txt",
+                                         PrintHashId = True,
+                                         PrintTable  = False)
+        acc.addPublicTool(pixTable)
+
+    if flags.Detector.GeometrySCT:
+        regSel.enableID = True
+        regSel.enableSCT = True
+
+        from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable
+        sctTable = SiRegionSelectorTable(name        = "SCT_RegionSelectorTable",
+                                         ManagerName = "SCT",
+                                         OutputFile  = "RoITableSCT.txt",
+                                         PrintHashId = True,
+                                         PrintTable  = False)
+        acc.addPublicTool(sctTable)
+
+    if flags.Detector.GeometryTRT:
+        regSel.enableID = True
+        regSel.enableTRT = True
+
+        from InDetRegionSelector.InDetRegionSelectorConf import TRT_RegionSelectorTable
+        trtTable = TRT_RegionSelectorTable(name = "TRT_RegionSelectorTable",
+                                           ManagerName = "TRT",
+                                           OutputFile  = "RoITableTRT.txt",
+                                           PrintHashId = True,
+                                           PrintTable  = False)
+        acc.addPublicTool(trtTable)
+
+
+    if flags.Detector.GeometryRPC:
+        regSel.enableMuon = True
+        regSel.enableRPC  = True
+        from MuonRegionSelector.MuonRegionSelectorConf import RPC_RegionSelectorTable
+        rpcTable = RPC_RegionSelectorTable(name = "RPC_RegionSelectorTable")
+        acc.addPublicTool( rpcTable )
+
+    if flags.Detector.GeometryMDT:
+        regSel.enableMuon = True
+        regSel.enableMDT  = True
+        from MuonRegionSelector.MuonRegionSelectorConf import MDT_RegionSelectorTable
+        mdtTable = MDT_RegionSelectorTable(name = "MDT_RegionSelectorTable")
+        acc.addPublicTool( mdtTable )
+
+    if flags.Detector.GeometryTGC:
+        regSel.enableMuon = True
+        regSel.enableTGC  = True
+        from MuonRegionSelector.MuonRegionSelectorConf import TGC_RegionSelectorTable
+        tgcTable = TGC_RegionSelectorTable(name = "TGC_RegionSelectorTable")
+        acc.addPublicTool( tgcTable )
+
+    if flags.Detector.GeometryCSC:
+        regSel.enableMuon = True
+        regSel.enableCSC  = True
+        from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable
+        cscTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable")
+        acc.addPublicTool( cscTable )
+
+    # ??? that is same puzzle of Calo, the RegSelSvc seems not to have such a property
+    # while it is set in:RegSelSvcDefault.py 
+    # regSel.RPC_RegionLUT_CreatorTool   = rpcTable
+    # regSel.MDT_RegionLUT_CreatorTool   = mdtTable
+    # regSel.TGC_RegionLUT_CreatorTool   = tgcTable
+    # regSel.CSC_RegionLUT_CreatorTool   = cscTable
 
-    from MuonRegionSelector.MuonRegionSelectorConf import TGC_RegionSelectorTable
-    tgcTable = TGC_RegionSelectorTable(name = "TGC_RegionSelectorTable")
-    acc.addPublicTool( tgcTable )
 
-    from MuonRegionSelector.MuonRegionSelectorConf import CSC_RegionSelectorTable
-    cscTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable")
-    acc.addPublicTool( cscTable )
+    if flags.Detector.GeometryMM:
+        regSel.enableMM  = True   
 
-    # ??? that is same puzzle of Calo, the RegSelSvc seems not to ahev such a property
-    # while it is set in:RegSelSvcDefault.py 
-    #regSel.RPC_RegionLUT_CreatorTool   = rpcTable
-    #regSel.MDT_RegionLUT_CreatorTool   = mdtTable
-    #regSel.TGC_RegionLUT_CreatorTool   = tgcTable
-    #regSel.CSC_RegionLUT_CreatorTool   = cscTable
-
-    regSel.enableMuon = True
-    regSel.enableRPC  = True
-    regSel.enableMDT  = True
-    regSel.enableTGC  = True
-    regSel.enableCSC  = True
-    regSel.enableMM   = False   
-
-    from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable
-    pixTable = SiRegionSelectorTable(name        = "PixelRegionSelectorTable",
-                                     ManagerName = "Pixel",
-                                     OutputFile  = "RoITablePixel.txt",
-                                     PrintHashId = True,
-                                     PrintTable  = False)
-    acc.addPublicTool(pixTable)
-
-    from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable
-    sctTable = SiRegionSelectorTable(name        = "SCT_RegionSelectorTable",
-                                     ManagerName = "SCT",
-                                     OutputFile  = "RoITableSCT.txt",
-                                     PrintHashId = True,
-                                     PrintTable  = False)
-    acc.addPublicTool(sctTable)
-
-    from InDetRegionSelector.InDetRegionSelectorConf import TRT_RegionSelectorTable
-    trtTable = TRT_RegionSelectorTable(name = "TRT_RegionSelectorTable",
-                                       ManagerName = "TRT",
-                                       OutputFile  = "RoITableTRT.txt",
-                                       PrintHashId = True,
-                                       PrintTable  = False)
-    acc.addPublicTool(trtTable)
     acc.addService( regSel )
 
 
-    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
-    from TileGeoModel.TileGMConfig import TileGMCfg
-    acc.merge( LArGMCfg(  flags ) )
-    acc.merge( TileGMCfg( flags ) )
 
-    return acc, regSel
+    return acc
 
 if __name__ == "__main__":
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
@@ -110,6 +136,15 @@ if __name__ == "__main__":
 
     Configurable.configurableRun3Behavior=True
 
+    ConfigFlags.Detector.GeometryPixel = True     
+    ConfigFlags.Detector.GeometrySCT   = True 
+    ConfigFlags.Detector.GeometryTRT   = True 
+    ConfigFlags.Detector.GeometryLAr   = True     
+    ConfigFlags.Detector.GeometryTile  = True     
+    ConfigFlags.Detector.GeometryMDT   = True 
+    ConfigFlags.Detector.GeometryTGC   = True
+    ConfigFlags.Detector.GeometryCSC   = True     
+    ConfigFlags.Detector.GeometryRPC   = True     
     
 
     ConfigFlags.Input.Files = defaultTestFiles.RAW    
@@ -121,16 +156,16 @@ if __name__ == "__main__":
 
     ## move up
 
-# when trying AOD
-#    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-#    cfg.merge( PoolReadCfg( ConfigFlags ) )
+    # when trying AOD
+    #    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    #    cfg.merge( PoolReadCfg( ConfigFlags ) )
 
     
     from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg
     cfg.merge(TrigBSReadCfg( ConfigFlags ))
     
     
-    acc,regSel = RegSelConfig( ConfigFlags )
+    acc,regSel = regSelCfg( ConfigFlags )
     cfg.merge( acc )
 
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 21bd5aa00cd..0c3a881dc1b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -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
 #
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
@@ -13,6 +13,15 @@ from TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO import setupMenu
 from AthenaCommon.Configurable import Configurable
 Configurable.configurableRun3Behavior=1
 
+flags.Detector.GeometryPixel = True     
+flags.Detector.GeometrySCT   = True 
+flags.Detector.GeometryTRT   = True 
+flags.Detector.GeometryLAr   = True     
+flags.Detector.GeometryTile  = True     
+flags.Detector.GeometryMDT   = True 
+flags.Detector.GeometryTGC   = True
+flags.Detector.GeometryCSC   = True     
+flags.Detector.GeometryRPC   = True     
 
 flags.needFlagsCategory('Trigger')
 setupMenu(flags)
@@ -42,15 +51,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu
 from TriggerJobOpts.TriggerConfig import triggerRunCfg
 acc.merge( triggerRunCfg( flags, generateMenu ) )
 
-from RegionSelector.RegSelConfig import RegSelConfig
-rsc, regSel = RegSelConfig( flags )
-regSel.enableCalo=True
-regSel.enableID=True
-regSel.enablePixel = True
-regSel.enableSCT = True
-regSel.enableTRT = True
-acc.merge( rsc )
-acc.addService(regSel)
+from RegionSelector.RegSelConfig import regSelCfg
+acc.merge( regSelCfg( flags ) )
+
 
 from TrigUpgradeTest.InDetConfig import TrigInDetCondConfig
 acc.merge( TrigInDetCondConfig( flags ) )
-- 
GitLab


From 3a3644d72d434e6ad6d03f25fe7926d11d48267d Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 26 Feb 2019 09:32:33 +0000
Subject: [PATCH 024/404] Fix unused variable compiler warning

---
 .../src/TFCSHistoLateralShapeParametrization.cxx                | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx
index fc78ae5ea4a..e7b62b40d5d 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx
@@ -45,7 +45,7 @@ void TFCSHistoLateralShapeParametrization::set_number_of_hits(float nhits)
   m_nhits=nhits;
 }
 
-FCSReturnCode TFCSHistoLateralShapeParametrization::simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState* truth, const TFCSExtrapolationState* extrapol)
+FCSReturnCode TFCSHistoLateralShapeParametrization::simulate_hit(Hit &hit, TFCSSimulationState &simulstate, const TFCSTruthState* truth, const TFCSExtrapolationState* /*extrapol*/)
 {
   if (!simulstate.randomEngine()) {
     return FCSFatal;
-- 
GitLab


From d50731cfc749bcc25d6101f302631b8430948158 Mon Sep 17 00:00:00 2001
From: Jyoti Prakash Biswal <jyoti.prakash.biswal@cern.ch>
Date: Tue, 26 Feb 2019 11:21:47 +0100
Subject: [PATCH 025/404] Solution to missing move assignment operator.

Coverity issue# 113564.
---
 .../TrkSurfaces/TrkSurfaces/DiscBounds.h          | 15 +++++++++------
 .../TrkDetDescr/TrkSurfaces/src/DiscBounds.cxx    | 13 +------------
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h
index 508607f0f5c..d914e9186d2 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.h
+++ b/Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/DiscBounds.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -60,14 +60,17 @@ namespace Trk {
      /**Constructor for a symmetric disc around phi != 0*/
      DiscBounds(double minrad, double maxrad, double avephi, double hphisec);
      
-     /**Copy constructor*/
-     DiscBounds(const DiscBounds& discbo);
-     
+     /**Default copy constructor*/ 
+     DiscBounds(const DiscBounds&) = default;  
+   
      /**Destructor*/
      virtual ~DiscBounds();
      
-     /**Assignment operator*/
-     DiscBounds& operator=(const DiscBounds& discbo);
+     /**Default move constructor*/	
+     DiscBounds(DiscBounds&& discbo) = default;
+
+     /**Default move assignment operator*/
+     DiscBounds& operator=(DiscBounds&& discbo) = default;
      
      /**Equality operator*/
      virtual bool operator==(const SurfaceBounds& sbo) const override;
diff --git a/Tracking/TrkDetDescr/TrkSurfaces/src/DiscBounds.cxx b/Tracking/TrkDetDescr/TrkSurfaces/src/DiscBounds.cxx
index d90628900f3..38c88c13b6e 100644
--- a/Tracking/TrkDetDescr/TrkSurfaces/src/DiscBounds.cxx
+++ b/Tracking/TrkDetDescr/TrkSurfaces/src/DiscBounds.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -40,21 +40,10 @@ Trk::DiscBounds::DiscBounds(double minrad, double maxrad, double avephi, double
         swap(m_boundValues[DiscBounds::bv_rMin],  m_boundValues[DiscBounds::bv_rMax]);
 }
 
-Trk::DiscBounds::DiscBounds(const DiscBounds& discbo) :
-  Trk::SurfaceBounds(),
-  m_boundValues(discbo.m_boundValues)
-{}
 
 Trk::DiscBounds::~DiscBounds()
 {}
 
-Trk::DiscBounds& Trk::DiscBounds::operator=(const DiscBounds& discbo)
-{
-    if (this!=&discbo)
-        m_boundValues    = discbo.m_boundValues;
-    return *this;
-}
-
 bool Trk::DiscBounds::operator==(const Trk::SurfaceBounds& sbo) const
 {
   // check the type first not to compare apples with oranges
-- 
GitLab


From f452c675b43f8b4ef90c569a1f91e1336c42261a Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 26 Feb 2019 11:27:09 +0100
Subject: [PATCH 026/404] standarise setup of DQ complex flags

---
 Control/AthenaConfiguration/python/AllConfigFlags.py | 2 +-
 Control/AthenaMonitoring/python/DQConfigFlags.py     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index 99e1eb37643..f7468117dee 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -105,7 +105,7 @@ def _createCfgFlags():
     def __dq():
         from AthenaMonitoring.DQConfigFlags import createDQConfigFlags, createComplexDQConfigFlags
         dqf = createDQConfigFlags()
-        createComplexDQConfigFlags(acf)  # TODO try to use the same style?
+        dqf.join( createComplexDQConfigFlags() )
         return dqf
     acf.addFlagsCategory("DQ", __dq )
 
diff --git a/Control/AthenaMonitoring/python/DQConfigFlags.py b/Control/AthenaMonitoring/python/DQConfigFlags.py
index 1d19f8c6803..1cd308251ab 100644
--- a/Control/AthenaMonitoring/python/DQConfigFlags.py
+++ b/Control/AthenaMonitoring/python/DQConfigFlags.py
@@ -13,9 +13,11 @@ def createDQConfigFlags():
     acf.addFlag('DQ.FileKey', 'CombinedMonitoring')
     return acf
 
-def createComplexDQConfigFlags( acf ):
+def createComplexDQConfigFlags():
+    acf=AthConfigFlags()
     acf.addFlag('DQ.Environment', getEnvironment )
     acf.addFlag('DQ.DataType', getDataType )
+    return acf
 
 def getDataType(flags):
     if flags.Input.isMC:
-- 
GitLab


From 8ae99b10f7280fcd82487c18550fcf0970b326b3 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 26 Feb 2019 11:33:31 +0100
Subject: [PATCH 027/404] HltEventLoopMgr: add magnet auto-configuration

Add back the code to perform the magnet configuration based on the
currents in the ptree. This is disabled by default and needs to be
enabled for job options that configure the AtlasFieldSvc.
---
 .../TrigServices/src/HltEventLoopMgr.cxx      | 51 +++++++++++++------
 .../TrigServices/src/HltEventLoopMgr.h        | 12 +++--
 .../TrigUpgradeTest/share/testHLT_MT.py       |  1 +
 Trigger/TriggerRelease/python/Modifiers.py    |  9 +++-
 4 files changed, 53 insertions(+), 20 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
index 76a6599cbe0..9dfbcc99618 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
@@ -381,28 +381,15 @@ StatusCode HltEventLoopMgr::prepareForRun(const ptree& pt)
     // (void)TClass::GetClass("vector<unsigned short>"); // preload to overcome an issue with dangling references in serialization
     // (void)TClass::GetClass("vector<unsigned long>");
 
-    // do the necessary resets
-    ATH_CHECK(clearTemporaryStores());
-
-    // update SOR in det store
-    ATH_CHECK( processRunParams(pt) );
+    ATH_CHECK(clearTemporaryStores());  // do the necessary resets
+    ATH_CHECK( processRunParams(pt) );  // update SOR in det store
+    ATH_CHECK( updateMagField(pt) );    // update magnetic field
 
     auto& soral = getSorAttrList();
 
     updateInternal(soral);       // update internally kept info
     updateMetadataStore(soral);  // update metadata store
 
-    /* Old code: kept for reference for the moment
-    const EventInfo * evinfo;
-    if(updMagField(pt).isFailure() ||     // update mag field when appropriate
-       updHLTConfigSvc().isFailure() ||   // update config svc when appropriate
-       prepXAODEventInfo().isFailure() || // update xAOD event data in SG
-       !(evinfo = prepEventInfo()))       // update old event data in SG
-      return StatusCode::FAILURE;
-
-    bookAllHistograms();
-    */
-
     // start top level algorithms
     for (auto& ita : m_topAlgList) {
       ATH_CHECK(ita->sysStart());
@@ -885,9 +872,41 @@ void HltEventLoopMgr::updateMetadataStore(const coral::AttributeList & sor_attrl
   else {
     ATH_MSG_DEBUG("Recorded MetaData in InputMetaDataStore");
   }
+}
+
+//=========================================================================
+StatusCode HltEventLoopMgr::updateMagField(const ptree& pt) const
+{
+  if (m_setMagFieldFromPtree) {
+    try {
+      auto tor_cur = pt.get<float>("Magnets.ToroidsCurrent.value");
+      auto sol_cur = pt.get<float>("Magnets.SolenoidCurrent.value");
+
+      IProperty* fieldSvc{nullptr};
+      service("AtlasFieldSvc", fieldSvc, /*createIf=*/false).ignore();
+      if ( fieldSvc==nullptr ) {
+        ATH_MSG_ERROR("Cannot retrieve AtlasFieldSvc");
+        return StatusCode::FAILURE;
+      }
+
+      ATH_CHECK( Gaudi::Utils::setProperty(fieldSvc, "UseSoleCurrent", sol_cur) );
+      ATH_CHECK( Gaudi::Utils::setProperty(fieldSvc, "UseToroCurrent", tor_cur) );
 
+      ATH_MSG_INFO("*****************************************");
+      ATH_MSG_INFO("  Auto-configuration of magnetic field:  ");
+      ATH_MSG_INFO("    solenoid current from IS = " << sol_cur);
+      ATH_MSG_INFO("     torroid current from IS = " << tor_cur);
+      ATH_MSG_INFO("*****************************************");
+    }
+    catch(ptree_bad_path& e) {
+      ATH_MSG_ERROR( "Cannot read magnet currents from ptree: " << e.what() );
+      return StatusCode::FAILURE;
+    }
+  }
+  return StatusCode::SUCCESS;
 }
 
+
 // =============================================================================
 StatusCode HltEventLoopMgr::clearTemporaryStores()
 {
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
index 3b237ed7c1c..40b9e90861d 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
@@ -131,6 +131,9 @@ private:
   // Update internally kept data from new sor
   void updateMetadataStore(const coral::AttributeList & sor_attrlist) const;
 
+  /// Set magnetic field currents from ptree
+  StatusCode updateMagField(const boost::property_tree::ptree& pt) const;
+
   /// Clear per-event stores
   StatusCode clearTemporaryStores();
 
@@ -230,15 +233,18 @@ private:
     this, "AlgErrorDebugStreamName", "HLTError",
     "Debug stream name for events with HLT algorithm errors"};
 
+  Gaudi::Property<std::string> m_sorPath{
+    this, "SORPath", "/TDAQ/RunCtrl/SOR_Params", "Path to StartOfRun parameters in detector store"};
+
+  Gaudi::Property<bool> m_setMagFieldFromPtree{
+    this, "setMagFieldFromPtree", false, "Read magnet currents from ptree"};
+
   SG::WriteHandleKey<EventContext> m_eventContextWHKey{
     this, "EventContextWHKey", "EventContext", "StoreGate key for recording EventContext"};
 
   SG::ReadHandleKey<EventInfo> m_eventInfoRHKey{
     this, "EventInfoRHKey", "ByteStreamEventInfo", "StoreGate key for reading EventInfo"};
 
-  Gaudi::Property<std::string> m_sorPath{
-    this, "SORPath", "/TDAQ/RunCtrl/SOR_Params", "Path to StartOfRun parameters in detector store"};
-
   SG::ReadHandleKey<HLT::HLTResultMT> m_hltResultRHKey;    ///< StoreGate key for reading the HLT result
 
   // ------------------------- Other private members ---------------------------
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
index 4b92672035b..4fbecdf062b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
@@ -120,6 +120,7 @@ if globalflags.DataSource.is_geant4():  # MC modifiers
     setModifiers += ['BFieldFromDCS']
 else:           # More data modifiers
     setModifiers += ['allowCOOLUpdates',
+                     'BFieldAutoConfig',
                      'useHLTMuonAlign',
                      #Check for beamspot quality flag
                      'UseBeamSpotFlagForBjet',
diff --git a/Trigger/TriggerRelease/python/Modifiers.py b/Trigger/TriggerRelease/python/Modifiers.py
index 6ad2de7fa67..237c515f58e 100644
--- a/Trigger/TriggerRelease/python/Modifiers.py
+++ b/Trigger/TriggerRelease/python/Modifiers.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 ##############################################################
 # Modifiers.py
@@ -343,6 +343,13 @@ class BFieldFromDCS(_modifier):
         conddb.addFolder("DCS_OFL","/EXT/DCS/MAGNETS/SENSORDATA")
         svcMgr.AtlasFieldSvc.UseDCS = True
 
+class BFieldAutoConfig(_modifier):
+    """
+    Read field currents from configuration ptree (athenaHLT)
+    """
+    def postSetup(self):
+        if hasattr(svcMgr,'HltEventLoopMgr'): svcMgr.HltEventLoopMgr.setMagFieldFromPtree = True
+
 class allowCOOLUpdates(_modifier):
     """
     Enable COOL folder updates during the run
-- 
GitLab


From 62cccf98c2303c2258144ea9493da0ec502233dc Mon Sep 17 00:00:00 2001
From: John Baines <john.baines@cern.ch>
Date: Tue, 26 Feb 2019 12:11:41 +0100
Subject: [PATCH 028/404] sweep of !21324 to master TrigInDetValidation fix for
 FTK chains in the v8 trigger menu

---
 .../python/TrigIDPhysValMonitoringConfig.py   | 34 +++++++++----------
 .../python/TrigIDtrkMonitoringConfig.py       | 34 +++++++++----------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
index 62332e6ac37..2977518f305 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDPhysValMonitoringConfig.py
@@ -211,10 +211,10 @@ def TrigIDPhysValMonitoringTool():
 
     chainnames = [
        #jets                   
-      "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
-      "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
-      "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
-      "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
+      "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
+      "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
+      "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
+      "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
       #taus
       "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK",
       "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK_IDTrig",
@@ -222,10 +222,10 @@ def TrigIDPhysValMonitoringTool():
       "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit",
       "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit_IDTrig",
       #muons 
-      "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK",
-      "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
-      "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
-      "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
+      "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK",
+      "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
+      "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
+      "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
     ]
 
     outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT)]
@@ -242,11 +242,11 @@ def TrigIDPhysValMonitoringTool():
     cosmic = False
     
     chainnames = [
-       #jets                   
-      "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
-      "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
-      "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
-      "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
+      #jets                   
+      "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
+      "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
+      "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
+      "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
       #taus
       "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK",
       "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK_IDTrig",
@@ -254,10 +254,10 @@ def TrigIDPhysValMonitoringTool():
       "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit",
       "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit_IDTrig",
       #muons 
-      "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK",
-      "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
-      "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
-      "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
+      "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK",
+      "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
+      "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
+      "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
     ]
 
     outputlist += [makePhysvalMon(name, pdgid, chainnames, useHighestPT, cosmic, useOffline)]
diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
index 2b775eb6e35..c6ca546cbb4 100644
--- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py
@@ -466,23 +466,23 @@ def TrigIDtrkMonitoringTool():
                 # tidabase.OutputLevel = DEBUG
                 tidaftk.ntupleChainNames += [
                         "Offline",
-                        #jets                   
-                        "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
-                        "HLT_j.*perf_.*FTKRefit:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
-                        "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
-                        "HLT_j.*perf_.*FTK:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
-                        #taus
-                        "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK",
-                        "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK_IDTrig",
-                        "HLT_tau.*FTKNoPrec:key=InDetTrigTrackingxAODCnv_Tau_FTK",
-                        "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit",
-                        "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit_IDTrig",
-                        #muons 
-                        "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK",
-                        "HLT_mu.*idperf_FTK:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
-                        "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
-                        "HLT_mu.*idperf_FTKRefit:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
-			]
+			 #jets                   
+			 "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit:roi=SplitJet",
+			 "HLT_j.*perf_.*FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTKRefit_IDTrig:roi=SplitJet",
+			 "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK:roi=SplitJet",
+			 "HLT_j.*perf_.*FTK_.*:key=InDetTrigTrackingxAODCnv_Bjet_FTK_IDTrig:roi=SplitJet",
+			 #taus
+			 "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK",
+			 "HLT_tau.*idperf_.*FTK:key=InDetTrigTrackingxAODCnv_Tau_FTK_IDTrig",
+			 "HLT_tau.*FTKNoPrec:key=InDetTrigTrackingxAODCnv_Tau_FTK",
+			 "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit",
+			 "HLT_tau.*FTKRefit:key=InDetTrigTrackingxAODCnv_Tau_FTKRefit_IDTrig",
+			 #muons 
+			 "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK",
+			 "HLT_mu.*idperf_FTK_.*:key=InDetTrigTrackingxAODCnv_Muon_FTK_IDTrig",
+			 "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit",
+			 "HLT_mu.*idperf_FTKRefit_.*:key=InDetTrigTrackingxAODCnv_Muon_FTKRefit_IDTrig"
+                        ]
 		#ToolSvc += tidaftk;
                 list += [ "TrigTestBase/IDFTKTool" ]
 
-- 
GitLab


From 0b112f2b4ed39400fdc71865f41c6ea1d89174fe Mon Sep 17 00:00:00 2001
From: Jovan Mitrevski <Jovan.Mitrevski@cern.ch>
Date: Tue, 26 Feb 2019 14:38:39 +0100
Subject: [PATCH 029/404] Remove remaining direct storegate accesses in
 LumiBlockComps

---
 .../CreateLumiBlockCollectionFromFile.h       |   4 +
 .../LumiBlockComps/LumiBlockMuWriter.h        |  51 ------
 .../LumiBlockComps/LumiBlockTester.h          |   6 +-
 .../LumiBlockComps/LuminosityTool.h           |   4 +
 .../LumiBlockComps/TrigLivefractionTool.h     |  10 +-
 .../share/LumiBlockMuWriterExample.py         |  58 -------
 .../share/LumiBlockMuWriter_jobOptions.py     |  28 ---
 .../src/CreateLumiBlockCollectionFromFile.cxx |  60 ++++---
 .../LumiBlockComps/src/LumiBlockMuWriter.cxx  | 161 ------------------
 .../LumiBlockComps/src/LumiBlockTester.cxx    |  19 ++-
 .../LumiBlockComps/src/LuminosityTool.cxx     |  20 +--
 .../src/TrigLivefractionTool.cxx              |  24 +--
 .../src/components/LumiBlockComps_entries.cxx |   2 -
 .../share/RecExCommon_topOptions.py           |  11 +-
 .../share/jobOptions_TileEventSelector.py     |   2 +-
 15 files changed, 85 insertions(+), 375 deletions(-)
 delete mode 100644 LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockMuWriter.h
 delete mode 100644 LumiBlock/LumiBlockComps/share/LumiBlockMuWriterExample.py
 delete mode 100644 LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py
 delete mode 100644 LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx

diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/CreateLumiBlockCollectionFromFile.h b/LumiBlock/LumiBlockComps/LumiBlockComps/CreateLumiBlockCollectionFromFile.h
index 59883a86d74..db81311b0db 100644
--- a/LumiBlock/LumiBlockComps/LumiBlockComps/CreateLumiBlockCollectionFromFile.h
+++ b/LumiBlock/LumiBlockComps/LumiBlockComps/CreateLumiBlockCollectionFromFile.h
@@ -29,6 +29,8 @@
 #include "GaudiKernel/IIoComponent.h"
 #include "AthenaKernel/IOVSvcDefs.h"
 
+#include "xAODEventInfo/EventInfo.h"
+
 class StoreGateSvc;
 
 class CreateLumiBlockCollectionFromFile:public AthAlgorithm, virtual public IIncidentListener,
@@ -50,6 +52,8 @@ public:
 
 protected:
  
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","RHK for EventInfo"};
+
   /// Fill metaDataStore and ntuples
   void finishUp();
 
diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockMuWriter.h b/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockMuWriter.h
deleted file mode 100644
index 17d26166e7c..00000000000
--- a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockMuWriter.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef XAOD_ANALYSIS
-
-/**
-   @class LumiBlockMuWriter
-   @brief Algorithm to write interactions per crossing (mu) into EventInfo
-   @author E.Torrence
-**/
-
-#ifndef LUMIBLOCKCOMPS_LumiBlockMuWriter_H
-#define LUMIBLOCKCOMPS_LumiBlockMuWriter_H
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "LumiBlockComps/ILuminosityTool.h"
-#include "LumiCalc/CoolQuery.h"
-
-#include <string>
-
-class LumiBlockMuWriter: public AthAlgorithm {
- public:
-  LumiBlockMuWriter(const std::string& name, ISvcLocator* pSvcLocator);
-
-  StatusCode          initialize();
-  StatusCode          execute();
-  StatusCode          finalize();
-  
- private:
-  ToolHandle<ILuminosityTool> m_lumiTool;
-
-  // Direct DB access properties for pileup events
-  bool m_writePileupEvents; // Attempt to write mu values into pileup (overlay) events.  Default is FALSE
-  StringProperty m_lumiDatabase;
-  StringProperty m_lumiFolder;
-  StringProperty m_lumiTag;
-  unsigned int m_lumiChannel;
-
-  CoolQuery* m_lumiDB;
-
-  CoolQuery::LumiFolderData getDBLuminosity(unsigned int run, unsigned int lb);
- 
-
-};
-
-#endif
-
-#endif
-
diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockTester.h b/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockTester.h
index 595ff382679..70b759a3ef9 100644
--- a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockTester.h
+++ b/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockTester.h
@@ -17,6 +17,8 @@
 #include "LumiBlockComps/ITrigLivefractionTool.h"
 #include "LumiBlockComps/ILumiBlockMuTool.h"
 
+#include "xAODEventInfo/EventInfo.h"
+
 #include <string>
 
 class LumiBlockTester: public AthAlgorithm {
@@ -30,7 +32,9 @@ class LumiBlockTester: public AthAlgorithm {
   ToolHandle<ILuminosityTool> m_lumiTool;
   ToolHandle<ITrigLivefractionTool> m_liveTool;
   ToolHandle<ILumiBlockMuTool> m_muTool;
-  
+
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","RHK for EventInfo"};
+
 };
 
 #endif
diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/LuminosityTool.h b/LumiBlock/LumiBlockComps/LumiBlockComps/LuminosityTool.h
index 9cd2921932c..03e5054085f 100644
--- a/LumiBlock/LumiBlockComps/LumiBlockComps/LuminosityTool.h
+++ b/LumiBlock/LumiBlockComps/LumiBlockComps/LuminosityTool.h
@@ -29,6 +29,8 @@
 
 #include "CoralBase/Blob.h"
 
+#include "xAODEventInfo/EventInfo.h"
+
 #include <string>
 #include <vector>
 #include <map>
@@ -81,6 +83,8 @@ class LuminosityTool: public AthAlgTool, virtual public ILuminosityTool {
 
  private:
 
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","RHK for EventInfo"};
+
   // Callback functions
   virtual StatusCode updateAvgLumi(IOVSVC_CALLBACK_ARGS);
   virtual StatusCode updateLBLB(IOVSVC_CALLBACK_ARGS);
diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/TrigLivefractionTool.h b/LumiBlock/LumiBlockComps/LumiBlockComps/TrigLivefractionTool.h
index e6e15ca7968..cf2822f0959 100644
--- a/LumiBlock/LumiBlockComps/LumiBlockComps/TrigLivefractionTool.h
+++ b/LumiBlock/LumiBlockComps/LumiBlockComps/TrigLivefractionTool.h
@@ -23,6 +23,8 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "LumiBlockComps/ILuminosityTool.h"
 
+#include "xAODEventInfo/EventInfo.h"
+
 #include <string>
 #include <vector>
 
@@ -75,8 +77,10 @@ class TrigLivefractionTool: public AthAlgTool, virtual public ITrigLivefractionT
   // Flag to indicate that cached data has changed
   bool m_recalcLumiLivefraction;
 
-  // Tool handle for luminosity
-  ToolHandle<ILuminosityTool> m_lumiTool;
+  // Tool handle for luminosity ### NEEDS UPDTING
+  PublicToolHandle<ILuminosityTool> m_lumiTool{this, "LuminosityTool", ""};
+
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,"EventInfoKey","EventInfo","RHK for EventInfo"};
 
   // Number of turns in this lumi block
   unsigned int m_turnCounter;
@@ -86,7 +90,7 @@ class TrigLivefractionTool: public AthAlgTool, virtual public ITrigLivefractionT
   std::vector<float> m_livefractionLow;
 
   // Folder name
-  std::string m_deadtimeFolderName;
+  Gaudi::Property<std::string> m_deadtimeFolderName{this,"DeadtimeFolderName", ""}; 
 
   void fillVector(std::vector<float>& livevec, const coral::Blob& blob);
 
diff --git a/LumiBlock/LumiBlockComps/share/LumiBlockMuWriterExample.py b/LumiBlock/LumiBlockComps/share/LumiBlockMuWriterExample.py
deleted file mode 100644
index 1da119ea674..00000000000
--- a/LumiBlock/LumiBlockComps/share/LumiBlockMuWriterExample.py
+++ /dev/null
@@ -1,58 +0,0 @@
-from AthenaCommon.GlobalFlags  import globalflags
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as af
-af.FilesInput = [
-
-    "/afs/cern.ch/atlas/maxidisk/d36/lumiJuly2010/data10_7TeV.00152166.physics_MinBias.merge.AOD.r1239_p134_tid129143_00/AOD.129143._000120.pool.root.1"
-    
-                 ]
-
-af.EvtMax=-1 # number of event to process
-
-#======================================================================================
-
-# Adding a public version of our new tool which will read from EventInfo
-from LumiBlockComps.LumiBlockCompsConf import LumiBlockMuTool
-ToolSvc += LumiBlockMuTool("LumiBlockMuTool")
-
-from RecExConfig.RecFlags import rec
-rec.AutoConfiguration = ['everything']
-rec.readRDO = False
-rec.readESD = True
-rec.readAOD = True
-rec.doCBNT = False
-rec.doWriteESD = False
-rec.doWriteAOD = False
-rec.doWriteTAG = False
-rec.doDPD = True
-rec.doFileMetaData = True
-
-# Output log setting
-OutputLevel = INFO
-
-# main jobOption - must always be included
-include ("RecExCommon/RecExCommon_topOptions.py")
-
-# add LumiCalcMuWriter, should only be done in RAW->ESD transform
-from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault
-
-lumiTool = LuminosityToolDefault()
-lumiTool.OutputLevel = DEBUG
-ToolSvc += lumiTool
-
-from LumiBlockComps.LumiBlockCompsConf import LumiBlockMuWriter
-muWriter = LumiBlockMuWriter("LumiBlockMuWriter")
-muWriter.OutputLevel = DEBUG
-#muWriter.LuminosityTool = ToolSvc.LuminosityTool
-        
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-topSequence += muWriter
-
-# this switches off performance monitoring ntuples creation
-from PerfMonComps.PerfMonFlags import jobproperties as jp
-jp.PerfMonFlags.doMonitoring = False
-jp.PerfMonFlags.doFastMon = False
-
-
-
-
diff --git a/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py b/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py
deleted file mode 100644
index 0bf9391c7ac..00000000000
--- a/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py
+++ /dev/null
@@ -1,28 +0,0 @@
-""" Configuration for LumiBlockMuWriter to write mu from LumiDB into EventInfo
-"""
-#
-#
-__author__  = 'E.Torrrence'
-#
-# 
-# Configure folder access
-
-from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault
-lumiTool = LuminosityToolDefault()  # Also configures DB
-# lumiTool.OutputLevel = DEBUG
-from AthenaCommon.AppMgr import ToolSvc
-ToolSvc += lumiTool
-
-# Configure MuWriter algorithm
-from LumiBlockComps.LumiBlockCompsConf import LumiBlockMuWriter
-muWriter = LumiBlockMuWriter("LumiBlockMuWriter")
-muWriter.LuminosityTool = lumiTool;
-#muWriter.PileupLuminosityTag = "OflLumi-UPD2-005"
-
-# muWriter.OutputLevel = DEBUG
-
-# Add this to the top-level sequence
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-topSequence += muWriter
-
diff --git a/LumiBlock/LumiBlockComps/src/CreateLumiBlockCollectionFromFile.cxx b/LumiBlock/LumiBlockComps/src/CreateLumiBlockCollectionFromFile.cxx
index c79607ea0e6..d2784caa27b 100644
--- a/LumiBlock/LumiBlockComps/src/CreateLumiBlockCollectionFromFile.cxx
+++ b/LumiBlock/LumiBlockComps/src/CreateLumiBlockCollectionFromFile.cxx
@@ -7,8 +7,6 @@
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/IIncidentSvc.h"
 #include "GaudiKernel/IIoComponentMgr.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 #include "StoreGate/StoreGateSvc.h"
 
 #include "xAODLuminosity/LumiBlockRangeContainer.h"
@@ -37,7 +35,9 @@ StatusCode CreateLumiBlockCollectionFromFile::initialize(){
 //*******************************************************
 
   ATH_MSG_INFO( "initialize() and create listeners" );
-                                                                                 
+
+  ATH_CHECK(m_eventInfoKey.initialize());
+
   // Locate the StoreGateSvc and initialize our local ptr
   // ****************************************************
   ATH_CHECK( m_metaStore.retrieve() );
@@ -82,30 +82,36 @@ StatusCode CreateLumiBlockCollectionFromFile::execute() {
   ATH_MSG_VERBOSE( "execute()" );
 
   // Check for event header
-  const DataHandle<EventInfo> evt;
-  ATH_CHECK( evtStore()->retrieve(evt) );
-   if(m_lastRun!=evt->event_ID()->run_number() || 
-      m_lastLumiBlock!=evt->event_ID()->lumi_block()) { 
-
-       IOVTime iovtime(evt->event_ID()->run_number(),evt->event_ID()->lumi_block());
-       RLBMap::iterator mitr;
-       mitr=m_LumiBlockInfo.find(iovtime);
-       if (mitr==m_LumiBlockInfo.end()) {
-       ATH_MSG_INFO( "Fill LumiBlockInfo with numExpected="<<m_numExpected );
-       inOut lbInOut(m_numExpected,1);
-       m_LumiBlockInfo[iovtime] = lbInOut;
-       }
-       else {
-         m_LumiBlockInfo[iovtime].second++;
-       }
-   
-     m_lastRun=evt->event_ID()->run_number();
-     m_lastLumiBlock=evt->event_ID()->lumi_block();
-     m_lastIOVTime=iovtime;
-   }
-   else {
-     m_LumiBlockInfo[m_lastIOVTime].second++;
-   }
+  SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfoKey);
+
+  // check is only useful for serial running; remove when MT scheduler used
+  if(!evt.isValid()) {
+    ATH_MSG_FATAL("Failed to retrieve "<< m_eventInfoKey.key());
+    return StatusCode::FAILURE;
+  }
+
+  if(m_lastRun!=evt->runNumber() ||
+     m_lastLumiBlock!=evt->lumiBlock()) {
+
+    IOVTime iovtime(evt->runNumber(),evt->lumiBlock());
+    RLBMap::iterator mitr;
+    mitr=m_LumiBlockInfo.find(iovtime);
+    if (mitr==m_LumiBlockInfo.end()) {
+      ATH_MSG_INFO( "Fill LumiBlockInfo with numExpected="<<m_numExpected );
+      inOut lbInOut(m_numExpected,1);
+      m_LumiBlockInfo[iovtime] = lbInOut;
+    }
+    else {
+      m_LumiBlockInfo[iovtime].second++;
+    }
+
+    m_lastRun=evt->runNumber();
+    m_lastLumiBlock=evt->lumiBlock();
+    m_lastIOVTime=iovtime;
+  }
+  else {
+    m_LumiBlockInfo[m_lastIOVTime].second++;
+  }
   
   return (StatusCode::SUCCESS);
 }
diff --git a/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx b/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx
deleted file mode 100644
index 0d66d9f135e..00000000000
--- a/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LumiBlockComps/LumiBlockMuWriter.h"
-
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/PileUpEventInfo.h"
-
-#include "GaudiKernel/MsgStream.h"
-#include "AthenaKernel/errorcheck.h"
-
-//--------------------------------------------------
-LumiBlockMuWriter::LumiBlockMuWriter(const std::string& name, ISvcLocator* pSvcLocator):
-  AthAlgorithm(name,pSvcLocator),
-  m_lumiTool("LuminosityTool"),
-  m_writePileupEvents(false),
-  m_lumiDatabase("COOLOFL_TRIGGER/COMP200"),
-  m_lumiFolder("/TRIGGER/OFLLUMI/LBLESTOFL"),
-  m_lumiTag("OflLumi-UPD2-005"),
-  m_lumiChannel(0),
-  m_lumiDB(NULL)
-{
-  declareProperty("LuminosityTool", m_lumiTool);
-  declareProperty("WritePileupEvents", m_writePileupEvents);
-  declareProperty("PileupLuminosityDatabase", m_lumiDatabase);
-  declareProperty("PileupLuminosityFolder", m_lumiFolder);
-  declareProperty("PileupLuminosityTag", m_lumiTag);
-  declareProperty("PileupLuminosityChannel", m_lumiChannel);
-}
-
-StatusCode
-LumiBlockMuWriter::initialize() 
-{
-  ATH_MSG_INFO("LumiBlockMuWriter::initialize()");
-
-  // Get the luminosity tool
-  CHECK(m_lumiTool.retrieve());
-
-  ATH_MSG_INFO("LumiBlockMuWriter::initialize() done");
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-LumiBlockMuWriter::execute() 
-{
-  ATH_MSG_DEBUG("LumiBlockMuWriter::execute()");
-
-  const EventInfo* eventInfo_c=0;
-  CHECK(evtStore()->retrieve(eventInfo_c));
-
-  unsigned int lumiblock = eventInfo_c->event_ID()->lumi_block();
-  ATH_MSG_DEBUG(" lumiblock " << lumiblock);
-
-  // Try to write mu back into EventInfo
-  EventInfo* eventInfo=0;
-  eventInfo = const_cast<EventInfo*>(eventInfo_c);
-
-  if (eventInfo) {
-
-    // float avgmu = m_muToolDB->averageInteractionsPerCrossing();
-    // float instmu = m_muToolDB->actualInteractionsPerCrossing();
-
-    float avgmu = m_lumiTool->lbAverageInteractionsPerCrossing();
-    float instmu = 0.;
-
-    if (m_lumiTool->muToLumi() > 0.)
-      instmu = m_lumiTool->lbLuminosityPerBCID()/m_lumiTool->muToLumi(); 
-
-    eventInfo->setAverageInteractionsPerCrossing(avgmu);
-    eventInfo->setActualInteractionsPerCrossing(instmu);
-
-    ATH_MSG_DEBUG(" called eventInfo::setAverageInteractionsPerCrossing("<<avgmu<<")");
-    ATH_MSG_DEBUG(" called eventInfo::setActualInteractionsPerCrossing("<<instmu<<")");
-
-    // Some debugging
-    // float lbTime = m_lumiTool->lbDuration();
-    // ATH_MSG_DEBUG(" lbtime: " << lbTime);
-
-  } else {
-    ATH_MSG_WARNING(" cannot get non-const eventInfo pointer! ");
-  }
-
-  if (m_writePileupEvents) {
-
-    // Also try to write pile-up event info if it exists
-    const PileUpEventInfo* puEventInfo_c = 0;
-    CHECK(evtStore()->retrieve(puEventInfo_c));
-
-    PileUpEventInfo::SubEvent::const_iterator s = puEventInfo_c->beginSubEvt();
-    while (s != puEventInfo_c->endSubEvt()) {
-      if (s->type()==4){  // Zero bias events, only ones with 'luminosity'
-	
-	unsigned int run = s->pSubEvt->event_ID()->run_number();
-	unsigned int lb = s->pSubEvt->event_ID()->lumi_block();
-	ATH_MSG_INFO("ACH9 sub event of type 4 with run/lb:" << run << "/" << lb);
-	
-	CoolQuery::LumiFolderData lumi = this->getDBLuminosity(run, lb);
-	
-	// And write this into the pileup event header
-	s->pSubEvt->setAverageInteractionsPerCrossing(lumi.LBAvEvtsPerBX);
-	
-      }
-      ++s;
-    }
-  }
-
-  ATH_MSG_DEBUG("LumiBlockMuWriter::execute() done");
-  return StatusCode::SUCCESS;
-}
-
-// Hack to access offline luminosity folder for arbitrary run/LB IOV
-CoolQuery::LumiFolderData 
-LumiBlockMuWriter::getDBLuminosity(unsigned int run, unsigned int lb) {
-
-  CoolQuery::LumiFolderData lumi;
-
-  // First check if we have a DB connection established
-  if (m_lumiDB == NULL) {
-    m_lumiDB = new CoolQuery(m_lumiDatabase, std::string());
-    if (!m_lumiDB->openDbConn()) {
-      ATH_MSG_WARNING(" failed to open luminosity DB folder " << m_lumiDatabase);
-      delete m_lumiDB;
-      return lumi;
-    }
-  }
-
-  // Specify the IOV
-  cool::ValidityKey start = run;
-  start = (start<<32)+lb;
-  cool::ValidityKey end = run;
-  end = (end<<32) + lb + 1;
-
-  m_lumiDB->setIOV(start, end);
-
-  // And read the data
-  std::map<cool::ValidityKey, CoolQuery::LumiFolderData> lumiDataMap;
-  lumiDataMap.clear();
-  lumiDataMap = m_lumiDB->getLumiFolderData(m_lumiFolder, m_lumiTag, m_lumiChannel);
-  if (lumiDataMap.find(start) == lumiDataMap.end()) {
-    // Didn't find our IOV
-    ATH_MSG_WARNING(" failed to find luminosity for run/LB: " << run << "/" << lb);
-  }
-
-  return lumiDataMap[start];  // Will create default LumiFolderData if not found
-}
-
-StatusCode
-LumiBlockMuWriter::finalize() 
-{
-  ATH_MSG_DEBUG("LumiBlockMuWriter::finalize()");
-
-  if (m_lumiDB != NULL) delete m_lumiDB;
-
-  ATH_MSG_INFO("LumiBlockMuWriter::finalize() done");
-
-  return StatusCode::SUCCESS;
-}
-
diff --git a/LumiBlock/LumiBlockComps/src/LumiBlockTester.cxx b/LumiBlock/LumiBlockComps/src/LumiBlockTester.cxx
index 00e820711a3..db311e023f6 100644
--- a/LumiBlock/LumiBlockComps/src/LumiBlockTester.cxx
+++ b/LumiBlock/LumiBlockComps/src/LumiBlockTester.cxx
@@ -3,8 +3,6 @@
 */
 
 #include "LumiBlockComps/LumiBlockTester.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventInfo.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/errorcheck.h"
 
@@ -25,6 +23,8 @@ LumiBlockTester::initialize()
 {
   ATH_MSG_INFO("LumiBlockTester::initialize()");
 
+  ATH_CHECK(m_eventInfoKey.initialize());
+
   // Get the luminosity tool
   CHECK(m_lumiTool.retrieve());
 
@@ -44,11 +44,16 @@ LumiBlockTester::execute()
 {
   ATH_MSG_DEBUG("LumiBlockTester::execute()");
 
-  const EventInfo* eventInfo_c=0;
-  CHECK(evtStore()->retrieve(eventInfo_c));
+  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey);  
+
+  // only there for serial running; remove when only doing MT
+  if(!eventInfo.isValid()) {
+    ATH_MSG_FATAL("Failed to retrieve "<< m_eventInfoKey.key());
+    return StatusCode::FAILURE;
+  }
 
-  unsigned int lumiblock = eventInfo_c->event_ID()->lumi_block();
-  unsigned int bcid = eventInfo_c->event_ID()->bunch_crossing_id();
+  unsigned int lumiblock = eventInfo->lumiBlock();
+  unsigned int bcid = eventInfo->bcid();
 
   ATH_MSG_DEBUG(" lumiblock " << lumiblock << " BCID " << bcid);
 
@@ -69,8 +74,6 @@ LumiBlockTester::execute()
   instmu = m_muTool->actualInteractionsPerCrossing();
   ATH_MSG_INFO( "From muTool - <mu>: " << avgmu << " mu: " << instmu);
 
-  const EventInfo* eventInfo;
-  CHECK(evtStore()->retrieve(eventInfo));
   instmu = eventInfo->actualInteractionsPerCrossing();
   avgmu = eventInfo->averageInteractionsPerCrossing();
   ATH_MSG_INFO( "From EvInfo - <mu>: " << avgmu << " mu: " << instmu);
diff --git a/LumiBlock/LumiBlockComps/src/LuminosityTool.cxx b/LumiBlock/LumiBlockComps/src/LuminosityTool.cxx
index 1af08217284..bae3a202df4 100644
--- a/LumiBlock/LumiBlockComps/src/LuminosityTool.cxx
+++ b/LumiBlock/LumiBlockComps/src/LuminosityTool.cxx
@@ -6,10 +6,6 @@
 
 #include "LumiBlockComps/LuminosityTool.h"
 
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventType.h"
-
 #include "CoolKernel/IObject.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
@@ -70,6 +66,8 @@ LuminosityTool::initialize()
 {
   ATH_MSG_DEBUG("LuminosityTool::initialize() begin");
 
+  ATH_CHECK(m_eventInfoKey.initialize());
+
   ATH_MSG_INFO("LuminosityTool::initialize() registering " << m_lumiFolderName);
 
   // In addition to local, private callback functions, also set up callbacks to updateCache any time
@@ -206,16 +204,16 @@ LuminosityTool::lbLuminosityPerBCIDVector() {
 float
 LuminosityTool::lbLuminosityPerBCID() {
 
-  const EventInfo* eventInfo;
-  StatusCode sc = evtStore()->retrieve(eventInfo);
-  if (sc.isFailure()) {
-    ATH_MSG_WARNING( "Cannot access event info " );
-    return 0.;
+  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey);  
+  // check is only useful for serial running; remove when MT scheduler used
+  if(!eventInfo.isValid()) {
+    ATH_MSG_FATAL("Failed to retrieve "<< m_eventInfoKey.key());
+    return 0;
   }
 
-  float lumi = lbLuminosityPerBCID(eventInfo->event_ID()->bunch_crossing_id());
+  float lumi = lbLuminosityPerBCID(eventInfo->bcid());
 
-  ATH_MSG_DEBUG( "From DB, LB " << eventInfo->event_ID()->lumi_block() << " bcid " << eventInfo->event_ID()->bunch_crossing_id() << " -> " << lumi << " ub-1 s-1" );
+  ATH_MSG_DEBUG( "From DB, LB " << eventInfo->lumiBlock() << " bcid " << eventInfo->bcid() << " -> " << lumi << " ub-1 s-1" );
 
   return lumi;
 }
diff --git a/LumiBlock/LumiBlockComps/src/TrigLivefractionTool.cxx b/LumiBlock/LumiBlockComps/src/TrigLivefractionTool.cxx
index 755aa746d3c..947349c6c08 100644
--- a/LumiBlock/LumiBlockComps/src/TrigLivefractionTool.cxx
+++ b/LumiBlock/LumiBlockComps/src/TrigLivefractionTool.cxx
@@ -4,10 +4,6 @@
 
 #include "LumiBlockComps/TrigLivefractionTool.h"
 
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventType.h"
-
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
 
 #include "AthenaKernel/errorcheck.h"
@@ -22,15 +18,11 @@ TrigLivefractionTool::TrigLivefractionTool(const std::string& type,
 				 const IInterface* parent)
   : AthAlgTool(type, name, parent),
     m_recalcLumiLivefraction(true),
-    m_lumiTool(""), // "LuminosityTool"),
     m_turnCounter(0),
-    m_deadtimeFolderName(""), // "/TRIGGER/LUMI/PerBcidDeadtime"),
     m_lumiLiveFractionLo(1.),
     m_lumiLiveFractionHi(1.)
 {
   declareInterface<ITrigLivefractionTool>(this);
-  declareProperty("DeadtimeFolderName", m_deadtimeFolderName);
-  declareProperty("LuminosityTool", m_lumiTool);
 
   // Initialize to 1 so we don't have divide by zero if there is no data
   m_livefractionHigh = std::vector<float>(TOTAL_LHC_BCIDS, 1.);
@@ -41,6 +33,7 @@ StatusCode
 TrigLivefractionTool::initialize()
 {
   ATH_MSG_DEBUG("TrigLivefractionTool::initialize() begin");
+  ATH_CHECK(m_eventInfoKey.initialize());
 
   if (m_deadtimeFolderName.empty()) {
     // May not be configured, could be OK
@@ -110,16 +103,17 @@ TrigLivefractionTool::l1LivefractionVector(bool highPriority) const {
 float
 TrigLivefractionTool::livefractionPerBCID(bool highPriority) const {
 
-  const EventInfo* eventInfo;
-  StatusCode sc = evtStore()->retrieve(eventInfo);
-  if (sc.isFailure()) {
-    ATH_MSG_WARNING( "Cannot access event info " );
-    return 0.;
+  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey);  
+
+  // check is only useful for serial running; remove when MT scheduler used
+  if(!eventInfo.isValid()) {
+    ATH_MSG_FATAL("Failed to retrieve "<< m_eventInfoKey.key());
+    return 0;
   }
 
-  float frac = livefractionPerBCID(eventInfo->event_ID()->bunch_crossing_id(), highPriority);
+  float frac = livefractionPerBCID(eventInfo->bcid(), highPriority);
 
-  ATH_MSG_DEBUG( "LB " << eventInfo->event_ID()->lumi_block() << " bcid " << eventInfo->event_ID()->bunch_crossing_id() << " -> Livefrac = " << frac << " for highPriority = " << highPriority);
+  ATH_MSG_DEBUG( "LB " << eventInfo->lumiBlock() << " bcid " << eventInfo->bcid() << " -> Livefrac = " << frac << " for highPriority = " << highPriority);
 
   return frac;
 }
diff --git a/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx b/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx
index b1a196e09d6..780dd362d12 100644
--- a/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx
+++ b/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx
@@ -8,14 +8,12 @@
 #include "LumiBlockComps/LuminosityTool.h"
 #include "LumiBlockComps/TrigLivefractionTool.h"
 #include "LumiBlockComps/LumiCalcSvc.h"
-#include "LumiBlockComps/LumiBlockMuWriter.h"
 #include "LumiBlockComps/LumiBlockTester.h"
 #endif
 
 DECLARE_COMPONENT( CreateLumiBlockCollectionFromFile )
 //DECLARE_COMPONENT( CreateAANTFromLumiBlockCollection )
 #ifndef XAOD_ANALYSIS
-DECLARE_COMPONENT( LumiBlockMuWriter )
 DECLARE_COMPONENT( LumiBlockTester )
 DECLARE_COMPONENT( LumiBlockMuTool )
 DECLARE_COMPONENT( LuminosityTool )
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 06b2c54ad47..8745bcab373 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -653,15 +653,8 @@ if globalflags.InputFormat.is_bytestream():
         pass
     pass
 
-### write mu values into EventInfo
-if rec.doESD() and rec.readRDO() and not (globalflags.DataSource()=='geant4') and jobproperties.Beam.beamType()=="collisions" and not athenaCommonFlags.isOnline():
-    try:
-        include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py")
-    except Exception:
-        treatException("Could not load LumiBlockMuWriter_jobOptions.py")
-        pass
-#    muWriter.OutputLevel=DEBUG
-    pass
+### Writing of mu values to xAOD::EventInfo is done in the converter step;
+### It's no longer necessary to write it in the old EventInfo
 
 if rec.doMonitoring():
     try:
diff --git a/TileCalorimeter/TileRecAlgs/share/jobOptions_TileEventSelector.py b/TileCalorimeter/TileRecAlgs/share/jobOptions_TileEventSelector.py
index 4fb358263f1..c0a7ceab748 100644
--- a/TileCalorimeter/TileRecAlgs/share/jobOptions_TileEventSelector.py
+++ b/TileCalorimeter/TileRecAlgs/share/jobOptions_TileEventSelector.py
@@ -204,7 +204,7 @@ if not ReadESD:
         include.block("TrigT1CaloCalibTools/DecorateL1CaloTriggerTowers_prodJobOFragment.py")
 
 if 'ForceTimeStamp' in dir():
-    include.block("LumiBlockComps/LumiBlockMuWriter_jobOptions.py")
+    # include.block("LumiBlockComps/LumiBlockMuWriter_jobOptions.py") # this has been removed since not needed for xAOD::EventInfo
     include.block("RecBackgroundAlgs/RecBackground_jobOptions.py")
 
 
-- 
GitLab


From 1ff921ca7fca9e1a25eff0df391e9f4eeeea591f Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Tue, 26 Feb 2019 15:27:10 +0000
Subject: [PATCH 030/404] Remove CondHandle - hopefully this isn't needed
 anymore

---
 .../InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt     | 3 +--
 .../InDetPrepRawDataFormation/src/CacheCreator.cxx            | 1 -
 .../InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h | 4 ----
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
index 9616ab15a64..a08cf39d914 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
@@ -22,7 +22,6 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetRecTools/TRT_DriftCircleTool
-                          InnerDetector/InDetConditions/PixelConditionsData
                           InnerDetector/InDetConditions/SCT_ConditionsData
                           InnerDetector/InDetConditions/SiLorentzAngleSvc
                         )
@@ -31,7 +30,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_component( InDetPrepRawDataFormation
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests IRegionSelector Identifier GaudiKernel InDetRawData InDetPrepRawData SiClusterizationToolLib TrigSteeringEvent AtlasDetDescr InDetIdentifier InDetReadoutGeometry PixelConditionsData AthViews)
+                     LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests IRegionSelector Identifier GaudiKernel InDetRawData InDetPrepRawData SiClusterizationToolLib TrigSteeringEvent AtlasDetDescr InDetIdentifier InDetReadoutGeometry AthViews)
 
 # Install files from the package:
 atlas_install_headers( InDetPrepRawDataFormation )
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx
index ee0748889c0..d26095c7c55 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx
@@ -47,7 +47,6 @@ namespace InDet{
         ATH_CHECK( m_SCTSpacePointCacheKey.initialize(!m_SCTSpacePointCacheKey.key().empty()) );
         ATH_CHECK( m_SCTRDOCacheKey.initialize(!m_SCTRDOCacheKey.key().empty()) );
         ATH_CHECK( m_PixRDOCacheKey.initialize(!m_PixRDOCacheKey.key().empty()) );
-        ATH_CHECK( m_condKey5.initialize() );
         if(!m_disableTRT) ATH_CHECK(detStore()->retrieve(m_pTRTHelper  , "TRT_ID"));
         ATH_CHECK(detStore()->retrieve(m_sct_idHelper, "SCT_ID"));
         ATH_CHECK(detStore()->retrieve(m_pix_idHelper, "PixelID"));
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h
index 16cc736a056..68f35cd0316 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h
@@ -16,13 +16,11 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
 #include "InDetPrepRawData/SCT_ClusterContainer.h"
 #include "TrkSpacePoint/SpacePointContainer.h"
-#include "PixelConditionsData/PixelOfflineCalibData.h"
 #include "InDetRawData/SCT_RDO_Container.h"
 #include "InDetRawData/PixelRDO_Container.h"
 
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h" 
-#include "PixelConditionsData/SpecialPixelMap.h"
 
 class TRT_ID;
 class PixelID;
@@ -53,8 +51,6 @@ namespace InDet{
         bool m_disableTRT;
         mutable bool m_disableWarning;
 	//Temporary workarounds for problem in scheduler - remove later
-        SG::ReadCondHandleKey<PixelCalib::PixelOfflineCalibData> m_condKey5{ this, "PixelOfflineCalibData", "PixelOfflineCalibData", "" };
-        SG::ReadCondHandleKey<DetectorSpecialPixelMap> m_condKey12{ this, "SpecialPixelMap", "SpecialPixelMap", "" };
         bool isInsideView(const EventContext&) const;
         template<typename T>
         StatusCode createContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext& ) const;
-- 
GitLab


From 2d0c50f50ee3e506d8b01767d13f55f97fa73011 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Tue, 26 Feb 2019 15:36:36 +0000
Subject: [PATCH 031/404] Optimize PixelChargeInterpolationParameters with
 references

---
 .../PixelChargeInterpolationValidation.cxx    |  2 --
 .../PixelChargeInterpolationParameters.h      | 15 ++++++-----
 .../PixelOfflineCalibData.h                   |  2 +-
 .../src/PixelOfflineCalibData.cxx             | 26 +++++++++----------
 .../test/PixelOfflineCalibServiceTest.cxx     | 24 ++++++++---------
 5 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
index f938992e6dc..e367ce9048b 100644
--- a/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
+++ b/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/src/PixelChargeInterpolationValidation.cxx
@@ -50,8 +50,6 @@ PixelChargeInterpolationValidation::PixelChargeInterpolationValidation(std::stri
 	m_name(tag){
 
 	std::vector<float> *layers = getLayersBins();
-	std::vector<float> etabins = model.getEtaBins();
-	std::vector<float> phibins = model.getAngleBins();
 	std::vector<float> clustersizeEta = model.getClusterSizeYBins();
 	clustersizeEta.insert(clustersizeEta.begin(),0.5);
 	clustersizeEta.push_back(100);
diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelChargeInterpolationParameters.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelChargeInterpolationParameters.h
index a54dda2253b..4d59540aea0 100644
--- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelChargeInterpolationParameters.h
+++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelChargeInterpolationParameters.h
@@ -27,7 +27,8 @@ class PixelChargeInterpolationParameters {
 
   public: 
     PixelChargeInterpolationParameters();
-  ~PixelChargeInterpolationParameters(){};
+   ~PixelChargeInterpolationParameters() = default;
+    PixelChargeInterpolationParameters(const PixelChargeInterpolationParameters&) = delete;
 
     // get/set version number
     int getVersion() const;
@@ -80,10 +81,10 @@ class PixelChargeInterpolationParameters {
     int getNumberOfXbins() const;
     int getNumberOfYbins() const;
 
-    const std::vector<float> getEtaBins() const{return m_etabins;}
-    const std::vector<float> getAngleBins() const{return m_phibins;}
-    const std::vector<float> getClusterSizeXBins() const{return m_csx;}
-    const std::vector<float> getClusterSizeYBins() const{return m_csy;}
+    const std::vector<float>& getEtaBins() const{return m_etabins;}
+    const std::vector<float>& getAngleBins() const{return m_phibins;}
+    const std::vector<float>& getClusterSizeXBins() const{return m_csx;}
+    const std::vector<float>& getClusterSizeYBins() const{return m_csy;}
     
     void setParameters(const int ncsx, const int ncsy, const int neta, 
                        const int nalpha, int offset, std::vector<float> constants);
@@ -92,8 +93,8 @@ class PixelChargeInterpolationParameters {
     void Load(std::string filename);
 
     // IBL
-    const std::vector<float> getIBLEtaBins() const{return m_ibletabins;}
-    const std::vector<float> getIBLAngleBins() const{return m_iblphibins;}
+    const std::vector<float>& getIBLEtaBins() const{return m_ibletabins;}
+    const std::vector<float>& getIBLAngleBins() const{return m_iblphibins;}
     int getIBLcsxbins() const {return m_csxbinsibl;}
     int getIBLcsybins() const {return m_csybinsibl;}
     int getIBLetabins() const {return m_etaibl;}
diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelOfflineCalibData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelOfflineCalibData.h
index f69d4f659d4..f6b9af934b5 100644
--- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelOfflineCalibData.h
+++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/PixelOfflineCalibData.h
@@ -59,7 +59,7 @@ class PixelOfflineCalibData{
   int GetNumberOfConstants() const;
 
   std::vector<float> GetConstants() const;
-  void SetConstants(std::vector<float> constants);
+  void SetConstants(const std::vector<float> &constants);
 
   void Dump();
 
diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelOfflineCalibData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelOfflineCalibData.cxx
index 832c545168e..c5062503525 100644
--- a/InnerDetector/InDetConditions/PixelConditionsData/src/PixelOfflineCalibData.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsData/src/PixelOfflineCalibData.cxx
@@ -22,13 +22,13 @@ std::vector<float> PixelOfflineCalibData::GetConstants() const {
   int n1 = m_clustererrordata->getNumberOfBarrelBins(); 
   int n2 = m_clustererrordata->getNumberOfEndcapBins();
   // get the bins of the cluster on track error data parametrization 
-  const std::vector<float> csx = m_clusterontrackerrordata->getClusterSizeBinsX();
-  const std::vector<float> csy = m_clusterontrackerrordata->getClusterSizeBinsY();
-  const std::vector<float> eta = m_clusterontrackerrordata->getEtaBins();
-  const std::vector<float> alpha = m_clusterontrackerrordata->getIncidenceAngleBins();
+  const std::vector<float> &csx = m_clusterontrackerrordata->getClusterSizeBinsX();
+  const std::vector<float> &csy = m_clusterontrackerrordata->getClusterSizeBinsY();
+  const std::vector<float> &eta = m_clusterontrackerrordata->getEtaBins();
+  const std::vector<float> &alpha = m_clusterontrackerrordata->getIncidenceAngleBins();
   //IBL
-  const std::vector<float> etaibl = m_clusterontrackerrordata->getEtaIBLBins();
-  const std::vector<float> alphaibl = m_clusterontrackerrordata->getIncidenceAngleIBLBins();
+  const std::vector<float> &etaibl = m_clusterontrackerrordata->getEtaIBLBins();
+  const std::vector<float> &alphaibl = m_clusterontrackerrordata->getIncidenceAngleIBLBins();
   //
   // number of bins 
   // Since the upper value is always implicit, numer of bins is the size of the vector
@@ -41,13 +41,13 @@ std::vector<float> PixelOfflineCalibData::GetConstants() const {
   int netaibl = m_clusterontrackerrordata->getIBLetabins();
   int nalphaibl =m_clusterontrackerrordata->getIBLphibins(); 
   // get the bins of the charge interpolation parametrization 
-  const std::vector<float> csx2 = m_chargeinterpolationparameters->getClusterSizeXBins();
-  const std::vector<float> csy2 = m_chargeinterpolationparameters->getClusterSizeYBins();
-  const std::vector<float> eta2 = m_chargeinterpolationparameters->getEtaBins();
-  const std::vector<float> alpha2 = m_chargeinterpolationparameters->getAngleBins();
+  const std::vector<float> &csx2 = m_chargeinterpolationparameters->getClusterSizeXBins();
+  const std::vector<float> &csy2 = m_chargeinterpolationparameters->getClusterSizeYBins();
+  const std::vector<float> &eta2 = m_chargeinterpolationparameters->getEtaBins();
+  const std::vector<float> &alpha2 = m_chargeinterpolationparameters->getAngleBins();
   // IBL
-  const std::vector<float> etaibl2 =  m_chargeinterpolationparameters->getIBLEtaBins() ;
-  const std::vector<float> alphaibl2 = m_chargeinterpolationparameters->getIBLAngleBins() ;
+  const std::vector<float> &etaibl2 =  m_chargeinterpolationparameters->getIBLEtaBins() ;
+  const std::vector<float> &alphaibl2 = m_chargeinterpolationparameters->getIBLAngleBins() ;
   //
   // number of bins
   // The upper limit is not implicit, we must subtract one!
@@ -162,7 +162,7 @@ void PixelOfflineCalibData::Dump(){
   m_chargeinterpolationparameters->Print("PixelChargeInterpolationParametersDump.txt");
 }
 
-void PixelOfflineCalibData::SetConstants(std::vector<float> constants){ 
+void PixelOfflineCalibData::SetConstants(const std::vector<float> &constants){ 
 
   if(constants.at(0) > 0){    // old format
     m_clustererrordata->setVersion(0);
diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelOfflineCalibServiceTest.cxx b/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelOfflineCalibServiceTest.cxx
index 313163f9c7a..c67fcfc7e10 100644
--- a/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelOfflineCalibServiceTest.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelOfflineCalibServiceTest.cxx
@@ -156,12 +156,12 @@ StatusCode PixelOfflineCalibServiceTest::execute() {
 
     // PixelClusterOnTrackErrorData
     int v2 = m_pat->getPixelClusterOnTrackErrorData()->getVersion();
-    const std::vector<float> csx =m_pat->getPixelClusterOnTrackErrorData()->getClusterSizeBinsX();
-    const std::vector<float> csy =m_pat->getPixelClusterOnTrackErrorData()->getClusterSizeBinsY();
-    const std::vector<float> eta =m_pat->getPixelClusterOnTrackErrorData()->getEtaBins();
-    const std::vector<float> alpha = m_pat->getPixelClusterOnTrackErrorData()->getIncidenceAngleBins();
-    const std::vector<float> etaibl =  m_pat->getPixelClusterOnTrackErrorData()->getEtaIBLBins();
-    const std::vector<float> alphaibl =  m_pat->getPixelClusterOnTrackErrorData()->getIncidenceAngleIBLBins();
+    const std::vector<float> &csx =m_pat->getPixelClusterOnTrackErrorData()->getClusterSizeBinsX();
+    const std::vector<float> &csy =m_pat->getPixelClusterOnTrackErrorData()->getClusterSizeBinsY();
+    const std::vector<float> &eta =m_pat->getPixelClusterOnTrackErrorData()->getEtaBins();
+    const std::vector<float> &alpha = m_pat->getPixelClusterOnTrackErrorData()->getIncidenceAngleBins();
+    const std::vector<float> &etaibl =  m_pat->getPixelClusterOnTrackErrorData()->getEtaIBLBins();
+    const std::vector<float> &alphaibl =  m_pat->getPixelClusterOnTrackErrorData()->getIncidenceAngleIBLBins();
 
     int ncsx = csx.size();
     int ncsy = csy.size();
@@ -226,14 +226,14 @@ StatusCode PixelOfflineCalibServiceTest::execute() {
 
     // PixelChargeInterpolationData
     int v3 = m_pat->getPixelChargeInterpolationParameters()->getVersion();
-    const std::vector<float> csx2 = m_pat->getPixelChargeInterpolationParameters()->getClusterSizeXBins();
-    const std::vector<float> csy2 = m_pat->getPixelChargeInterpolationParameters()->getClusterSizeYBins();
-    const std::vector<float> eta2 = m_pat->getPixelChargeInterpolationParameters()->getEtaBins();
-    const std::vector<float> alpha2 = m_pat->getPixelChargeInterpolationParameters()->getAngleBins();
+    const std::vector<float> &csx2 = m_pat->getPixelChargeInterpolationParameters()->getClusterSizeXBins();
+    const std::vector<float> &csy2 = m_pat->getPixelChargeInterpolationParameters()->getClusterSizeYBins();
+    const std::vector<float> &eta2 = m_pat->getPixelChargeInterpolationParameters()->getEtaBins();
+    const std::vector<float> &alpha2 = m_pat->getPixelChargeInterpolationParameters()->getAngleBins();
     // IBL
-    const std::vector<float> etaibl2 = m_pat->getPixelChargeInterpolationParameters()->getIBLEtaBins() ;
+    const std::vector<float> &etaibl2 = m_pat->getPixelChargeInterpolationParameters()->getIBLEtaBins() ;
 
-    const std::vector<float> alphaibl2 = m_pat->getPixelChargeInterpolationParameters()->getIBLAngleBins() ;
+    const std::vector<float> &alphaibl2 = m_pat->getPixelChargeInterpolationParameters()->getIBLAngleBins() ;
     //
     // number of bins
     // The upper limit is not implicit, we must subtract one!
-- 
GitLab


From 9820640f89bf47def21b03d6aa4e4ce70a857e7b Mon Sep 17 00:00:00 2001
From: Marcin Nowak <Marcin.Nowak@cern.ch>
Date: Tue, 26 Feb 2019 16:44:40 +0100
Subject: [PATCH 032/404] Make TagInfoMgr read runNumber from
 context.conditionsRun for HLT

---
 Event/EventInfoMgt/src/TagInfoMgr.cxx | 30 +++++++++++++++++++--------
 Event/EventInfoMgt/src/TagInfoMgr.h   |  3 +++
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/Event/EventInfoMgt/src/TagInfoMgr.cxx b/Event/EventInfoMgt/src/TagInfoMgr.cxx
index c421e3e6274..1609c6ff919 100755
--- a/Event/EventInfoMgt/src/TagInfoMgr.cxx
+++ b/Event/EventInfoMgt/src/TagInfoMgr.cxx
@@ -35,6 +35,7 @@
 #include "AthenaPoolUtilities/CondAttrListCollAddress.h"
 #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h"
 #include "CxxUtils/make_unique.h"
+#include "AthenaKernel/ExtendedEventContext.h"
 
 // Gaudi includes
 #include "GaudiKernel/IIncidentSvc.h"
@@ -55,6 +56,7 @@ TagInfoMgr::TagInfoMgr(const std::string &name,
         m_iovDbSvc("IOVDbSvc", name),
         m_metaDataTool("IOVDbMetaDataTool"),
         m_isFirstBeginRun(true),
+        m_conditionsRun(EventIDBase::UNDEFNUM),
         m_newFileIncidentSeen(false),
         m_lastIOVRange(IOVRange(IOVTime(),IOVTime())),
         m_log(msgSvc(), name)
@@ -487,7 +489,7 @@ TagInfoMgr::fillMetaData   (const TagInfo* tagInfo, const CondAttrListCollection
     if (m_log.level() <= MSG::DEBUG) m_log << MSG::DEBUG << "entering fillMetaData" << endmsg;
 
     // Get run number for IOV
-    unsigned int runNumber = 0;
+    EventIDBase::number_type runNumber = 0;
     const EventIDBase* evid = EventIDFromStore( m_storeGate );
     if( evid ) {
        runNumber = evid->run_number();
@@ -495,8 +497,13 @@ TagInfoMgr::fillMetaData   (const TagInfo* tagInfo, const CondAttrListCollection
        // For simulation, we may be in the initialization phase and
        // must get the run number from the event selector
        if (StatusCode::SUCCESS != getRunNumber (runNumber)) {
+          // For HLT use the conditionsRun retrieved from the first BeginRun incident
+          if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
+             runNumber = m_conditionsRun;
+          } else {
              m_log << MSG::ERROR << "fillMetaData:  Could not get event info neither via retrieve nor from the EventSelectror" << endmsg;      
              return (StatusCode::FAILURE);
+          }
        }
     }
     // Copy tags to AttributeList
@@ -672,25 +679,30 @@ TagInfoMgr::handle(const Incident& inc) {
         // reset flags 
         m_newFileIncidentSeen = false;
 
+        // get conditionsRun from the Context - can be used if no EventID in the SG (for HLT) 
+        m_conditionsRun = inc.context().getExtension<Atlas::ExtendedEventContext>().conditionsRun();
+
         // Print out EventInfo
         // can't use a ref here!
         const EventIDBase eventID =  inc.context().eventID();
 
         if (m_log.level() <= MSG::DEBUG) {
-            m_log << MSG::DEBUG << "handle: BeginRun incident - Event info: " << endmsg;
-            m_log << MSG::DEBUG << "handle: Event ID: ["
+            m_log << MSG::DEBUG << "handle: First BeginRun incident - Event ID: ["
                   << eventID.run_number()   << ","
                   << eventID.event_number() << ":"
-                  << eventID.time_stamp() << "] "
-                  << endmsg;
+                  << eventID.time_stamp() << "] ";
+            if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
+               m_log << MSG::DEBUG <<"conditionsRun = " << m_conditionsRun;
+            }
+            m_log << MSG::DEBUG << endmsg;
         }
-        
+
         // For the moment, we must set IOVDbSvc into the BeginRun
         // state to be able to access TagInfo from the file meta data
 
         // create IOV time from current event coming in with BeginRun incident
-        unsigned int run = eventID.run_number();
-        unsigned int lb  = eventID.lumi_block();
+        EventIDBase::number_type  run = eventID.run_number();
+        EventIDBase::number_type  lb  = eventID.lumi_block();
         IOVTime curTime;
         curTime.setRunEvent(run, lb);
 
@@ -744,7 +756,7 @@ TagInfoMgr::handle(const Incident& inc) {
             if (m_log.level() <= MSG::DEBUG) m_log << MSG::DEBUG << "handle: Requested IOVDbSvc to register callback" << endmsg;
         }
     }
-    else if (inc.type() == "BeginRun") {
+    else if (inc.type() == IncidentType::BeginRun) {
         // For subsequent BeginRuns, check whether the /TagInfo folder
         // exists, and if so return. We only treat the case where
         // TagInfo is coming in with each event. In this case we fill
diff --git a/Event/EventInfoMgt/src/TagInfoMgr.h b/Event/EventInfoMgt/src/TagInfoMgr.h
index 51eb17a333c..6099805bd0a 100755
--- a/Event/EventInfoMgt/src/TagInfoMgr.h
+++ b/Event/EventInfoMgt/src/TagInfoMgr.h
@@ -221,6 +221,9 @@ private:
     /// Flag to identify the first BeginRun incident
     bool                           m_isFirstBeginRun;
 
+    /// conditionsRun from the first BeginRun incident (HLT)
+    EventIDBase::number_type       m_conditionsRun;
+
     /// Flag to identify a new file incident
     bool                           m_newFileIncidentSeen;
 
-- 
GitLab


From ef8d64e5f2c1d93f17d233e625d692e76c39ce02 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Tue, 26 Feb 2019 09:49:18 -0600
Subject: [PATCH 033/404] Don't add things directly to the AthOutSeq

---
 .../AthenaPoolMultiTest/share/EventSplitDecision_jo.py          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
index 6bcfdb06b1a..4e0910ba9d5 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/EventSplitDecision_jo.py
@@ -101,7 +101,7 @@ StreamAll.TakeItemsFromInput = True
 StreamAll.ForceRead=TRUE
 
 # Add the outputstreams to the execution sequence
-athOutSeq+=StreamAll
+#athOutSeq+=StreamAll
 
 #--------------------------------------------------------------
 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
-- 
GitLab


From 632dd3fb23b50b184861b068f57a9d592dc13628 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 26 Feb 2019 17:15:58 +0100
Subject: [PATCH 034/404] corrected apparent mistake

---
 DetectorDescription/RegionSelector/python/RegSelConfig.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/DetectorDescription/RegionSelector/python/RegSelConfig.py b/DetectorDescription/RegionSelector/python/RegSelConfig.py
index 504d020394f..1f5090299f6 100644
--- a/DetectorDescription/RegionSelector/python/RegSelConfig.py
+++ b/DetectorDescription/RegionSelector/python/RegSelConfig.py
@@ -148,6 +148,7 @@ if __name__ == "__main__":
     
 
     ConfigFlags.Input.Files = defaultTestFiles.RAW    
+    ConfigFlags.Input.isMC = False
     ConfigFlags.dump()
     ConfigFlags.lock()
 
@@ -165,7 +166,7 @@ if __name__ == "__main__":
     cfg.merge(TrigBSReadCfg( ConfigFlags ))
     
     
-    acc,regSel = regSelCfg( ConfigFlags )
+    acc = regSelCfg( ConfigFlags )
     cfg.merge( acc )
 
 
-- 
GitLab


From 073ae96ec431b2b0b4ddb819e321e9bc237f4f55 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Tue, 26 Feb 2019 16:44:24 +0000
Subject: [PATCH 035/404] Add new job options to run muon reco from ESD, +
 associated ART tests in serial and one thread mode.

---
 .../share/RecExRecoTest_ART_muons_fromESD.py  | 101 ++++++++++++++++++
 .../test/test_recexreco_art_muons_fromesd.sh  |  12 +++
 ...ecexreco_art_muons_fromesd_MT_oneThread.sh |   8 ++
 3 files changed, 121 insertions(+)
 create mode 100644 Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
 create mode 100755 Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd.sh
 create mode 100755 Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh

diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
new file mode 100644
index 00000000000..f0113bfbb22
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
@@ -0,0 +1,101 @@
+from MuonRecExample.MuonRecFlags import muonRecFlags
+from RecExConfig.RecFlags import rec
+from RecExConfig.RecAlgsFlags import recAlgs
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+from MuonRecExample.MuonStandaloneFlags import muonStandaloneFlags
+
+## flag to set number of events to be processed
+EvtMax = 10
+
+#--------------------------------------------------------------------------------
+# Input
+#--------------------------------------------------------------------------------
+athenaCommonFlags.FilesInput = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root"]
+## flag for running in mig5
+doMig5 = False
+
+# in Standalone mode, don't allow any configuration errors
+athenaCommonFlags.AllowIgnoreConfigError = False
+
+# configure flags so that only Muon Standalone reco is run
+import MuonRecExample.MuonRecStandaloneOnlySetup
+
+#import MuonCombinedRecExample.MuonCombinedRecOnlySetup 
+from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
+
+from MuonRecExample import MuonRecUtils
+from MuonRecExample.MuonRecUtils import assertCastorStager,hasJobPropertyBeenSet
+
+#Need the beam spot for the TrackParticleCreator
+if not ('conddb' in dir()):
+    IOVDbSvc = Service("IOVDbSvc")
+    from IOVDbSvc.CondDB import conddb
+conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList")
+
+from AthenaCommon.AlgSequence import AthSequencer
+condSeq = AthSequencer("AthCondSeq")
+if not hasattr(condSeq, "BeamSpotCondAlg"):
+   from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
+   condSeq += BeamSpotCondAlg( "BeamSpotCondAlg" )
+
+#ToolSvc += MDTCablingDbTool 
+import MuonCnvExample.MuonCablingConfig
+
+#--------------------------------------------------------------------------------
+# Output
+#--------------------------------------------------------------------------------
+muonRecFlags.doCalibNtuple = False # write calibration ntuple?
+###
+
+#Set to false, because re-reco of muon truth does not work. Lock it because downstream python alters its value to True otherwise.
+rec.doTruth.set_Value_and_Lock(False)
+
+rec.doTrigger = False
+
+muonRecFlags.doStandalone.set_Value_and_Lock(True)
+muonRecFlags.doTrackPerformance    = True
+muonRecFlags.TrackPerfSummaryLevel = 2
+muonRecFlags.TrackPerfDebugLevel   = 5
+muonRecFlags.doCSCs                = True
+muonRecFlags.doNSWNewThirdChain    = True
+
+# flags to tweak standalone muon reconstruction
+if doMig5:
+    muonStandaloneFlags.doSegmentsOnly       = False
+    muonStandaloneFlags.patternsOnly         = False
+    muonStandaloneFlags.createTrackParticles = False
+
+muonStandaloneFlags.printSummary         = True
+muonCombinedRecFlags.doTrackPerformance  = True
+muonCombinedRecFlags.doMuGirl            = True
+muonCombinedRecFlags.printSummary        = True
+
+
+##### no more flags after this line #####
+try:
+    include("MuonRecExample/MuonRec_topOptions.py")
+    ###### put any user finetuning after this line #####
+
+
+    ##### DO NOT ADD ANYTHING AFTER THIS LINE #####
+except:
+    # print the stacktrace (saving could fail, and would then obscure the real problem)
+    import traceback
+    print traceback.format_exc().rstrip()
+    
+    # always write config so far for debugging
+    from AthenaCommon.ConfigurationShelve import saveToAscii
+    saveToAscii("config.txt")
+    # add DetFlags
+    from MuonRecExample.MuonRecUtils import dumpDetFlags
+    dumpDetFlags("config.txt")
+    # but still exit with error
+    import sys
+    sys.exit(10)
+else:
+    # and write config to include user changes after topOptions
+    from AthenaCommon.ConfigurationShelve import saveToAscii
+    saveToAscii("config.txt")
+    # add DetFlags
+    from MuonRecExample.MuonRecUtils import dumpDetFlags
+    dumpDetFlags("config.txt")
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd.sh
new file mode 100755
index 00000000000..d0924c5818b
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# art-description: Athena runs topoclustering from an ESD file
+# art-type: grid
+# art-include: 21.0/Athena
+# art-include: 21.0-TrigMC/Athena
+# art-include: master/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+
+athena RecExRecoTest/RecExRecoTest_ART_muons_fromESD.py
+echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh
new file mode 100755
index 00000000000..38a1a7c6d9c
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_muons_fromesd_MT_oneThread.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# art-description: Athena runs topoclustering from an ESD file
+# art-type: grid
+# art-include: master/Athena
+
+athena --threads=1 RecExRecoTest/RecExRecoTest_ART_muons_fromESD.py
+echo "art-result: $?"
-- 
GitLab


From ee3c8e59f65f7aaa7e65401ddc755adb6188a691 Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <gemmeren@anl.gov>
Date: Tue, 26 Feb 2019 11:30:15 -0600
Subject: [PATCH 036/404] Fix qtest for new index navigation (not yet used).

---
 Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp b/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp
index dedcc116ab9..e8ddfc32857 100644
--- a/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp
+++ b/Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp
@@ -56,7 +56,7 @@ DbStatus RootTreeIndexContainer::writeObject(TransactionStack::value_type& ent)
    if (m_index_ref != nullptr && s >= m_index_ref->GetEntries()) {
       *m_index = this->nextRecordId();
       m_index_ref->SetAddress(m_index);
-      if (this->isBranchContainer()) m_index_ref->Fill();
+      if( isBranchContainer() && !m_treeFillMode ) m_index_ref->Fill();
    }
    if( isBranchContainer() && !m_treeFillMode ) m_tree->SetEntries(s);
    DbStatus status = RootTreeContainer::writeObject(ent);
-- 
GitLab


From 54011f898a11dc570cfba0118a0b5ebc38660c14 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 26 Feb 2019 18:33:14 +0100
Subject: [PATCH 037/404] little cleanup of AthenaMT code

---
 .../python/HLTMenuConfig/Menu/HLTCFConfig.py  |  26 ----
 .../HLTMenuConfig/Menu/MenuComponents.py      | 126 ------------------
 2 files changed, 152 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index e131666ca92..bece7d71b2d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -25,27 +25,6 @@ def makeSummary(name, flatDecisions):
     return summary
 
 
-def makeStreamESD(name, flatDecisions):
-    """ Creates output stream for given decisions """
-    import AthenaPoolCnvSvc.WriteAthenaPool
-    from OutputStreamAthenaPool.OutputStreamAthenaPool import  createOutputStream
-    StreamESD = createOutputStream(name,"myESD.pool.root",True)
-    StreamESD.OutputLevel=3
-    from AthenaCommon.AlgSequence import AlgSequence
-    topSequence = AlgSequence()
-    topSequence.remove( StreamESD )
-    def addTC(name):   
-        StreamESD.ItemList += [ "xAOD::TrigCompositeContainer#"+name, "xAOD::TrigCompositeAuxContainer#"+name+"Aux." ]
-
-    for tc in flatDecisions:
-        addTC( tc )
-
-    addTC("HLTSummary")
-    log.debug("ESD file content: ")
-    log.debug( StreamESD.ItemList  )
-    return StreamESD
-
-
 def createStepRecoNode(name, seq_list, dump=False):
     """ elementary HLT reco step, contianing all sequences of the step """
 
@@ -166,10 +145,6 @@ def makeHLTTree(HLTChains, triggerConfigHLT = None):
     flatDecisions=[]
     for step in finalDecisions: flatDecisions.extend (step)
     summary= makeSummary("TriggerSummaryFinal", flatDecisions)
-    #from TrigOutputHandling.TrigOutputHandlingConf import HLTEDMCreator
-    #edmCreator = HLTEDMCreator()    
-    #edmCreator.TrigCompositeContainer = flatDecisions
-    #summary.OutputTools= [ edmCreator ]
     hltTop += summary
 
     # add signature monitor
@@ -182,7 +157,6 @@ def makeHLTTree(HLTChains, triggerConfigHLT = None):
     monAcc, monAlg = triggerMonitoringCfg( ConfigFlags, hypos, l1decoder[0] )
     monAcc.appendToGlobals()    
     hltTop += monAlg
-    #hltTop += makeStreamESD("StreamESD", flatDecisions)
     
     topSequence += hltTop
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index b9fc1072f79..aa253f8944d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -253,32 +253,6 @@ def isFilterAlg(alg):
     return isinstance(alg, RoRSeqFilter)
 
 
-class WrappedList:
-    def __init__(self, lst):
-        self._lst = lst
-    def __getitem__(self, item):
-        return self._lst[item]
-    def __setitem__(self, item):
-        return self._lst.append(item)
-
-
-#class duplicatedHypos(WrappedList):
-
-## allAlgs={}
-## def useExisting(name):
-##     global allAlgs
-##     return allAlgs[name]
-
-## def AlgExisting(name):
-##     global allAlgs
-##     return name in allAlgs
-
-
-## def remember(name, instance):
-##     global allAlgs
-##     allAlgs[name] = instance
-##     return instance
-
 
 ##########################################################
 # NOW sequences and chains
@@ -607,105 +581,5 @@ class RecoFragmentsPool:
             return cls.fragments[requestHash]
 
 
-class NJMenuSequence( ComponentAccumulator ):
-    def __init__( self, name ):
-        super( NJMenuSequence, self ).__init__()
-        from AthenaCommon.CFElements import seqAND
-        self.name = name
-        self.mainSeq = seqAND( name )
-        self.addSequence( self.mainSeq )
-        self.filterAlg =  None
-        self.reco = None
-        self.hypoAlg = None
-
-    def addReco( self, reco ):
-        """ Adds reconstruction sequence, has to be one of InViewReco or InEventReco objects """
-        assert self.filterAlg, "The filter alg has to be setup first"
-        self.reco = reco
-        reco.addInputFromFilter( self.filterAlg )
-        self.addSequence( reco.sequence(), self.mainSeq.name() )
-        self.merge( reco )
-
-    def addFilter( self, chains, inKey ):
-        """ adds filter alg of type RoRSeqFilter, output key is predefined by the sequence name as: Filtered + the name"""
-        from DecisionHandling.DecisionHandlingConf import RoRSeqFilter
-        self.filterAlg = RoRSeqFilter( self.name+'Filter' )
-        self.filterAlg.Input       = [ inKey ]
-        self.filterAlg.Output      = [ 'Filtered_'+self.name ]
-        self.filterAlg.Chains      = chains
-        from AthenaCommon.Constants import DEBUG
-        self.filterAlg.OutputLevel = DEBUG
-        self.addEventAlgo( self.filterAlg, self.mainSeq.name() )
-
-    def hypoDecisions( self ):
-        return "Decisions_"+self.name
-
-    def addHypo( self, hypo ):
-        self.hypoAlg = hypo
-        self.hypoAlg.HypoInputDecisions = self.reco.inputMaker().InputMakerOutputDecisions[-1]
-        self.hypoAlg.HypoOutputDecisions = self.hypoDecisions()
-        self.addEventAlgo( hypo, self.mainSeq.name() )
-
-    def sequence( self ):
-        return self.mainSeq
-
-    def filter( self ):
-        return self.filterAlg
-
-    def check( self ):
-        assert self.filterAlg, "Filter not configured"
-        assert self.hypoAlg, "Hypo alg is not configured"
-
-
-class HLTMenuAccumulator( ComponentAccumulator ):
-    def __init__( self ):
-        super( HLTMenuAccumulator, self ).__init__()
-        from AthenaCommon.CFElements import seqAND
-        HLTSteps =  seqAND( "HLTSteps" )
-        self.addSequence( HLTSteps )
-
-    def __getOrMakeStepSequence(self, step, isFilter = False ):
-       """ Constructs sequence for the step, the filtering step or, reco step will be created depending on isFilter flags
-
-       The function assures that all previous steps are aready in place i.e. HLTStep_1_filter, HLTStep_1 ... until HLTStep_N-1 are in place.
-       Therefore the steps can be added in any order (not yet sure if that will but better assure robustness now)
-       """
-       from AthenaCommon.CFElements import parOR
-       name = "HLTStep_%d%s" % (step, "_filters" if isFilter else "" )
-
-       s  = self.getSequence( name )
-       if s:
-           return s
-       # make sure that sequences for previous steps are in place
-       for p in range( 1, step ):
-           self.__getOrMakeStepSequence( p, isFilter = True )
-           self.__getOrMakeStepSequence( p, isFilter = False )
-       # make sure that filtering steps is placed before reco steps
-       if not isFilter:
-           self.__getOrMakeStepSequence( step, isFilter = True )
-       s = parOR( name )
-       self.addSequence( s, parentName="HLTSteps")
-       return s
-
-
-    def setupSteps( self, steps ):
-        """ The main menu function, it is responsible for crateion of step sequences and placing slice specific sequencers there.
-
-        It would rely on the MenuSeq object API in two aspects, to obtain filter alg and to obtain the reco sequence
-        The MenuSeq should already contain all the chains that are needed for the menu setup (chains info can be accessed via flags passed when steps were created)
-        """
-        for stepNo, fhSeq in enumerate( steps, 1 ):
-            filterStep = self.__getOrMakeStepSequence( stepNo, isFilter = True )
-            filterStep += fhSeq.filter() # FilterHypoSequence API
-
-            recoStep = self.__getOrMakeStepSequence( stepNo, isFilter = False )
-            self.addSequence( fhSeq.sequence(), recoStep.name() )
-
-
-    def steps( self ):
-        """ returns step seqeuncers """
-        return self.getSequence("HLTSteps")
-
-
 def getChainStepName(chainName, stepNumber):
     return '{}_step{}'.format(chainName, stepNumber)
-- 
GitLab


From 6514a3db626bd1aebaaa66a4265e286437ea91a0 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 18 Feb 2019 15:01:35 +0100
Subject: [PATCH 038/404] Move CscDigitizationTool out of CscOverlay Algorithm

Having `CscOverlay` own and call the tools which create its inputs causes
the MT scheduling code to get think there is a dependency error. For this
reason it is better to call `CscDigitizationTool` from a separate
`CscDigitBuilder` Algorithm which can run before `CscOverlay`.
---
 .../share/MuonOverlay_jobOptions.py                    |  1 +
 .../CSC_Digitization/python/CSC_DigitizationConfig.py  | 10 +++++++---
 .../python/CSC_DigitizationConfigDb.py                 |  5 +++--
 MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt |  1 -
 .../MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h     |  2 --
 .../MuonOverlay/CscOverlay/python/CscOverlayConfig.py  |  1 -
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx          | 10 ----------
 7 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
index b288231c84f..6eea4a9a977 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
@@ -33,6 +33,7 @@ if DetFlags.overlay.MDT_on() or DetFlags.overlay.CSC_on() or DetFlags.overlay.RP
         include("MuonCnvExample/MuonReadBS_jobOptions.py")
 
     if DetFlags.overlay.CSC_on():
+        job += CfgGetter.getAlgorithm("CscOverlayDigitBuilder")
         job += CfgGetter.getAlgorithm("CscOverlay")
         if not overlayFlags.isDataOverlay():
             job += CfgGetter.getAlgorithm("CscTruthOverlay")
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfig.py
index 9adf4b92eda..aa8aefa876e 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfig.py
@@ -26,7 +26,7 @@ def getCscRange(name="CscRange", **kwargs):
     return CfgMgr.PileUpXingFolder(name, **kwargs)
 
 
-def CscDigitizationTool(name="CscDigitizationTool", **kwargs):
+def getCscDigitizationTool(name="CscDigitizationTool", **kwargs):
     if jobproperties.Digitization.doXingByXingPileUp(): # PileUpTool approach
         # This should match the range for the CSC in Simulation/Digitization/share/MuonDigitization.py 
         kwargs.setdefault("FirstXing", CSC_FirstXing() ) 
@@ -45,10 +45,14 @@ def CscDigitizationTool(name="CscDigitizationTool", **kwargs):
 
     return CfgMgr.CscDigitizationTool(name, **kwargs)
 
-def Csc_OverlayDigitizationTool(name="Csc_OverlayDigitizationTool",**kwargs):
+def getCscOverlayDigitizationTool(name="CscOverlayDigitizationTool",**kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
     kwargs.setdefault("EvtStore", overlayFlags.evtStore())
     kwargs.setdefault("OutputObjectName",overlayFlags.evtStore()+"+CSC_DIGITS")
     if not overlayFlags.isDataOverlay():
         kwargs.setdefault("CSCSimDataCollectionOutputName",overlayFlags.evtStore()+"+CSC_SDO")
-    return CscDigitizationTool(name,**kwargs)
+    return CfgMgr.CscDigitizationTool(name,**kwargs)
+
+def getCscOverlayDigitBuilder(name="CscOverlayDigitBuilder", **kwargs):
+    kwargs.setdefault("DigitizationTool","CscOverlayDigitizationTool")
+    return CfgMgr.CscDigitBuilder(name,**kwargs)
diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigDb.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigDb.py
index f79021dbd8d..5c655be0bad 100644
--- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigDb.py
+++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigDb.py
@@ -2,6 +2,7 @@
 
 from AthenaCommon.CfgGetter import addTool
 
-addTool("CSC_Digitization.CSC_DigitizationConfig.CscDigitizationTool" , "CscDigitizationTool") 
-addTool("CSC_Digitization.CSC_DigitizationConfig.Csc_OverlayDigitizationTool" , "Csc_OverlayDigitizationTool")
+addTool("CSC_Digitization.CSC_DigitizationConfig.getCscDigitizationTool" , "CscDigitizationTool")
+addTool("CSC_Digitization.CSC_DigitizationConfig.getCscOverlayDigitizationTool" , "CscOverlayDigitizationTool")
+addTool("CSC_Digitization.CSC_DigitizationConfig.getCscOverlayDigitBuilder" , "CscOverlayDigitBuilder")
 addTool("CSC_Digitization.CSC_DigitizationConfig.getCscRange"         , "CscRange")
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
index 4fdc2018cc2..e08fb1349fd 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
@@ -8,7 +8,6 @@ atlas_subdir( CscOverlay )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaKernel
-                          Control/PileUpTools
                           GaudiKernel
                           MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools
                           MuonSpectrometer/MuonCnv/MuonCSC_CnvTools
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index d22064bfeb1..abc8b118dd4 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
@@ -16,7 +16,6 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonOverlayBase/MuonOverlayBase.h"
 #include "MuonDigToolInterfaces/IMuonDigitizationTool.h"
-#include "PileUpTools/IPileUpTool.h"
 
 #include "MuonRDO/CscRawDataContainer.h"
 
@@ -100,7 +99,6 @@ private:
 
   const CscIdHelper   * m_cscHelper{nullptr};
   ToolHandle<ICscCalibTool> m_cscCalibTool{this, "CalibTool", "CscCalibTool", ""};
-  ToolHandle<IPileUpTool> m_digTool{this, "DigitizationTool", "CscDigitizationTool", ""};
   ToolHandle<IMuonDigitizationTool> m_rdoTool2{this, "MakeRDOTool2", "CscDigitToCscRDOTool2", ""};
   ToolHandle<IMuonDigitizationTool> m_rdoTool4{this, "MakeRDOTool4", "CscDigitToCscRDOTool4", ""};
   PublicToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool{this, "CscRdoDecoderTool", "Muon::CscRDO_Decoder", ""};
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
index 4be3e3aa0db..448a9c1d3b0 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
@@ -4,7 +4,6 @@ def getCscOverlay(name="CscOverlay", **kwargs):
     kwargs.setdefault("InputDataRDOKey", overlayFlags.dataStore()+"+CSCRDO")
     kwargs.setdefault("InputOverlayRDOKey", overlayFlags.evtStore()+"+CSCRDO")
     kwargs.setdefault("OutputContainerKey", "StoreGateSvc+CSCRDO")
-    kwargs.setdefault("DigitizationTool", "Csc_OverlayDigitizationTool")
     kwargs.setdefault("MakeRDOTool2", "CscDigitToCscRDOTool2")
     kwargs.setdefault("MakeRDOTool4", "CscDigitToCscRDOTool4")
     kwargs.setdefault("MCStore", overlayFlags.evtStore())
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index 1358ced7a0f..855856ac037 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -40,9 +40,6 @@ StatusCode CscOverlay::overlayInitialize()
   // get cscRdoDecoderTool
   ATH_CHECK(m_cscRdoDecoderTool.retrieve());
 
-  ATH_CHECK(m_digTool.retrieve());
-  ATH_MSG_DEBUG("Retrieved CSC Digitization Tool.");
-
   ATH_CHECK(m_rdoTool2.retrieve());
   ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 2.");
 
@@ -84,13 +81,6 @@ StatusCode CscOverlay::overlayExecute() {
     numsamples=inputDataRDO->begin()->numSamples();
   }
 
-  /** in the simulation stream, run digitization of the fly
-      and make RDO - this will be used as input to the overlay job */
-  if ( m_digTool->processAllSubEvents().isFailure() ) {
-     ATH_MSG_WARNING("On the fly CSC digitization failed ");
-     return StatusCode::SUCCESS;
-  }
-
   if (numsamples==2) {
     if ( m_rdoTool2->digitize().isFailure() ) {
       ATH_MSG_WARNING("On the fly CSC Digit -> RDO 2 failed ");
-- 
GitLab


From fc8abd37b0a5299f3ffd1fca137b8c253936139d Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 18 Feb 2019 16:06:13 +0100
Subject: [PATCH 039/404] Add new CscOverlayDigitToRDO Algorithm to convert
 signal CSC Digits to CSC RDOs

Moved signal CSC Digit to CSC RDO conversion from `CscOverlay` to a separate
`CscOverlayDigitToRDO` Algorithm. Currently this is just a copy-paste of the old
code, but it would be useful to know the circumstances which determine whether
`numSamples` is two or four. Perhaps this can be configured at the python level.
This would remove the need to check the background `CscRawDataContainer` to
determine how the signal CSC Digits should be processed.

Standardized `CscOverlay` input/ouput property naming at the same time.
---
 .../share/MuonOverlay_jobOptions.py           |  1 +
 .../CscOverlay/CscOverlay/CscOverlay.h        | 14 ++--
 .../CscOverlay/CscOverlayDigitToRDO.h         | 30 ++++++++
 .../CscOverlay/python/CscOverlayConfig.py     | 18 +++--
 .../CscOverlay/python/CscOverlayConfigDb.py   |  1 +
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx | 76 +++++--------------
 .../CscOverlay/src/CscOverlayDigitToRDO.cxx   | 68 +++++++++++++++++
 .../src/components/CscOverlay_entries.cxx     |  2 +
 8 files changed, 141 insertions(+), 69 deletions(-)
 create mode 100644 MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
 create mode 100644 MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
index 6eea4a9a977..3089e0fda30 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
@@ -34,6 +34,7 @@ if DetFlags.overlay.MDT_on() or DetFlags.overlay.CSC_on() or DetFlags.overlay.RP
 
     if DetFlags.overlay.CSC_on():
         job += CfgGetter.getAlgorithm("CscOverlayDigitBuilder")
+        job += CfgGetter.getAlgorithm("CscOverlayDigitToRDO")
         job += CfgGetter.getAlgorithm("CscOverlay")
         if not overlayFlags.isDataOverlay():
             job += CfgGetter.getAlgorithm("CscTruthOverlay")
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index abc8b118dd4..6db76848f52 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
@@ -15,7 +15,6 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonOverlayBase/MuonOverlayBase.h"
-#include "MuonDigToolInterfaces/IMuonDigitizationTool.h"
 
 #include "MuonRDO/CscRawDataContainer.h"
 
@@ -41,9 +40,8 @@ public:
   CscOverlay(const std::string &name,ISvcLocator *pSvcLocator);
 
   /** Framework implemenrtation for the event loop */
-  virtual StatusCode overlayInitialize();
-  virtual StatusCode overlayExecute();
-  virtual StatusCode overlayFinalize();
+  virtual StatusCode overlayInitialize() override final;
+  virtual StatusCode execute() override final;
 
   /** given 2 container of data - zero bias real data and the simulation,
       do the merging */
@@ -92,15 +90,13 @@ private:
   // jO controllable properties.
   // "Main" containers are read, have data from "overlay" containers added,
   // and written out with the original SG keys.
-  SG::ReadHandleKey<CscRawDataContainer> m_inputDataRDOKey{this,"InputDataRDOKey","OriginalEvent_SG+CSCRDO",""};
-  SG::ReadHandleKey<CscRawDataContainer> m_inputOverlayRDOKey{this,"InputOverlayRDOKey","BkgEvent_0_SG+CSCRDO",""};
-  SG::WriteHandleKey<CscRawDataContainer> m_outputContainerKey{this,"OutputContainerKey","StoreGateSvc+CSCRDO",""};
+  SG::ReadHandleKey<CscRawDataContainer> m_bkgInputKey{this,"BkgInputKey","OriginalEvent_SG+CSCRDO",""};
+  SG::ReadHandleKey<CscRawDataContainer> m_signalInputKey{this,"SignalInputKey","BkgEvent_0_SG+CSCRDO",""};
+  SG::WriteHandleKey<CscRawDataContainer> m_outputKey{this,"OutputKey","StoreGateSvc+CSCRDO",""};
 
 
   const CscIdHelper   * m_cscHelper{nullptr};
   ToolHandle<ICscCalibTool> m_cscCalibTool{this, "CalibTool", "CscCalibTool", ""};
-  ToolHandle<IMuonDigitizationTool> m_rdoTool2{this, "MakeRDOTool2", "CscDigitToCscRDOTool2", ""};
-  ToolHandle<IMuonDigitizationTool> m_rdoTool4{this, "MakeRDOTool4", "CscDigitToCscRDOTool4", ""};
   PublicToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool{this, "CscRdoDecoderTool", "Muon::CscRDO_Decoder", ""};
 
   ServiceHandle <IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"};      // Random number service
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
new file mode 100644
index 00000000000..7a5c08d5d11
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef CSCOVERLAY_CSCOVERLAYDIGITTORDO_H
+#define CSCOVERLAY_CSCOVERLAYDIGITTORDO_H
+
+#include <string>
+
+#include "GaudiKernel/ToolHandle.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "MuonDigToolInterfaces/IMuonDigitizationTool.h"
+
+#include "MuonRDO/CscRawDataContainer.h"
+
+class CscOverlayDigitToRDO : public AthAlgorithm  {
+public:
+  CscOverlayDigitToRDO(const std::string &name, ISvcLocator *pSvcLocator);
+  virtual ~CscOverlayDigitToRDO() = default;
+  /** Framework implemenrtation for the event loop */
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
+
+private:
+  SG::ReadHandleKey<CscRawDataContainer> m_inputBkgRDOKey{this,"InputBkgRDOKey","OriginalEvent_SG+CSCRDO",""};
+  ToolHandle<IMuonDigitizationTool> m_rdoTool2{this, "MakeRDOTool2", "CscDigitToCscRDOTool2", ""};
+  ToolHandle<IMuonDigitizationTool> m_rdoTool4{this, "MakeRDOTool4", "CscDigitToCscRDOTool4", ""};
+};
+
+#endif/*CSCOVERLAY_CSCOVERLAYDIGITTORDO_H*/
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
index 448a9c1d3b0..5d764734e12 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
@@ -1,13 +1,21 @@
 
 def getCscOverlay(name="CscOverlay", **kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
-    kwargs.setdefault("InputDataRDOKey", overlayFlags.dataStore()+"+CSCRDO")
-    kwargs.setdefault("InputOverlayRDOKey", overlayFlags.evtStore()+"+CSCRDO")
-    kwargs.setdefault("OutputContainerKey", "StoreGateSvc+CSCRDO")
-    kwargs.setdefault("MakeRDOTool2", "CscDigitToCscRDOTool2")
-    kwargs.setdefault("MakeRDOTool4", "CscDigitToCscRDOTool4")
+    kwargs.setdefault("BkgInputKey", overlayFlags.dataStore()+"+CSCRDO")
+    kwargs.setdefault("SignalInputKey", overlayFlags.evtStore()+"+CSCRDO")
+    kwargs.setdefault("OutputKey", "StoreGateSvc+CSCRDO")
     kwargs.setdefault("MCStore", overlayFlags.evtStore())
     kwargs.setdefault("DataStore", overlayFlags.dataStore())
 
     from AthenaCommon import CfgMgr
     return CfgMgr.CscOverlay(name,**kwargs)
+
+
+def getCscOverlayDigitToRDO(name="CscOverlayDigitToRDO", **kwargs):
+    from OverlayCommonAlgs.OverlayFlags import overlayFlags
+    kwargs.setdefault("InputBkgRDOKey", overlayFlags.dataStore()+"+CSCRDO")
+    kwargs.setdefault("MakeRDOTool2", "CscDigitToCscRDOTool2")
+    kwargs.setdefault("MakeRDOTool4", "CscDigitToCscRDOTool4")
+
+    from AthenaCommon import CfgMgr
+    return CfgMgr.CscOverlayDigitToRDO(name,**kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
index 34eabc4ad87..5e224e49d71 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
@@ -1,2 +1,3 @@
 from AthenaCommon.CfgGetter import addAlgorithm
 addAlgorithm("CscOverlay.CscOverlayConfig.getCscOverlay", "CscOverlay")
+addAlgorithm("CscOverlay.CscOverlayConfig.getCscOverlayDigitToRDO", "CscOverlayDigitToRDO")
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index 855856ac037..c11953ab6f3 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -28,7 +28,7 @@ CscOverlay::CscOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
 //================================================================
 StatusCode CscOverlay::overlayInitialize()
 {
-  ATH_MSG_INFO("CscOverlay initialized");
+  ATH_MSG_DEBUG("CscOverlay initialized");
 
   /** access to the CSC Identifier helper */
   ATH_CHECK(detStore()->retrieve(m_cscHelper, "CSCIDHELPER"));
@@ -40,79 +40,45 @@ StatusCode CscOverlay::overlayInitialize()
   // get cscRdoDecoderTool
   ATH_CHECK(m_cscRdoDecoderTool.retrieve());
 
-  ATH_CHECK(m_rdoTool2.retrieve());
-  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 2.");
-
-  ATH_CHECK(m_rdoTool4.retrieve());
-  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 4.");
-
   //random number initialization
   ATH_CHECK(m_rndmSvc.retrieve());
 
-  ATH_CHECK( m_inputDataRDOKey.initialize() );
-  ATH_CHECK( m_inputOverlayRDOKey.initialize() );
-  ATH_CHECK( m_outputContainerKey.initialize() );
-
-  return StatusCode::SUCCESS;
-}
+  ATH_CHECK( m_bkgInputKey.initialize() );
+  ATH_CHECK( m_signalInputKey.initialize() );
+  ATH_CHECK( m_outputKey.initialize() );
 
-//================================================================
-StatusCode CscOverlay::overlayFinalize()
-{
-  ATH_MSG_INFO("CscOverlay finalized");
   return StatusCode::SUCCESS;
 }
 
 //================================================================
-StatusCode CscOverlay::overlayExecute() {
+StatusCode CscOverlay::execute() {
   ATH_MSG_DEBUG("CscOverlay::execute() begin");
   //----------------------------------------------------------------
   unsigned int numsamples=0;//to be determined from the data
-  SG::ReadHandle<CscRawDataContainer> inputDataRDO(m_inputDataRDOKey);
-  if(!inputDataRDO.isValid()) {
-    ATH_MSG_WARNING("Could not get data CscRawDataContainer  \"" << inputDataRDO.name() << "\" in " << inputDataRDO.store());
+  SG::ReadHandle<CscRawDataContainer> inputBkgRDO(m_bkgInputKey);
+  if(!inputBkgRDO.isValid()) {
+    ATH_MSG_WARNING("Could not get background CscRawDataContainer  \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
     return StatusCode::SUCCESS;
   }
-  ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputDataRDO.name() << "\" in " << inputDataRDO.store());
-  if ((inputDataRDO->begin()==inputDataRDO->end()) || !*(inputDataRDO->begin())){
-        ATH_MSG_WARNING("Could not get nsamples, inputDataRDO empty?");
-  }
-  else{
-    numsamples=inputDataRDO->begin()->numSamples();
-  }
-
-  if (numsamples==2) {
-    if ( m_rdoTool2->digitize().isFailure() ) {
-      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 2 failed ");
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_DEBUG("Digitizing with 2 samples");
-  }
-  else if (numsamples==4) {
-    if ( m_rdoTool4->digitize().isFailure() ) {
-      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 4 failed ");
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_DEBUG("Digitizing with 4 samples");
+  ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
+  if ((inputBkgRDO->begin()==inputBkgRDO->end()) || !*(inputBkgRDO->begin())){
+        ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
   }
   else{
-    ATH_MSG_WARNING("On the fly CSC Digit -> RDO failed - not 2 or 4 samples!");
-    //return StatusCode::SUCCESS;
+    numsamples=inputBkgRDO->begin()->numSamples();
   }
 
   if (numsamples>0) {
-    ATH_MSG_DEBUG("Retrieving MC input CSC container");
-    SG::ReadHandle<CscRawDataContainer> inputOverlayRDO(m_inputOverlayRDOKey);
-    if(!inputOverlayRDO.isValid()) {
-      ATH_MSG_WARNING("Could not get overlay CscRawDataContainer \"" << inputOverlayRDO.name() << "\" in " << inputOverlayRDO.store());
+    ATH_MSG_DEBUG("Retrieving signal input CSC container");
+    SG::ReadHandle<CscRawDataContainer> inputSignalRDO(m_signalInputKey);
+    if(!inputSignalRDO.isValid()) {
+      ATH_MSG_WARNING("Could not get signal CscRawDataContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
       return StatusCode::SUCCESS;
     }
-    ATH_MSG_VERBOSE("Found CscRawOverlayContainer \"" << inputOverlayRDO.name() << "\" in " << inputOverlayRDO.store());
+    ATH_MSG_VERBOSE("Found CscRawOverlayContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
 
-    /* now do the overlay - reading real data from the data stream
-       and reading simulated RDO produced in the previous steps
-       from the simulation stream */
-    this->overlayContainer(inputDataRDO.cptr(), inputOverlayRDO.cptr());
+    /* now do the overlay */
+    this->overlayContainer(inputBkgRDO.cptr(), inputSignalRDO.cptr());
   }
 
   //----------------------------------------------------------------
@@ -126,9 +92,9 @@ void CscOverlay::overlayContainer(const CscRawDataContainer *main,
 {
   ATH_MSG_DEBUG("overlayContainer<>() begin");
 
-  SG::WriteHandle<CscRawDataContainer> outputContainer(m_outputContainerKey);
+  SG::WriteHandle<CscRawDataContainer> outputContainer(m_outputKey);
   if (outputContainer.record(std::make_unique<CscRawDataContainer>()).isFailure()) {
-    ATH_MSG_ERROR("Failed to record " << m_outputContainerKey);
+    ATH_MSG_ERROR("Failed to record " << m_outputKey);
   }
 
   /** Add data from the main container to the output one */
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx
new file mode 100644
index 00000000000..90650f03d82
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "CscOverlay/CscOverlayDigitToRDO.h"
+
+#include "StoreGate/ReadHandle.h"
+
+//================================================================
+CscOverlayDigitToRDO::CscOverlayDigitToRDO(const std::string &name, ISvcLocator *pSvcLocator) :
+  AthAlgorithm(name, pSvcLocator)
+{
+}
+
+//================================================================
+StatusCode CscOverlayDigitToRDO::initialize()
+{
+  ATH_MSG_INFO("CscOverlayDigitToRDO initialized");
+
+  ATH_CHECK(m_rdoTool2.retrieve());
+  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 2.");
+
+  ATH_CHECK(m_rdoTool4.retrieve());
+  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 4.");
+
+  ATH_CHECK( m_inputBkgRDOKey.initialize() );
+  return StatusCode::SUCCESS;
+}
+
+//================================================================
+StatusCode CscOverlayDigitToRDO::execute() {
+  ATH_MSG_DEBUG("CscOverlayDigitToRDO::execute() begin");
+  //----------------------------------------------------------------
+  unsigned int numsamples=0;//to be determined from the data
+  SG::ReadHandle<CscRawDataContainer> inputBkgRDO(m_inputBkgRDOKey);
+  if(!inputBkgRDO.isValid()) {
+    ATH_MSG_WARNING("Could not get background CscRawDataContainer  \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
+    return StatusCode::SUCCESS;
+  }
+  ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
+  if ((inputBkgRDO->begin()==inputBkgRDO->end()) || !*(inputBkgRDO->begin())){
+        ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
+  }
+  else{
+    numsamples=inputBkgRDO->begin()->numSamples();
+  }
+
+  if (numsamples==2) {
+    if ( m_rdoTool2->digitize().isFailure() ) {
+      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 2 failed ");
+      return StatusCode::SUCCESS;
+    }
+    ATH_MSG_DEBUG("Digitizing with 2 samples");
+  }
+  else if (numsamples==4) {
+    if ( m_rdoTool4->digitize().isFailure() ) {
+      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 4 failed ");
+      return StatusCode::SUCCESS;
+    }
+    ATH_MSG_DEBUG("Digitizing with 4 samples");
+  }
+  else{
+    ATH_MSG_WARNING("On the fly CSC Digit -> RDO failed - not 2 or 4 samples!");
+    //return StatusCode::SUCCESS;
+  }
+  ATH_MSG_DEBUG("CscOverlayDigitToRDO::execute() end");
+  return StatusCode::SUCCESS;
+}
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
index d7d673cb4a2..b2c1d874a32 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
@@ -1,4 +1,6 @@
 #include "CscOverlay/CscOverlay.h"
+#include "CscOverlay/CscOverlayDigitToRDO.h"
 
 DECLARE_COMPONENT( CscOverlay )
+DECLARE_COMPONENT( CscOverlayDigitToRDO )
 
-- 
GitLab


From 6d398381e60dc83a6becb3969a52653d09135de9 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 18 Feb 2019 16:53:37 +0100
Subject: [PATCH 040/404] Drop dependency of CscOverlay on MuonOverlayBase

---
 MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt    | 3 +--
 .../MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h        | 8 ++++----
 .../MuonOverlay/CscOverlay/python/CscOverlayConfig.py     | 2 --
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx             | 4 ++--
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
index e08fb1349fd..811d08d73c0 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CMakeLists.txt
@@ -11,7 +11,6 @@ atlas_depends_on_subdirs( PUBLIC
                           GaudiKernel
                           MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools
                           MuonSpectrometer/MuonCnv/MuonCSC_CnvTools
-                          MuonSpectrometer/MuonOverlay/MuonOverlayBase
                           MuonSpectrometer/MuonRDO
                           PRIVATE
                           Control/StoreGate
@@ -26,7 +25,7 @@ atlas_add_component( CscOverlay
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel MuonOverlayBase MuonRDO StoreGateLib SGtests MuonIdHelpersLib )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaKernel GaudiKernel MuonRDO StoreGateLib SGtests MuonIdHelpersLib )
 
 # Install files from the package:
 atlas_install_headers( CscOverlay )
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index 6db76848f52..4d612fd64cf 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
@@ -11,10 +11,9 @@
 #ifndef CSCOVERLAY_CSCOVERLAY_H
 #define CSCOVERLAY_CSCOVERLAY_H
 
-#include <string>
 
 #include "GaudiKernel/ToolHandle.h"
-#include "MuonOverlayBase/MuonOverlayBase.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
 
 #include "MuonRDO/CscRawDataContainer.h"
 
@@ -24,6 +23,7 @@
 #include "AthenaKernel/IAthRNGSvc.h"
 
 #include <vector>
+#include <string>
 #include <map>
 
 class CscIdHelper;
@@ -34,13 +34,13 @@ namespace CLHEP {
   class HepRandomEngine;
 }
 
-class CscOverlay : public MuonOverlayBase  {
+class CscOverlay : public AthAlgorithm {
 public:
 
   CscOverlay(const std::string &name,ISvcLocator *pSvcLocator);
 
   /** Framework implemenrtation for the event loop */
-  virtual StatusCode overlayInitialize() override final;
+  virtual StatusCode initialize() override final;
   virtual StatusCode execute() override final;
 
   /** given 2 container of data - zero bias real data and the simulation,
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
index 5d764734e12..76e1333a632 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
@@ -4,8 +4,6 @@ def getCscOverlay(name="CscOverlay", **kwargs):
     kwargs.setdefault("BkgInputKey", overlayFlags.dataStore()+"+CSCRDO")
     kwargs.setdefault("SignalInputKey", overlayFlags.evtStore()+"+CSCRDO")
     kwargs.setdefault("OutputKey", "StoreGateSvc+CSCRDO")
-    kwargs.setdefault("MCStore", overlayFlags.evtStore())
-    kwargs.setdefault("DataStore", overlayFlags.dataStore())
 
     from AthenaCommon import CfgMgr
     return CfgMgr.CscOverlay(name,**kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index c11953ab6f3..9a4faae036c 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -21,12 +21,12 @@ constexpr uint16_t MAX_AMPL = 4095; // 12-bit ADC
 
 //================================================================
 CscOverlay::CscOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
-  MuonOverlayBase(name, pSvcLocator)
+  AthAlgorithm(name, pSvcLocator)
 {
 }
 
 //================================================================
-StatusCode CscOverlay::overlayInitialize()
+StatusCode CscOverlay::initialize()
 {
   ATH_MSG_DEBUG("CscOverlay initialized");
 
-- 
GitLab


From 8cc0275d064ca801053ee09a893e44008d01c950 Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <gemmeren@anl.gov>
Date: Tue, 26 Feb 2019 16:10:00 -0600
Subject: [PATCH 041/404] Clean up unused files from RootFileTools.

---
 .../AthenaPOOL/RootFileTools/CMakeLists.txt   |  38 --
 .../IRootFileTransformationsTool.h            |  43 --
 .../RootFileTools/RootFileToolsDict.h         |  10 -
 .../RootFileTools/RootFileTools/selection.xml |   3 -
 .../RootFileTools/python/__init__.py          |   2 -
 .../RootFileTools/python/changeSplit.py       |   8 -
 .../AthenaPOOL/RootFileTools/python/full.py   |  15 -
 .../AthenaPOOL/RootFileTools/python/order.py  |  66 --
 .../RootFileTools/share/optimizeBS.py         |  81 ---
 .../RootFileTools/share/orderFile.py          |  70 --
 .../RootFileTools/share/showTrees.py          |  61 --
 .../RootFileTools/src/FilterAndMergeD3PD.cxx  | 415 ------------
 .../RootFileTools/src/HistoPile.cxx           | 118 ----
 .../AthenaPOOL/RootFileTools/src/HistoPile.h  |  63 --
 .../AthenaPOOL/RootFileTools/src/Makefile     |  37 --
 .../src/RootFileTransformationsTool.cxx       | 111 ----
 .../src/RootFileTransformationsTool.h         |  44 --
 .../RootFileTools/src/checkCache.cxx          |  57 --
 .../AthenaPOOL/RootFileTools/src/cobs.cxx     | 624 ------------------
 Database/AthenaPOOL/RootFileTools/src/cobs.h  |  68 --
 .../RootFileTransformations_entries.cxx       |   5 -
 .../RootFileTools/src/mergeD3PD.cxx           | 406 ------------
 .../RootFileTools/src/releaseFileCache.cxx    |  31 -
 23 files changed, 2376 deletions(-)
 delete mode 100644 Database/AthenaPOOL/RootFileTools/RootFileTools/IRootFileTransformationsTool.h
 delete mode 100644 Database/AthenaPOOL/RootFileTools/RootFileTools/RootFileToolsDict.h
 delete mode 100644 Database/AthenaPOOL/RootFileTools/RootFileTools/selection.xml
 delete mode 100644 Database/AthenaPOOL/RootFileTools/python/__init__.py
 delete mode 100644 Database/AthenaPOOL/RootFileTools/python/changeSplit.py
 delete mode 100644 Database/AthenaPOOL/RootFileTools/python/full.py
 delete mode 100644 Database/AthenaPOOL/RootFileTools/python/order.py
 delete mode 100755 Database/AthenaPOOL/RootFileTools/share/optimizeBS.py
 delete mode 100755 Database/AthenaPOOL/RootFileTools/share/orderFile.py
 delete mode 100755 Database/AthenaPOOL/RootFileTools/share/showTrees.py
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/FilterAndMergeD3PD.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/HistoPile.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/HistoPile.h
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/Makefile
 delete mode 100755 Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.cxx
 delete mode 100755 Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.h
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/checkCache.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/cobs.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/cobs.h
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/components/RootFileTransformations_entries.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/mergeD3PD.cxx
 delete mode 100644 Database/AthenaPOOL/RootFileTools/src/releaseFileCache.cxx

diff --git a/Database/AthenaPOOL/RootFileTools/CMakeLists.txt b/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
index e017c0b459f..b33ff5d69af 100644
--- a/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
+++ b/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
@@ -19,48 +19,10 @@ find_package( ROOT COMPONENTS RIO Core Tree MathCore Hist pthread )
 # action releaseFileCache "$(cpp_name) $(src)releaseFileCache.cxx -o $(bin)releaseFileCache.exe;mkdir -p $(CMTINSTALLAREA)/$(tag)/bin; cd $(CMTINSTALLAREA)/$(tag)/bin;rm -f releaseFileCache.exe; ln -s ../../../Database/AthenaPOOL/RootFileTools/$(tag)/releaseFileCache.exe releaseFileCache.exe "
 
 # Component(s) in the package:
-atlas_add_library( RootFileToolsLib
-                   src/cobs.cxx
-                   src/RootFileTransformationsTool.cxx
-                   src/HistoPile.cxx
-                   PUBLIC_HEADERS RootFileTools
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES GaudiKernel
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps PersistentDataModel )
-
-atlas_add_component( RootFileTools
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
-
-atlas_add_dictionary( RootFileToolsDict
-                      RootFileTools/RootFileToolsDict.h
-                      RootFileTools/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
-
 atlas_add_executable( mergePOOL
                       src/merge.cxx
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                       LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
 
-atlas_add_executable( mergeD3PD
-                      src/mergeD3PD.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
-
-atlas_add_executable( checkCache
-                      src/checkCache.cxx
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
-
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
-atlas_install_scripts( share/orderFile.py share/optimizeBS.py share/showTrees.py )
-
-# Aliases:
-atlas_add_alias( optimizeBasketsSizes "optimizeBS.py" )
-atlas_add_alias( orderFile "orderFile.py" )
-atlas_add_alias( mergeD3PD "mergeD3PD.exe" )
-atlas_add_alias( showTrees "showTrees.py" )
-
diff --git a/Database/AthenaPOOL/RootFileTools/RootFileTools/IRootFileTransformationsTool.h b/Database/AthenaPOOL/RootFileTools/RootFileTools/IRootFileTransformationsTool.h
deleted file mode 100644
index 68e66229b44..00000000000
--- a/Database/AthenaPOOL/RootFileTools/RootFileTools/IRootFileTransformationsTool.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ROOTFILETOOLS_IROOTFILETRANSFORMATIONSTOOL_H
-#define ROOTFILETOOLS_IROOTFILETRANSFORMATIONSTOOL_H
-/** @file RootFileTransformationsTool.cxx
- *  @brief Tool to call RootFileTransformations to optimise output files
- *  @author Gerhard Brandt <gbrandt@cern.ch>
- *  $Id:  $
- **/
-
-#include "GaudiKernel/IAlgTool.h"
-
-/** @file RootFileTransformationsTool.cxx
- *  @brief Tool to call RootFileTransformations to optimise output files
- **/
-class IRootFileTransformationsTool : virtual public IAlgTool {
-
-public:    
-   /// Gaudi boilerplate
-   static const InterfaceID& interfaceID();
-
-   /// Initialize AlgTool
-   virtual StatusCode initialize() = 0;
-   /// Finalize AlgTool
-   virtual StatusCode finalize() = 0;
-   
-   // Reorder Baskets
-   virtual StatusCode reorderBaskets(std::string, std::string) = 0;
-   
-   // Resize Baskets
-   virtual StatusCode resizeBaskets(std::string, std::string, std::string, std::string, int, float) = 0;
-
-};
-
-inline const InterfaceID& IRootFileTransformationsTool::interfaceID() {
-   static const InterfaceID IID("IRootFileTransformationsTool", 1, 0);
-   return IID;
-}
-
-#endif
-
diff --git a/Database/AthenaPOOL/RootFileTools/RootFileTools/RootFileToolsDict.h b/Database/AthenaPOOL/RootFileTools/RootFileTools/RootFileToolsDict.h
deleted file mode 100644
index 172df8e7bc6..00000000000
--- a/Database/AthenaPOOL/RootFileTools/RootFileTools/RootFileToolsDict.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ROOTFILETOOLSDICT_H
-#define ROOTFILETOOLSDICT_H
-
-#include "src/cobs.h"
-
-#endif 
diff --git a/Database/AthenaPOOL/RootFileTools/RootFileTools/selection.xml b/Database/AthenaPOOL/RootFileTools/RootFileTools/selection.xml
deleted file mode 100644
index 12923255d55..00000000000
--- a/Database/AthenaPOOL/RootFileTools/RootFileTools/selection.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<lcgdict>
-	<class name="cobs" /> 
-</lcgdict>
diff --git a/Database/AthenaPOOL/RootFileTools/python/__init__.py b/Database/AthenaPOOL/RootFileTools/python/__init__.py
deleted file mode 100644
index 74583d364ec..00000000000
--- a/Database/AthenaPOOL/RootFileTools/python/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
diff --git a/Database/AthenaPOOL/RootFileTools/python/changeSplit.py b/Database/AthenaPOOL/RootFileTools/python/changeSplit.py
deleted file mode 100644
index 8ffb574a854..00000000000
--- a/Database/AthenaPOOL/RootFileTools/python/changeSplit.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import AthenaPython.PyAthena as PyAthena
-trans = PyAthena.cobs('/data/ilija/AOD.067184.big.pool.root','/data/ilija/split0.pool.root')
-# trans.mkProject()
-
-trans.setSplitLevel(0)
-trans.changeSplitLevel()
\ No newline at end of file
diff --git a/Database/AthenaPOOL/RootFileTools/python/full.py b/Database/AthenaPOOL/RootFileTools/python/full.py
deleted file mode 100644
index 854a5fde0d7..00000000000
--- a/Database/AthenaPOOL/RootFileTools/python/full.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-import AthenaPython.PyAthena as PyAthena
-trans = PyAthena.cobs('/data/ilija/AOD.067184.big.pool.root','/data/ilija/tmp.pool.root')
-# trans.mkProject()
-
-# resizing BS and adding CL=7
-trans.setTreeToSkip('##Links')
-trans.setTreeToSkip('##Shapes')
-trans.setTreeToSkip('##Params')
-trans.setTreeMemory(10*1024,'POOLContainer_DataHeader')
-trans.resizeBaskets() 
-
-trans1 =  PyAthena.cobs('/data/ilija/tmp.pool.root','/data/ilija/oBS_orderedByEvent.pool.root')
-trans1.order(2)
diff --git a/Database/AthenaPOOL/RootFileTools/python/order.py b/Database/AthenaPOOL/RootFileTools/python/order.py
deleted file mode 100644
index 8365f5779cc..00000000000
--- a/Database/AthenaPOOL/RootFileTools/python/order.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# @file:    orderFile.py
-# @purpose: optimizes ordering in trees of root file and creates a new file with a new compression level 
-# @author:  Ilija Vukotic <ilija@vukotic.me>
-# @date:    October 2009
-
-###########################################################################################################
-# example:
-# for standard AOD file this would be a reasonable command line:
-# orderFile -o ofilename ifilename
-#
-###########################################################################################################
-
-__version__ = "$Revision: 1.0 $"
-__author__  = "Ilija Vukotic <ilija@vukotic.me>"
-
-import sys
-import os
-
-from optparse import OptionParser
-
-
-import AthenaPython.PyAthena as PyAthena
-trans = PyAthena.cobs('/data/ilija/AOD.067184.big.pool.root','/data/ilija/ordered.pool.root')
-
-if __name__ == "__main__":
-
-	parser = OptionParser(usage="usage: %prog [options] my.file.pool.root")
-	p = parser.add_option 
-	p( "-f", "--file", dest = "fileName", help = "The path to the POOL file to analyze" )
-	p( "-m", "--mode", dest = "orderingMode", default = 2, help = "ordering mode 1 - by Offset, 2 - byEntry, 3 - byBranch " )
-	p( "-o", "--output", dest = "outFileName", default = None, help = "Name of the output file. If ommited output file name will be the same as input one with _ordered appended." )
-	p( "-s", "--skip", dest="skip", default = None, help ="List of tree names to leave as is. Compression level is still changed.")
-	(options, args) = parser.parse_args()
-
-	fileName=""
-	if len(args) > 0:    
-		for arg in args:
-			if arg[0] != "-":
-				fileName=arg
-
-	if options.fileName == None and len(fileName) == 0:
-		str(parser.print_help() or "")
-		sys.exit(1)
-	
-	ofileName=""	
-	if options.outFileName == None:
-		ofileName=fileName + "_ordered"
-	else:
-		ofileName=options.outFileName
-
-	import AthenaPython.PyAthena as PyAthena
-	print "Optimizing file: ", fileName
-	print "Output file:     ", ofileName
-	trans = PyAthena.cobs(fileName, ofileName)
-
-	if options.skip != None:
-		trees=options.skip.split(",")
-		for t in trees:
-			print "Skipping tree:   ", t
-			trans.setTreeToSkip(t)
-	
-	trans.order(options.orderingMode)
\ No newline at end of file
diff --git a/Database/AthenaPOOL/RootFileTools/share/optimizeBS.py b/Database/AthenaPOOL/RootFileTools/share/optimizeBS.py
deleted file mode 100755
index ba15013ffc6..00000000000
--- a/Database/AthenaPOOL/RootFileTools/share/optimizeBS.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
- 
-# @file:    optimizeBS.py
-# @purpose: optimizes basket sizes in trees of root file and creates a new file with a new compression level 
-# @author:  Ilija Vukotic <ilija@vukotic.me>
-# @date:    October 2009
-
-###########################################################################################################
-# example:
-# for standard AOD file this would be a reasonable command line:
-# optimizeBS -s '##Links,##Shapes,##Params' -t 'POOLContainer_DataHeader=10240' -o ofilename ifilename
-#
-###########################################################################################################
-
-__version__ = "$Revision: 226925 $"
-__author__  = "Ilija Vukotic <ilija@vukotic.me>"
-
-import sys
-import os
-
-from optparse import OptionParser
-
-if __name__ == "__main__":
-
-	parser = OptionParser(usage="usage: %prog [options] my.file.pool.root")
-	p = parser.add_option 
-	p( "-f", "--file", dest = "fileName", help = "The path to the POOL file to analyze" )
-	p( "-o", "--output", dest = "outFileName", default = None, help = "Name of the output file. If ommited output file name will be the same as input one with _optBS appended." )
-	p( "-m", "--memory", dest = "Memory", default = None, help = "Memory to be used for all the baskets for all the trees for which it is not explicitly set using option -t. Given in kb." )
-	p( "-t", "--treemem", dest = "treeMemList", default = None, help = "Comma separated list of form 'treename=memory,treename=memory'. Memory is given in kb." )
-	p( "-c", "--compression", dest = "compressionF", default = 7, help = "Compression factor of the output file. 7 by default.")
-	p( "-s", "--skip", dest="skip", default = None, help ="List of tree names to leave as is. Compression level is still changed.")
-	(options, args) = parser.parse_args()
-
-	fileName=""
-	if len(args) > 0:    
-		for arg in args:
-			if arg[0] != "-":
-				fileName=arg
-
-	if options.fileName == None and len(fileName) == 0:
-		str(parser.print_help() or "")
-		sys.exit(1)
-	
-	ofileName=""	
-	if options.outFileName == None:
-		ofileName=fileName + "_optBS"
-	else:
-		ofileName=options.outFileName
-
-	import AthenaPython.PyAthena as PyAthena
-	print "Optimizing file: ", fileName
-	print "Output file:     ", ofileName
-	trans = PyAthena.cobs(fileName, ofileName)
-
-	if options.skip != None:
-		trees=options.skip.split(",")
-		for t in trees:
-			print "Skipping tree:   ", t
-			trans.setTreeToSkip(t)
-			
-	if options.compressionF != None:
-		trans.setCompressionLevel(options.compressionF)
-		print 'Compression factor:', options.compressionF
-	else:
-		print 'Compression factor: 7'
-		
-	if options.Memory != None:
-		trans.setDedicatedMemory(options.Memory)
-		print 'Memory per tree:', options.Memory,'kb'
-	else:
-		print 'Memory per tree: 30720 kb'
-		
-	if options.treeMemList != None:
-		pairs = options.treeMemList.split(",")
-		for p in pairs:
-			elem = p.split('=')
-			trans.setTreeMemory(int (elem[1]),elem[0])
-			print  'Memory for tree: ', elem[0], ' set to', int(elem[1])
-
-	trans.resizeBaskets()
diff --git a/Database/AthenaPOOL/RootFileTools/share/orderFile.py b/Database/AthenaPOOL/RootFileTools/share/orderFile.py
deleted file mode 100755
index 3cddec94de1..00000000000
--- a/Database/AthenaPOOL/RootFileTools/share/orderFile.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-
-# @file:    orderFile.py
-# @purpose: optimizes ordering in trees of root file and creates a new file with a new compression level 
-# @author:  Ilija Vukotic <ilija@vukotic.me>
-# @date:    October 2009
-
-###########################################################################################################
-# example:
-# for standard AOD file this would be a reasonable command line:
-# orderFile -o ofilename ifilename
-#
-###########################################################################################################
-
-__version__ = "$Revision: 226925 $"
-__author__  = "Ilija Vukotic <ilija@vukotic.me>"
-
-import sys
-import os
-
-from optparse import OptionParser
-
-
-import AthenaPython.PyAthena as PyAthena
-trans = PyAthena.cobs('/data/ilija/AOD.067184.big.pool.root','/data/ilija/ordered.pool.root')
-
-if __name__ == "__main__":
-
-	parser = OptionParser(usage="usage: %prog [options] my.file.pool.root")
-	p = parser.add_option 
-	p( "-f", "--file", dest = "fileName", help = "The path to the POOL file to analyze" )
-	p( "-m", "--mode", dest = "orderingMode", default = 2, help = "ordering mode 1 - by Offset, 2 - byEntry, 3 - byBranch " )
-	p( "-o", "--output", dest = "outFileName", default = None, help = "Name of the output file. If ommited output file name will be the same as input one with _ordered appended." )
-	p( "-s", "--skip", dest="skip", default = None, help ="List of tree names to leave as is. Compression level is still changed.")
-	(options, args) = parser.parse_args()
-
-	fileName=""
-	if len(args) > 0:    
-		for arg in args:
-			if arg[0] != "-":
-				fileName=arg
-
-	if options.fileName == None and len(fileName) == 0:
-		str(parser.print_help() or "")
-		sys.exit(1)
-	
-	ofileName=""	
-	if options.outFileName == None:
-		ofileName=fileName + "_ordered"
-	else:
-		ofileName=options.outFileName
-
-	import AthenaPython.PyAthena as PyAthena
-	print "Optimizing file: ", fileName
-	print "Output file:     ", ofileName
-	trans = PyAthena.cobs(fileName, ofileName)
-
-	if options.skip != None:
-		trees=options.skip.split(",")
-		for t in trees:
-			print "Skipping tree:   ", t
-			trans.setTreeToSkip(t)
-	if options.orderingMode==1:
-		print "Ordering mode: by OFFSET"
-	if options.orderingMode==2:
-		print "Ordering mode: by EVENT"
-	if options.orderingMode==1:
-		print "Ordering mode: by BRANCH"
-		
-	trans.order(options.orderingMode)
\ No newline at end of file
diff --git a/Database/AthenaPOOL/RootFileTools/share/showTrees.py b/Database/AthenaPOOL/RootFileTools/share/showTrees.py
deleted file mode 100755
index 02ea0410b8c..00000000000
--- a/Database/AthenaPOOL/RootFileTools/share/showTrees.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-
-# @file:    showTrees.py
-# @purpose: print information about the TTrees in the ROOT file given
-# @author:  Gerhard Brandt <gbrandt@cern.ch>
-# @date:    October 2009
-
-__version__ = "$Revision: 227455 $"
-__author__  = "Gerhard Brandt <gbrandt@cern.ch>"
-
-import sys
-import os
-
-from optparse import OptionParser
-
-import AthenaPython.PyAthena as PyAthena
-mcobs = PyAthena.cobs()
-
-if __name__ == "__main__":
-
-	parser = OptionParser(usage="usage: %prog [-f] file.root")
-	p = parser.add_option 
-	p( "-f", 
-	   "--file", 
-	   dest = "fileName", 
-	   help = "The path to the ROOT file to analyze" )
-	p( "-b", 
-	   "--branches", 
-	   action  = "store_true",
-	   dest = "show_branches",  
-	   default = False,
-	   help = "Print branches" )
-
-	(options, args) = parser.parse_args()
-
-	if len(args) > 0:    
-		for arg in args:
-			if arg[0] != "-":
-				fileName=arg
-
-	if options.fileName == None and len(fileName) == 0:
-		str(parser.print_help() or "")
-		sys.exit(1)
-	
-	if options.show_branches != None:
-		mcobs.setShowBranches(True)
-	
-	mcobs.printTrees(fileName)      
-
-#       import AthenaPython.PyAthena as PyAthena
-#       print "Optimizing file: ", fileName
-#       print "Output file:     ", ofileName
-#       mcobs = PyAthena.cobs(fileName, ofileName)
-#
-#       if options.skip != None:
-#               trees=options.skip.split(",")
-#               for t in trees:
-#                       print "Skipping tree:   ", t
-#                       mcobs.setTreeToSkip(t)
-#       
-#       mcobs.order(options.orderingMode)
diff --git a/Database/AthenaPOOL/RootFileTools/src/FilterAndMergeD3PD.cxx b/Database/AthenaPOOL/RootFileTools/src/FilterAndMergeD3PD.cxx
deleted file mode 100644
index b14fe6eba09..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/FilterAndMergeD3PD.cxx
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// TODO:
-// make sure that we use only the last of all the trees with the same name !!!
-
-#include <Riostream.h>
-
-#include <TTree.h>
-#include <TFile.h>
-#include <TChain.h>
-#include <TChainElement.h>
-#include <TSystem.h>
-#include <TROOT.h>
-#include <TKey.h>
-#include <TLeaf.h>
-#include <TStopwatch.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream>
-#include <sstream>
-#include <fstream>
-
-using namespace std;
-
-class mTree{
-public:
-    mTree(string a):filename(a), entries(0){}
-    string filename;
-    long entries;
-};
-
-class mTrees{
-public:
-    mTrees(){};
-    mTrees(string a):name(a),leaves(0),totalSize(0){}
-    string name;
-    int leaves;
-    double totalSize;    
-    vector<unsigned int> basketSize;// this is the value to be optimized - at beggining = totSize
-    vector<unsigned int> totSize;// this is value of ZIPPED SIZES collected from all the files
-    vector<unsigned int> baskets;// this is cached to speed up calculation - at beggining = 1 
-    void addFile(string s){ m_tree.push_back(mTree(s)); }
-    
-    void setLeaves(int l){
-        leaves=l;
-        for (int w=0;w<l;w++){
-            totSize.push_back(0); 
-            }
-    }
-    
-    void recalculate(){
-        cout<<"recalculate baskets"<<endl;
-        for (int w=0;w<leaves;w++){
-            basketSize.push_back(totSize[w]);
-            baskets.push_back(1);
-            totalSize+=totSize[w];
-        }
-    }
-    
-    void optimize(unsigned long memory){
-        
-        cout<<"optimize baskets. total tree size:"<<totalSize<<"\t memory: "<<memory<<endl;
-        while(true){    
-            double totMem=0;
-            for (int i=0;i<leaves;i++)
-                totMem += basketSize[i];
-                 
-            if ( totMem < memory) break;
-    
-            int maxSpare=-1; int mi=-1;
-            for (int i=0;i<leaves;i++){
-                int spare=totSize[i]/baskets[i]-totSize[i]/(baskets[i]+1);
-                if (maxSpare<spare){
-                    maxSpare=spare; 
-                    mi=i;
-                }
-            }
-            baskets[mi]++;
-            basketSize[mi]=totSize[mi]/baskets[mi];
-            // cout<<"totMem: "<<totMem<<"\tSpare: "<<totSize[mi]/(baskets[mi]-1)-totSize[mi]/baskets[mi]<<"\t baskets: "<<baskets[mi]<<"\n";
-        }
-        roundBasketSize();
-    }
-    
-    void roundBasketSize(){
-        
-        cout<<"round basket sizes"<<endl;
-        double totMem = 0;
-        int    totBas = 0;
-        unsigned int    maxBs  = 0;
-        unsigned int    minBs  = 1024*1024*1024;
-        
-        for (int w=0;w<leaves;w++){
-            if (basketSize[w]==0) basketSize[w]=16;
-            basketSize[w] = basketSize[w] - basketSize[w] % 8;
-            totMem += basketSize[w];
-            totBas += baskets[w];
-            if (basketSize[w]<minBs) minBs=basketSize[w];
-            if (basketSize[w]>maxBs) maxBs=basketSize[w];
-        }
-        cout<<"Total memory buffer: "<<totMem/1024<<" kb total baskets: "<<totBas<<"\tmin BS: "<<minBs<<"\tmax BS: "<<maxBs<<endl;
-        cout<<"-------------------------------------------------------------------------------------------------"<<endl;
-    }
-    
-    vector<mTree>::const_iterator bi(){return (vector<mTree>::const_iterator) m_tree.begin();};
-    vector<mTree>::const_iterator ei(){return (vector<mTree>::const_iterator) m_tree.end();};
-    
-private:
-    vector<mTree> m_tree;
-};
-
-std::string sfo="";
-std::string stn="";
-std::string filename = "";
-vector<string> toKeep;
-
-mTrees* tt;
-
-void ren(){
-    cout<<"renaming ... "<<endl;
-    std::string com="rm "+sfo+".root; for i in *temporary*.root; do mv \"$i\" \"${i/_temporary/}\";done";
-    // cout<<"command to execute: "<<com<<endl;
-    int ret=system (com.c_str());
-    if (!ret) cout<<"files renamed OK"<<endl;
-}
-
-void warmUp(const char* fn){
-    std::string com="cat "+std::string(fn)+" > /dev/null ";
-    cout<<"warming up the cache for file: "<<com<<endl;
-    int ret=system (com.c_str());
-    if (!ret) cout<<"file warmed up OK"<<endl;
-}
-
-void loadToKeep(string filename){    
-    if(filename=="") return;
-    cout<<"Slimming according to file: "<<filename<<endl;
-    ifstream file(filename.c_str(),ios::in);
-    if (file){
-        cout<<"Keep only the following branches:"<<endl;
-        string line;
-        while(getline(file,line)){
-            cout<<line<<endl; 
-            toKeep.push_back(line);
-        }
-    }
-
-}
-
-void order(int m){
-    
-    TChain *ch=new TChain(tt->name.c_str());
-    std::string o=sfo+"*.root";
-    ch->Add(o.c_str());
-    TObjArray *oaFiles=ch->GetListOfFiles();
-    
-    for(int i=0;i<oaFiles->GetEntries();i++){
-        TChainElement *element = (TChainElement*)oaFiles->At(i);
-        const char *fn=element->GetTitle();
-        
-        TStopwatch timer;    
-        timer.Start();
-        cout<<"optimizing: "<<fn<<endl;
-        // warmUp(fn);
-        
-        timer.Start();
-        TFile *fIn = TFile::Open(fn);
-        
-        std::stringstream out; out << i;
-        std::string s = out.str();
-        std::string tmp = sfo+"_temporary_"+s+".root";
-        TFile* fOut=TFile::Open(tmp.c_str(),"recreate","",6);
-     
-     // -  ordering
-        TTree *tc2 = (TTree*)fIn->Get(tt->name.c_str()) ;
-        
-        if(toKeep.size()){
-            tc2->SetBranchStatus("*",0);
-            for(vector<string>::iterator i=toKeep.begin();i!=toKeep.end();i++){
-                unsigned int found=0;
-                tc2->SetBranchStatus( i->c_str() , 1, &found);
-                cout<<"Setting status of the branch(es) "<<i->c_str()<<"\t found: "<<found<<endl;
-                }
-        }
-        
-        TTree* TC2;
-        if (m==2)  TC2= tc2->CloneTree(-1,"SortBasketsByEntry fast");
-        else TC2 = tc2->CloneTree(-1,"SortBasketsByBranch fast");
-        TC2->Write("",TObject::kOverwrite);
-     // -  
-       
-        timer.Stop();
-        cout<<"ordering file:                   "<<i<<" \t\twallclock time: "<< timer.RealTime()<<"\t CPU time: "<<timer.CpuTime()<<endl;
-        
-        fOut->Close();
-        fIn->Close();
-    }
-    
-    cout<<"ordering done"<<endl;
-    ren();
-    return;
-}
-
-void optimizeBasketSizes(){
-    
-    cout<<"Doing tree: "<<tt->name<<endl;
-    // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>          SUMMING UP BRANCH SIZES OVER ALL THE FILES
-    for(vector<mTree>::const_iterator itt=tt->bi(); itt!=tt->ei(); itt++){ // loop over files having this tree
-        
-        TFile* f = TFile::Open(itt->filename.c_str());
-        TTree* t = (TTree*) f->Get(tt->name.c_str());
-
-        for (int i=0; i<tt->leaves; i++) {
-            TBranch* branch = (TBranch*)t->GetListOfBranches()->UncheckedAt(i);
-            branch->SetAddress(0);
-            // cout <<i<<"\t"<<branch->GetName()<<"\t BS: "<< branch->GetBasketSize()<<"\t size: "<< branch->GetTotalSize()<< "\ttotbytes: "<<branch->GetTotBytes() << endl;
-            tt->totSize[i] += branch->GetTotBytes(); 
-        }
-         
-        f->Close();
-    }
-    
-    cout<<"got basket sizes from all the files"<<endl;
-    tt->recalculate();
-    
-    tt->optimize(40*1024*1024); // in bytes !
-    
-}
-
-void createMergedFile(){
-    
-    std::string oname=sfo+".root";
-    TFile* fOut = TFile::Open(oname.c_str(),"RECREATE","",1);
-    TDirectory *gDirectory_save = gDirectory;
-    if (fOut->IsZombie()){
-        cout<<"File "<<oname<<" isZombified. Output file can not be created."<<endl;
-        return;
-    }
-    
-    TTree *newtree=0; 
-    
-    TFile* f = TFile::Open((tt->bi())->filename.c_str());
-    TTree* t = (TTree*) f->Get(tt->name.c_str());
-    
-   // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CREATING NEW TREE
-    newtree = (TTree*)t->CloneTree(0); // no copy of events
-    
-    newtree->SetDirectory(gDirectory_save);
-    
-    // Once the cloning is done, separate the trees,to avoid as many side-effects as possible
-    t->GetListOfClones()->Remove(newtree);
-    t->ResetBranchAddresses();
-    newtree->ResetBranchAddresses();
-   
-   // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Setting optimized basket sizes. 
-    for (int w=0;w<tt->leaves;w++) {     
-        TBranch* branch=(TBranch*)newtree->GetListOfBranches()->UncheckedAt(w);
-        branch->SetBasketSize(tt->basketSize[w]);
-        // cout<<"basket size: "<<basketSize[w]<<"\t number of baskets:"<<baskets[w]<<endl;
-    }
-
-    // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> copying data.
-    
-    int ne=0;
-        
-    for(vector<mTree>::const_iterator itt=tt->bi(); itt!=tt->ei(); itt++){ // loop over files having this tree
-
-        TFile* f = TFile::Open(itt->filename.c_str());
-        TTree* t = (TTree*) f->Get(tt->name.c_str());
-                 
-        
-        newtree->CopyAddresses(t);
-        t->      SetBranchAddress("el_n",&ne);
-        newtree->SetBranchAddress("el_n",&ne);      
-        
-        unsigned long nentries = t->GetEntries();    
-        for ( unsigned long e = 0; e < nentries; ++e) {
-            t->GetEntry(e);
-            if (ne>1)
-                newtree->Fill();
-        }
-        t->ResetBranchAddresses(); // Disconnect from new tree.
-        f->Close();
-        cout<<"Current file entries: "<<nentries <<endl;
-    }
-    
-    fOut->cd();
-    int s = newtree->Write("", TObject::kOverwrite);       
-    if (!s) {
-        cout<<" WARNING FILE IS NOT OPTIMIZED. MAYBE NOT ENOUGH DISK SPACE? "<<endl;
-        return;
-    }
-
-   
-    fOut=newtree->GetCurrentFile();
-    fOut->Write();
-    fOut->Close();
-    
-}
-
-
-
-int main(int argc,char* argv[]){
-    
-    
-    if (argc < 7) { 
-        cout << "Usage is:\n";
-        cout << "\t-in <infile>             --- this can be of the form /data/higgs/my*nobel*_000*.1 \n";
-        cout << "\t-out <outfile>           --- this can be of the form /data/out/higgs - as .root will be appended\n";
-        cout << "\t-tree <outfile>          --- name of the tree to be filtered. other trees are not copied.\n";
-        cout << "\t-var <variables>         --- name of the file containing branche names to be kept in the output file. By default all the branches are copied.\n";
-        cout << "\t-maxsize <tree max size> --- maximum zip size of the main tree (in Mb). The default value is 6000.\n";
-		cout << "\t-byBranch                --- baskets in output files will be ordered by branch. The default is by Entry.\n";
-        std::cin.get();
-        return 0;
-    }
-    
-    char *fi = NULL;
-    Long64_t maxsize=6000;
-	int toOrder=2;
-    
-    for (int i = 1; i < argc; i++) {    
-        if (! strcmp(argv[i], "-in") ) {
-            fi = argv[i + 1];
-        } else if (! strcmp(argv[i], "-out") ) {
-            sfo=std::string(argv[i + 1]);
-        } else if (! strcmp(argv[i], "-tree") ) {
-            stn=std::string(argv[i + 1]);
-        } else if (! strcmp(argv[i], "-maxsize") ) {
-            maxsize = atoi(argv[i + 1]);
-        } else if (! strcmp(argv[i], "-var")){
-            filename=std::string(argv[i + 1]);
-            loadToKeep(filename);
-        } else if (! strcmp(argv[i], "-byBranch") ){
-			toOrder=1;
-		} 
-    }
-    
-    TTree::SetMaxTreeSize(maxsize*1024*1024);
-    
-    cout<<"Input files: "<<fi<<"\nOutput file: "<<sfo<<"\nMax Tree Size: "<<maxsize<<endl;
-    
-    TChain *ch = new TChain(stn.c_str());
-    ch->Add(fi);
-    
-    TObjArray *oaFiles = ch->GetListOfFiles();
-    if (!oaFiles->GetEntries()){
-        cout<<"No input files found!"<<endl;
-        return 0;
-    }
-    
-    
-    cout<<"I chain created..."<<endl;
-    
-    
-    
-    // ==================================================================== take tree names from the first file
-    
-    
-    tt = new mTrees(stn.c_str());
-    
-    cout<<"II trees to merge determined ..."<<endl;
-    // =====================================================================
-
-    std::vector<TFile*> fFile (oaFiles->GetEntries());
-    for(int i=0;i<oaFiles->GetEntries();i++){
-        
-        const char* fn = ((TChainElement*)oaFiles->At(i))->GetTitle();
-        fFile[i] = TFile::Open(fn);
-        
-        if (fFile[i]->IsZombie()){
-            cout<<"File "<<fn<<" isZombified. Its corrupted or not a root file."<<endl;
-            continue;
-        }
-        
-        TTree* tmpt=(TTree*)fFile[i]->Get( (tt->name).c_str() );
-        int leaves=tmpt->GetListOfBranches()->GetEntriesFast();
-        
-        if (!leaves){
-            cout<<"WARNING! Tree: "<< (tt->name).c_str() <<"  in file: "<<fn<<" contains no events. Will not be merged."<<endl;
-        }
-        else{
-            tt->addFile(fn);
-            if (!tt->leaves)
-                tt->setLeaves(leaves);
-        }
-        
-        
-        fFile[i]->Close();
-    }
-    
-    delete ch;  ch=NULL;
-    oaFiles=NULL;
-    cout<<"Files checked and verified..."<<endl;
-    // =====================================================================
-    
-    TStopwatch timer;
-    timer.Start();
-
-    optimizeBasketSizes();
-    createMergedFile();
-    
-    timer.Stop();
-    cout<<"Done           in wallclock: "<< timer.RealTime()<<"\t\t CPU time: "<<timer.CpuTime()<<endl;
-    
-    order(toOrder);
-    
-    return 0;   
-}
-
-
-
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/HistoPile.cxx b/Database/AthenaPOOL/RootFileTools/src/HistoPile.cxx
deleted file mode 100644
index f164020ed5a..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/HistoPile.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-#include "HistoPile.h"
-
-using namespace std;
-
-//______________________________________________________________________________
-void HistoPile::Push(const char *str) 
-{
-    m_path.push_back(str);
-    m_path.push_back(".");
-    m_currHist = 0;
-}
-
-//______________________________________________________________________________
-void HistoPile::Pop() 
-{
-    m_path.pop_back();
-    m_path.pop_back(); 
-    m_currHist = 0;
-}
-
-//______________________________________________________________________________
-const char * HistoPile::Path() 
-{
-    static std::string line;
-
-    for (const std::string& p : m_path) {
-      line += p;
-    }
-    // replace trailing dot
-    if (line.size() > 0) {
-      line.erase (line.size()-1);
-    }
-    return line.c_str(); 
-}
-
-//______________________________________________________________________________
-void HistoPile::Fill(Float_t f) 
-{  
-  // only look for current histogram again if not set
-  if ( !m_currHist) {  
-  
-    const char *path = Path();
-  
-    m_currHist = (TH1F*)m_histos->FindObject(path);
-
-    // not yet in list - try to take def from reference file
-    if (!m_currHist && m_reffile) {
-        TH1F* refHist = (TH1F*)m_reffile->Get(path);
-        if (!refHist) {
-          cout << "WARNING Could not find "<<path<<" in reference file!" << endl;        
-        } else {
-//          cout << ">>>CLONE HISTO<<< " << path << endl;
-          m_currHist = (TH1F*)refHist->Clone(path);
-          m_currHist->Reset();
-#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)        
-          m_currHist->SetCanExtend(TH1::kNoAxis);    // don't allow rebinning binning
-#else
-          m_currHist->SetBit(TH1::kCanRebin,0);
-#endif
-//          m_currHist->SetDirectory(0);
-        //cout << m_currHist->Hash() << " " << refHist->Hash() << endl; 
-          m_histos->AddLast(m_currHist);
-        }
-    }
-
-    if (!m_currHist) {  
-        // some default - tbc
-        m_currHist =  new TH1F(path,path,40,f/2.,f*2.); 
-#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)        
-        m_currHist->SetCanExtend(TH1::kAllAxes);
-#else
-        m_currHist->SetBit(TH1::kCanRebin);
-#endif
-        m_currHist->SetDirectory(0);
-        m_histos->AddLast(m_currHist);
-//        cout << ">>>NEW HISTO<<< " << path << endl;
-    }
-  }
-  m_currHist->Fill(f);
-}
-
-//______________________________________________________________________________
-void HistoPile::Save() 
-{
-	if (!m_filename) return;
-    
-    TFile* file = TFile::Open(m_filename,"RECREATE");
-
-	TIter next(m_histos);
-	TH1F* hist;
-	while ((hist = (TH1F *)next() ))
-	{
-#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)        
-          hist->SetCanExtend(TH1::kNoAxis);    // don't allow rebinning binning
-#else
-          hist->SetBit(TH1::kCanRebin,0);
-#endif
-	  hist->SetDirectory(file);
-	  hist->Write();
-	  //cout << hist->GetName() << endl;
-	  //hist->Print();
-	  //  if (obj->GetUniqueID()) nbins++;
-      
-      //Remove(hist); // clean up
-	}
-
-	delete file;	   
-
-	cout << "Histograms created: about "
-		<< m_histos->AverageCollisions()*m_histos->GetEntries() << endl;
-
-}
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/HistoPile.h b/Database/AthenaPOOL/RootFileTools/src/HistoPile.h
deleted file mode 100644
index 3c7bd1be581..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/HistoPile.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef HISTOPILE_H
-#define HISTOPILE_H
-//
-// A hashlist of automatic histograms
-//
-// - push and pop labels to traverse "tree"
-// - call fill to fill histogram belonging to current tree node
-// 
-// Author: Gerhard Brandt, 2009-09-27 
-//
-
-#include <iostream>
-#include <list>
-#include <string>
-
-#include "TFile.h"
-#include "TH1F.h"
-#include "THashList.h"
-
-
-class HistoPile {
-
-public:
-  
-  HistoPile(const char * filename, const char * reffilename=0) : 
-      m_currHist(0)
-    , m_filename(filename) 
-  { 
-    if (reffilename) {
-      m_reffile = TFile::Open(reffilename);
-      if ( !m_reffile ) {
-        std::cout << "WARNING Could not open reference file!" << std::endl;
-      } else {
-        std::cout << "Using reference file " << reffilename << std::endl;
-      }
-    } else
-      m_reffile = 0;  
-	  
-	// high number to avoid collisions  
-	m_histos = new THashList(10000);  	  
-  }
-
-  void Push(const char *);          // Descend object tree
-  void Pop();                       // Ascend object tree
-  void Fill(Float_t);               // Plot value at current node
-  const char *Path();               // Print name of current node
-  void Save();                      // Save histograms to file
-  
-private:
-
-  THashList*    m_histos;            // hashlist of histograms at nodes
-  TH1F*         m_currHist;          // current histogram
-  const char *  m_filename;          // name of output file
-  TFile *       m_reffile;           // reference file to take histo definitions from
-  
-  std::list<std::string>  m_path;              // current path
-};
-
-#endif
diff --git a/Database/AthenaPOOL/RootFileTools/src/Makefile b/Database/AthenaPOOL/RootFileTools/src/Makefile
deleted file mode 100644
index 96b3f044b5b..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-include $(ROOTSYS)/test/Makefile.arch
-
-MERGEO       = mergeD3PD.$(ObjSuf)
-MERGES       = mergeD3PD.$(SrcSuf)
-MERGE        = mergeD3PD$(ExeSuf)
-
-FILTERO       = FilterAndMergeD3PD.$(ObjSuf)
-FILTERS       = FilterAndMergeD3PD.$(SrcSuf)
-FILTER        = FilterAndMergeD3PD$(ExeSuf)
-
-OBJS          = $(FILTERO) $(MERGEO) 
-PROGRAMS      = $(FILTER) $(MERGE)
-
-#------------------------------------------------------------------------------
-
-.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
-
-all:            $(PROGRAMS)
-
-$(FILTER):      $(FILTERO)
-		$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
-		$(MT_EXE)
-		@echo "$@ done"
-
-$(MERGE):      $(MERGEO)
-		$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
-		$(MT_EXE)
-		@echo "$@ done"
-
-clean:
-		@rm -f $(OBJS) core
-
-.SUFFIXES: .$(SrcSuf)
-
-
-.$(SrcSuf).$(ObjSuf):
-	$(CXX)  $(CXXFLAGS) -c $<
diff --git a/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.cxx b/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.cxx
deleted file mode 100755
index 18b125a0d30..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file RootFileTransformationsTool.cxx
- *  @brief Tool to call RootFileTransformations to optimize output files
- *  @author Gerhard Brandt <gbrandt@cern.ch>
- *  $Id:  $
- **/
-
-#include <stdio.h>
-#include "RootFileTransformationsTool.h"
-#include "cobs.h"
-
-RootFileTransformationsTool::RootFileTransformationsTool(const std::string& type,
-                                                         const std::string& name,
-                                                         const IInterface* parent)
-        : AthAlgTool(type, name, parent)
-{
-   // Declare IRootFileTransformationsTool interface
-   declareInterface<IRootFileTransformationsTool>(this);
-}
-//__________________________________________________________________________
-RootFileTransformationsTool::~RootFileTransformationsTool() {
-}
-//__________________________________________________________________________
-StatusCode RootFileTransformationsTool::initialize() {
-   ATH_MSG_INFO ("Initializing " << name() << " - package version " << PACKAGE_VERSION);
-
-   return(StatusCode::SUCCESS);
-}
-//__________________________________________________________________________
-StatusCode RootFileTransformationsTool::finalize() {   
-   return(::AlgTool::finalize());
-}
-//__________________________________________________________________________
-StatusCode RootFileTransformationsTool::reorderBaskets(std::string fileName, std::string option) {
-   ATH_MSG_INFO("Reordering baskets on file " << fileName << " using " << option);
-
-   std::string optFileName = fileName+".opt.root";   
-   (void) remove(optFileName.c_str());
-      
-   cobs* mcobs = new cobs(fileName, optFileName);
-
-   // set debug level of optimizer
-   if ( msg().level() <= MSG::DEBUG) {
-       mcobs->setDebug(true);
-       // dump tree info before operations
-       mcobs->printTrees(fileName);
-   } 
-
-   if (option=="SortBasketsByOffset") {    
-     if (mcobs->order(1))
-         (void)rename(optFileName.c_str(), fileName.c_str());
-     else 
-         (void)remove(optFileName.c_str());
-   } 
-   else if(option=="SortBasketsByEntry") {    
-     if (mcobs->order(2))
-         (void)rename(optFileName.c_str(), fileName.c_str());
-     else 
-         (void)remove(optFileName.c_str());
-   }  
-   else if(option=="SortBasketsByBranch") {    
-     if (mcobs->order(3))
-         (void)rename(optFileName.c_str(), fileName.c_str());
-      else 
-          (void)remove(optFileName.c_str());
-   }
-   else {
-      ATH_MSG_WARNING("Unsupported ordering option " << option << ". Not ordering file " << fileName);
-   }
-   if ( msg().level() <= MSG::DEBUG) {
-     mcobs->printTrees(fileName);
-   }    
-   
-   delete mcobs;
-   
-   ATH_MSG_INFO("Finished optimizing " << fileName);
-   return(StatusCode::SUCCESS);
-}
-//__________________________________________________________________________
-StatusCode RootFileTransformationsTool::resizeBaskets(std::string fileName, std::string algo, std::string treesToExclude, std::string memPerTree, int maxMemory, float minComp) {
-
-   ATH_MSG_INFO ("Optimizing basket sizes of the file " << fileName << "\tusing " << algo << "\ttreesToExclude: "<< treesToExclude << "\tmemPerTree: " << memPerTree << "\ttotal memory: " << maxMemory << "\tmin compression: " << minComp);
-
-   std::string optFileName = fileName+".opt.root";
-   (void) remove(optFileName.c_str());
-   
-   cobs* mcobs = new cobs(fileName, optFileName);   
-   // mcobs->setDebugLevel(1);
-   mcobs->setDedicatedMemory(maxMemory);
-   mcobs->setMinCompressionFactor(minComp);
-   // mcobs->setTreeToSkip(); // here decode treesToExclude and set them
-   // mcobs->setTreeMemory(mem,treeName); // here decode memPerTree and set them
-   
-   if (algo=="1") { // currently only one method exists.
-       if (mcobs->resizeBaskets())
-           (void)rename(optFileName.c_str(), fileName.c_str());
-       else 
-           (void)remove(optFileName.c_str());
-   } 
-   else {
-     ATH_MSG_WARNING("Unsupported resizing option " << algo << ". Not resizing baskets on file " << fileName);
-   }
-   
-   delete mcobs;
-
-   ATH_MSG_INFO("Finished optimizing " << fileName);
-   return(StatusCode::SUCCESS);
-}
diff --git a/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.h b/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.h
deleted file mode 100755
index ba0863638c4..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/RootFileTransformationsTool.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ROOTFILETOOLS_ROOTFILETRANSFORMATIONSTOOL_H
-#define ROOTFILETOOLS_ROOTFILETRANSFORMATIONSTOOL_H
-/** @file RootFileTransformationsTool.cxx
- *  @brief Tool to call RootFileTransformations to optimize output files
- *  @author Gerhard Brandt <gbrandt@cern.ch>
- *  $Id:  $
- **/
-
-#include "RootFileTools/IRootFileTransformationsTool.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-
-/** @class RootFileTransformationsTool
- *  @brief Tool to call RootFileTransformations to optimize output files
- **/
-class RootFileTransformationsTool : virtual public IRootFileTransformationsTool, 
-                                    virtual public AthAlgTool {
-
-public:
-   /// Constructor
-   RootFileTransformationsTool(const std::string& type,
-	   const std::string& name,
-	   const IInterface* parent);
-   /// Destructor
-   virtual ~RootFileTransformationsTool();
-
-   /// Initialize
-   virtual StatusCode initialize();
-   /// Finalize
-   virtual StatusCode finalize();
-
-   // Reorder Baskets
-   virtual StatusCode reorderBaskets(std::string, std::string);
-   
-   // Resize Baskets ( filename, algorithm, names of trees to exlude, memory per tree, memory (in kilobytes!), min zip level)
-   virtual StatusCode resizeBaskets(std::string, std::string, std::string, std::string, int, float);
-
-private:
-};
-
-#endif
diff --git a/Database/AthenaPOOL/RootFileTools/src/checkCache.cxx b/Database/AthenaPOOL/RootFileTools/src/checkCache.cxx
deleted file mode 100644
index b8e02dd5473..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/checkCache.cxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/mman.h>
-int main(int argc, char *argv[]) {
-    
-    if (argc==1) {
-		puts(" usage: checkCache <filename>\n prints out all the cached blocks of the file given. warning: for a large file that may mean a big printout.");
-    	return 0;
-    }
-    int fd;
-    struct stat file_stat;
-    void *file_mmap;
-#ifndef __APPLE__
-    unsigned char *mincore_vec;
-#else
-    char *mincore_vec;
-#endif
-    size_t page_size = getpagesize();
-    size_t page_index;
-
-    fd = open(argv[1],0);
-    if (fd < 0) {
-      perror ("open");
-      return 1;
-    }
-    if (fstat(fd, &file_stat) < 0) {
-      perror ("ftsat");
-      return 1;
-    }
-    file_mmap = mmap((void *)0, file_stat.st_size, PROT_NONE, MAP_SHARED, fd, 0);
-#ifndef __APPLE__
-    mincore_vec = (unsigned char *) calloc(1, (file_stat.st_size+page_size-1)/page_size);
-#else
-    mincore_vec = (char *) calloc(1, (file_stat.st_size+page_size-1)/page_size);
-#endif
-    mincore(file_mmap, file_stat.st_size, mincore_vec);
-    printf("Cached Blocks of %s: ",argv[1]);
-    for (page_index = 0; page_index <= file_stat.st_size/page_size; page_index++) {
-        if (mincore_vec[page_index]&1) {
-            printf("%lu ", (unsigned long)page_index);
-        }
-    }
-    printf("\n");
-    free(mincore_vec);
-    munmap(file_mmap, file_stat.st_size);
-    close(fd);
-    return 0;
-}
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/cobs.cxx b/Database/AthenaPOOL/RootFileTools/src/cobs.cxx
deleted file mode 100644
index 01c124f909d..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/cobs.cxx
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file cobs.cxx
- *  @brief Rewrite root files in various ways to speed up reading.
- *  @author: Ilija Vukotic, Gerhard Brandt
- *  $Id: $
- *
- * Current defaults are: 
- *
- *      compression level = 6
- *      split level = 99
- *      dedicated memory = 30MB (per tree)
- *      minimal compression factor = 1.0 (compression is never off)
- *       
- * There are three main transformations that
- * should be applied in the following precedence:
- *
- *      1. change tree split level (should be set on write already)
- *      2. change tree basket sizes
- *      3. change tree basket order
- *      
- **/
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include "cobs.h"
-#include <vector>
-#include <string>
-#include <iostream>
-
-#include <Riostream.h>
-#include <TTree.h>
-#include <TFile.h>
-#include <TSystem.h>
-#include <TROOT.h>
-#include <TKey.h>
-#include <TLeaf.h>
-
-using namespace std;
- 
-
-//__________________________________________________________________________
-cobs::cobs(string inputFile) : m_inputFilename(inputFile) {
-    m_compressionLevel     = 6;
-    m_splitLevel           = 99;
-    m_dedicatedMemory      = 30720; //30Mb
-    m_minCompressionFactor = 1.0;
-    m_libraryName          = "RFT";
-    m_libraryDirName       = "RFT/RFT.so";
-    m_useCINTlibrary       = false;
-    m_debug                = false;
-    m_showBranches         = false;
-}
-//__________________________________________________________________________
-cobs::cobs(string inputFile, string outputFile) :
-        m_inputFilename(inputFile),
-        m_outputFilename(outputFile)
-{
-    m_compressionLevel     = 6;
-    m_splitLevel           = 99;
-    m_dedicatedMemory      = 30720; //30Mb
-    m_minCompressionFactor = 1.0;
-    m_libraryName          = "RFT";
-    m_libraryDirName       = "RFT/RFT.so";
-    m_useCINTlibrary       = false;
-    m_debug                = false;
-    m_showBranches         = false;
-}
-
-//__________________________________________________________________________
-void cobs::setDebug(bool debug)
-{
-    m_debug = debug;
-}
-
-//__________________________________________________________________________
-void cobs::setOutputFile(string outputFile){
-    m_outputFilename    = outputFile;
-}
-//__________________________________________________________________________
-void cobs::setCompressionLevel(short CL){
-    // from (0-9) ROOT default is 1. Outside HEP people use 6. 
-    if (CL>9) CL=9;
-    if (CL<0) CL=0;
-    m_compressionLevel = CL;
-}
-//__________________________________________________________________________
-void cobs::setSplitLevel(short SL){
-    m_splitLevel        = SL;
-}
-//__________________________________________________________________________
-void cobs::setDedicatedMemory(int DM){
-    // this call sets default amount of memory to be used.
-    // this is not split on all the trees.
-    // to give a memory per tree use setTreeMemory  
-    // value is given in kb
-    m_dedicatedMemory   = DM;
-}       
-//__________________________________________________________________________
-void cobs::setDebugLevel(short DL){
-    m_debug   = DL;
-}
-//__________________________________________________________________________
-void cobs::setTreeToSkip(string treeName){
-    // tree not to be used in transform
-    // when rewriting into new file it will be simply cloned.
-    // still compression level will be the one of the output file.
-    m_treesToSkip.push_back(treeName);
-}
-//__________________________________________________________________________
-void cobs::setTreeMemory(int mem, string treeName){
-    // used to set dedicated memory for a specific tree
-    std::pair<int, string> p(mem, treeName);
-    m_memoryForATree.push_back(p);
-}
-//__________________________________________________________________________
-void cobs::setMinCompressionFactor(float minComp){
-    // if compression of a branch in input file is smaller than value given
-    // the branch will not be compressed. Default value is 1.0 (never)
-    m_minCompressionFactor = minComp;
-}
-//__________________________________________________________________________
-void cobs::setLibraryName(std::string libN){
-    m_libraryName=libN;
-    m_libraryDirName=libN+"/"+libN+".so";
-}
-//__________________________________________________________________________
-void cobs::useCINTLibrary(bool use){
-    m_useCINTlibrary = use; 
-}
-//__________________________________________________________________________
-void cobs::mkProject(){
-    // this function should be called just once before the first transform.
-    // it does not work in root versions before 5.25 
-    if (!m_useCINTlibrary) return;
-    std::cout<<"Making library corresponding to the file: "<< m_inputFilename<<std::endl;
-    TFile* f = TFile::Open(m_inputFilename.c_str());
-    if (f->IsZombie()) {
-        cout << "Error! Can't opend the file to makeProject. Returning." << endl;
-        return;
-    }
-    f->MakeProject(m_libraryName.c_str(),"*","recreate++");
-    f->Close();
-}
-//__________________________________________________________________________
-bool cobs::order(short orderBy){
-    // orders the branches in one of 3 ways: 
-    // 1- byOffset (root default so normaly not to be used)
-    // 2- by Entry (optimal one when reading all the events)
-    // 3- byBranch (can be optimal in certain quite special cases)
-    // output file compression level is root default (=1)
-    
-    pid_t p = getpid();
-    char com [50];
-    sprintf (com, "ls -l /proc/%d/fd > openedfiles", p);
-    system(com);
-    
-    if (m_debug) {  
-        cout<<"<cobs::order> "<<m_inputFilename;
-        if (orderBy==1) cout<<" (SortBasketsByOffset)"<<endl;
-        if (orderBy==2) cout<<" (SortBasketsByEntry)"<<endl;
-        if (orderBy==3) cout<<" (SortBasketsByBranch)"<<endl;
-    }
-        
-    if (m_useCINTlibrary) {
-        gSystem->Load(m_libraryDirName.c_str());
-    }
-        
-    TFile* f  = TFile::Open( m_inputFilename.c_str()); 
-    if (f->IsZombie()) {
-        cout << "Error with file to be optimized. File is maybe not closed ?" << endl;
-        return false;
-    }     
-    TFile* f2 = TFile::Open( m_outputFilename.c_str(),"RECREATE");
- 
-    sprintf (com, "ls -l /proc/%d/fd > openedfiles1", p);
-    system(com);
-            
-    TTree* T2 = 0;
-    TList* keys = f->GetListOfKeys();
-    TKey*  key;
-     
-    TIter  next( keys );
-    while (( key = static_cast< TKey * > (next()) )) {
-
-        TString  name(key->GetName());    
-        TObject* obj = f->Get( name );
-
-        TClass *classPtr = gROOT->GetClass((const char *) key->GetClassName());
-        if (m_debug) {
-            cout << "<cobs::order> (" << classPtr->GetName() <<") "<<name;
-        }
-                
-        if ( !(classPtr->GetBaseClass("TTree")) ) {
-            cout << "<cobs::order> WARNING ! object " << name << " not cloned!" << endl;
-            continue; 
-        }
-                
-        TTree* T = static_cast<TTree*>(obj);
-
-//      if (m_debug) cout<<"<cobs::order> Ordering tree "<<T->GetName()<<endl;
-        if (m_debug) cout<<" --- ordering "<<endl;
-
-        if (orderBy==1)      T2 = T->CloneTree(-1,"SortBasketsByOffset fast");
-        else if (orderBy==2) T2 = T->CloneTree(-1,"SortBasketsByEntry fast");
-        else if (orderBy==3) T2 = T->CloneTree(-1,"SortBasketsByBranch fast");
-
-        if (!T2) {
-          cout << "Did't get tree; bad orderBy? " << orderBy << "\n";
-          return false;
-        }
-        int s=T2->Write("",TObject::kOverwrite);
-        if (!s) {
-            cout<<" WARNING FILE IS NOT OPTIMIZED. MAYBE NOT ENOUGH DISK SPACE? "<<endl;
-            delete f2;
-            delete f;
-            return false;
-            }
-        f2->WriteStreamerInfo();
-    }
-        
-    //if (m_debug) cout << "------------ copy"<<endl;
-    //f2->ls();
-    delete f2;
-        
-    //if (m_debug) cout << "------------ original"<<endl;
-    //f->ls();
-    delete f;
-    return true;
-}
-//__________________________________________________________________________
-bool cobs::resizeBaskets(){
-    // optimizes basket sizes 
-    // newly produced file has compression level requested.
-    // by default uses function which minimizes total number of baskets in the file
-    
-    if (m_debug) cout<<"<cobs::resizeBaskets> Resizing baskets ... START"<<endl;
-        
-    // // TVirtualStreamerInfo::SetStreamMemberWise(1);
-    
-    if (m_useCINTlibrary) {
-        gSystem->Load(m_libraryDirName.c_str());
-    }
-
-    
-    TFile* f  = TFile::Open( m_inputFilename.c_str());
-    if (f->IsZombie()) {
-        cout << "Error file to be optimized. File is maybe not closed ?" << endl;
-        return false;
-    }  
-    TFile* f2 = TFile::Open(m_outputFilename.c_str(),"RECREATE","",m_compressionLevel);
-    // f2->Write();
-    
-
-    TTree* T2 = 0;
-    TList* keys = f->GetListOfKeys();
-    TKey*  key;
-    
-    TIter  next( keys );
-    while (( key = static_cast< TKey * > (next()) )) {
-        
-        TString  name(key->GetName());      
-        TObject* obj = f->Get( name );
-
-        TClass *classPtr = gROOT->GetClass((const char *) key->GetClassName());
-        
-        if (m_debug) {
-            cout << "<cobs::resize> (" << classPtr->GetName() <<") "<<name;
-        }
-
-        if ( !(classPtr->GetBaseClass("TTree")) ) {
-            cout << "<cobs::resize> WARNING ! object " << name << " not cloned!" << endl;
-            continue; 
-        }
-
-        TTree* T = static_cast<TTree*>(obj);
-        
-        // if no explicit request which trees *not* to optimize is made
-        // only optimize the main payload tree
-        int skip=0;
-        if ( m_treesToSkip.size() == 0) {
-            if (strcmp("CollectionTree",T->GetName())) skip=1;
-        }
-        else{
-            // optimize all except those in skip-list
-            for (vector<string>::iterator i = m_treesToSkip.begin(); i != m_treesToSkip.end(); i++)
-                if (T->GetName() == (*i)) skip=1;
-        }
-        
-        if (m_debug){
-            TObjArray *ls = T->GetListOfLeaves();
-            Int_t nls = ls->GetEntries();
-            cout<<"<cobs::resizeBaskets> "<<name <<" entries: "<<T->GetEntries()<<" size: "<<T->GetTotBytes() <<" zipped: "<<T->GetZipBytes()<<" leaves: "<<nls<<endl;
-        }
-
-        int mem = m_dedicatedMemory; // default 
-        for (vector<pair<int, string> >::iterator i=m_memoryForATree.begin(); i != m_memoryForATree.end(); i++)
-            if ( name==(*i).second ) mem = (*i).first;
-  
-        if (skip) {
-            cout<<"<cobs::resizeBaskets> skipping tree "<<T->GetName()<<endl;
-            T2 = T->CloneTree(-1,"SortBasketsByEntry fast");
-        }
-        else { 
-            SimpleOptimizeBaskets(T, mem, m_minCompressionFactor);
-            T2 = T->CloneTree(-1,"SortBasketsByEntry");
-        }
-        
-        int s=T2->Write("",TObject::kOverwrite);
-        if (!s) {
-            cout<<" WARNING FILE IS NOT OPTIMIZED. MAYBE NOT ENOUGH DISK SPACE? "<<endl;
-            delete f2;
-            delete f;
-            return false;
-        }
-        f2->WriteStreamerInfo();
-        
-        if (m_debug) cout<<"<cobs::resizeBaskets> new tree zip size: "<<T2->GetZipBytes()<<endl;
-    }
-
-
-    // if (m_debug) {
-    //     cout << "------------ copy"<<endl;
-    //     f2->ls();
-    // }
-    delete f2;
-
-    // if (m_debug) {
-    //     cout << "------------ original"<<endl;
-    //     f->ls();
-    // }
-    delete f;
-
-    cout<<"Optimizing baskets sizes FINISHED"<<endl;
-    return true;
-}
-//__________________________________________________________________________
-void cobs::changeSplitLevel(){
-    // this function completely rewrites trees from one file to another
-    // it can change compression level
-        
-    if (m_debug) cout<<"Changing split level ... START"<<endl;
-    // TVirtualStreamerInfo::SetStreamMemberWise(1);        
-    if (m_useCINTlibrary) gSystem->Load(m_libraryDirName.c_str());
-
-    TFile* f  = TFile::Open( m_inputFilename.c_str());  
-    if (f->IsZombie()) {
-        cout << "Error! Can't open input file to change split level. returning. " << endl;
-        return;
-    }
-    TFile* f2 = TFile::Open(m_outputFilename.c_str(),"recreate","",m_compressionLevel);     
-
-    TList* keys = f->GetListOfKeys();
-    TKey*  key;
-
-    TIter  next( keys );
-    while (( key = static_cast< TKey * > (next()) )) {
-
-        TString  name(key->GetName());      
-        TObject* obj = f->Get( name );
-
-        TClass* classPtr = gROOT->GetClass((const char *) key->GetClassName());
-
-        if ( !(classPtr->GetBaseClass("TTree") )) continue;
-
-        TTree *  T                        = static_cast<TTree*>(obj);                 
-        int      nls          = T->GetListOfLeaves()->GetEntries();               
-        // Double_t treeSize     = (Double_t)T->GetTotBytes();
-                
-        cout<<name<<"\t entries: "<<T->GetEntries()<<"\t Size: "<<T->GetTotBytes()<<"\t zipped:"<<T->GetZipBytes()<<"\t leaves: "<<nls<<endl;
-
-        int skip=0;
-        for (vector<string>::iterator i = m_treesToSkip.begin(); i != m_treesToSkip.end(); i++)
-            if (name==(*i)) skip=1;
-        if (skip) {
-            if (m_debug) cout<<"skipping this tree"<<endl;
-            TTree *T2 = T->CloneTree(-1,"fast");
-            T2->Write("", TObject::kOverwrite);
-            cout<<"---------------------------------------------------"<<endl;
-            continue;
-        }
-               
-        RecreateTheTree( T ); 
-    }
-
-    delete f2; 
-        
-    if (m_debug) cout<<"Changing split level ... STOP"<<endl;
-}
-//__________________________________________________________________________
-void cobs::SimpleOptimizeBaskets(TTree* tree, unsigned long memory, float minComp){
-    // function which minimizes total number of baskets in the file
-    // it will not take more memory than a total tree size
-
-    if (tree->GetDirectory()->IsWritable()) tree->FlushBaskets();
-
-    memory *= 1024; // change to bytes
-    TObjArray *leaves      = tree->GetListOfLeaves();
-    const int nleaves      = leaves->GetEntries();
-
-    int       * totSize    = new int[nleaves];
-    int       * basketSize = new int[nleaves];
-    int       * baskets    = new int[nleaves];
-    float     *CF          = new float[nleaves];
-
-
-    int Nnb=0; int NBnb=0;
-       
-    for (int i=0;i<nleaves;i++) { // collects data needed
-        TLeaf   *leaf    = (TLeaf*)leaves->At(i);
-        TBranch *branch  = leaf->GetBranch();
-        int   nb       = branch->GetListOfBranches()->GetEntries();
-
-        totSize[i]    = branch->GetTotBytes();
-        basketSize[i] = totSize[i];
-        baskets[i]    = 1;
-        CF[i]         = 1.0;
-        if (branch->GetTotBytes()) CF[i]= (float)branch->GetZipBytes()/branch->GetTotBytes();
-
-        if (nb > 0) {
-            Nnb++;
-            NBnb += 1 + int(branch->GetTotBytes() /2048);
-            // cout << "no B: " 
-            // << "\t bs: "<<branch->GetBasketSize()
-            // << "\t tot byte: "<< branch->GetTotBytes() 
-            // << "\t tot size: " << branch->GetTotalSize() 
-            // << "\t zip size: " << branch->GetZipBytes()
-            // <<"\t name: "<<branch->GetName() <<endl;
-        }
-
-    }
-    // cout<<"Nnb: "<<Nnb<<"\tNbasketsNB:"<<NBnb<<endl;
-
-    while(true){ // recursive optimization
-
-        double totMem=0;
-        for (int i=0;i<nleaves;i++)
-            totMem += basketSize[i];
-
-        if ( totMem < memory) break;
-
-        int maxSpare=-1; int mi=-1;
-        for (int i=0;i<nleaves;i++){
-            int spare=totSize[i]/baskets[i]-totSize[i]/(baskets[i]+1);
-            if (maxSpare<spare){
-                maxSpare=spare; 
-                mi=i;
-            }
-        }
-        baskets[mi]++;
-        basketSize[mi]=totSize[mi]/baskets[mi];
-        // cout<<"Spare: "<<totSize[mi]/(baskets[mi]-1)-totSize[mi]/baskets[mi]<<"\t baskets: "<<baskets[mi]<<"\t";
-    }
- 
-    double totMem = 0;
-    int    totBas = 0;
-    int    maxBs  = -1;
-    int    minBs  = 1024*1024*1024;
-    for (int i=0;i<nleaves;i++) {           
-        TLeaf *leaf = (TLeaf*)leaves->At(i);
-        TBranch *branch = leaf->GetBranch();
-        if (basketSize[i]==0) basketSize[i]=16;
-        basketSize[i] = basketSize[i] - basketSize[i] % 8;
-        branch->SetBasketSize(basketSize[i]);
-        if (CF[i]<minComp) branch->SetCompressionLevel(0);
-
-        totMem += basketSize[i];
-        totBas += baskets[i];
-        if (basketSize[i]<minBs) minBs=basketSize[i];
-        if (basketSize[i]>maxBs) maxBs=basketSize[i];
-        // cout<<basketSize[i]<<"\t"<<baskets[i]<<endl;
-    }
-    if (m_debug) cout<<"<cobs::SimpleOptimizeBaskets> Total memory buffer: "
-                     <<totMem * 1e-3 <<" kb total baskets: "<<totBas<<"\tmin BS: "<<minBs<<"\tmax BS: "<<maxBs<<endl;
-    //cout<<"-------------------------------------------------------------------------------------------------"<<endl;
-    delete [] totSize;      
-    delete [] basketSize;
-    delete [] baskets;
-    delete [] CF;
-}
-
-
-//__________________________________________________________________________
-bool cobs::RecreateTheTree(TTree* T){
-    // deep tree copy
-    if (m_debug) cout << "<cobs::RecreateTheTree> Recreating tree "<< T->GetName();
-        
-    TTree *T2 = new TTree(T->GetName(),T->GetTitle(),m_splitLevel);
-
-    Int_t nbranches = T->GetListOfBranches()->GetEntriesFast();
-    TBranch *branch;
-        
-    for (Int_t i=0; i<nbranches; i++) {
-
-        branch = (TBranch*)T->GetListOfBranches()->UncheckedAt(i);
-        branch->SetAddress(0);
-
-        if (m_debug) {
-            cout <<"<cobs::RecreateTheTree> "<< branch->GetName()
-                //<<"\t class: "<< branch->GetClassName()
-                 <<"\t BS: "<< branch->GetBasketSize()<<"\t size: "<< branch->GetTotalSize() << endl;
-        }       
-
-        if (strlen(branch->GetClassName())) {   // branch with object
-            T2->Branch(branch->GetName(), branch->GetClassName(), branch->GetAddress(), branch->GetBasketSize(), m_splitLevel);
-        } else {                // branch with simple type
-            T2->Branch(branch->GetName(), branch->GetAddress(), branch->GetBasketSize(), m_splitLevel);
-        }
-    }
-
-    unsigned long nentries = T->GetEntries();
-    for ( unsigned long e = 0; e < nentries; ++e) {
-        T->GetEntry(e);
-        T2->Fill();
-        if (!(e%100))  cout << "\tevent: "<< e << endl;
-    }
-
-    int s = T2->Write("", TObject::kOverwrite);       
-    if (!s) {
-        cout<<" WARNING FILE IS NOT OPTIMIZED. MAYBE NOT ENOUGH DISK SPACE? "<<endl;
-        return false;
-    }              
-    //cout << "<cobs::RecreateTheTree> Recreated tree. Now "<< T2->GetTotBytes()/1000000<<" MB "<<endl;
-    return true;
-}
-//__________________________________________________________________________
-void cobs::printTrees(std::string fileName){
-
-    //gDebug=1;
-
-    TFile* f  = TFile::Open( fileName.c_str()); 
-    if (f->IsZombie()) {
-        cout << "Error! Can't open file to print trees. returning..." << endl;
-        return;
-    }
-    cout << Form("%-45s %12s[Mb]%9s[Mb]%8s %8s %8s\n",
-                 "TREE","TotBytes","ZipBytes","Entries","Branches","Leaves") << endl;
-
-    // Loop on keys and find all trees
-    TList* keys = f->GetListOfKeys();
-    TKey*  key;
-    TIter  next( keys );
-    while ( (key = (TKey *)(next())) ) {
-        TString  name(key->GetName());      
-        TClass *classPtr = gROOT->GetClass((const char *) key->GetClassName());
-        if ( classPtr->GetBaseClass("TTree") ) {
-            TTree* T = (TTree*)(f->Get(name));                          
-
-			Int_t nentries  = T->GetEntries();
-			Int_t nbranches = T->GetListOfBranches()->GetEntries();
-			Int_t nleaves   = T->GetListOfLeaves()->GetEntries();
-
-            printf("TREE   %-45s %12.6f %12.6f %8d %8d %8d\n",
-                         T->GetName(),
-                         1.e-6*(Float_t)(T->GetTotBytes()),
-                         1.e-6*(Float_t)(T->GetZipBytes()),
-                         nentries, nbranches, nleaves
-                         );
-						 
-		    if (m_showBranches == true) printBranches(T);
-						 
-        } else {
-		  // also show other objects on file
-		  cout << "("<<classPtr->GetName()<<") "<<name<<endl;
-		}
-    }
-
-    delete f;
-}
-//____________________________________________________________________________
-Int_t cobs::printBranches(TTree *T) {
-
-  Int_t nbranches = T->GetListOfBranches()->GetEntries();
-  Int_t nb=0;
-  Int_t entry=0;
-  Int_t getall=1;
-
-  //hBranchSizes = new TH1F("hbranchsizes","Branch Sizes (unzipped)",nbranches,0,nbranches);
-  //hBranchSizes->SetYTitle("Mb");
-  //hBranchSizes->SetBit(TH1::kCanRebin);
-
-  printf("%112s\n","basketsize[kb]");
-
-  for (Int_t i=0;i<nbranches;i++)  {
-     TBranch* branch = (TBranch*)T->GetListOfBranches()->At(i);
-
-     branch->SetAddress(0);
-
- 	 const char* pname  = branch->GetName();     
-     const char* clname = branch->GetClassName();
-
-     // only show transient part of name
-	 const char * tname = pname;
-	 if (strstr(pname,clname)) {
-       tname = pname+strlen(clname)+1;	  
-     }
-	 
-     nb = branch->GetEntry(entry, getall);
-     if (nb < 0) {
-       cout << "I/O error reading branch " << branch->GetName() << endl;
-       return nb;
-     }
-     Float_t ntot= branch->GetTotBytes("*");
-     Float_t nzip= branch->GetZipBytes("*");
-	 
-	 Int_t nbranches  = branch->GetListOfBranches()->GetEntries();
- 	 Int_t basketsize = branch->GetBasketSize();
-
-     //if (ntot>20.e6) {
-     printf("BRANCH   %-43s %12.6f %12.6f          %8d %8.3f\n",
-         tname, 1.e-6*(Double_t)(ntot), 1.e-6*(Double_t)(nzip), 
-         nbranches, 1.e-3*basketsize );
-
-       //hBranchSizes->Fill(branch->GetName(),1.e-6*(Double_t)(ntot));
-     //}
-  }
-  cout << endl;
-
-  return nbranches;
-}
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/cobs.h b/Database/AthenaPOOL/RootFileTools/src/cobs.h
deleted file mode 100644
index 031e4a4c198..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/cobs.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <vector>
-#include <string>
-
-#include <TTree.h>
-
-class cobs {
-
-public:
-        
-    cobs()
-      : m_useCINTlibrary(false),
-        m_compressionLevel(0),
-        m_splitLevel(0),
-        m_dedicatedMemory(0),
-        m_minCompressionFactor(0),
-        m_debug(false),
-        m_showBranches(false)
-    {}
-    cobs(std::string inputFile);
-    cobs(std::string inputFile, std::string outputFile);
-
-    void setDebug(bool debug);
-    void setOutputFile(std::string outputFile);
-    void setCompressionLevel(short CL);
-    void setSplitLevel(short SL);
-    void setDedicatedMemory(int DM); // in kilobytes
-    void setDebugLevel(short DL);
-    void setTreeToSkip(std::string treeName);
-    void setTreeMemory(int mem, std::string treeName);
-    void setMinCompressionFactor(float minComp);
-    void setLibraryName(std::string);
-    void useCINTLibrary(bool use=false);
-    void mkProject();
-                   
-    // clone fast to reorder baskets (default: by entry)
-    bool order(short orderBy=2);
-    bool resizeBaskets();
-    void changeSplitLevel();
-                
-    void  printTrees(std::string fileName);
-    Int_t printBranches(TTree *T);
-    void  setShowBranches(bool b) { m_showBranches = b; }
-                               
-private:
-                
-    void SimpleOptimizeBaskets(TTree*, unsigned long, float );
-    bool RecreateTheTree(TTree* );
-                
-    std::string m_libraryName;
-    std::string m_libraryDirName;
-    bool        m_useCINTlibrary;
-    std::string m_inputFilename;
-    std::string m_outputFilename;
-    short       m_compressionLevel;
-    short       m_splitLevel;
-    int         m_dedicatedMemory; // in kb's
-    float       m_minCompressionFactor; // don't compress branches with CF smaller than this number
-    bool        m_debug;
-    std::vector<std::string> m_treesToSkip;
-    std::vector<std::pair<int, std::string> > m_memoryForATree;
-                
-    bool        m_showBranches;
-                
-};
diff --git a/Database/AthenaPOOL/RootFileTools/src/components/RootFileTransformations_entries.cxx b/Database/AthenaPOOL/RootFileTools/src/components/RootFileTransformations_entries.cxx
deleted file mode 100644
index efa19ea6588..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/components/RootFileTransformations_entries.cxx
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "../RootFileTransformationsTool.h"
-
-
-DECLARE_COMPONENT( RootFileTransformationsTool )
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/mergeD3PD.cxx b/Database/AthenaPOOL/RootFileTools/src/mergeD3PD.cxx
deleted file mode 100644
index 28f21b61df4..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/mergeD3PD.cxx
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// TODO:
-// make sure that we use only the last of all the trees with the same name !!!
-
-#include <Riostream.h>
-
-#include <TTree.h>
-#include <TFile.h>
-#include <TChain.h>
-#include <TChainElement.h>
-#include <TSystem.h>
-#include <TROOT.h>
-#include <TKey.h>
-#include <TLeaf.h>
-#include <TStopwatch.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream>
-#include <sstream>
-
-using namespace std;
-
-class mTree{
-public:
-    mTree(string a):filename(a), entries(0){}
-    string filename;
-    long entries;
-};
-
-class mTrees{
-public:
-    mTrees(string a):name(a),leaves(0),totalSize(0){}
-    string name;
-    int leaves;
-    double totalSize;    
-    vector<unsigned int> basketSize;// this is the value to be optimized - at beggining = totSize
-    vector<unsigned int> totSize;// this is value of ZIPPED SIZES collected from all the files
-    vector<unsigned int> baskets;// this is cached to speed up calculation - at beggining = 1 
-    void addFile(string s){ m_tree.push_back(mTree(s)); }
-    
-    void setLeaves(int l){
-        leaves=l;
-        for (int w=0;w<l;w++){
-            totSize.push_back(0); 
-            }
-    }
-    
-    void recalculate(){
-        cout<<"recalculate baskets"<<endl;
-        for (int w=0;w<leaves;w++){
-            basketSize.push_back(totSize[w]);
-            baskets.push_back(1);
-            totalSize+=totSize[w];
-        }
-    }
-    
-    void optimize(unsigned long memory){
-        
-        cout<<"optimize baskets. total tree size:"<<totalSize<<"\t memory: "<<memory<<endl;
-        while(true){    
-            double totMem=0;
-            for (int i=0;i<leaves;i++)
-                totMem += basketSize[i];
-                 
-            if ( totMem < memory) break;
-    
-            int maxSpare=-1; int mi=-1;
-            for (int i=0;i<leaves;i++){
-                int spare=totSize[i]/baskets[i]-totSize[i]/(baskets[i]+1);
-                if (maxSpare<spare){
-                    maxSpare=spare; 
-                    mi=i;
-                }
-            }
-            if (mi < 0) continue;
-            baskets[mi]++;
-            basketSize[mi]=totSize[mi]/baskets[mi];
-            // cout<<"totMem: "<<totMem<<"\tSpare: "<<totSize[mi]/(baskets[mi]-1)-totSize[mi]/baskets[mi]<<"\t baskets: "<<baskets[mi]<<"\n";
-        }
-        roundBasketSize();
-    }
-    
-    void roundBasketSize(){
-        
-        cout<<"round basket sizes"<<endl;
-        double totMem = 0;
-        int    totBas = 0;
-        unsigned int    maxBs  = 0;
-        unsigned int    minBs  = 1024*1024*1024;
-        
-        for (int w=0;w<leaves;w++){
-            if (basketSize[w]==0) basketSize[w]=16;
-            basketSize[w] = basketSize[w] - basketSize[w] % 8;
-            totMem += basketSize[w];
-            totBas += baskets[w];
-            if (basketSize[w]<minBs) minBs=basketSize[w];
-            if (basketSize[w]>maxBs) maxBs=basketSize[w];
-        }
-        cout<<"Total memory buffer: "<<totMem/1024<<" kb total baskets: "<<totBas<<"\tmin BS: "<<minBs<<"\tmax BS: "<<maxBs<<endl;
-        cout<<"-------------------------------------------------------------------------------------------------"<<endl;
-    }
-    
-    vector<mTree>::const_iterator bi(){return (vector<mTree>::const_iterator) m_tree.begin();};
-    vector<mTree>::const_iterator ei(){return (vector<mTree>::const_iterator) m_tree.end();};
-    
-private:
-    vector<mTree> m_tree;
-};
-
-std::string sfo="";
-
-vector<mTrees> ALL;
-
-void ren(){
-    cout<<"renaming ... "<<endl;
-    std::string com="rm "+sfo+".root; for i in *temporary*.root; do mv \"$i\" \"${i/_temporary/}\";done";
-    // cout<<"command to execute: "<<com<<endl;
-    int ret=system (com.c_str());
-    if (!ret) cout<<"files renamed OK"<<endl;
-}
-
-void warmUp(const char* fn){
-    std::string com="cat "+std::string(fn)+" > /dev/null ";
-    cout<<"warming up the cache for file: "<<com<<endl;
-    int ret=system (com.c_str());
-    if (!ret) cout<<"file warmed up OK"<<endl;
-}
-
-
-void order(int m){
-    
-    TChain *ch=new TChain(ALL.begin()->name.c_str());
-    std::string o=sfo+"*.root";
-    ch->Add(o.c_str());
-    TObjArray *oaFiles=ch->GetListOfFiles();
-    
-    for(int i=0;i<oaFiles->GetEntries();i++){
-        TChainElement *element = (TChainElement*)oaFiles->At(i);
-        const char *fn=element->GetTitle();
-        
-        TStopwatch timer;    
-        timer.Start();
-        cout<<"optimizing: "<<fn<<endl;
-        // warmUp(fn);
-        
-        timer.Start();
-        TFile *fIn = TFile::Open(fn);
-        
-        std::stringstream out; out << i;
-        std::string s = out.str();
-        std::string tmp = sfo+"_temporary_"+s+".root";
-        TFile* fOut=TFile::Open(tmp.c_str(),"recreate","",6);
-     
-     // -  ordering
-        for (vector<mTrees>::const_iterator it=ALL.begin();it!=ALL.end();it++){
-            TTree *tc2 = (TTree*)fIn->Get(it->name.c_str()) ;
-            TTree* TC2;
-            if (m==2)  TC2= tc2->CloneTree(-1,"SortBasketsByEntry fast");
-            else TC2 = tc2->CloneTree(-1,"SortBasketsByBranch fast");
-            TC2->Write("",TObject::kOverwrite);
-        }
-     // -  
-       
-        timer.Stop();
-        cout<<"ordering file:                   "<<i<<" \t\twallclock time: "<< timer.RealTime()<<"\t CPU time: "<<timer.CpuTime()<<endl;
-        
-        fOut->Close();
-        fIn->Close();
-    }
-    
-    cout<<"ordering done"<<endl;
-    ren();
-    return;
-}
-
-void optimizeBasketSizes(){
-    
-    for (vector<mTrees>::iterator it=ALL.begin(); it!=ALL.end(); it++) {
-        
-        cout<<"Doing tree: "<<it->name<<endl;
-        // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>          SUMMING UP BRANCH SIZES OVER ALL THE FILES
-        for(vector<mTree>::const_iterator itt=it->bi(); itt!=it->ei(); itt++){ // loop over files having this tree
-            
-            TFile* f = TFile::Open(itt->filename.c_str());
-            TTree* t = (TTree*) f->Get(it->name.c_str());
-    
-            for (int i=0; i<it->leaves; i++) {
-                TBranch* branch = (TBranch*)t->GetListOfBranches()->UncheckedAt(i);
-                branch->SetAddress(0);
-                // cout <<i<<"\t"<<branch->GetName()<<"\t BS: "<< branch->GetBasketSize()<<"\t size: "<< branch->GetTotalSize()<< "\ttotbytes: "<<branch->GetTotBytes() << endl;
-                it->totSize[i] += branch->GetTotBytes(); 
-            }
-             
-            f->Close();
-        }
-        
-        cout<<"got basket sizes from all the files"<<endl;
-        it->recalculate();
-        
-        it->optimize(40*1024*1024); // in bytes !
-        
-
-    }
-}
-
-void createMergedFile(){
-    
-    std::string oname=sfo+".root";
-    TFile* fOut = TFile::Open(oname.c_str(),"RECREATE","",1);
-    TDirectory *gDirectory_save = gDirectory;
-    if (fOut->IsZombie()){
-        cout<<"File "<<oname<<" isZombified. Output file can not be created."<<endl;
-        return;
-    }
-    
-    TTree *newtree=0; 
-    for (vector<mTrees>::iterator it=ALL.begin(); it!=ALL.end(); it++) {
-        
-        TFile* f = TFile::Open((it->bi())->filename.c_str());
-        TTree* t = (TTree*) f->Get(it->name.c_str());
-        
-       // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CREATING NEW TREE
-        newtree = (TTree*)t->CloneTree(0); // no copy of events
-        
-        newtree->SetDirectory(gDirectory_save);
-        
-        // Once the cloning is done, separate the trees,to avoid as many side-effects as possible
-        t->GetListOfClones()->Remove(newtree);
-        t->ResetBranchAddresses();
-        newtree->ResetBranchAddresses();
-       
-       // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Setting optimized basket sizes. 
-        for (int w=0;w<it->leaves;w++) {     
-            TBranch* branch=(TBranch*)newtree->GetListOfBranches()->UncheckedAt(w);
-            branch->SetBasketSize(it->basketSize[w]);
-            // cout<<"basket size: "<<basketSize[w]<<"\t number of baskets:"<<baskets[w]<<endl;
-        }
-
-        // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> copying data.
-            
-        for(vector<mTree>::const_iterator itt=it->bi(); itt!=it->ei(); itt++){ // loop over files having this tree
-
-            TFile* f = TFile::Open(itt->filename.c_str());
-            TTree* t = (TTree*) f->Get(it->name.c_str());
-            
-            unsigned long nentries = t->GetEntries();    
-            newtree->CopyAddresses(t);
-            for ( unsigned long e = 0; e < nentries; ++e) {
-                t->GetEntry(e);
-                newtree->Fill();
-            }
-            t->ResetBranchAddresses(); // Disconnect from new tree.
-            f->Close();
-            cout<<"Current file entries: "<<nentries <<endl;
-        }
-        
-        fOut->cd();
-        int s = newtree->Write("", TObject::kOverwrite);       
-        if (!s) {
-            cout<<" WARNING FILE IS NOT OPTIMIZED. MAYBE NOT ENOUGH DISK SPACE? "<<endl;
-            return;
-        }
-    }
-       
-    fOut=newtree->GetCurrentFile();
-    fOut->Write();
-    fOut->Close();
-    
-}
-
-
-
-int main(int argc,char* argv[]){
-    
-    
-    if (argc < 5) { 
-        cout << "Usage is:\n";
-        cout << "\t-in <infile>             --- this can be of the form /data/higgs/my*nobel*_000*.1 \n";
-        cout << "\t-out <outfile>           --- this can be of the form /data/out/higgs - as .root will be appended\n";
-        cout << "\t-maxsize <tree max size> --- maximum zip size of the main tree (in Mb). The default value is 6000.\n";
-		cout << "\t-byBranch                --- baskets in output files will be ordered by branch. The default is by Entry.\n";
-        cout << "\t-noCollectionTree        --- TTree named CollectionTree is usualy needed if you will use merged file in Athena\n";
-        std::cin.get();
-        return 0;
-    }
-    
-    char *fi = NULL;
-    Long64_t maxsize=6000;
-    bool noCollectionTree=false;
-	int toOrder=2;
-    
-    for (int i = 1; i < argc; i++) {    
-        if (! strcmp(argv[i], "-in") ) {
-            fi = argv[i + 1];
-        } else if (! strcmp(argv[i], "-out") ) {
-            sfo=std::string(argv[i + 1]);
-        } else if (! strcmp(argv[i], "-maxsize") ) {
-            maxsize = atoi(argv[i + 1]);
-        } else if (! strcmp(argv[i], "-byBranch") ){
-			toOrder=1;
-		} else if (! strcmp(argv[i], "-noCollectionTree")){
-            noCollectionTree=true;
-        }
-    }
-    
-    TTree::SetMaxTreeSize(maxsize*1024*1024);
-    
-    cout<<"Input files: "<<fi<<"\nOutput file: "<<sfo<<"\nMax Tree Size: "<<maxsize<<endl;
-    
-    TChain *ch = new TChain("CollectionTree");
-    ch->Add(fi);
-    
-    TObjArray *oaFiles = ch->GetListOfFiles();
-    if (!oaFiles->GetEntries()){
-        cout<<"No input files found!"<<endl;
-        return 0;
-    }
-    
-    
-    cout<<"I chain created..."<<endl;
-    
-    
-    
-    // ==================================================================== take tree names from the first file
-    
-    TFile f( ((TChainElement*) oaFiles->At(0))->GetTitle() );
-    
-    TList* keys = f.GetListOfKeys();
-    TKey*  key;  TIter  next( keys );
-    string oldname("");
-    while (( key = static_cast< TKey * > (next()) )) {
-        string name(key->GetName());
-        TClass *classPtr = gROOT->GetClass((const char *) key->GetClassName());
-        if ( !(classPtr->GetBaseClass("TTree")) ) {
-            cout << " WARNING ! object " << name << " will not be merged!" << endl;
-            continue; 
-        } else {
-            if (oldname==name) continue;
-            oldname=name;
-            if (noCollectionTree and name=="CollectionTree") continue; 
-            cout<< "Tree to merge: "<< name <<endl;
-            mTrees tt(name);
-            ALL.push_back(tt);
-        }
-    }
-    key=NULL;
-    f.Close();
-    
-    
-    cout<<"II trees to merge determined ..."<<endl;
-    // =====================================================================
-
-    std::vector<TFile*> fFile (oaFiles->GetEntries());
-    for(int i=0;i<oaFiles->GetEntries();i++){
-        
-        const char* fn = ((TChainElement*)oaFiles->At(i))->GetTitle();
-        fFile[i] = TFile::Open(fn);
-        
-        if (fFile[i]->IsZombie()){
-            cout<<"File "<<fn<<" isZombified. Its corrupted or not a root file."<<endl;
-            continue;
-        }
-        
-        for(vector<mTrees>::iterator it=ALL.begin();it!=ALL.end();it++){
-            TTree* tmpt=(TTree*)fFile[i]->Get( (it->name).c_str() );
-            int leaves=tmpt->GetListOfBranches()->GetEntriesFast();
-            
-            if (!leaves){
-                cout<<"WARNING! Tree: "<< (it->name).c_str() <<"  in file: "<<fn<<" contains no events. Will not be merged."<<endl;
-            }
-            else{
-                it->addFile(fn);
-                if (!it->leaves)
-                    it->setLeaves(leaves);
-            }
-        }
-        
-        fFile[i]->Close();
-    }
-    
-    delete ch;  ch=NULL;
-    oaFiles=NULL;
-    cout<<"Files checked and verified..."<<endl;
-    // =====================================================================
-    
-    TStopwatch timer;
-    timer.Start();
-
-    optimizeBasketSizes();
-    createMergedFile();
-    
-    timer.Stop();
-    cout<<"Done           in wallclock: "<< timer.RealTime()<<"\t\t CPU time: "<<timer.CpuTime()<<endl;
-    
-    order(toOrder);
-    
-return 0;   
-}
-
-
-
-
diff --git a/Database/AthenaPOOL/RootFileTools/src/releaseFileCache.cxx b/Database/AthenaPOOL/RootFileTools/src/releaseFileCache.cxx
deleted file mode 100644
index 8564a114573..00000000000
--- a/Database/AthenaPOOL/RootFileTools/src/releaseFileCache.cxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-int main(int argc, char *argv[]) {
-	if (argc==1) {
-		puts(" usage: releaseFileCache <filename>\n removes from memory all the cache associtated to the file given.");
-		return 0;
-    }
-    int fd;
-    fd = open(argv[1], O_RDONLY);
-    if (fd < 0) {
-      perror ("open");
-      return 1;
-    }
-#ifndef __APPLE__
-    fdatasync(fd);
-    if (posix_fadvise(fd, 0,0,POSIX_FADV_DONTNEED) < 0) {
-      perror ("posix_fadvise");
-      return 1;
-    }
-#else
-	fsync(fd);
-#endif
-    close(fd);
-    return 0;
-}
-
-- 
GitLab


From 57c8e8e0da6cc7b6e9aa6d8b6250972a06645d70 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 25 Feb 2019 23:58:17 +0100
Subject: [PATCH 042/404] Fix Athena and AthenaHive event loop managers for
 running over inputs without the old-style EventInfo

For such inputs the event loop manager first tries to get the xAOD::EventInfo, and in case of success
it creates the old-style EventInfo in the Event Store for those clients that still need it
---
 .../AthenaServices/src/AthenaEventLoopMgr.cxx | 12 ++++++++---
 .../src/AthenaHiveEventLoopMgr.cxx            | 20 +++++++++++++++++--
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/Control/AthenaServices/src/AthenaEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
index 8e08151e23d..ece6bb68f8a 100644
--- a/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaEventLoopMgr.cxx
@@ -674,10 +674,17 @@ StatusCode AthenaEventLoopMgr::executeEvent(void* /*par*/)
 	  eventStore()->tryConstRetrieve<xAOD::EventInfo>(); 
 	if (xAODEvent==nullptr) {
 	  error() << "Failed to get EventID from input. Tried old-style and xAOD::EventInfo" <<endmsg;
-	  //std::cout << eventStore()->dump();
 	  return StatusCode::FAILURE;
 	}
-	eventID=eventIDFromxAOD(xAODEvent);
+	// Record the old-style object for those clients that still need it
+	pEventPtr = CxxUtils::make_unique<EventInfo>(new EventID(eventIDFromxAOD(xAODEvent)), new EventType(eventTypeFromxAOD(xAODEvent)));
+	pEvent = pEventPtr.get();
+	eventID=*(pEvent->event_ID());
+	StatusCode sc = eventStore()->record(std::move(pEventPtr),"");
+	if( !sc.isSuccess() )  {
+	  error() << "Error declaring event data object" << endmsg;
+	  return StatusCode::FAILURE;
+	}
       }
     }
   }
@@ -1088,7 +1095,6 @@ void AthenaEventLoopMgr::handle(const Incident& inc)
     const xAOD::EventInfo* xAODEvent=eventStore()->tryConstRetrieve<xAOD::EventInfo>(); 
     if (xAODEvent==nullptr) {
       error() << "Failed to get EventID from input. Tried old-style and xAOD::EventInfo" <<endmsg;
-      std::cout << eventStore()->dump();
       return; 
     }
     eventID=eventIDFromxAOD(xAODEvent);
diff --git a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
index ff44dbfdfa8..9ee4df119fb 100644
--- a/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
+++ b/Control/AthenaServices/src/AthenaHiveEventLoopMgr.cxx
@@ -42,6 +42,8 @@
 #include "EventInfo/EventInfo.h"
 #include "EventInfo/EventID.h"
 #include "EventInfo/EventType.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "EventInfoUtils/EventInfoFromxAOD.h"
 
 #include "AthenaHiveEventLoopMgr.h"
 
@@ -1109,8 +1111,22 @@ int AthenaHiveEventLoopMgr::declareEventRootAddress(const EventContext& ctx){
     // Retrieve the Event object
     sc = eventStore()->retrieve(pEvent);
     if( !sc.isSuccess() ) {
-      error() << "Unable to retrieve Event root object" << endmsg;
-      return -1;
+      // Try to get the xAOD::EventInfo
+      const xAOD::EventInfo* pXEvent{nullptr};
+      sc = eventStore()->retrieve(pXEvent);
+      if( !sc.isSuccess() ) {
+	error() << "Unable to retrieve Event root object" << endmsg;
+	return -1;
+      }
+      // Build the old-style Event Info object for those clients that still need it
+      std::unique_ptr<EventInfo> pEventPtr = CxxUtils::make_unique<EventInfo>(new EventID(eventIDFromxAOD(pXEvent))
+									      , new EventType(eventTypeFromxAOD(pXEvent)));
+      pEvent = pEventPtr.get();
+      sc = eventStore()->record(std::move(pEventPtr),"");
+      if( !sc.isSuccess() )  {
+	error() << "Error declaring event data object" << endmsg;
+	return -1;
+      }
     }
 
     m_pEvent = pEvent;
-- 
GitLab


From acc784b983dc6e8a62dfe58f0afce0d7a82ed316 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Tue, 26 Feb 2019 09:48:39 +0000
Subject: [PATCH 043/404] Merge branch 'debugR1BStest' into '21.3'

ATR-19447: Change which log is grepped in test_run1_bstoesdaod_build

See merge request atlas/athena!21416

(cherry picked from commit a91c8e147e5b7758a07e0cb6531dbe87d810a375)

b3990020 change where log is grepped in test_run1_bstoesdaod_build
---
 .../TrigAnalysisTest/test/test_run1_bstoesdaod_build.sh        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_run1_bstoesdaod_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_run1_bstoesdaod_build.sh
index 4a3fa15424b..b41ce19b829 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_run1_bstoesdaod_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_run1_bstoesdaod_build.sh
@@ -28,6 +28,7 @@ export COST_MONITORING="False"
 export TEST="TrigAnalysisTest"
 export EVENTS="5"
 export JOB_LOG="athena.log"
+export RECO_LOG="log.RAWtoESD"
 
 Reco_tf.py --maxEvents $EVENTS \
 --AMITag 'q222' \
@@ -41,7 +42,7 @@ Reco_tf.py --maxEvents $EVENTS \
 --outputAODFile 'AOD.pool.root' \
 --outputHISTFile 'HIST.root' &> ${JOB_LOG}
 
-N_CONTAINERS=$(grep -o HLT_xAOD__ ${JOB_LOG} | wc -l)
+N_CONTAINERS=$(grep -o HLT_xAOD__ ${RECO_LOG} | wc -l)
 if [ $N_CONTAINERS -gt 0 ]; then 
   echo "xAOD Container Check: ${N_CONTAINERS} xAOD HLT containers found. OK."; 
   echo "art-result: xAODContainers 0"
-- 
GitLab


From fa9bdb52e868eb8b446b33ee1d3ec7cb0e2baf59 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 05:07:04 +0100
Subject: [PATCH 044/404] AthExHelloWorld: Fix grep pattern in test.

Fix unmatched parens in EXTRA_PATTERNS.
---
 .../AthExHelloWorld/CMakeLists.txt            |  2 +-
 .../share/AthExHelloWorldMT_2.ref             | 37 ++++++++++++-------
 2 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/Control/AthenaExamples/AthExHelloWorld/CMakeLists.txt b/Control/AthenaExamples/AthExHelloWorld/CMakeLists.txt
index 552f735fab9..3cbee671209 100644
--- a/Control/AthenaExamples/AthExHelloWorld/CMakeLists.txt
+++ b/Control/AthenaExamples/AthExHelloWorld/CMakeLists.txt
@@ -37,7 +37,7 @@ atlas_add_test( AthExHelloWorldMT_1
 atlas_add_test( AthExHelloWorldMT_2
     ENVIRONMENT THREADS=2
 		SCRIPT test/test_AthExHelloWorld.sh
-    EXTRA_PATTERNS "AthenaHiveEventLoopMgr.* processing event|^HelloWorld .*(INFO|WARNING A WARNING|ERROR An ERROR|FATAL A FATAL" #processing order can change
+    EXTRA_PATTERNS "AthenaHiveEventLoopMgr.* processing event|^HelloWorld .*(INFO|WARNING A WARNING|ERROR An ERROR|FATAL A FATAL)" #processing order can change
 		)
 
 atlas_add_test( AthExHelloWorld_CfgTest    SCRIPT python -m AthExHelloWorld.HelloWorldConfig    POST_EXEC_SCRIPT nopost.sh )
diff --git a/Control/AthenaExamples/AthExHelloWorld/share/AthExHelloWorldMT_2.ref b/Control/AthenaExamples/AthExHelloWorld/share/AthExHelloWorldMT_2.ref
index 9daa6040063..f949b94b920 100644
--- a/Control/AthenaExamples/AthExHelloWorld/share/AthExHelloWorldMT_2.ref
+++ b/Control/AthenaExamples/AthExHelloWorld/share/AthExHelloWorldMT_2.ref
@@ -1,7 +1,7 @@
-Sun Jan 20 03:15:09 CET 2019
+Wed Feb 27 04:49:09 CET 2019
 Preloading tcmalloc_minimal.so
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [WorkDir-22.0.1] [x86_64-slc6-gcc8-opt] [atlas-work3/7fb5304f19] -- built on [2019-01-19T2316]
+Py:Athena            INFO using release [WorkDir-22.0.1] [x86_64-centos7-gcc8-opt] [atlas-work3/aba582d739d] -- built on [2019-02-27T0219]
 Py:Athena            INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Py:Athena            INFO executing ROOT6Setup
 Py:Athena            INFO configuring AthenaHive with [2] concurrent threads and [2] concurrent events
@@ -9,25 +9,32 @@ Py:AlgScheduler      INFO setting up AvalancheSchedulerSvc/AvalancheSchedulerSvc
 Py:Athena            INFO including file "AthenaCommon/Execution.py"
 Py:Athena            INFO including file "AthExHelloWorld/HelloWorldOptions.py"
 Py:Athena            INFO including file "AthenaCommon/runbatch.py"
-Py:ConfigurableDb    INFO Read module info for 5455 configurables from 55 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5463 configurables from 45 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-[?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
 MessageSvc           INFO Activating in a separate thread
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
-                                                   Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
-                                          running on lxplus076.cern.ch on Sun Jan 20 03:15:30 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus057.cern.ch on Wed Feb 27 04:49:23 2019
 ====================================================================================================================================
-ApplicationMgr       INFO Successfully loaded modules : AthenaServices
 ApplicationMgr       INFO Application Manager Configured successfully
 ApplicationMgr                                     INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
 AthDictLoaderSvc                                   INFO in initialize...
 AthDictLoaderSvc                                   INFO acquired Dso-registry
-ClassIDSvc                                         INFO  getRegistryEntries: read 3685 CLIDRegistry entries for module ALL
+ClassIDSvc                                         INFO  getRegistryEntries: read 3750 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) 
 AthenaHiveEventLoopMgr                             INFO Initializing AthenaHiveEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc                                  0      INFO  getRegistryEntries: read 1193 CLIDRegistry entries for module ALL
+xAODMaker::EventInfoCnvAlg                  0      INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
+xAODMaker::EventInfoCnvAlg.EventInfoC...    0      INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
+xAODMaker::EventInfoCnvAlg.EventInfoC...    0   WARNING Beam conditions service not available
+xAODMaker::EventInfoCnvAlg.EventInfoC...    0   WARNING Will not fill beam spot information into xAOD::EventInfo
+xAODMaker::EventInfoCnvAlg.EventInfoC...    0      INFO Luminosity information not available
+xAODMaker::EventInfoCnvAlg.EventInfoC...    0      INFO Will take information from the EventInfo object
+ClassIDSvc                                  0      INFO  getRegistryEntries: read 159 CLIDRegistry entries for module ALL
 HelloWorld                                  0      INFO initialize()
 HelloWorld                                  0      INFO   MyInt =    42
 HelloWorld                                  0      INFO   MyBool =   1
@@ -57,8 +64,10 @@ HelloWorld                                  0      INFO MyPrivateHelloTool: Retr
 HelloWorld                                  0      INFO MyPublicHelloTool: Retrieved tool HelloTool
 ThreadPoolSvc                               0      INFO no thread init tools attached
 AvalancheSchedulerSvc                       0      INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                       0      INFO Found 6 algorithms
-AvalancheSchedulerSvc                       0      INFO No unmet INPUT data dependencies were found
+AvalancheSchedulerSvc                       0      INFO Found 7 algorithms
+AvalancheSchedulerSvc                       0      INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
+   o  ( 'EventInfo' , 'StoreGateSvc+McEventInfo' )     required by Algorithm: 
+       * xAODMaker::EventInfoCnvAlg
 PrecedenceSvc                               0      INFO Assembling CF and DF task precedence rules
 PrecedenceSvc                               0      INFO PrecedenceSvc initialized successfully
 AvalancheSchedulerSvc                       0      INFO Concurrency level information:
@@ -84,6 +93,7 @@ HelloWorld                              0   0      INFO Let the tool MyPublicHel
 ToolSvc.PublicHello                     0   0      INFO my message to the world: A Public Message!
 HelloWorld                              0   0      INFO Let the tool MyPrivateHelloTool say something:
 HelloWorld.HelloTool                    0   0      INFO my message to the world: A Private Message!
+ClassIDSvc                              0   0      INFO  getRegistryEntries: read 108 CLIDRegistry entries for module ALL
 HelloWorld                              1   1      INFO execute()
 HelloWorld                              1   1      INFO An INFO message
 HelloWorld                              1   1   WARNING A WARNING message
@@ -183,8 +193,8 @@ ToolSvc.PublicHello                     9   1      INFO my message to the world:
 HelloWorld                              9   1      INFO Let the tool MyPrivateHelloTool say something:
 HelloWorld.HelloTool                    9   1      INFO my message to the world: A Private Message!
 AthenaHiveEventLoopMgr                             INFO   ===>>>  done processing event #9, run #0 on slot 1,  10 events processed so far  <<<===
-AthenaHiveEventLoopMgr                             INFO ---> Loop Finished (seconds): 0.145294
-HelloWorld                                         INFO stop()
+AthenaHiveEventLoopMgr                             INFO ---> Loop Finished (seconds): 0.0229208
+HelloWorld                              9   1      INFO stop()
 ApplicationMgr                                     INFO Application Manager Stopped successfully
 IncidentProcAlg1                                   INFO Finalize
 SGInputLoader                                      INFO Finalizing SGInputLoader...
@@ -196,9 +206,10 @@ EventDataSvc                                       INFO Finalizing EventDataSvc
 AthDictLoaderSvc                                   INFO in finalize...
 ToolSvc                                            INFO Removing all tools created by ToolSvc
 *****Chrono*****                                   INFO ****************************************************************************************************
+*****Chrono*****                                   INFO WARNING: MT job; statistics are unreliable
 *****Chrono*****                                   INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****                                   INFO ****************************************************************************************************
-ChronoStatSvc                                      INFO Time User   : Tot=  130 [ms]                                             #=  1
+ChronoStatSvc                                      INFO Time User   : Tot=  120 [ms]                                             #=  1
 *****Chrono*****                                   INFO ****************************************************************************************************
 ChronoStatSvc.finalize()                           INFO  Service finalized successfully 
 ApplicationMgr                                     INFO Application Manager Finalized successfully
-- 
GitLab


From 066b004d554ac4f629be626547803de9ce230f30 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 26 Feb 2019 17:01:41 +0100
Subject: [PATCH 045/404] IdDict: Fix cppcheck warnings.

cppcheck warnings: Passing structs by value; field duplicated bewteen
base and derived.
---
 DetectorDescription/IdDict/IdDict/IdDictDefs.h     | 14 ++++++--------
 .../IdDict/IdDict/IdDictFieldImplementation.h      | 10 +++++-----
 DetectorDescription/IdDict/src/IdDictMgr.cxx       | 14 +++++++-------
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/DetectorDescription/IdDict/IdDict/IdDictDefs.h b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
index 4af35be5d95..d3745ff85c6 100755
--- a/DetectorDescription/IdDict/IdDict/IdDictDefs.h
+++ b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
@@ -107,7 +107,7 @@ public:
     int get_label_value (const std::string& field, const std::string& label, int& value) const;  // > 0 == error
     IdDictSubRegion* find_subregion (const std::string& subregion_name) const;  
     IdDictRegion* find_region (const std::string& region_name) const;  
-    IdDictRegion* find_region (const std::string& region_name, const std::string group_name) const;  
+    IdDictRegion* find_region (const std::string& region_name, const std::string& group_name) const;  
     IdDictGroup* find_group (const std::string& group_name) const;
 
 
@@ -126,7 +126,7 @@ public:
     /// Find first region that matches id
     int find_region(const ExpandedIdentifier& id, size_type& index) const;
     IdDictRegion* find_region(const ExpandedIdentifier& id) const;
-    IdDictRegion* find_region(const ExpandedIdentifier& id,const std::string group_name) const;
+    IdDictRegion* find_region(const ExpandedIdentifier& id,const std::string& group_name) const;
     
     ///  Set up integral of bits for efficient unpacking
     void integrate_bits ();
@@ -139,8 +139,8 @@ public:
      *   'last_field' If last_field == "", all fields are
      * taken. Prepend prefix if provided.  */
     MultiRange build_multirange (const ExpandedIdentifier& region_id,
-                                 const Range prefix = Range(),
-                                 std::string last_field = "") const; 
+                                 const Range& prefix = Range(),
+                                 const std::string& last_field = "") const; 
 
     /**
      *   Get MultiRange for a specific region_id, constrained to be
@@ -150,8 +150,8 @@ public:
 
     MultiRange build_multirange (const ExpandedIdentifier& region_id,
                                  const std::string& group_name,
-                                 const Range prefix = Range(),
-                                 std::string last_field = "") const; 
+                                 const Range& prefix = Range(),
+                                 const std::string& last_field = "") const; 
  
     /** 
      *   Pack to 32bits the subset of id between (inclusive) index1
@@ -517,8 +517,6 @@ public:
                                   IdDictRegion& region,
                                   std::string tag = "");  
     void reset_implementation ();  
- 
-    std::string m_name; 
 }; 
  
 class IdDictRegionEntry 
diff --git a/DetectorDescription/IdDict/IdDict/IdDictFieldImplementation.h b/DetectorDescription/IdDict/IdDict/IdDictFieldImplementation.h
index 5ce9ef1f10c..63d4fd40a90 100755
--- a/DetectorDescription/IdDict/IdDict/IdDictFieldImplementation.h
+++ b/DetectorDescription/IdDict/IdDict/IdDictFieldImplementation.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,8 +89,8 @@ public:
 
     /// Modifiers
     void                set_range        (const IdDictRange* range);
-    void                set_field        (Range::field  field);
-    void                set_ored_field   (Range::field ored_field);
+    void                set_field        (const Range::field&  field);
+    void                set_ored_field   (const Range::field& ored_field);
     void                set_bits_offset  (size_type bits_offset);
     void                set_bits         (size_type bits, size_type bits_offset);
     void                set_decode_index (bool decode_index);
@@ -248,7 +248,7 @@ inline void  IdDictFieldImplementation::initialize()
 }
 
 //-----------------------------------------------------------------
-inline void  IdDictFieldImplementation::set_field        (Range::field  field)
+inline void  IdDictFieldImplementation::set_field        (const Range::field&  field)
 //-----------------------------------------------------------------
 {
     m_field = field;
@@ -256,7 +256,7 @@ inline void  IdDictFieldImplementation::set_field        (Range::field  field)
 
 
 //-----------------------------------------------------------------
-inline void  IdDictFieldImplementation::set_ored_field   (Range::field ored_field)
+inline void  IdDictFieldImplementation::set_ored_field   (const Range::field& ored_field)
 //-----------------------------------------------------------------
 {
     // Set ored field and bits, and init
diff --git a/DetectorDescription/IdDict/src/IdDictMgr.cxx b/DetectorDescription/IdDict/src/IdDictMgr.cxx
index 33e34c505f5..88d65c46562 100755
--- a/DetectorDescription/IdDict/src/IdDictMgr.cxx
+++ b/DetectorDescription/IdDict/src/IdDictMgr.cxx
@@ -409,7 +409,7 @@ IdDictRegion* IdDictDictionary::find_region (const std::string& region_name) con
   return find_region (region_name, "");
 }
 
-IdDictRegion* IdDictDictionary::find_region (const std::string& region_name, const std::string group_name) const
+IdDictRegion* IdDictDictionary::find_region (const std::string& region_name, const std::string& group_name) const
 { 
   for (size_t i = 0; i < m_regions.size (); ++i) 
     { 
@@ -492,7 +492,7 @@ void IdDictDictionary::resolve_references (const IdDictMgr& idd)
  
 typedef std::vector <IdDictRegion*> RV; 
  
-static void compute_bits (const RV& regions, size_t level, const std::string group)
+static void compute_bits (const RV& regions, size_t level, const std::string& group)
 { 
  
     //
@@ -931,7 +931,7 @@ IdDictRegion* IdDictDictionary::find_region(const ExpandedIdentifier& id) const
   return find_region (id, "");
 }
 
-IdDictRegion* IdDictDictionary::find_region(const ExpandedIdentifier& id, const std::string group_name) const
+IdDictRegion* IdDictDictionary::find_region(const ExpandedIdentifier& id, const std::string& group_name) const
 {
     // Find first region that matches id
 
@@ -1127,8 +1127,8 @@ MultiRange IdDictDictionary::build_multirange () const
 } 
 
 MultiRange IdDictDictionary::build_multirange (const ExpandedIdentifier& region_id,
-					       const Range prefix,
-					       std::string last_field) const
+					       const Range& prefix,
+					       const std::string& last_field) const
 {
     MultiRange result; 
 
@@ -1194,8 +1194,8 @@ MultiRange IdDictDictionary::build_multirange (const ExpandedIdentifier& region_
 
 MultiRange IdDictDictionary::build_multirange (const ExpandedIdentifier& region_id,
 					       const std::string& group_name,
-					       const Range prefix,
-					       std::string last_field) const 
+					       const Range& prefix,
+					       const std::string& last_field) const 
 {
     MultiRange result; 
 
-- 
GitLab


From cd8eb738e74b4b5f4beb48ade4e29ef8487bc522 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 22 Feb 2019 20:27:44 +0100
Subject: [PATCH 046/404] LArIdentifier: Remove references to
 ExpandedIdentifier::last_error.

Error handling using ExpandedIdentifier::last_error is largely useless,
as there are hardly any errors that are actually reported, and is not
thread-safe.  Remove this error handling.  Remaining error cases
will be changed in ExpandedIdentifier to use exceptions.
---
 .../LArIdentifier/src/LArHVLineID.cxx         | 30 +-----------------
 .../LArIdentifier/src/LArOnlineID_Base.cxx    | 31 +------------------
 2 files changed, 2 insertions(+), 59 deletions(-)

diff --git a/LArCalorimeter/LArIdentifier/src/LArHVLineID.cxx b/LArCalorimeter/LArIdentifier/src/LArHVLineID.cxx
index 35b285ac7ec..af9e3a62ee6 100755
--- a/LArCalorimeter/LArIdentifier/src/LArHVLineID.cxx
+++ b/LArCalorimeter/LArIdentifier/src/LArHVLineID.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 "LArIdentifier/LArHVLineID.h"
@@ -191,34 +191,6 @@ int LArHVLineID::get_expanded_id  (const HWIdentifier& id,
   return (0);
 }
 
-/*
-//=====================================================================================
-void LArHVLineID::hvlineId_checks( int part, int canline, int cannode, int line) const throw(LArOnlID_Exception)
-//=====================================================================================
-{  
-  MsgStream log(m_msgSvc, "LArHVLineID" );
-  // Fill expanded id
-  ExpandedIdentifier id(calo_exp());
-  id << part << canline << cannode << line;
-  if( id.last_error () != ExpandedIdentifier::none) {
-    char * lStr = new char[200];
-    std::string errorMessage ;
-    sprintf(lStr,"Error in LArHVLineID::hvline_id(field values), did not build, partition: %d, canline: %d, can node: %d, hv line: %d ", partition, canline, cannode , line );
-    errorMessage += std::string(lStr);
-    delete[] lStr ;
-    LArOnlID_Exception except(errorMessage , 2);
-    throw except ;   
-  }  
-  if (!m_full_atlas_highvoltage_range.match(id)) { 
-    std::string errorMessage = "[LArHVLineID]::hv_lineId() result is not OK: ID, range = "
-      + std::string(id) + " , " + (std::string)m_full_atlas_highvoltage_range;
-    LArOnlID_Exception except(errorMessage , 2);
-    throw except ;   
-  }
-}
-*/
-
-
 
 //=============================================================================
 int LArHVLineID::initLevelsFromDict(void) 
diff --git a/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx b/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx
index 5d97bb469d8..2720a17375e 100755
--- a/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx
+++ b/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.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 "LArIdentifier/LArOnlineID_Base.h"
@@ -685,15 +685,6 @@ void LArOnlineID_Base::channel_Id_checks( int barrel_ec, int pos_neg, int feedth
     ExpandedIdentifier expId(lar_exp());
     expId << s_lar_online_field_value << barrel_ec << pos_neg << feedthrough << slot << channel ;
     if ( m_this_is_slar ) expId << 1;
-    if( expId.last_error () != ExpandedIdentifier::none) {
-        char * l_str = new char[200];
-        std::string errorMessage ;
-        sprintf(l_str,"Error in LArOnlineID_Base::channel_Id_checks(field values) , values ok but did not build , barrel_ec: %d, feedthrough: %d , slot: %d , channel_in_slot: %d ", barrel_ec , feedthrough, slot, channel);
-        errorMessage += std::string(l_str);
-        delete[] l_str ;
-        LArOnlID_Exception except(errorMessage , 99);
-        throw except ;   
-    }
 
     if (!m_full_laronline_range.match(expId)) { 
         std::string errorMessage = "LArOnlineID_Base::channel_Id_checks() result is not OK: ID, range = "
@@ -765,16 +756,6 @@ void LArOnlineID_Base::feb_Id_checks( int barrel_ec, int pos_neg, int feedthroug
   expId << s_lar_online_field_value << barrel_ec << pos_neg << feedthrough << slot ;
 
   if ( m_this_is_slar ) expId << 0 << 1;
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    char * l_str = new char[200];
-    std::string errorMessage ;
-    sprintf(l_str,"Error in LArOnlineID_Base::feb_Id_checks , values ok but did not build , barrel_ec: %d , pos_neg: %d , feedthrough: %d , slot: %d", 
-            barrel_ec , pos_neg, feedthrough, slot);
-    errorMessage += std::string(l_str);
-    delete[] l_str ;
-    LArOnlID_Exception except(errorMessage , 99);
-    throw except ;
-    }  
     if (!m_full_feedthrough_range.match(expId)) { std::string errorMessage = "LArOnlineID_Base::feb_Id_checks() result is not OK: ID, range = "
     + std::string(expId) + " , " + (std::string)m_full_feb_range;
     LArOnlID_Exception except(errorMessage , 99);
@@ -792,16 +773,6 @@ void LArOnlineID_Base::feedthrough_Id_checks( int barrel_ec, int pos_neg, int fe
   expId << s_lar_online_field_value << barrel_ec << pos_neg << feedthrough << 0 << 0 << (int)m_this_is_slar;
 
 //  if ( m_this_is_slar ) expId << 0 << 0 << 1;
-  if(  expId.last_error () != ExpandedIdentifier::none ){
-    char * l_str = new char[200];
-    std::string errorMessage ;
-    sprintf(l_str,"Error in LArOnlineID_Base::feedthrough_Id_checks , values ok but did not build , barrel_ec: %d , pos_neg: %d , feedthrough: %d ", 
-    barrel_ec , pos_neg, feedthrough);
-    errorMessage += std::string(l_str);
-    delete[] l_str ;
-    LArOnlID_Exception except(errorMessage , 99);
-    throw except ;
-    }  
     if (!m_full_feedthrough_range.match(expId)) { std::string errorMessage = "LArOnlineID_Base::feedthrough_Id_checks() result is not OK: ID, range = "
     + std::string(expId) + " , " + (std::string)m_full_feedthrough_range;
     LArOnlID_Exception except(errorMessage , 99);
-- 
GitLab


From ce9ccad41e0af33e9a6c75cbd7548085f7eed5bb Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 26 Feb 2019 16:59:21 +0100
Subject: [PATCH 047/404] CaloIdentifier: Remove need for MT-unsafe
 set_do_checks().

set_do_checks() is not thread-safe when used on a const object.
For the methods in that can do checking, add versions that
take an extra bool argument to force checking either on or off.

Also fix some CRLF line terminators.
---
 .../CaloIdentifier/CaloCell_Base_ID.h         |  24 +-
 .../CaloIdentifier/CaloCell_Base_ID.icc       |  70 +-
 .../CaloIdentifier/CaloIdentifier/CaloDM_ID.h |  40 +-
 .../CaloIdentifier/CaloLVL1_ID.h              |  64 +-
 .../CaloIdentifier/JGTowerBase_ID.h           |  43 +-
 .../CaloIdentifier/LArEM_Base_ID.h            |   7 +-
 .../CaloIdentifier/LArEM_Base_ID.icc          |  34 +-
 .../CaloIdentifier/LArFCAL_Base_ID.h          |   7 +-
 .../CaloIdentifier/LArFCAL_Base_ID.icc        |  36 +-
 .../CaloIdentifier/LArHEC_Base_ID.h           |   9 +-
 .../CaloIdentifier/LArHEC_Base_ID.icc         |  35 +-
 .../CaloIdentifier/LArMiniFCAL_ID.h           |  41 +-
 .../CaloIdentifier/TTOnlineID.h               | 947 +++++++++---------
 .../CaloIdentifier/CaloIdentifier/TileTBID.h  |   7 +-
 .../CaloIdentifier/Tile_Base_ID.h             |  29 +-
 Calorimeter/CaloIdentifier/src/TileTBID.cxx   |  36 +-
 .../CaloIdentifier/src/Tile_Base_ID.cxx       | 118 ++-
 .../CaloIdentifier/test/test_calo_dm_id.cxx   |  14 +-
 .../CaloIdentifier/test/test_lvl1_id.cxx      |   8 +-
 19 files changed, 976 insertions(+), 593 deletions(-)

diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
index 0b5331ccacf..4a98ef55c4e 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
@@ -1,7 +1,7 @@
 // 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$
@@ -72,12 +72,12 @@ public:
 
   int GetSubCaloName( const std::string SubCaloName ) const;
 
-  bool do_checks(void) const;
+  virtual bool do_checks(void) const override;
 
-  void set_do_checks(bool do_checks) const;
+  virtual void set_do_checks(bool do_checks) const override;
 
   /// Initialization from the identifier dictionary
-  virtual int         initialize_from_dictionary(const IdDictMgr& dict_mgr);
+  virtual int         initialize_from_dictionary(const IdDictMgr& dict_mgr) override;
 
   /** Make a region ID from constituting fields and subCalo index;
       for (Mini)FCAL and Tiles, the last argument is not used  
@@ -86,6 +86,11 @@ public:
 				 const int barec_or_posneg, 
                                  const int sampling_or_fcalmodule, 
                                  const int region_or_dummy ) const;
+  Identifier  region_id   	(const int subCalo, 
+				 const int barec_or_posneg, 
+                                 const int sampling_or_fcalmodule, 
+                                 const int region_or_dummy,
+                                 bool checks) const;
 
   /** Make a cell (== channel) ID from constituting fields and subCalo index;
       for (Mini)FCAL,  'region_or_dummy' argument is not used 
@@ -97,6 +102,13 @@ public:
                                  const int region_or_dummy,
 				 const int eta,    
                                  const int phi ) const;
+  Identifier  cell_id   	(const int subCalo, 
+				 const int barec_or_posneg, 
+                                 const int sampling_or_fcalmodule,
+                                 const int region_or_dummy,
+				 const int eta,    
+                                 const int phi,
+                                 bool checks) const;
 				 
   /** Make a region ID from a cell ID   */     
   Identifier  region_id	(const Identifier cellId ) const;
@@ -106,6 +118,10 @@ public:
   Identifier  cell_id( const Identifier regionId,
 		       const int eta, const int phi,
                        int depth = 0) const ;
+  Identifier  cell_id( const Identifier regionId,
+		       const int eta, const int phi,
+                       int depth,
+                       bool checks) const ;
 			     
   /** create region id from 'global'(==full calo) hash id*/
   Identifier region_id	(const IdentifierHash caloRegionHash) const;
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.icc b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.icc
index 99cae44d6ca..dfee1d461ae 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.icc
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.icc
@@ -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
 */
 
 // $Id$
@@ -20,29 +20,40 @@ inline  Identifier
 CaloCell_Base_ID::region_id   	(const int subCalo, 
 				 const int barec_or_posneg, 
                                  const int sampling_or_fcalmodule, 
-                                 const int region_or_dummy ) const
+                                 const int region_or_dummy,
+                                 bool checks) const
 {
   Identifier result(0);  // this returns a pixel identifier [2.1.-2.0.0]
   if( subCalo == LAREM ) {
-    return m_emHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy);
+    return m_emHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
   } 
   else if( subCalo == LARHEC ) {
-    return m_hecHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy);
+    return m_hecHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, checks);
   } 
   else if( subCalo == LARFCAL ) {
-    return m_fcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule);
+    return m_fcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
   } 
   else if( subCalo == LARMINIFCAL ) {
-    return m_minifcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule);
+    return m_minifcalHelper->module_id(barec_or_posneg, sampling_or_fcalmodule, checks);
   } 
   else if( subCalo == TILE ) {
-    return m_tileHelper->region_id(barec_or_posneg, sampling_or_fcalmodule);
+    return m_tileHelper->region_id(barec_or_posneg, sampling_or_fcalmodule, checks);
   } 
   else {
     return(result);
   }
 }
 
+inline  Identifier  
+CaloCell_Base_ID::region_id   	(const int subCalo, 
+				 const int barec_or_posneg, 
+                                 const int sampling_or_fcalmodule, 
+                                 const int region_or_dummy ) const
+{
+  return region_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
+                    region_or_dummy, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 CaloCell_Base_ID::cell_id (const int subCalo, 
@@ -50,29 +61,42 @@ CaloCell_Base_ID::cell_id (const int subCalo,
                            const int sampling_or_fcalmodule,
                            const int region_or_dummy,
                            const int eta,
-                           const int phi) const
+                           const int phi,
+                           bool checks) const
 {
   Identifier result(0);
   if( subCalo == LAREM ) {
-    return m_emHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi);
+    return m_emHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
   } 
   else if( subCalo == LARHEC ) {
-    return m_hecHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi);
+    return m_hecHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
   } 
   else if( subCalo == LARFCAL ) {
-    return m_fcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, eta, phi);
+    return m_fcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, eta, phi, checks);
   } 
   else if( subCalo == LARMINIFCAL ) {
-    return m_minifcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi);
+    return m_minifcalHelper->channel_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
   } 
   else if( subCalo == TILE ) {
-    return m_tileHelper->cell_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi);
+    return m_tileHelper->cell_id(barec_or_posneg, sampling_or_fcalmodule, region_or_dummy, eta, phi, checks);
   } 
   else {
     return(result);
   }
 }
 
+inline Identifier 
+CaloCell_Base_ID::cell_id (const int subCalo, 
+                           const int barec_or_posneg, 
+                           const int sampling_or_fcalmodule,
+                           const int region_or_dummy,
+                           const int eta,
+                           const int phi) const
+{
+  return cell_id (subCalo, barec_or_posneg, sampling_or_fcalmodule,
+                  region_or_dummy, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 CaloCell_Base_ID::region_id ( const Identifier cellId ) const 
@@ -104,27 +128,37 @@ inline Identifier
 CaloCell_Base_ID::cell_id (const Identifier regionId,
                            const int eta,
                            const int phi,
-                           int depth) const 
+                           int depth,
+                           bool checks) const 
 {
   Identifier result(0);
   if(m_emHelper->is_lar_em(regionId)) {
-    return m_emHelper->channel_id(regionId,eta,phi);
+    return m_emHelper->channel_id(regionId,eta,phi,checks);
   } 
   else if(m_emHelper->is_lar_hec(regionId)) {
-    return m_hecHelper->channel_id(regionId,eta,phi);
+    return m_hecHelper->channel_id(regionId,eta,phi,checks);
   } 
   else if(m_emHelper->is_lar_minifcal(regionId)) {
     // must do minifcal before fcal because miniFCAL IS FCAL
-    return m_minifcalHelper->channel_id(regionId, depth,eta,phi);
+    return m_minifcalHelper->channel_id(regionId, depth,eta,phi,checks);
   } 
   else if(m_emHelper->is_lar_fcal(regionId)) {
-    return m_fcalHelper->channel_id(regionId,eta,phi);
+    return m_fcalHelper->channel_id(regionId,eta,phi,checks);
   } 
   else {
     return(result);
   }
 }
 
+inline Identifier 
+CaloCell_Base_ID::cell_id (const Identifier regionId,
+                           const int eta,
+                           const int phi,
+                           int depth) const
+{
+  return cell_id (regionId, eta, phi, depth, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 CaloCell_Base_ID::region_id    (const IdentifierHash caloRegionHash) const
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h
index 10518512911..63e108ba0f5 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloDM_ID.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 CALODM_ID_H
@@ -111,6 +111,7 @@ public:
 
   /** build a region identifier valid for both LAr and Tiles  */
   Identifier region_id  ( int pos_neg_z, int dmat, int sampling, int region )  const;
+  Identifier region_id  ( int pos_neg_z, int dmat, int sampling, int region, bool checks)  const;
 
   /** build a region identifier valid for both LAr and Tiles  */
   Identifier region_id  (const Identifier& zoneId ) const;
@@ -118,10 +119,14 @@ public:
   /** build a zone identifier valid for both LAr and Tiles  */
   Identifier  zone_id   	(int pos_neg_z, int dat, int sampling, int region,
 				 int eta,       int phi )  const;
+  Identifier  zone_id   	(int pos_neg_z, int dat, int sampling, int region,
+				 int eta,       int phi, bool checks )  const;
 				 
   /** build a zone identifier valid for both LAr and Tiles  */
   Identifier  zone_id   	(const Identifier& regionId,
     				 int eta,       int phi )  const ;
+  Identifier  zone_id   	(const Identifier& regionId,
+    				 int eta,       int phi, bool checks )  const ;
 
   /** to disentangle between LAr and Tile dead material */
   bool is_lar  (const Identifier& zoneId) const;
@@ -378,7 +383,8 @@ CLASS_DEF( CaloDM_ID , 167756483 , 1 )
 
      
 //----------------------------------------------------------------------------
-inline Identifier CaloDM_ID::region_id (int pos_neg_z, int dmat, int sampling, int region)  const
+inline Identifier CaloDM_ID::region_id (int pos_neg_z, int dmat, int sampling, int region,
+                                        bool checks)  const
 {
     Identifier result(0);
     // Pack fields independently
@@ -389,7 +395,7 @@ inline Identifier CaloDM_ID::region_id (int pos_neg_z, int dmat, int sampling, i
     m_region_impl.pack   (region,                         result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
       if(abs(pos_neg_z) == 4) {
 	lar_region_id_checks( pos_neg_z, dmat, sampling, region);
       } else
@@ -406,6 +412,11 @@ inline Identifier CaloDM_ID::region_id (int pos_neg_z, int dmat, int sampling, i
     return result;
 }
 
+inline Identifier CaloDM_ID::region_id (int pos_neg_z, int dmat, int sampling, int region)  const
+{
+  return region_id (pos_neg_z, dmat, sampling, region, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 CaloDM_ID::region_id   ( const Identifier& zoneId ) const 
@@ -419,7 +430,8 @@ CaloDM_ID::region_id   ( const Identifier& zoneId ) const
 
 //----------------------------------------------------------------------------
 inline Identifier CaloDM_ID::zone_id   ( int pos_neg_z, int dmat, int sampling, int region,
-					 int eta,       int phi )  const
+					 int eta,       int phi,
+                                         bool checks)  const
 {  
     Identifier result(0);
     // Pack fields independently
@@ -432,7 +444,7 @@ inline Identifier CaloDM_ID::zone_id   ( int pos_neg_z, int dmat, int sampling,
     m_phi_impl.pack      (phi,                            result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
       if(abs(pos_neg_z) == 4) {
 	lar_zone_id_checks( pos_neg_z, dmat, sampling, region, eta, phi );
       } 
@@ -447,10 +459,16 @@ inline Identifier CaloDM_ID::zone_id   ( int pos_neg_z, int dmat, int sampling,
 
     return result;
 }
- 
+
+inline Identifier CaloDM_ID::zone_id   ( int pos_neg_z, int dmat, int sampling, int region,
+					 int eta,       int phi )  const
+{
+  return zone_id (pos_neg_z, dmat, sampling, region, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier CaloDM_ID::zone_id   ( const Identifier& regionId,
-					 int eta,  int phi ) const 
+					 int eta,  int phi, bool checks ) const 
 {
     Identifier result(regionId);
 
@@ -461,13 +479,19 @@ inline Identifier CaloDM_ID::zone_id   ( const Identifier& regionId,
     m_phi_impl.pack      (phi, result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	zone_id_checks( regionId, eta, phi );
     }
 
     return result;
 }
 
+inline Identifier CaloDM_ID::zone_id   ( const Identifier& regionId,
+					 int eta,  int phi ) const
+{
+  return zone_id (regionId, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline bool CaloDM_ID::is_lar(const Identifier& zoneId) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h
index 13e6c8a57aa..b521ac039df 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloLVL1_ID.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 CALOLVL1_ID_H
@@ -76,16 +76,21 @@ public:
   /** build a tower identifier */
   Identifier  tower_id   	(int pos_neg_z, int sampling, int region,
 				 int eta,       int phi ) const ;
+  Identifier  tower_id   	(int pos_neg_z, int sampling, int region,
+				 int eta,       int phi, bool checks ) const ;
 				 
   /** build a tower identifier */
   Identifier  tower_id   	(const Identifier regionId,
     				 int eta,       int phi )  const ;
+  Identifier  tower_id   	(const Identifier regionId,
+    				 int eta,       int phi, bool checks )  const ;
   
   /** build a tower identifier */
   Identifier  tower_id   	(const Identifier layerId)  const;
   
   /** build a region (of towers) identifier */
   Identifier region_id  ( int pos_neg_z, int sampling, int region ) const;
+  Identifier region_id  ( int pos_neg_z, int sampling, int region, bool checks) const;
 
   /** build a region (of towers) identifier */
   Identifier region_id  ( const Identifier tower_or_layerId ) const;
@@ -94,9 +99,13 @@ public:
   /** build a layer identifier */
   Identifier layer_id   ( int pos_neg_z, int sampling, int region,
  		          int eta,       int phi,      int layer ) const;
+  Identifier layer_id   ( int pos_neg_z, int sampling, int region,
+ 		          int eta,       int phi,      int layer,
+                          bool checks) const;
 
   /** build a layer identifier */
   Identifier layer_id   ( const Identifier towerId,   int layer ) const;
+  Identifier layer_id   ( const Identifier towerId,   int layer, bool checks ) const;
 
 
   /** access to IdContext's which define which levels of fields are contained in the id */
@@ -398,7 +407,7 @@ CLASS_DEF( CaloLVL1_ID , 108133391 , 1 )
 
 //----------------------------------------------------------------------------
 inline Identifier CaloLVL1_ID::tower_id   ( int pos_neg_z, int sampling, int region,
-					    int eta,       int phi ) const 
+					    int eta,       int phi, bool checks ) const 
 {  
     Identifier result(0);
     // Pack fields independently
@@ -410,16 +419,23 @@ inline Identifier CaloLVL1_ID::tower_id   ( int pos_neg_z, int sampling, int reg
     m_phi_impl.pack      (phi,                   result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	tower_id_checks( pos_neg_z, sampling, region, eta, phi );
     }
 
     return result;
 }
 
+inline Identifier CaloLVL1_ID::tower_id   ( int pos_neg_z, int sampling, int region,
+					    int eta,       int phi ) const
+{
+  return tower_id (pos_neg_z, sampling, region, eta, phi, do_checks());
+}
+
+
 //----------------------------------------------------------------------------
 inline Identifier CaloLVL1_ID::tower_id   ( const Identifier regionId,
-					    int eta,  int phi ) const 
+					    int eta,  int phi, bool checks ) const 
 {
     Identifier result(regionId);
 
@@ -430,13 +446,20 @@ inline Identifier CaloLVL1_ID::tower_id   ( const Identifier regionId,
     m_phi_impl.pack      (phi, result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	tower_id_checks( regionId, eta, phi );
     }
 
     return result;
 }
 
+inline Identifier CaloLVL1_ID::tower_id   ( const Identifier regionId,
+					    int eta,  int phi ) const
+{
+  return tower_id (regionId, eta, phi, do_checks());
+}
+
+
 //----------------------------------------------------------------------------
 inline Identifier CaloLVL1_ID::region_id   ( const Identifier tower_or_layerId ) const 
 {
@@ -458,7 +481,8 @@ inline Identifier CaloLVL1_ID::tower_id   ( const Identifier layerId ) const
 }
 
 //----------------------------------------------------------------------------
-inline Identifier CaloLVL1_ID::region_id (int pos_neg_z, int sampling, int region)const 
+inline Identifier CaloLVL1_ID::region_id (int pos_neg_z, int sampling, int region,
+                                          bool checks)const 
 {
     Identifier result(0);
     // Pack fields independently
@@ -468,16 +492,22 @@ inline Identifier CaloLVL1_ID::region_id (int pos_neg_z, int sampling, int regio
     m_region_impl.pack   (region,                result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	region_id_checks( pos_neg_z, sampling, region);
     }
 
     return result;
 }
 
+inline Identifier CaloLVL1_ID::region_id (int pos_neg_z, int sampling, int region)const
+{
+  return region_id (pos_neg_z, sampling, region, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier CaloLVL1_ID::layer_id   ( int pos_neg_z, int sampling, int region,
-					    int eta,       int phi,      int layer ) const 
+					    int eta,       int phi,      int layer,
+                                            bool checks) const 
 {  
     Identifier result(0);
     // Pack fields independently
@@ -490,16 +520,22 @@ inline Identifier CaloLVL1_ID::layer_id   ( int pos_neg_z, int sampling, int reg
     m_layer_impl.pack    (layer,                 result);
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	layer_id_checks( pos_neg_z, sampling, region, eta, phi, layer );
     }
 
     return result;
 }
 
+inline Identifier CaloLVL1_ID::layer_id   ( int pos_neg_z, int sampling, int region,
+					    int eta,       int phi,      int layer ) const
+{
+  return layer_id (pos_neg_z, sampling, region, eta, phi, layer, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier CaloLVL1_ID::layer_id   ( const Identifier towerId,
-					    int layer ) const
+					    int layer, bool checks ) const
 {
     Identifier result(towerId);
 
@@ -507,13 +543,19 @@ inline Identifier CaloLVL1_ID::layer_id   ( const Identifier towerId,
     m_layer_impl.reset     (result);
     m_layer_impl.pack      (layer, result);
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
 	layer_id_checks( towerId, layer );
     }
 
     return result;
 }
 
+inline Identifier CaloLVL1_ID::layer_id   ( const Identifier towerId,
+					    int layer ) const
+{
+  return layer_id (towerId, layer, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline CaloLVL1_ID::size_type   CaloLVL1_ID::tower_hash_max (void) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h
index 17a5a8c6c16..b75d8c37e70 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/JGTowerBase_ID.h
@@ -1,7 +1,7 @@
 // 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$
@@ -42,14 +42,19 @@ public:
 
 	/** build a tower identifier */
 	Identifier  tower_id   	(int pos_neg, int sampling, int region,
-		 int eta,       int phi ) const ;
+                                 int eta,       int phi ) const ;
+	Identifier  tower_id   	(int pos_neg, int sampling, int region,
+                                 int eta,       int phi, bool checks ) const ;
 				 
 	/** build a tower identifier */
 	Identifier  tower_id   	(const Identifier regionId,
-		 int eta,       int phi )  const ;
+                                 int eta,       int phi )  const ;
+	Identifier  tower_id   	(const Identifier regionId,
+                                 int eta,       int phi, bool checks )  const ;
  
 	/** build a region (of towers) identifier */
 	Identifier region_id  ( int pos_neg, int sampling, int region ) const;
+        Identifier region_id  ( int pos_neg, int sampling, int region, bool checks ) const;
 
 	/** access to IdContext's which define which levels of fields are contained in the id */
 	/** id for towers ("reduced" id) */
@@ -359,7 +364,7 @@ private:
 CLASS_DEF( JGTowerBase_ID , 131336095, 1 )
 
 inline Identifier JGTowerBase_ID::tower_id   ( int pos_neg, int sampling, int region,
-                                               int eta,       int phi ) const 
+                                               int eta,       int phi, bool checks ) const 
 {  
 	Identifier result(0);
 	// Pack fields independently
@@ -371,15 +376,22 @@ inline Identifier JGTowerBase_ID::tower_id   ( int pos_neg, int sampling, int re
 	m_phi_impl.pack      (phi,                   result);
 
 	// Do checks
-	if(m_do_checks) {
+	if(checks) {
 		tower_id_checks( pos_neg, sampling, region, eta, phi );
 	}
 
 	return result;
 }
+
+inline Identifier JGTowerBase_ID::tower_id   ( int pos_neg, int sampling, int region,
+                                               int eta,       int phi ) const
+{
+  return tower_id (pos_neg, sampling, region, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier JGTowerBase_ID::tower_id   ( const Identifier regionId,
-                                               int eta,  int phi ) const 
+                                               int eta,  int phi, bool checks ) const 
 {
 	Identifier result(regionId);
 
@@ -390,13 +402,19 @@ inline Identifier JGTowerBase_ID::tower_id   ( const Identifier regionId,
 	m_phi_impl.pack      (phi, result);
 
 	// Do checks
-	if(m_do_checks) {
+	if(checks) {
 		tower_id_checks( regionId, eta, phi );
 	}
 
 	return result;
 }
 
+inline Identifier JGTowerBase_ID::tower_id   ( const Identifier regionId,
+                                               int eta,  int phi ) const
+{
+  return tower_id (regionId, eta, phi, do_checks());
+}
+
 
 //----------------------------------------------------------------------------
 inline JGTowerBase_ID::size_type   JGTowerBase_ID::tower_hash_max (void) const
@@ -536,7 +554,8 @@ inline Identifier JGTowerBase_ID::region_id   ( const Identifier tower_Id ) cons
 }
 
 //----------------------------------------------------------------------------
-inline Identifier JGTowerBase_ID::region_id (int pos_neg, int sampling, int region)const 
+inline Identifier JGTowerBase_ID::region_id (int pos_neg, int sampling, int region,
+                                             bool checks) const 
 {
 	Identifier result(0);
 	// Pack fields independently
@@ -546,13 +565,19 @@ inline Identifier JGTowerBase_ID::region_id (int pos_neg, int sampling, int regi
 	m_region_impl.pack   (region,                result);
 
 	// Do checks
-	if(m_do_checks) {
+	if(checks) {
 		region_id_checks( pos_neg, sampling, region);
 	}
 
 	return result;
 }
 
+inline Identifier JGTowerBase_ID::region_id (int pos_neg, int sampling, int region)const
+{
+  return region_id (pos_neg, sampling, region, do_checks());
+}
+
+
 //----------------------------------------------------------------------------
 inline Identifier JGTowerBase_ID::tower_id    (IdentifierHash tower_hash_id) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.h
index 45574bcc888..23dcfaa995d 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.h
@@ -1,7 +1,7 @@
 // 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$
@@ -52,10 +52,13 @@ public:
 				 
   /** build a region identifier */
   Identifier  region_id   	(int barrel_ec, int sampling, int region ) const;
+  Identifier  region_id   	(int barrel_ec, int sampling, int region, bool checks ) const;
 
   /** build a cell identifier */
   Identifier  channel_id   	(int barrel_ec, int sampling, int region,
 				 int eta,       int phi )  const;
+  Identifier  channel_id   	(int barrel_ec, int sampling, int region,
+				 int eta,       int phi, bool checks )  const;
 
   /** allows to know in which region is a channel/cell
       -- valid for both kinds of channels */
@@ -65,6 +68,8 @@ public:
       -- valid for both kinds of channels */
   Identifier  channel_id   	(const Identifier regionId,
 				 int eta,       int phi ) const;
+  Identifier  channel_id   	(const Identifier regionId,
+				 int eta,       int phi, bool checks ) const;
 
   /** create hash id from channel id  */
   IdentifierHash channel_hash (Identifier channelId) const;
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.icc b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.icc
index ca6d994671f..91a10295d9f 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.icc
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArEM_Base_ID.icc
@@ -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
 */
 
 // $Id$
@@ -37,11 +37,11 @@ LArEM_Base_ID::channel_id   ( const ExpandedIdentifier& exp_id) const
 
 //----------------------------------------------------------------------------
 inline Identifier 
-LArEM_Base_ID::region_id (int barrel_ec, int sampling, int region) const 
+LArEM_Base_ID::region_id (int barrel_ec, int sampling, int region, bool checks) const 
 {
 
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
       region_id_checks ( barrel_ec, sampling, region );
     }
 
@@ -58,14 +58,20 @@ LArEM_Base_ID::region_id (int barrel_ec, int sampling, int region) const
     return result;
 }
 
+inline Identifier 
+LArEM_Base_ID::region_id (int barrel_ec, int sampling, int region) const
+{
+  return region_id (barrel_ec, sampling, region, do_checks());
+}
+
 
 //----------------------------------------------------------------------------
 inline Identifier 
 LArEM_Base_ID::channel_id   ( int barrel_ec, int sampling, int region,
-                              int eta,       int phi )  const
+                              int eta,       int phi, bool checks )  const
 {  
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
       channel_id_checks( barrel_ec, sampling, region, eta, phi );
     }
 
@@ -83,6 +89,13 @@ LArEM_Base_ID::channel_id   ( int barrel_ec, int sampling, int region,
     return result;
 }
 
+inline Identifier 
+LArEM_Base_ID::channel_id   ( int barrel_ec, int sampling, int region,
+                              int eta,       int phi )  const
+{
+  return channel_id (barrel_ec, sampling, region, eta, phi, do_checks());
+}
+
 
 //----------------------------------------------------------------------------
 inline Identifier 
@@ -99,10 +112,10 @@ LArEM_Base_ID::region_id   ( const Identifier channelId ) const
 //----------------------------------------------------------------------------
 inline Identifier 
 LArEM_Base_ID::channel_id   ( const Identifier regionId,
-                              int eta,       int phi ) const 
+                              int eta,       int phi, bool checks ) const 
 {
     // Do checks
-    if(m_do_checks) {
+    if(checks) {
         channel_id_checks( regionId, eta, phi );
     }
 
@@ -118,6 +131,13 @@ LArEM_Base_ID::channel_id   ( const Identifier regionId,
     return result;
 }
 
+inline Identifier 
+LArEM_Base_ID::channel_id   ( const Identifier regionId,
+                              int eta,       int phi ) const
+{
+  return channel_id (regionId, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline IdentifierHash LArEM_Base_ID::channel_hash (Identifier channelId) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.h
index 8a5fc4dd415..ea7cdf5f1c1 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.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 CALOIDENTIFIER_LARFCAL_BASE_ID_H
@@ -31,10 +31,13 @@ public:
 
   /** build a module identifier for a channel  */
   Identifier  module_id	( int pos_neg, int module ) const ;
+  Identifier  module_id	( int pos_neg, int module, bool checks ) const ;
 
   /** build a cell identifier for a channel  */
   Identifier  channel_id( int pos_neg,  int module,
 			  int eta,      int phi ) const ;
+  Identifier  channel_id( int pos_neg,  int module,
+			  int eta,      int phi, bool checks ) const ;
 
   /** allows to know in which region is a channel/cell
       -- valid for both kinds of channels */
@@ -44,6 +47,8 @@ public:
       -- valid for both kinds of channels */
   Identifier  channel_id( const Identifier moduleId,
 			  int eta, int phi) const ;
+  Identifier  channel_id( const Identifier moduleId,
+			  int eta, int phi, bool checks) const ;
 			     
     /** create module id from hash id*/
   Identifier module_id	(IdentifierHash module_hash_id) const;
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.icc b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.icc
index d633c157694..dccad8e3537 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.icc
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArFCAL_Base_ID.icc
@@ -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
 */
 
 // $Id$
@@ -35,10 +35,10 @@ LArFCAL_Base_ID::channel_id (const ExpandedIdentifier& exp_id) const
 
 //----------------------------------------------------------------------------
 inline Identifier 
-LArFCAL_Base_ID::module_id (int pos_neg, int module) const 
+LArFCAL_Base_ID::module_id (int pos_neg, int module, bool checks) const 
 {
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         module_id_checks ( pos_neg, module );
     }
 
@@ -54,13 +54,19 @@ LArFCAL_Base_ID::module_id (int pos_neg, int module) const
     return result;
 }
 
+inline Identifier 
+LArFCAL_Base_ID::module_id (int pos_neg, int module) const
+{
+  return module_id (pos_neg, module, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 LArFCAL_Base_ID::channel_id   ( int pos_neg, int module,
-                           int eta,     int phi ) const 
-{  
+                                int eta,     int phi, bool checks ) const 
+{
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         channel_id_checks( pos_neg, module, eta, phi );
     }
 
@@ -77,6 +83,13 @@ LArFCAL_Base_ID::channel_id   ( int pos_neg, int module,
     return result;
 }
 
+inline Identifier 
+LArFCAL_Base_ID::channel_id   ( int pos_neg, int module,
+                                int eta,     int phi ) const
+{
+  return channel_id (pos_neg, module, eta, phi, do_checks());
+}
+
 
 //----------------------------------------------------------------------------
 inline Identifier 
@@ -94,10 +107,10 @@ LArFCAL_Base_ID::module_id   ( const Identifier channelId ) const
 //----------------------------------------------------------------------------
 inline Identifier 
 LArFCAL_Base_ID::channel_id   ( const Identifier module_id,
-                           int eta,       int phi ) const 
+                                int eta,       int phi, bool checks ) const 
 {
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
       channel_id_checks( module_id, eta, phi );
     }
 
@@ -113,6 +126,13 @@ LArFCAL_Base_ID::channel_id   ( const Identifier module_id,
     return result;
 }
 
+inline Identifier 
+LArFCAL_Base_ID::channel_id   ( const Identifier module_id,
+                                int eta,       int phi ) const
+{
+  return channel_id (module_id, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier LArFCAL_Base_ID::module_id    (IdentifierHash module_hash_id) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h
index d2b03232e5f..5181a298826 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.h
@@ -1,7 +1,7 @@
 // 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$
@@ -57,10 +57,13 @@ public:
 
   /** build a region identifier for a channel  */
   Identifier  region_id   	(int pos_neg, int sampling, int region ) const ;
+  Identifier  region_id   	(int pos_neg, int sampling, int region, bool checks) const;
 
   /** build a cell identifier for a channel  */
   Identifier  channel_id   	(int pos_neg, int sampling, int region,
-				 int eta,     int phi ) const ;
+				 int eta,     int phi ) const;
+  Identifier  channel_id   	(int pos_neg, int sampling, int region,
+				 int eta,     int phi, bool checks) const;
 				 
   /** build a cell identifier for a channel  <br>
       eta counting includes regions     */
@@ -88,6 +91,8 @@ public:
       -- valid for both kinds of channels */
   Identifier  channel_id   	(const Identifier regionId,
 				 int eta,       int phi ) const ;
+  Identifier  channel_id   	(const Identifier regionId,
+				 int eta,       int phi, bool checks) const;
 
   /** Test if the identifier represents a supercell. */
   bool        is_supercell    (const Identifier id)const;
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.icc b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.icc
index bb1391e3a67..54a6ea24cca 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.icc
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArHEC_Base_ID.icc
@@ -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
 */
 
 // $Id$
@@ -36,10 +36,10 @@ LArHEC_Base_ID::channel_id (const ExpandedIdentifier& exp_id) const
 
 //----------------------------------------------------------------------------
 inline Identifier 
-LArHEC_Base_ID::region_id (int pos_neg, int sampling, int region) const 
+LArHEC_Base_ID::region_id (int pos_neg, int sampling, int region, bool checks) const 
 {
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         region_id_checks ( pos_neg, sampling, region );
     }
 
@@ -56,13 +56,20 @@ LArHEC_Base_ID::region_id (int pos_neg, int sampling, int region) const
     return result;
 }
 
+inline Identifier 
+LArHEC_Base_ID::region_id (int pos_neg, int sampling, int region) const
+{
+  return region_id (pos_neg, sampling, region, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 LArHEC_Base_ID::channel_id   ( int pos_neg, int sampling, int region,
-                               int eta,     int phi ) const 
+                               int eta,     int phi,
+                               bool checks) const 
 {  
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         channel_id_checks( pos_neg, sampling, region, eta, phi );
     }
 
@@ -79,6 +86,12 @@ LArHEC_Base_ID::channel_id   ( int pos_neg, int sampling, int region,
 
     return result;
 }
+inline Identifier 
+LArHEC_Base_ID::channel_id   ( int pos_neg, int sampling, int region,
+                               int eta,     int phi ) const
+{
+  return channel_id (pos_neg, sampling, region, eta, phi, do_checks());
+}
 
 //----------------------------------------------------------------------------
 inline Identifier 
@@ -96,10 +109,11 @@ LArHEC_Base_ID::region_id   ( const Identifier channelId ) const
 //----------------------------------------------------------------------------
 inline Identifier 
 LArHEC_Base_ID::channel_id   ( const Identifier regionId,
-                               int eta,       int phi ) const 
+                               int eta,       int phi,
+                               bool checks) const 
 {
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
       channel_id_checks( regionId, eta, phi );
     }
 
@@ -115,6 +129,13 @@ LArHEC_Base_ID::channel_id   ( const Identifier regionId,
     return result;
 }
 
+inline Identifier 
+LArHEC_Base_ID::channel_id   ( const Identifier regionId,
+                               int eta,       int phi ) const
+{
+  return channel_id (regionId, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline IdentifierHash LArHEC_Base_ID::channel_hash (Identifier channelId) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h
index f6328a9af76..b3dc8a74335 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/LArMiniFCAL_ID.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 LARMiniFCAL_ID_H
@@ -75,10 +75,13 @@ public:
 
   /** build a module identifier for a channel  */
   Identifier  module_id ( int pos_neg, int module ) const ;
+  Identifier  module_id ( int pos_neg, int module, bool checks ) const ;
 
   /** build a cell identifier for a channel  */
   Identifier  channel_id( int pos_neg,  int module,  int depth,
                           int eta,      int phi ) const ;
+  Identifier  channel_id( int pos_neg,  int module,  int depth,
+                          int eta,      int phi, bool checks ) const ;
 
   /** allows to know in which region is a channel/cell
       -- valid for both kinds of channels */
@@ -88,6 +91,8 @@ public:
       -- valid for both kinds of channels */
   Identifier  channel_id( const Identifier moduleId, int depth,
                           int eta, int phi) const ;
+  Identifier  channel_id( const Identifier moduleId, int depth,
+                          int eta, int phi, bool checks) const ;
                              
   bool is_supercell (const Identifier channelId) const;
                                  
@@ -308,13 +313,13 @@ LArMiniFCAL_ID::channel_id (const ExpandedIdentifier& exp_id) const
 
 //----------------------------------------------------------------------------
 inline Identifier 
-LArMiniFCAL_ID::module_id (int pos_neg, int module) const 
+LArMiniFCAL_ID::module_id (int pos_neg, int module, bool checks) const 
 {
 
     Identifier result(0);
 
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         module_id_checks ( pos_neg, module );
     }
 
@@ -327,14 +332,21 @@ LArMiniFCAL_ID::module_id (int pos_neg, int module) const
     return result;
 }
 
+inline Identifier 
+LArMiniFCAL_ID::module_id (int pos_neg, int module) const 
+{
+  return module_id (pos_neg, module, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 LArMiniFCAL_ID::channel_id   ( int pos_neg, int module, int depth,
-                           int eta,     int phi ) const 
+                               int eta,     int phi,
+                               bool checks ) const 
 {  
 
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
         channel_id_checks( pos_neg, module, depth, eta, phi );
     }
 
@@ -351,6 +363,13 @@ LArMiniFCAL_ID::channel_id   ( int pos_neg, int module, int depth,
     return result;
 }
 
+inline Identifier 
+LArMiniFCAL_ID::channel_id   ( int pos_neg, int module, int depth,
+                               int eta,     int phi ) const
+{
+  return channel_id (pos_neg, module, depth, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier 
 LArMiniFCAL_ID::module_id   ( const Identifier channelId ) const 
@@ -367,10 +386,11 @@ LArMiniFCAL_ID::module_id   ( const Identifier channelId ) const
 //----------------------------------------------------------------------------
 inline Identifier 
 LArMiniFCAL_ID::channel_id   ( const Identifier module_id, int depth,
-                           int eta,       int phi ) const 
+                               int eta,       int phi,
+                               bool checks) const 
 {
     // Do checks 
-    if(m_do_checks) {
+    if(checks) {
       channel_id_checks( module_id, depth, eta, phi );
     }
 
@@ -387,6 +407,13 @@ LArMiniFCAL_ID::channel_id   ( const Identifier module_id, int depth,
     return result;
 }
 
+inline Identifier 
+LArMiniFCAL_ID::channel_id   ( const Identifier module_id, int depth,
+                               int eta,       int phi) const
+{
+  return channel_id (module_id, depth, eta, phi, do_checks());
+}
+
 //----------------------------------------------------------------------------
 inline Identifier LArMiniFCAL_ID::module_id    (IdentifierHash module_hash_id) const
 {
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h
index 1a23595a0e2..71349afa2ca 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/TTOnlineID.h
@@ -1,465 +1,488 @@
 /*
-  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 CALOIDENTIFIER_TTONLINEID_H
-#define CALOIDENTIFIER_TTONLINEID_H
-
-#include "AthenaKernel/CLASS_DEF.h"
-#include "GaudiKernel/MsgStream.h"
-#include "AtlasDetDescr/AtlasDetectorID.h"
-#include "Identifier/HWIdentifier.h"
-#include "Identifier/IdentifierHash.h"
-#include "Identifier/Range.h"
-#include "IdDict/IdDictFieldImplementation.h"
-#include "IdDict/IdDictDefs.h"
-#include "CaloIdentifier/CaloID_Exception.h"
-#include <vector>
-#include <iostream>
-#include <algorithm>
-#include <map>
-
-//using namespace std;
-
-class IdentifierHash;
-class Range;
-
-/**
-*
-* @class TTOnlineID
-* @brief Helper class for Calo TT online identifiers
-*  
-*  This class provides an interface to decode and generate online identifiers
-*  for the Calorimeter Trigger Towers.  <p>
-* 
-*/
-class TTOnlineID : public AtlasDetectorID
-{
- public:
-
-  typedef Identifier::size_type  size_type;
-
-  TTOnlineID(void);
-  ~TTOnlineID(void);
-
-
-  /* build towerId HWIdentifier */
-  /*=========================== */
-  /** (1) create towerId from fields */
-  HWIdentifier crateId( int crate ) const;
-  /** (2) create towerId from hash */
-  HWIdentifier crateId( IdentifierHash crate_hash ) const;
-  /** (3) create towerId from hash */
-  IdentifierHash crateHash( HWIdentifier crate_id ) const;
-  /** (4) iterator over towerId */
-  std::vector<HWIdentifier>::const_iterator crate_begin(void) const;
-  std::vector<HWIdentifier>::const_iterator crate_end(void) const;
-
-  /* build moduleId HWIdentifier */
-  /*=========================== */
-  /** (1) create towerId from fields */
-  HWIdentifier moduleId( int crate, int module) const;
-  /** (2) create towerId from hash */
-  HWIdentifier moduleId( IdentifierHash crate_hash ) const;
-  /** (3) create towerId from hash */
-  IdentifierHash moduleHash( HWIdentifier crate_id ) const;
-  /** (4) iterator over towerId */
-  std::vector<HWIdentifier>::const_iterator module_begin(void) const;
-  std::vector<HWIdentifier>::const_iterator module_end(void) const;
-
-  /* build submoduleId HWIdentifier */
-  /*=========================== */
-  /** (1) create towerId from fields */
-  HWIdentifier submoduleId( int crate, int module, int submodule) const;
-  /** (2) create towerId from hash */
-  HWIdentifier submoduleId( IdentifierHash crate_hash ) const;
-  /** (3) create towerId from hash */
-  IdentifierHash submoduleHash( HWIdentifier crate_id ) const;
-  /** (4) iterator over towerId */
-  std::vector<HWIdentifier>::const_iterator submodule_begin(void) const;
-  std::vector<HWIdentifier>::const_iterator submodule_end(void) const;
-
-  /* build moduleId HWIdentifier */
-  /*=========================== */
-  /** (1) create towerId from fields */
-  HWIdentifier channelId( int crate, int module, int submodule, int channel) const;
-  /** (2) create towerId from hash */
-  HWIdentifier channelId( IdentifierHash crate_hash ) const;
-  /** (3) create towerId from hash */
-  IdentifierHash channelHash( HWIdentifier crate_id ) const;
-  /** (4) iterator over towerId */
-  std::vector<HWIdentifier>::const_iterator channel_begin(void) const;
-  std::vector<HWIdentifier>::const_iterator channel_end(void) const;
-
-
-
-  /*  hash tables max size */
-  /*====================== */
-  size_type  crateHashMax (void) const;
-  size_type  moduleHashMax (void) const;
-  size_type  submoduleHashMax (void) const;
-  size_type  channelHashMax (void) const;
-
-
-  /** Initialization from the identifier dictionary*/
-  virtual int initialize_from_dictionary (const IdDictMgr& dict_mgr);
-
-
-  // HWIdentifier Fields for TTOnlineID
-  // ========================================
-  int crate( const HWIdentifier id )const;
-  int module( const HWIdentifier id )const;
-  int submodule( const HWIdentifier id )const;
-  int channel( const HWIdentifier id )const;
-
-
-  /** context for feedthroughs, feb  & channels */
-
-  IdContext    crateContext(void) const;
-  IdContext    moduleContext(void) const;
-  IdContext    submoduleContext(void) const;
-  IdContext    channelContext(void) const;
-
-
-private:
-
-  enum {NOT_VALID_HASH = 256000};
-
-  IdentifierHash channel_hash_binary_search(HWIdentifier channelId) const;
-
-  // Check methods
-  void  channel_Id_checks(int crate, int module, int submodule, int channel ) const;
-  void  channel_Id_checks(const HWIdentifier crateId, int module, int submodule, int channel ) const;
-  void  channel_Id_checks(const HWIdentifier moduleId, int submodule, int channel ) const;
-  void  channel_Id_checks(const HWIdentifier submoduleId, int channel ) const;
-
-  void  submodule_Id_checks(int crate, int module, int submodule ) const;
-  void  module_Id_checks(int crate, int module ) const;
-  void  crate_Id_checks( int crate ) const;
-
-  /** create expanded HWIdentifier from HWIdentifier (return == 0 for OK) */
-  int  get_expanded_id (const HWIdentifier& id, ExpandedIdentifier& exp_id,
-			const IdContext* context) const;
-
-  /** return the value of the detzside field (initialized in initialize_from_dictionary())*/
-  int detzside_field_value() const;
-
-  /** init() hashes */
-  int  initLevelsFromDict(void) ;
-  int  init_hashes(void);
-
-  /** Member Data index */
-	size_type m_calo_index;
-	size_type m_detzside_index;
-	size_type m_l1online_regions_index;
-	size_type m_crate_index;
-	size_type m_module_index;
-	size_type m_submodule_index;
-	size_type m_channel_index;
-
-  const IdDictDictionary*       m_dict;
-  MultiRange                    m_full_crate_range;
-  MultiRange                    m_full_module_range;
-  MultiRange                    m_full_submodule_range;
-  MultiRange                    m_full_channel_range;
-
-  size_type                     m_crateHashMax;
-  size_type                     m_moduleHashMax;
-  size_type                     m_submoduleHashMax;
-  size_type                     m_channelHashMax;
-
-  std::vector<HWIdentifier>     m_crate_vec;
-  std::vector<HWIdentifier>     m_module_vec;
-  std::vector<HWIdentifier>     m_submodule_vec;
-  std::vector<HWIdentifier>     m_channel_vec;
-
-  int m_iDetZSideFieldValue;
-
-  /**
-     @brief small class holding the starting hash value, the min eta and the number of phi bins of each region <br>
-     used to CPU-optimize the conversion from an identifier to a hash index
-   */
-  class HashCalc
-  {
-  public:
-    HashCalc() :
-    m_hash(0),
-      m_channelmin(0) {}
-    IdentifierHash m_hash;
-    size_type      m_channelmin;
-  };
-  std::vector<HashCalc>         m_hash_calcs;
-
-
-  /** Field Implementation */
-  IdDictFieldImplementation   m_calo_impl;
-  IdDictFieldImplementation   m_calo_detzside_impl;
-  IdDictFieldImplementation   m_crate_impl;
-  IdDictFieldImplementation   m_module_impl;
-  IdDictFieldImplementation   m_submodule_impl;
-  IdDictFieldImplementation   m_channel_impl;
-};
-
-
-//using the macro below we can assign an identifier (and a version)
-//This is required and checked at compile time when you try to record/retrieve
-CLASS_DEF( TTOnlineID , 38321944 , 1 )
-
-
-//=====================
-// Inline Definitions
-//=====================
-
-/* Crates */
-
-//==========================================================================================================
-inline HWIdentifier TTOnlineID::crateId( int crate ) const
-//==========================================================================================================
-{
-  HWIdentifier result(0);
-  m_calo_impl.pack                (10   , result);
-  m_calo_detzside_impl.pack       (0   , result);
-  m_crate_impl.pack               (crate                , result);
-
-  /* Do checks */
-  if(m_do_checks) {
-    crate_Id_checks( crate );
-  }
-  return result;
-}
-
-//============================================================================== */
-inline HWIdentifier TTOnlineID::crateId(IdentifierHash cratehash_id) const
-//===============================================================================*/
-{
-    return(m_crate_vec[cratehash_id]);
-}
-
-//=============================================================================
-inline IdentifierHash TTOnlineID::crateHash  (HWIdentifier crate_id) const{
-//=============================================================================
-  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_crate_vec.begin(),m_crate_vec.end(),crate_id);
-  if ( it != m_crate_vec.end() ){
-    return (it - m_crate_vec.begin());
-  }
-  return (0);
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::crate_begin(void) const {
-//=============================================================================
-	return(m_crate_vec.begin());
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::crate_end(void) const {
-//=============================================================================
-	return(m_crate_vec.end());
-}
-
-/* Modules */
-
-//==========================================================================================================
-inline HWIdentifier TTOnlineID::moduleId( int crate, int module ) const
-//==========================================================================================================
-{
-  HWIdentifier result(0);
-  m_calo_impl.pack                (10   , result);
-  m_calo_detzside_impl.pack       (0   , result);
-  m_crate_impl.pack               (crate                , result);
-  m_module_impl.pack              (module               , result);
-
-  /* Do checks */
-  if(m_do_checks) {
-    module_Id_checks( crate, module );
-  }
-  return result;
-}
-
-//============================================================================== */
-inline HWIdentifier TTOnlineID::moduleId(IdentifierHash modulehash_id) const
-//===============================================================================*/
-{
-    return(m_module_vec[modulehash_id]);
-}
-
-//=============================================================================
-inline IdentifierHash TTOnlineID::moduleHash  (HWIdentifier module_id) const{
-//=============================================================================
-  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_module_vec.begin(),m_module_vec.end(),module_id);
-  if ( it != m_module_vec.end() ){
-    return (it - m_module_vec.begin());
-  }
-  return (0);
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::module_begin(void) const {
-//=============================================================================
-	return(m_module_vec.begin());
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::module_end(void) const {
-//=============================================================================
-	return(m_module_vec.end());
-}
-
-
-/* SubModules */
-
-//==========================================================================================================
-inline HWIdentifier TTOnlineID::submoduleId( int crate, int module, int submodule ) const
-//==========================================================================================================
-{
-  HWIdentifier result(0);
-  m_calo_impl.pack                (10   , result);
-  m_calo_detzside_impl.pack       (0   , result);
-  m_crate_impl.pack               (crate                , result);
-  m_module_impl.pack              (module               , result);
-  m_submodule_impl.pack           (submodule            , result);
-
-  /* Do checks */
-  if(m_do_checks) {
-    submodule_Id_checks( crate, module, submodule );
-  }
-  return result;
-}
-
-//============================================================================== */
-inline HWIdentifier TTOnlineID::submoduleId(IdentifierHash submodulehash_id) const
-//===============================================================================*/
-{
-    return(m_submodule_vec[submodulehash_id]);
-}
-
-//=============================================================================
-inline IdentifierHash TTOnlineID::submoduleHash  (HWIdentifier submodule_id) const{
-//=============================================================================
-  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_submodule_vec.begin(),m_submodule_vec.end(),submodule_id);
-  if ( it != m_submodule_vec.end() ){
-    return (it - m_submodule_vec.begin());
-  }
-  return (0);
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::submodule_begin(void) const {
-//=============================================================================
-	return(m_submodule_vec.begin());
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::submodule_end(void) const {
-//=============================================================================
-	return(m_submodule_vec.end());
-}
-
-
-/* Channels */
-
-//==========================================================================================================
-inline HWIdentifier TTOnlineID::channelId( int crate, int module, int submodule, int channel ) const
-//==========================================================================================================
-{
-  HWIdentifier result(0);
-  m_calo_impl.pack                (10   , result);
-  m_calo_detzside_impl.pack       (0   , result);
-  m_crate_impl.pack               (crate                , result);
-  m_module_impl.pack              (module               , result);
-  m_submodule_impl.pack           (submodule            , result);
-  m_channel_impl.pack             (channel              , result);
-
-  /* Do checks */
-  if(m_do_checks) {
-    channel_Id_checks( crate, module, submodule, channel );
-  }
-  return result;
-}
-
-//============================================================================== */
-inline HWIdentifier TTOnlineID::channelId(IdentifierHash channelhash_id) const
-//===============================================================================*/
-{
-    return(m_channel_vec[channelhash_id]);
-}
-
-//=============================================================================
-inline IdentifierHash TTOnlineID::channelHash  (HWIdentifier channel_id) const{
-//=============================================================================
-  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_channel_vec.begin(),m_channel_vec.end(),channel_id);
-  if ( it != m_channel_vec.end() ){
-    return (it - m_channel_vec.begin());
-  }
-  return (0);
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::channel_begin(void) const {
-//=============================================================================
-	return(m_channel_vec.begin());
-}
-
-//=============================================================================
-inline std::vector<HWIdentifier>::const_iterator TTOnlineID::channel_end(void) const {
-//=============================================================================
-	return(m_channel_vec.end());
-}
-
-
-/* Hash indices */
-
-inline TTOnlineID::size_type TTOnlineID::crateHashMax (void) const
-/*====================================================================*/
-{
-  return m_crateHashMax;
-}
-
-inline TTOnlineID::size_type TTOnlineID::moduleHashMax (void) const
-/*====================================================================*/
-{
-  return m_moduleHashMax;
-}
-
-inline TTOnlineID::size_type TTOnlineID::submoduleHashMax (void) const
-/*====================================================================*/
-{
-  return m_submoduleHashMax;
-}
-
-inline TTOnlineID::size_type TTOnlineID::channelHashMax (void) const
-/*====================================================================*/
-{
-  return m_channelHashMax;
-}
-
-inline int TTOnlineID::crate(const HWIdentifier id)const
-/*===========================================================*/
-{
-  return (m_crate_impl.unpack(id));
-}
-
-inline int TTOnlineID::module(const HWIdentifier id)const
-/*===========================================================*/
-{
-  return (m_module_impl.unpack(id));
-}
-
-inline int TTOnlineID::submodule(const HWIdentifier id)const
-/*===========================================================*/
-{
-  return (m_submodule_impl.unpack(id));
-}
-
-inline int TTOnlineID::channel(const HWIdentifier id)const
-/*===========================================================*/
-{
-  return (m_channel_impl.unpack(id));
-}
-
-inline int TTOnlineID::detzside_field_value() const
-{
-  return m_iDetZSideFieldValue;
-}
-
-#endif // TTOnlineID_H
+#ifndef CALOIDENTIFIER_TTONLINEID_H
+#define CALOIDENTIFIER_TTONLINEID_H
+
+#include "AthenaKernel/CLASS_DEF.h"
+#include "GaudiKernel/MsgStream.h"
+#include "AtlasDetDescr/AtlasDetectorID.h"
+#include "Identifier/HWIdentifier.h"
+#include "Identifier/IdentifierHash.h"
+#include "Identifier/Range.h"
+#include "IdDict/IdDictFieldImplementation.h"
+#include "IdDict/IdDictDefs.h"
+#include "CaloIdentifier/CaloID_Exception.h"
+#include <vector>
+#include <iostream>
+#include <algorithm>
+#include <map>
+
+//using namespace std;
+
+class IdentifierHash;
+class Range;
+
+/**
+*
+* @class TTOnlineID
+* @brief Helper class for Calo TT online identifiers
+*  
+*  This class provides an interface to decode and generate online identifiers
+*  for the Calorimeter Trigger Towers.  <p>
+* 
+*/
+class TTOnlineID : public AtlasDetectorID
+{
+ public:
+
+  typedef Identifier::size_type  size_type;
+
+  TTOnlineID(void);
+  ~TTOnlineID(void);
+
+
+  /* build towerId HWIdentifier */
+  /*=========================== */
+  /** (1) create towerId from fields */
+  HWIdentifier crateId( int crate ) const;
+  HWIdentifier crateId( int crate, bool checks ) const;
+  /** (2) create towerId from hash */
+  HWIdentifier crateId( IdentifierHash crate_hash ) const;
+  /** (3) create towerId from hash */
+  IdentifierHash crateHash( HWIdentifier crate_id ) const;
+  /** (4) iterator over towerId */
+  std::vector<HWIdentifier>::const_iterator crate_begin(void) const;
+  std::vector<HWIdentifier>::const_iterator crate_end(void) const;
+
+  /* build moduleId HWIdentifier */
+  /*=========================== */
+  /** (1) create towerId from fields */
+  HWIdentifier moduleId( int crate, int module) const;
+  HWIdentifier moduleId( int crate, int module, bool checks) const;
+  /** (2) create towerId from hash */
+  HWIdentifier moduleId( IdentifierHash crate_hash ) const;
+  /** (3) create towerId from hash */
+  IdentifierHash moduleHash( HWIdentifier crate_id ) const;
+  /** (4) iterator over towerId */
+  std::vector<HWIdentifier>::const_iterator module_begin(void) const;
+  std::vector<HWIdentifier>::const_iterator module_end(void) const;
+
+  /* build submoduleId HWIdentifier */
+  /*=========================== */
+  /** (1) create towerId from fields */
+  HWIdentifier submoduleId( int crate, int module, int submodule) const;
+  HWIdentifier submoduleId( int crate, int module, int submodule, bool checks) const;
+  /** (2) create towerId from hash */
+  HWIdentifier submoduleId( IdentifierHash crate_hash ) const;
+  /** (3) create towerId from hash */
+  IdentifierHash submoduleHash( HWIdentifier crate_id ) const;
+  /** (4) iterator over towerId */
+  std::vector<HWIdentifier>::const_iterator submodule_begin(void) const;
+  std::vector<HWIdentifier>::const_iterator submodule_end(void) const;
+
+  /* build moduleId HWIdentifier */
+  /*=========================== */
+  /** (1) create towerId from fields */
+  HWIdentifier channelId( int crate, int module, int submodule, int channel) const;
+  HWIdentifier channelId( int crate, int module, int submodule, int channel, bool checks) const;
+  /** (2) create towerId from hash */
+  HWIdentifier channelId( IdentifierHash crate_hash ) const;
+  /** (3) create towerId from hash */
+  IdentifierHash channelHash( HWIdentifier crate_id ) const;
+  /** (4) iterator over towerId */
+  std::vector<HWIdentifier>::const_iterator channel_begin(void) const;
+  std::vector<HWIdentifier>::const_iterator channel_end(void) const;
+
+
+
+  /*  hash tables max size */
+  /*====================== */
+  size_type  crateHashMax (void) const;
+  size_type  moduleHashMax (void) const;
+  size_type  submoduleHashMax (void) const;
+  size_type  channelHashMax (void) const;
+
+
+  /** Initialization from the identifier dictionary*/
+  virtual int initialize_from_dictionary (const IdDictMgr& dict_mgr);
+
+
+  // HWIdentifier Fields for TTOnlineID
+  // ========================================
+  int crate( const HWIdentifier id )const;
+  int module( const HWIdentifier id )const;
+  int submodule( const HWIdentifier id )const;
+  int channel( const HWIdentifier id )const;
+
+
+  /** context for feedthroughs, feb  & channels */
+
+  IdContext    crateContext(void) const;
+  IdContext    moduleContext(void) const;
+  IdContext    submoduleContext(void) const;
+  IdContext    channelContext(void) const;
+
+
+private:
+
+  enum {NOT_VALID_HASH = 256000};
+
+  IdentifierHash channel_hash_binary_search(HWIdentifier channelId) const;
+
+  // Check methods
+  void  channel_Id_checks(int crate, int module, int submodule, int channel ) const;
+  void  channel_Id_checks(const HWIdentifier crateId, int module, int submodule, int channel ) const;
+  void  channel_Id_checks(const HWIdentifier moduleId, int submodule, int channel ) const;
+  void  channel_Id_checks(const HWIdentifier submoduleId, int channel ) const;
+
+  void  submodule_Id_checks(int crate, int module, int submodule ) const;
+  void  module_Id_checks(int crate, int module ) const;
+  void  crate_Id_checks( int crate ) const;
+
+  /** create expanded HWIdentifier from HWIdentifier (return == 0 for OK) */
+  int  get_expanded_id (const HWIdentifier& id, ExpandedIdentifier& exp_id,
+			const IdContext* context) const;
+
+  /** return the value of the detzside field (initialized in initialize_from_dictionary())*/
+  int detzside_field_value() const;
+
+  /** init() hashes */
+  int  initLevelsFromDict(void) ;
+  int  init_hashes(void);
+
+  /** Member Data index */
+	size_type m_calo_index;
+	size_type m_detzside_index;
+	size_type m_l1online_regions_index;
+	size_type m_crate_index;
+	size_type m_module_index;
+	size_type m_submodule_index;
+	size_type m_channel_index;
+
+  const IdDictDictionary*       m_dict;
+  MultiRange                    m_full_crate_range;
+  MultiRange                    m_full_module_range;
+  MultiRange                    m_full_submodule_range;
+  MultiRange                    m_full_channel_range;
+
+  size_type                     m_crateHashMax;
+  size_type                     m_moduleHashMax;
+  size_type                     m_submoduleHashMax;
+  size_type                     m_channelHashMax;
+
+  std::vector<HWIdentifier>     m_crate_vec;
+  std::vector<HWIdentifier>     m_module_vec;
+  std::vector<HWIdentifier>     m_submodule_vec;
+  std::vector<HWIdentifier>     m_channel_vec;
+
+  int m_iDetZSideFieldValue;
+
+  /**
+     @brief small class holding the starting hash value, the min eta and the number of phi bins of each region <br>
+     used to CPU-optimize the conversion from an identifier to a hash index
+   */
+  class HashCalc
+  {
+  public:
+    HashCalc() :
+    m_hash(0),
+      m_channelmin(0) {}
+    IdentifierHash m_hash;
+    size_type      m_channelmin;
+  };
+  std::vector<HashCalc>         m_hash_calcs;
+
+
+  /** Field Implementation */
+  IdDictFieldImplementation   m_calo_impl;
+  IdDictFieldImplementation   m_calo_detzside_impl;
+  IdDictFieldImplementation   m_crate_impl;
+  IdDictFieldImplementation   m_module_impl;
+  IdDictFieldImplementation   m_submodule_impl;
+  IdDictFieldImplementation   m_channel_impl;
+};
+
+
+//using the macro below we can assign an identifier (and a version)
+//This is required and checked at compile time when you try to record/retrieve
+CLASS_DEF( TTOnlineID , 38321944 , 1 )
+
+
+//=====================
+// Inline Definitions
+//=====================
+
+/* Crates */
+
+//==========================================================================================================
+inline HWIdentifier TTOnlineID::crateId( int crate, bool checks ) const
+//==========================================================================================================
+{
+  HWIdentifier result(0);
+  m_calo_impl.pack                (10   , result);
+  m_calo_detzside_impl.pack       (0   , result);
+  m_crate_impl.pack               (crate                , result);
+
+  /* Do checks */
+  if(checks) {
+    crate_Id_checks( crate );
+  }
+  return result;
+}
+inline HWIdentifier TTOnlineID::crateId( int crate ) const
+{
+  return crateId (crate, do_checks());
+}
+
+//============================================================================== */
+inline HWIdentifier TTOnlineID::crateId(IdentifierHash cratehash_id) const
+//===============================================================================*/
+{
+    return(m_crate_vec[cratehash_id]);
+}
+
+//=============================================================================
+inline IdentifierHash TTOnlineID::crateHash  (HWIdentifier crate_id) const{
+//=============================================================================
+  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_crate_vec.begin(),m_crate_vec.end(),crate_id);
+  if ( it != m_crate_vec.end() ){
+    return (it - m_crate_vec.begin());
+  }
+  return (0);
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::crate_begin(void) const {
+//=============================================================================
+	return(m_crate_vec.begin());
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::crate_end(void) const {
+//=============================================================================
+	return(m_crate_vec.end());
+}
+
+/* Modules */
+
+//==========================================================================================================
+inline HWIdentifier TTOnlineID::moduleId( int crate, int module, bool checks ) const
+//==========================================================================================================
+{
+  HWIdentifier result(0);
+  m_calo_impl.pack                (10   , result);
+  m_calo_detzside_impl.pack       (0   , result);
+  m_crate_impl.pack               (crate                , result);
+  m_module_impl.pack              (module               , result);
+
+  /* Do checks */
+  if(checks) {
+    module_Id_checks( crate, module );
+  }
+  return result;
+}
+
+inline HWIdentifier TTOnlineID::moduleId( int crate, int module ) const
+{
+  return moduleId (crate, module, do_checks());
+}
+
+//============================================================================== */
+inline HWIdentifier TTOnlineID::moduleId(IdentifierHash modulehash_id) const
+//===============================================================================*/
+{
+    return(m_module_vec[modulehash_id]);
+}
+
+//=============================================================================
+inline IdentifierHash TTOnlineID::moduleHash  (HWIdentifier module_id) const{
+//=============================================================================
+  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_module_vec.begin(),m_module_vec.end(),module_id);
+  if ( it != m_module_vec.end() ){
+    return (it - m_module_vec.begin());
+  }
+  return (0);
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::module_begin(void) const {
+//=============================================================================
+	return(m_module_vec.begin());
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::module_end(void) const {
+//=============================================================================
+	return(m_module_vec.end());
+}
+
+
+/* SubModules */
+
+//==========================================================================================================
+inline HWIdentifier TTOnlineID::submoduleId( int crate, int module, int submodule, bool checks ) const
+//==========================================================================================================
+{
+  HWIdentifier result(0);
+  m_calo_impl.pack                (10   , result);
+  m_calo_detzside_impl.pack       (0   , result);
+  m_crate_impl.pack               (crate                , result);
+  m_module_impl.pack              (module               , result);
+  m_submodule_impl.pack           (submodule            , result);
+
+  /* Do checks */
+  if(checks) {
+    submodule_Id_checks( crate, module, submodule );
+  }
+  return result;
+}
+inline HWIdentifier TTOnlineID::submoduleId( int crate, int module, int submodule ) const
+{
+  return submoduleId (crate, module, submodule, do_checks());
+}
+
+
+//============================================================================== */
+inline HWIdentifier TTOnlineID::submoduleId(IdentifierHash submodulehash_id) const
+//===============================================================================*/
+{
+    return(m_submodule_vec[submodulehash_id]);
+}
+
+//=============================================================================
+inline IdentifierHash TTOnlineID::submoduleHash  (HWIdentifier submodule_id) const{
+//=============================================================================
+  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_submodule_vec.begin(),m_submodule_vec.end(),submodule_id);
+  if ( it != m_submodule_vec.end() ){
+    return (it - m_submodule_vec.begin());
+  }
+  return (0);
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::submodule_begin(void) const {
+//=============================================================================
+	return(m_submodule_vec.begin());
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::submodule_end(void) const {
+//=============================================================================
+	return(m_submodule_vec.end());
+}
+
+
+/* Channels */
+
+//==========================================================================================================
+inline HWIdentifier TTOnlineID::channelId( int crate, int module, int submodule, int channel, bool checks ) const
+//==========================================================================================================
+{
+  HWIdentifier result(0);
+  m_calo_impl.pack                (10   , result);
+  m_calo_detzside_impl.pack       (0   , result);
+  m_crate_impl.pack               (crate                , result);
+  m_module_impl.pack              (module               , result);
+  m_submodule_impl.pack           (submodule            , result);
+  m_channel_impl.pack             (channel              , result);
+
+  /* Do checks */
+  if(checks) {
+    channel_Id_checks( crate, module, submodule, channel );
+  }
+  return result;
+}
+
+inline HWIdentifier TTOnlineID::channelId( int crate, int module, int submodule, int channel ) const
+{
+  return channelId (crate, module, submodule, channel, do_checks());
+}
+
+//============================================================================== */
+inline HWIdentifier TTOnlineID::channelId(IdentifierHash channelhash_id) const
+//===============================================================================*/
+{
+    return(m_channel_vec[channelhash_id]);
+}
+
+//=============================================================================
+inline IdentifierHash TTOnlineID::channelHash  (HWIdentifier channel_id) const{
+//=============================================================================
+  std::vector<HWIdentifier>::const_iterator it = std::lower_bound(m_channel_vec.begin(),m_channel_vec.end(),channel_id);
+  if ( it != m_channel_vec.end() ){
+    return (it - m_channel_vec.begin());
+  }
+  return (0);
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::channel_begin(void) const {
+//=============================================================================
+	return(m_channel_vec.begin());
+}
+
+//=============================================================================
+inline std::vector<HWIdentifier>::const_iterator TTOnlineID::channel_end(void) const {
+//=============================================================================
+	return(m_channel_vec.end());
+}
+
+
+/* Hash indices */
+
+inline TTOnlineID::size_type TTOnlineID::crateHashMax (void) const
+/*====================================================================*/
+{
+  return m_crateHashMax;
+}
+
+inline TTOnlineID::size_type TTOnlineID::moduleHashMax (void) const
+/*====================================================================*/
+{
+  return m_moduleHashMax;
+}
+
+inline TTOnlineID::size_type TTOnlineID::submoduleHashMax (void) const
+/*====================================================================*/
+{
+  return m_submoduleHashMax;
+}
+
+inline TTOnlineID::size_type TTOnlineID::channelHashMax (void) const
+/*====================================================================*/
+{
+  return m_channelHashMax;
+}
+
+inline int TTOnlineID::crate(const HWIdentifier id)const
+/*===========================================================*/
+{
+  return (m_crate_impl.unpack(id));
+}
+
+inline int TTOnlineID::module(const HWIdentifier id)const
+/*===========================================================*/
+{
+  return (m_module_impl.unpack(id));
+}
+
+inline int TTOnlineID::submodule(const HWIdentifier id)const
+/*===========================================================*/
+{
+  return (m_submodule_impl.unpack(id));
+}
+
+inline int TTOnlineID::channel(const HWIdentifier id)const
+/*===========================================================*/
+{
+  return (m_channel_impl.unpack(id));
+}
+
+inline int TTOnlineID::detzside_field_value() const
+{
+  return m_iDetZSideFieldValue;
+}
+
+#endif // TTOnlineID_H
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h
index 8317f038f3f..d53e62bd9a2 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.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
 */
 
 /***************************************************************************
@@ -102,15 +102,20 @@ public:
    * @brief identifer for Tile testbeam detectors of a give type
    */
   Identifier          type_id                 ( int type)                     const;
+  Identifier          type_id                 ( int type, bool checks )       const;
   /**
    * @brief identifer for one module of a Tile testbeam detector
    */
   Identifier          module_id               ( int type, int module )        const;
+  Identifier          module_id               ( int type, int module, bool checks ) const;
   /**
    * @brief identifer for one channel of a Tile testbeam detector
    */
   Identifier          channel_id              ( int type, int module, 
                                                 int channel )                 const;
+  Identifier          channel_id              ( int type, int module, 
+                                                int channel,
+                                                bool checks)                  const;
 
   /**
    * @brief extract module ID from channel ID
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h
index 00d13950132..c4da3d4591e 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/Tile_Base_ID.h
@@ -1,7 +1,7 @@
 // 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$
@@ -71,36 +71,61 @@ public:
 
     /** build identifier for any Tilecal section */
     Identifier          tile_det                ( int section)                  const;
+    Identifier          tile_det                ( int section, bool checks)     const;
 
     /** build single region, module, tower, cell, pmt, adc identifiers */
     Identifier          region_id               ( int index)                    const;
     Identifier          region_id               ( int section, int side)        const;
+    Identifier          region_id               ( int section, int side, bool checks) const;
     Identifier          region_id               ( const Identifier& any_id)     const;
 
     Identifier          module_id               ( int section, int side,
                                                   int module)                   const;
+    Identifier          module_id               ( int section, int side,
+                                                  int module, bool checks)      const;
     Identifier          module_id               ( const Identifier& any_id)     const;
     Identifier          tower_id                ( int section,  int side,
                                                   int module,   int tower)      const;
-    Identifier          tower_id               ( const Identifier& any_id)     const;
+    Identifier          tower_id                ( int section,  int side,
+                                                  int module,   int tower,
+                                                  bool checks)                  const;
+    Identifier          tower_id               ( const Identifier& any_id)      const;
     Identifier          cell_id                 ( const Identifier & any_id )   const;
     Identifier          cell_id                 ( int section,  int side,
                                                   int module,   int tower,
                                                   int sample )                  const;
+    Identifier          cell_id                 ( int section,  int side,
+                                                  int module,   int tower,
+                                                  int sample, bool checks )     const;
     Identifier          pmt_id                  ( const Identifier & any_id )   const;
     Identifier          pmt_id                  ( const Identifier & cell_id,
                                                   int pmt )                     const;
+    Identifier          pmt_id                  ( const Identifier & cell_id,
+                                                  int pmt, bool checks )        const;
     Identifier          pmt_id                  ( int section,  int side,
                                                   int module,   int tower,
                                                   int sample,   int pmt )       const;
+    Identifier          pmt_id                  ( int section,  int side,
+                                                  int module,   int tower,
+                                                  int sample,   int pmt,
+                                                  bool checks)                  const;
     Identifier          adc_id                  ( const Identifier & cell_id,
                                                   int pmt, int adc )            const;
+    Identifier          adc_id                  ( const Identifier & cell_id,
+                                                  int pmt, int adc,
+                                                  bool checks )                 const;
     Identifier          adc_id                  ( const Identifier & pmt_id,
                                                   int adc )                     const;
+    Identifier          adc_id                  ( const Identifier & pmt_id,
+                                                  int adc, bool checks )        const;
     Identifier          adc_id                  ( int section,  int side,
                                                   int module,   int tower,
                                                   int sample,   int pmt,
                                                   int adc ) const;
+    Identifier          adc_id                  ( int section,  int side,
+                                                  int module,   int tower,
+                                                  int sample,   int pmt,
+                                                  int adc, bool checks ) const;
 
     /** fast conversion from hash to ID for cells */
     Identifier          cell_id                 (const IdentifierHash& hash_id) const;
diff --git a/Calorimeter/CaloIdentifier/src/TileTBID.cxx b/Calorimeter/CaloIdentifier/src/TileTBID.cxx
index 8e2399fd622..cd168127993 100755
--- a/Calorimeter/CaloIdentifier/src/TileTBID.cxx
+++ b/Calorimeter/CaloIdentifier/src/TileTBID.cxx
@@ -106,10 +106,9 @@ TileTBID::tiletb_id     ()      const
 // Build type & module id
 //
 Identifier
-TileTBID::type_id       ( int type )      const
+TileTBID::type_id       ( int type, bool checks )      const
 {
-#ifndef NDEBUG
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -123,19 +122,23 @@ TileTBID::type_id       ( int type )      const
 	    throw TileID_Exception(errorMessage , 2);
 	}
     }
-#endif
 
     Identifier compactID(m_base_tile_type);
     m_type_impl.pack	(type,compactID);
 
     return (compactID);
 }
+Identifier
+TileTBID::type_id       ( int type )      const
+{
+  return type_id (type, do_checks());
+}
+
 
 Identifier
-TileTBID::module_id       ( int type, int module )       const
+TileTBID::module_id       ( int type, int module, bool checks )       const
 {
-#ifndef NDEBUG
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -149,7 +152,6 @@ TileTBID::module_id       ( int type, int module )       const
 	    throw TileID_Exception(errorMessage , 1);
 	}
     }
-#endif
 
     Identifier compactID(m_base_tile_type);
     m_type_impl.pack	(type,compactID);
@@ -157,15 +159,19 @@ TileTBID::module_id       ( int type, int module )       const
 
     return (compactID);
 }
+Identifier
+TileTBID::module_id       ( int type, int module )       const
+{
+  return module_id (type, module, do_checks());
+}
 
 //
 // Build channel id
 //
 Identifier
-TileTBID::channel_id ( int type, int module, int channel ) const
+TileTBID::channel_id ( int type, int module, int channel, bool checks ) const
 {
-#ifndef NDEBUG
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -179,7 +185,6 @@ TileTBID::channel_id ( int type, int module, int channel ) const
 	    throw TileID_Exception(errorMessage , 1);
 	}
     }
-#endif
 
     Identifier compactID(m_base_tile_type);
     m_type_impl.pack	(type,compactID);
@@ -188,6 +193,11 @@ TileTBID::channel_id ( int type, int module, int channel ) const
 
     return (compactID);
 }
+Identifier
+TileTBID::channel_id ( int type, int module, int channel ) const
+{
+  return channel_id (type, module, channel, do_checks());
+}
 
 Identifier
 TileTBID::module_id     ( const Identifier & any_id )   const
@@ -205,7 +215,6 @@ TileTBID::channel_id    ( const Identifier & module_id,
     Identifier compactId(module_id);
     m_channel_impl.pack(channel,compactId);
 
-#ifndef NDEBUG
     if(m_do_checks) {
 	
 	// Check that id is within allowed range
@@ -230,7 +239,6 @@ TileTBID::channel_id    ( const Identifier & module_id,
 	    throw TileID_Exception(errorMessage , 1);
 	}
     }
-#endif
 
     return compactId;
 }
diff --git a/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
index e00dc907111..d4eb14fb3e4 100755
--- a/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/Tile_Base_ID.cxx
@@ -371,9 +371,9 @@ Tile_Base_ID::tile_gap        ()      const
 
 // For any Tilecal section
 Identifier
-Tile_Base_ID::tile_det        ( int section )        const
+Tile_Base_ID::tile_det        ( int section, bool checks )        const
 {
-    if(m_do_checks) {
+    if(checks) {
 	// Check that id is within allowed range
 	// Fill expanded id
 	ExpandedIdentifier expId(tile_exp());
@@ -394,6 +394,12 @@ Tile_Base_ID::tile_det        ( int section )        const
     return result;
 }
 
+Identifier
+Tile_Base_ID::tile_det        ( int section )        const
+{
+  return tile_det (section, do_checks());
+}
+
 // single region, module, tower, cell, pmt, adc identifiers
 Identifier
 Tile_Base_ID::region_id       ( int index )           const
@@ -408,9 +414,9 @@ Tile_Base_ID::region_id       ( int index )           const
 }
 
 Identifier
-Tile_Base_ID::region_id       ( int section, int side )      const
+Tile_Base_ID::region_id       ( int section, int side, bool checks )      const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -440,6 +446,13 @@ Tile_Base_ID::region_id       ( int section, int side )      const
     return result;
 }
 
+Identifier
+Tile_Base_ID::region_id       ( int section, int side )      const
+{
+  return region_id (section, side, do_checks());
+}
+
+
 Identifier
 Tile_Base_ID::region_id       ( const Identifier& any_id )   const
 {
@@ -454,9 +467,10 @@ Tile_Base_ID::region_id       ( const Identifier& any_id )   const
 
 Identifier
 Tile_Base_ID::module_id       ( int section, int side, 
-                                int module ) const
+                                int module,
+                                bool checks ) const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -487,6 +501,14 @@ Tile_Base_ID::module_id       ( int section, int side,
     return result;
 }
 
+Identifier
+Tile_Base_ID::module_id       ( int section, int side, 
+                                int module ) const
+{
+  return module_id (section, side, module, do_checks());
+}
+
+
 Identifier
 Tile_Base_ID::module_id       ( const Identifier& any_id )   const
 {
@@ -501,9 +523,10 @@ Tile_Base_ID::module_id       ( const Identifier& any_id )   const
 
 Identifier
 Tile_Base_ID::tower_id        ( int section, int side,
-                                int module,   int tower )     const
+                                int module,   int tower,
+                                bool checks)     const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -535,6 +558,13 @@ Tile_Base_ID::tower_id        ( int section, int side,
     return result;
 }
 
+Identifier
+Tile_Base_ID::tower_id        ( int section, int side,
+                                int module,   int tower) const
+{
+  return tower_id (section, side, module, tower, do_checks());
+}
+
 Identifier
 Tile_Base_ID::tower_id       ( const Identifier& any_id )   const
 {
@@ -562,9 +592,10 @@ Tile_Base_ID::cell_id         ( const Identifier & any_id )   const
 Identifier
 Tile_Base_ID::cell_id         ( int section, int side,
                                 int module,   int tower, 
-                                int sample )                  const
+                                int sample,
+                                bool checks )                  const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -597,6 +628,14 @@ Tile_Base_ID::cell_id         ( int section, int side,
     return result;
 }
 
+Identifier
+Tile_Base_ID::cell_id         ( int section, int side,
+                                int module,   int tower, 
+                                int sample )                  const
+{
+  return cell_id (section, side, module, tower, sample, do_checks());
+}
+
 Identifier
 Tile_Base_ID::pmt_id          ( const Identifier & any_id )   const
 {
@@ -611,7 +650,7 @@ Tile_Base_ID::pmt_id          ( const Identifier & any_id )   const
 
 Identifier
 Tile_Base_ID::pmt_id          ( const Identifier & cell_id, 
-                                int pmt )                     const
+                                int pmt, bool checks )                const
 {
     Identifier result;
 
@@ -628,7 +667,7 @@ Tile_Base_ID::pmt_id          ( const Identifier & cell_id,
       throw TileID_Exception(errorMessage , 1);
     }
 
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -656,12 +695,20 @@ Tile_Base_ID::pmt_id          ( const Identifier & cell_id,
     return result;
 }
 
+Identifier
+Tile_Base_ID::pmt_id          ( const Identifier & cell_id, 
+                                int pmt )                const
+{
+  return pmt_id (cell_id, pmt, do_checks());
+}
+
 Identifier
 Tile_Base_ID::pmt_id          ( int section, int side,
                                 int module,   int tower,
-                                int sample,   int pmt )       const
+                                int sample,   int pmt,
+                                bool checks)       const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -695,9 +742,17 @@ Tile_Base_ID::pmt_id          ( int section, int side,
     return result;
 }
 
+Identifier
+Tile_Base_ID::pmt_id          ( int section, int side,
+                                int module,   int tower,
+                                int sample,   int pmt) const
+{
+  return pmt_id (section, side, module, tower, sample, pmt, do_checks());
+}
+
 Identifier
 Tile_Base_ID::adc_id          ( const Identifier & cell_id,
-                                int pmt, int adc )            const
+                                int pmt, int adc, bool checks )       const
 {
     Identifier result;
 
@@ -715,7 +770,7 @@ Tile_Base_ID::adc_id          ( const Identifier & cell_id,
       throw TileID_Exception(errorMessage , 1);
     }
 
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -743,9 +798,16 @@ Tile_Base_ID::adc_id          ( const Identifier & cell_id,
     return result;
 }
 
+Identifier
+Tile_Base_ID::adc_id          ( const Identifier & cell_id,
+                                int pmt, int adc )       const
+{
+  return adc_id (cell_id, pmt, adc, do_checks());
+}
+
 Identifier
 Tile_Base_ID::adc_id          ( const Identifier & pmt_id,
-                                int adc )                     const
+                                int adc, bool checks )               const
 {
     Identifier result;
 
@@ -762,7 +824,7 @@ Tile_Base_ID::adc_id          ( const Identifier & pmt_id,
       throw TileID_Exception(errorMessage , 1);
     }
 
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -790,12 +852,20 @@ Tile_Base_ID::adc_id          ( const Identifier & pmt_id,
     return result;
 }
 
+Identifier
+Tile_Base_ID::adc_id          ( const Identifier & pmt_id,
+                                int adc )               const
+{
+  return adc_id (pmt_id, adc, do_checks());
+}
+
 Identifier
 Tile_Base_ID::adc_id          ( int section, int side,
                                 int module, int tower, int sample, 
-                                int pmt, int adc )            const
+                                int pmt, int adc,
+                                bool checks)            const
 {
-    if(m_do_checks) {
+    if(checks) {
 	
 	// Check that id is within allowed range
 
@@ -830,6 +900,14 @@ Tile_Base_ID::adc_id          ( int section, int side,
     return result;
 }
 
+Identifier
+Tile_Base_ID::adc_id          ( int section, int side,
+                                int module, int tower, int sample, 
+                                int pmt, int adc)            const
+{
+  return adc_id (section, side, module, tower, sample, pmt, adc, do_checks());
+}
+
 bool Tile_Base_ID::module_id  ( const Identifier& region_id,
                                 int module, Identifier& module_id ) const
 {
diff --git a/Calorimeter/CaloIdentifier/test/test_calo_dm_id.cxx b/Calorimeter/CaloIdentifier/test/test_calo_dm_id.cxx
index b56f53163a4..7794b2e50ce 100755
--- a/Calorimeter/CaloIdentifier/test/test_calo_dm_id.cxx
+++ b/Calorimeter/CaloIdentifier/test/test_calo_dm_id.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
 */
 
 // $Header: /build/atlas/cvs/atlas/offline/Calorimeter/CaloIdentifier/test/test_calo_dm_id.cxx,v 1.6 2006-05-18 11:38:04 fledroit Exp $ 
@@ -24,10 +24,10 @@ check_lar_dm_id_decoding(IdDictMgr& idd)
     }
     const CaloDM_ID* dm_p = &dm_id;
 
-    bool verif = dm_p->do_checks();
+    bool verif = dm_id.do_checks();
     std::cout << "verif0 = " << verif << std::endl;
-    dm_p->set_do_checks(true);
-    verif = dm_p->do_checks();
+    dm_id.set_do_checks(true);
+    verif = dm_id.do_checks();
     std::cout << "verif1 = " << verif << std::endl;
 
 
@@ -160,10 +160,10 @@ check_tile_dm_id_decoding(IdDictMgr& idd)
     }
     const CaloDM_ID* dm_p = &dm_id;
 
-    bool verif = dm_p->do_checks();
+    bool verif = dm_id.do_checks();
     std::cout << "verif0 = " << verif << std::endl;
-    dm_p->set_do_checks(true);
-    verif = dm_p->do_checks();
+    dm_id.set_do_checks(true);
+    verif = dm_id.do_checks();
     std::cout << "verif1 = " << verif << std::endl;
 
 
diff --git a/Calorimeter/CaloIdentifier/test/test_lvl1_id.cxx b/Calorimeter/CaloIdentifier/test/test_lvl1_id.cxx
index abb50a89cfe..ca09d684f21 100755
--- a/Calorimeter/CaloIdentifier/test/test_lvl1_id.cxx
+++ b/Calorimeter/CaloIdentifier/test/test_lvl1_id.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,10 +146,10 @@ check_lvl1_helper(IdDictMgr& idd)
     const CaloLVL1_ID* lvl1_id = &lvl1Id;
 
 
-    bool verif = lvl1_id->do_checks();
+    bool verif = lvl1Id.do_checks();
     std::cout << "verif0 = " << verif << std::endl;
-    lvl1_id->set_do_checks(true);
-    verif = lvl1_id->do_checks();
+    lvl1Id.set_do_checks(true);
+    verif = lvl1Id.do_checks();
     std::cout << "verif1 = " << verif << std::endl;
 
 
-- 
GitLab


From f170e32bdac329766453f015d68cf816e0e8830a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 23 Feb 2019 16:12:25 +0100
Subject: [PATCH 048/404] TileRecUtils: Remove calls to set_do_checks.

Remove MT-unsafe calls to set_do_checks.  They should really be useless anyhow,
as checks are disabled for standard jobs.
---
 .../TileRecUtils/src/TileCellBuilderFromHit.cxx      | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
index 963b1073879..f9e659bfd78 100644
--- a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
+++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx
@@ -741,13 +741,6 @@ void TileCellBuilderFromHit::build(TileDrawerEvtStatusArray& drawerEvtStatus,
                                    TileCellContainer* MBTSCells,
                                    TileCellContainer* E4prCells) const
 {
-  // disable checks for TileID and remember previous state
-  // FIXME: const violation; MT problem.
-  bool do_checks = m_tileID->do_checks();
-  m_tileID->set_do_checks(false);
-  bool do_checks_tb = m_tileID->do_checks();
-  m_tileTBID->set_do_checks(false);
-
   /* zero all counters and sums */
   int nTwo = 0;
   int nCell = 0;
@@ -1217,11 +1210,6 @@ void TileCellBuilderFromHit::build(TileDrawerEvtStatusArray& drawerEvtStatus,
 
     msg(MSG::DEBUG) << endmsg;
   }
-
-  m_tileID->set_do_checks(do_checks);
-  // set back this flag to TileID
-  m_tileTBID->set_do_checks(do_checks_tb);
-
 }
 
 #undef NEWTILECELL
-- 
GitLab


From 4e02bb6a749f12ad0faa7c04ef027de5e1eb609e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 26 Feb 2019 17:00:58 +0100
Subject: [PATCH 049/404] InDetGlobalMonitoring: Fix placement of using
 directives.

Do not put using directives in headers in the global namespace.

Also change CRLF line terminators to LF.
---
 .../src/InDetGlobalNoiseOccupancyMonTool.h    | 481 +++++++++---------
 .../src/InDetGlobalPixelTool.cxx              |   5 +-
 2 files changed, 243 insertions(+), 243 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
index 2b11f88c1ed..93e015f017e 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
@@ -1,244 +1,243 @@
 /*
-  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 InDetGlobalNoiseOccupancyMonTool.h
- * Implementation of inner detector global noise occupancy monitoring tool
- *
- * @author
- * Anne-Catherine Le Bihan <Anne-Catherine.Le.Bihan@cern.ch> @n
- * Heidi Sandaker <Heidi.Sandaker@cern.ch> @n
- * Arshak Tonoyan <Arshak.Tonyoan@cern.ch> @n
- * Thomas Burgess <Thomas.Burgess@cern.ch>      
- *
- * $Id: InDetGlobalNoiseOccupancyMonTool.h,v 1.28 2009-05-13 13:43:47 kastanas Exp $
- *
- ****************************************************************************/
-
-
-#ifndef InDetGlobalNoiseOccupancyMonTool_H
-#define InDetGlobalNoiseOccupancyMonTool_H
-
-//Local
-#include "InDetGlobalMotherMonTool.h"
-//Standard C++
-#include <string>
-#include <vector>
-#include <list>
-using namespace std;
-
-//Pre declarations
-class TH1F_LW;
-class TH2F_LW;
-class TProfile_LW;
-class IInterface;
-class StatusCode;
-
-/// Monitoring tool derived from InDetGlobalMotherMonTool
-/// Tools to verify correlaction in noise occupancy between the three detectors
-
-class InDetGlobalNoiseOccupancyMonTool : public InDetGlobalMotherMonTool{
-  
- public:
-  /// Constructor
-  InDetGlobalNoiseOccupancyMonTool(const string & type, 
-				   const string & name,
-				   const IInterface* parent); 
-  
-  /// Virtual destructor
-  virtual ~InDetGlobalNoiseOccupancyMonTool() {}
-  
-  ///@name Book, fill and proc histograms
-  ///@{
-  ///@copydoc InDetGlobalMotherMonTool::bookHistograms()
-    virtual StatusCode bookHistogramsRecurrent();
-  
-  ///@copydoc InDetGlobalMotherMonTool::fillHistograms()
-  virtual StatusCode fillHistograms();
-  ///@} 
-
-  
- private:
-  /** Check if Drift Circle is on Track
-   *@param DCId Drift Circle Identifier
-   *@return true if DC is on track
-   */
-  bool isOnTrack(const Identifier &DCId) const;
-  
-  /** Get triplet id
-   *@paraFGem list 
-   *@param rdoId
-   *@return
-   */
-  int histIdx( const vector<int> &aList, 
-	       const Identifier &rdoId) const;
-  
-  
-  /* 
-   * container for holding calculated NO for each event together
-   * Added by m 
-   */
-  struct noise{
-    float trt_no;
-    float sct_no;
-    float pix_no;
-  };
-  
-  /*
-   * new methods for calculating the correlation coefficients
-   * Added by m
-   */
-  void correlation_coeffs(vector<struct noise> &no);
-  
-  float calc_correlation(float *sum_x, float *sum_y, 
-			 float *sum_xy, float *sum_x_sq, float *sum_y_sq,
-			 int *points);
-  
-  int GetSCTCounts(int barrel_ec_sel, bool do_checks_flg);
-  int GetPixelCounts(int barrel_ec_sel, bool do_checks_flg);
-
-  
-  //-------- private member variables --------
-  
-  const TrackCollection* m_tracks;
-  
-  /// Geometric description (to be replaced with database entries)    
-  float m_nStraws; 
-  float m_nStraws_B;
-  float m_nStraws_ECA;
-  float m_nStraws_ECC;
-
-  float m_nStrips;
-  float m_nStrips_B;
-  float m_nStrips_ECA;
-  float m_nStrips_ECC;
-
-  float m_nPixels;
-  float m_nPixels_B;
-  float m_nPixels_ECA;
-  float m_nPixels_ECC;
-
-  /// pixel histogram max limit
-  float m_pixelMax;    
-  int m_pixel_nBins;
-  
-  ///SCT histogram limit
-  float m_sctMax;      
-  int m_sct_nBins;
-  
-  ///TRT histogram limit        
-  float m_trtMax;
-  int m_trt_nBins;
-  
-  bool m_start;
-  bool m_doData;
-  
-  //--- Combined noise correleations ---------------------------
-  
-  ///TRT noise occupancy vs SCT noise occupancy
-  TH2F_LW * m_SCT_TRT_NO;
-  
-  ///PIX noise occupancy vs SCT noise occupancy
-  TH2F_LW * m_SCT_PIX_NO;
-  
-  ///PIX noise occupancy vs TRT noise occupancy
-  TH2F_LW * m_PIX_TRT_NO;
-  
-  ///PIX noise occupancy vs event number   
-  TH2F_LW * m_PIX_SCT_TRT_NO;
-  
-  
-  
-  /* new correlation coefficient histos to combine TRT, 
-   * SCT and PIX NO 
-   * Added by m
-   */
-  
-  TH2F_LW * m_TRT_SCTvTRT_PIX_10evt;
-  TH2F_LW * m_TRT_SCTvSCT_PIX_10evt;
-  TH2F_LW * m_TRT_PIXvSCT_PIX_10evt;
-  
-  //--- Debug histograms Pixel -------------------------
-  
-  ///PIX noise occupancy vs event number
-  TProfile_LW* m_PIX_NO_evt;
-  
-  ///PIX noise occupancy
-  TH1F_LW * m_PIX_NO;  
-  TH1F_LW * m_PIX_NO_B;  
-  TH1F_LW * m_PIX_NO_ECA;  
-  TH1F_LW * m_PIX_NO_ECC;  
-  
-  ///PIX noise occupancy vs number of PIX segments
-  TH2F_LW * m_PIX_NO_nseg;
-  
-  ///PIX noise occupancy vs number of PIX segments
-  TH2F_LW * m_PIX_NO_ntrk;
-  
-  //--- Debug histograms SCT -------------------------
-  
-  ///SCT noise occupancy vs event number
-  TProfile_LW* m_SCT_NO_evt;
-  
-  ///SCT noise occupancy
-  TH1F_LW * m_SCT_NO;
-  TH1F_LW * m_SCT_NO_B;
-  TH1F_LW * m_SCT_NO_ECA;
-  TH1F_LW * m_SCT_NO_ECC;
-
-    ///SCT noise occupancy vs number of SCT segments"
-  TH2F_LW * m_SCT_NO_nseg;
-  
-  ///SCT noise occupancy vs number of combined tracks
-  TH2F_LW * m_SCT_NO_ntrk;
-  
-  //--- Debug histograms TRT -------------------------
-  
-  ///TRT noise occupancy vs event number
-  TProfile_LW* m_TRT_NO_evt;
-
-  ///TRT noise occupancy vs phi sector (barrel)
-  TProfile_LW* m_TRT_NO_BA_phi;
-  TProfile_LW* m_TRT_NO_BC_phi;
-
-  ///TRT noise occupancy vs phi sector (ECA)
-  TProfile_LW* m_TRT_NO_ECA_phi;
-
-  ///TRT noise occupancy vs phi sector (ECC)
-  TProfile_LW* m_TRT_NO_ECC_phi;
-  
-  ///TRT HL noise occupancy vs event number
-  TProfile_LW* m_TRT_HL_NO_evt;
-  
-  ///TRT noise occupancy
-  TH1F_LW * m_TRT_NO; 
-  
-  ///TRT HL noise occupancy
-  TH1F_LW * m_TRT_HL_NO;
-  
-  ///TRT noise occupancy vs number of TRT segments
-  TH2F_LW * m_TRT_NO_nseg;
-  
-  ///TRT noise occupancy vs number of combined tracks
-  TH2F_LW * m_TRT_NO_ntrk;
-  
-  /// Temporary (to be verified)
-  vector<int> m_phiModBTemp;
-  vector<int> m_phiModECATemp;
-  vector<int> m_phiModECCTemp;
-  
-  /// list of trt circle identifiers
-  list<Identifier> m_dcidOnTrack;
-  
-  /* 
-   * Vector to hold the noise occupancies so they can
-   * be saved for calculating correlation coefficients
-   * on several points instead of being over-written
-   * each time
-   * Added by m
-   */  
-
-  vector<struct noise> m_NO;
-};
-
-#endif
+/** @file InDetGlobalNoiseOccupancyMonTool.h
+ * Implementation of inner detector global noise occupancy monitoring tool
+ *
+ * @author
+ * Anne-Catherine Le Bihan <Anne-Catherine.Le.Bihan@cern.ch> @n
+ * Heidi Sandaker <Heidi.Sandaker@cern.ch> @n
+ * Arshak Tonoyan <Arshak.Tonyoan@cern.ch> @n
+ * Thomas Burgess <Thomas.Burgess@cern.ch>      
+ *
+ * $Id: InDetGlobalNoiseOccupancyMonTool.h,v 1.28 2009-05-13 13:43:47 kastanas Exp $
+ *
+ ****************************************************************************/
+
+
+#ifndef InDetGlobalNoiseOccupancyMonTool_H
+#define InDetGlobalNoiseOccupancyMonTool_H
+
+//Local
+#include "InDetGlobalMotherMonTool.h"
+//Standard C++
+#include <string>
+#include <vector>
+#include <list>
+
+//Pre declarations
+class TH1F_LW;
+class TH2F_LW;
+class TProfile_LW;
+class IInterface;
+class StatusCode;
+
+/// Monitoring tool derived from InDetGlobalMotherMonTool
+/// Tools to verify correlaction in noise occupancy between the three detectors
+
+class InDetGlobalNoiseOccupancyMonTool : public InDetGlobalMotherMonTool{
+  
+ public:
+  /// Constructor
+  InDetGlobalNoiseOccupancyMonTool(const std::string & type, 
+				   const std::string & name,
+				   const IInterface* parent); 
+  
+  /// Virtual destructor
+  virtual ~InDetGlobalNoiseOccupancyMonTool() {}
+  
+  ///@name Book, fill and proc histograms
+  ///@{
+  ///@copydoc InDetGlobalMotherMonTool::bookHistograms()
+    virtual StatusCode bookHistogramsRecurrent();
+  
+  ///@copydoc InDetGlobalMotherMonTool::fillHistograms()
+  virtual StatusCode fillHistograms();
+  ///@} 
+
+  
+ private:
+  /** Check if Drift Circle is on Track
+   *@param DCId Drift Circle Identifier
+   *@return true if DC is on track
+   */
+  bool isOnTrack(const Identifier &DCId) const;
+  
+  /** Get triplet id
+   *@paraFGem list 
+   *@param rdoId
+   *@return
+   */
+  int histIdx( const std::vector<int> &aList, 
+	       const Identifier &rdoId) const;
+  
+  
+  /* 
+   * container for holding calculated NO for each event together
+   * Added by m 
+   */
+  struct noise{
+    float trt_no;
+    float sct_no;
+    float pix_no;
+  };
+  
+  /*
+   * new methods for calculating the correlation coefficients
+   * Added by m
+   */
+  void correlation_coeffs(std::vector<struct noise> &no);
+  
+  float calc_correlation(float *sum_x, float *sum_y, 
+			 float *sum_xy, float *sum_x_sq, float *sum_y_sq,
+			 int *points);
+  
+  int GetSCTCounts(int barrel_ec_sel, bool do_checks_flg);
+  int GetPixelCounts(int barrel_ec_sel, bool do_checks_flg);
+
+  
+  //-------- private member variables --------
+  
+  const TrackCollection* m_tracks;
+  
+  /// Geometric description (to be replaced with database entries)    
+  float m_nStraws; 
+  float m_nStraws_B;
+  float m_nStraws_ECA;
+  float m_nStraws_ECC;
+
+  float m_nStrips;
+  float m_nStrips_B;
+  float m_nStrips_ECA;
+  float m_nStrips_ECC;
+
+  float m_nPixels;
+  float m_nPixels_B;
+  float m_nPixels_ECA;
+  float m_nPixels_ECC;
+
+  /// pixel histogram max limit
+  float m_pixelMax;    
+  int m_pixel_nBins;
+  
+  ///SCT histogram limit
+  float m_sctMax;      
+  int m_sct_nBins;
+  
+  ///TRT histogram limit        
+  float m_trtMax;
+  int m_trt_nBins;
+  
+  bool m_start;
+  bool m_doData;
+  
+  //--- Combined noise correleations ---------------------------
+  
+  ///TRT noise occupancy vs SCT noise occupancy
+  TH2F_LW * m_SCT_TRT_NO;
+  
+  ///PIX noise occupancy vs SCT noise occupancy
+  TH2F_LW * m_SCT_PIX_NO;
+  
+  ///PIX noise occupancy vs TRT noise occupancy
+  TH2F_LW * m_PIX_TRT_NO;
+  
+  ///PIX noise occupancy vs event number   
+  TH2F_LW * m_PIX_SCT_TRT_NO;
+  
+  
+  
+  /* new correlation coefficient histos to combine TRT, 
+   * SCT and PIX NO 
+   * Added by m
+   */
+  
+  TH2F_LW * m_TRT_SCTvTRT_PIX_10evt;
+  TH2F_LW * m_TRT_SCTvSCT_PIX_10evt;
+  TH2F_LW * m_TRT_PIXvSCT_PIX_10evt;
+  
+  //--- Debug histograms Pixel -------------------------
+  
+  ///PIX noise occupancy vs event number
+  TProfile_LW* m_PIX_NO_evt;
+  
+  ///PIX noise occupancy
+  TH1F_LW * m_PIX_NO;  
+  TH1F_LW * m_PIX_NO_B;  
+  TH1F_LW * m_PIX_NO_ECA;  
+  TH1F_LW * m_PIX_NO_ECC;  
+  
+  ///PIX noise occupancy vs number of PIX segments
+  TH2F_LW * m_PIX_NO_nseg;
+  
+  ///PIX noise occupancy vs number of PIX segments
+  TH2F_LW * m_PIX_NO_ntrk;
+  
+  //--- Debug histograms SCT -------------------------
+  
+  ///SCT noise occupancy vs event number
+  TProfile_LW* m_SCT_NO_evt;
+  
+  ///SCT noise occupancy
+  TH1F_LW * m_SCT_NO;
+  TH1F_LW * m_SCT_NO_B;
+  TH1F_LW * m_SCT_NO_ECA;
+  TH1F_LW * m_SCT_NO_ECC;
+
+    ///SCT noise occupancy vs number of SCT segments"
+  TH2F_LW * m_SCT_NO_nseg;
+  
+  ///SCT noise occupancy vs number of combined tracks
+  TH2F_LW * m_SCT_NO_ntrk;
+  
+  //--- Debug histograms TRT -------------------------
+  
+  ///TRT noise occupancy vs event number
+  TProfile_LW* m_TRT_NO_evt;
+
+  ///TRT noise occupancy vs phi sector (barrel)
+  TProfile_LW* m_TRT_NO_BA_phi;
+  TProfile_LW* m_TRT_NO_BC_phi;
+
+  ///TRT noise occupancy vs phi sector (ECA)
+  TProfile_LW* m_TRT_NO_ECA_phi;
+
+  ///TRT noise occupancy vs phi sector (ECC)
+  TProfile_LW* m_TRT_NO_ECC_phi;
+  
+  ///TRT HL noise occupancy vs event number
+  TProfile_LW* m_TRT_HL_NO_evt;
+  
+  ///TRT noise occupancy
+  TH1F_LW * m_TRT_NO; 
+  
+  ///TRT HL noise occupancy
+  TH1F_LW * m_TRT_HL_NO;
+  
+  ///TRT noise occupancy vs number of TRT segments
+  TH2F_LW * m_TRT_NO_nseg;
+  
+  ///TRT noise occupancy vs number of combined tracks
+  TH2F_LW * m_TRT_NO_ntrk;
+  
+  /// Temporary (to be verified)
+  std::vector<int> m_phiModBTemp;
+  std::vector<int> m_phiModECATemp;
+  std::vector<int> m_phiModECCTemp;
+  
+  /// list of trt circle identifiers
+  std::list<Identifier> m_dcidOnTrack;
+  
+  /* 
+   * Vector to hold the noise occupancies so they can
+   * be saved for calculating correlation coefficients
+   * on several points instead of being over-written
+   * each time
+   * Added by m
+   */  
+
+  std::vector<struct noise> m_NO;
+};
+
+#endif
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
index 5aee40acd5e..314782895f0 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.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
 */
 
 /** @file InDetGlobalPixelTool.cxx
@@ -22,7 +22,6 @@
 #include "TMath.h"
 #include "TH1F.h"
 #include "TH2F.h"
-using namespace TMath;
 //Standard c++
 #include <string>
 //tracks
@@ -39,6 +38,8 @@ using namespace TMath;
 
 #include "EventPrimitives/EventPrimitivesHelpers.h"
 
+using namespace TMath;
+
 InDetGlobalPixelTool::InDetGlobalPixelTool(
 					   const std::string & type, 
 					   const std::string & name,
-- 
GitLab


From cb9af1a46e9fa3dff85caae729891161310f7bcc Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Wed, 27 Feb 2019 09:28:28 +0100
Subject: [PATCH 050/404] Add debug messages to fromHelper

---
 .../src/EFMissingETFromHelper.cxx             | 77 ++++++++++++-------
 1 file changed, 51 insertions(+), 26 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index aa9c1c3e666..a241e50a3c7 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -223,18 +223,22 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
     // basic info - DK calibration
     if (i<elem-18){  // skip muon or Had Topo granular or EM Topo correction for all quantities
+      ATH_MSG_WARNING( "skip muon or Had Topo granular or EM Topo correction for all quantities" );
       setMET(met, metHelper, i);
     }
 
     if(save9comp && i == 24) { // Save summed HAD MET
+      ATH_MSG_WARNING( "Save summed HAD MET" );
       setMET(met, metHelper, i);
     }
 
     if( (save2comp || save6comp) && i == 34) { // Save JET MET
+      ATH_MSG_WARNING( "Save JET MET" );
       setMET(met, metHelper, i);
     }
 
     if(save3comp && i == 39) { // Save PUC MET
+      ATH_MSG_WARNING( "Save PUC MET" );
       setMET(met, metHelper, i);
     }
 
@@ -242,69 +246,90 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
     // auxiliary info - uncorrected
     if (comp == unsigned(elem-17) && i < 24) { // finest granularity
+      ATH_MSG_WARNING( "finest granularity");
       setMETComp(met, metHelper, i);
     } else if(comp == unsigned(elem-17) && i == 41) { // save muons
+      ATH_MSG_WARNING( "save muons");
       setMETComp(met, metHelper, i-17);
     } else if (save6comp) {
       if (i>=34 && i < 39) { // Central and Forward Jets
+        ATH_MSG_WARNING( "Central and Forward Jets");
         setMETComp(met, metHelper, i-34);
       }
       if (i==41) { // Muons
+        ATH_MSG_WARNING( "Muons");
         setMETComp(met, metHelper, 5);
       }
 
     } else if (save9comp) {
       if (i > 24 && i < 29 ) { // HAD scale quantities
-      setMETComp(met, metHelper, i-25);
+        ATH_MSG_WARNING( "HAD scale quantities" );
+        setMETComp(met, metHelper, i-25);
       } else if( i > 29 && i < 34) {     // EM scale quantities
-      setMETComp(met, metHelper, i-25-1);
+        ATH_MSG_WARNING( "EM scale quantities" );
+        setMETComp(met, metHelper, i-25-1);
       } else if( i == 41) {    // Muon
-      setMETComp(met, metHelper, i-25-8);
+        ATH_MSG_WARNING( "Muon" );
+        setMETComp(met, metHelper, i-25-8);
       }
     } else if (save5comp) {
       switch (i) {
         case 0: case 1: case 2: case 3: // LAr, barrel
+          ATH_MSG_WARNING("LAr, barrel");
           setMETComp(met, metHelper, 0, 1);
           break;
         case 4: case 5: case 6: case 7: // LAr, end-cap
+          ATH_MSG_WARNING("LAr, end-cap");
         case 21:                        // + FCalEM
+          ATH_MSG_WARNING("+ FCalEM");
           setMETComp(met, metHelper, 1, 2);
           break;
         case 12: case 13: case 14: // Tile, barrel +
+          ATH_MSG_WARNING("Tile, barrel +");
         case 18: case 19: case 20: // Tile, extended barrel
+          ATH_MSG_WARNING("Tile, extended barrel");
           setMETComp(met, metHelper, 2, 3);
           break;
         case 24: case 25: case 26: case 27: case 28:
         case 29: case 30: case 31: case 32: case 33:
         case 34: case 35: case 36: case 37: case 38:
         case 39: case 40 :             // Topo. cluster elements or jets - do nothing.
+          ATH_MSG_WARNING("Topo. cluster elements or jets - do nothing.");
           break;
         case 41: // muons
+          ATH_MSG_WARNING("muons");
           setMETComp(met, metHelper, 4);
           break;
         default: // Hadr. end-cap + Tile gap + FCalHad
+          ATH_MSG_WARNING("Hadr. end-cap + Tile gap + FCalHad");
           setMETComp(met, metHelper, 3, 4);
       }
     } else if (save3comp) {
       switch (i) {
         case 39: // Corrected MET
+          ATH_MSG_WARNING( "Corrected MET" );
           setMETComp(met, metHelper, 0);
           break;
         case 40: // Original MET
+          ATH_MSG_WARNING( "Original MET" );
           setMETComp(met, metHelper, 1);
           break;
         case 41: // Muons
+          ATH_MSG_WARNING( "Muons" );
           setMETComp(met, metHelper, 2);
       }
     } else if (save2comp) { // Jets + muons only
       if (i==34) { // Jets
+        ATH_MSG_WARNING( "Jets+Mu only: Jets");
         setMETComp(met, metHelper, 0);
       }
       if (i==41) { // Muons
+        ATH_MSG_WARNING( "Jets+Mu only: Muons");
         setMETComp(met, metHelper, 1);
       }
     } else if (save1comp) { // muons only
       if (i==41) { // REPLACE WITH A TEST OVER COMP. NAME
+        ATH_MSG_WARNING("Muons only");
         setMETComp(met, metHelper, 0);
       }
     }
@@ -344,35 +369,35 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
   unsigned int Nc = met->getNumberOfComponents();
 
-  if (Nc > 0) {
-    if(msgLvl(MSG::DEBUG)){
+  // if (Nc > 0) {
+  //   if(msgLvl(MSG::DEBUG)){
         s="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
 			    s+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
-        ATH_MSG_DEBUG( s );
-     }
-   }
+        ATH_MSG_WARNING( s );
+   //   }
+   // }
 
    for(uint j = 0; j < Nc; j++) {
 
-	const char* name =               met->nameOfComponent(j).c_str();
-	const short status =             met->statusComponent(j);
-	const unsigned short usedChan =  met->usedChannelsComponent(j);
-	const short sumOfSigns =         met->sumOfSignsComponent(j);
-	const float calib0 =             met->calib0Component(j);
-	const float calib1 =             met->calib1Component(j);
-	const float ex =                 met->exComponent(j);
-	const float ey =                 met->eyComponent(j);
-	const float ez =                 met->ezComponent(j);
-	const float sumE =               met->sumEComponent(j);
-	const float sumEt =              met->sumEtComponent(j);
-
-     if(msgLvl(MSG::DEBUG)){
-        message = strformat ("REGTEST   %s   %6d %12d %10d   %6.2f  %6.3f %10.2f %10.2f %10.2f %10.2f %10.2f",
-			   name, status, usedChan, sumOfSigns, calib1, calib0, ex, ey, ez, sumE, sumEt);
-        ATH_MSG_DEBUG( message );
-      }
+  	const char* name =               met->nameOfComponent(j).c_str();
+  	const short status =             met->statusComponent(j);
+  	const unsigned short usedChan =  met->usedChannelsComponent(j);
+  	const short sumOfSigns =         met->sumOfSignsComponent(j);
+  	const float calib0 =             met->calib0Component(j);
+  	const float calib1 =             met->calib1Component(j);
+  	const float ex =                 met->exComponent(j);
+  	const float ey =                 met->eyComponent(j);
+  	const float ez =                 met->ezComponent(j);
+  	const float sumE =               met->sumEComponent(j);
+  	const float sumEt =              met->sumEtComponent(j);
+
+    // if(msgLvl(MSG::DEBUG)){
+      message = strformat ("REGTEST   %s   %6d %12d %10d   %6.2f  %6.3f %10.2f %10.2f %10.2f %10.2f %10.2f",
+       name, status, usedChan, sumOfSigns, calib1, calib0, ex, ey, ez, sumE, sumEt);
+      ATH_MSG_WARNING( message );
+    // }
 
-    }
+  }
 
 
 
-- 
GitLab


From 7f50ecccc417095805d62c1fe64565c71de80bd5 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 09:27:38 +0100
Subject: [PATCH 051/404] HltEventLoopMgr: Use worker ID as directory name

- Add worker ID as a private member and read from DF config
- Use the worker ID instead of the application name as the per-worker
  directory name
- Remove unused properties: PartitionName, JobOptionsType, enabledROBs,
  enabledSubDetectors
- Convert the ApplicationName property to a plain private member
- Avoid code-duplication when reading properties from DataFlowConfig
---
 .../TrigServices/src/HltEventLoopMgr.cxx      | 123 +++++-------------
 .../TrigServices/src/HltEventLoopMgr.h        |  33 ++---
 2 files changed, 43 insertions(+), 113 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
index 76a6599cbe0..61030f3375c 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx
@@ -72,6 +72,7 @@ using namespace boost::property_tree;
 HltEventLoopMgr::HltEventLoopMgr(const std::string& name, ISvcLocator* svcLoc)
 : base_class(name, svcLoc),
   m_incidentSvc("IncidentSvc", name),
+  m_jobOptionsSvc("JobOptionsSvc", name),
   m_evtStore("StoreGateSvc", name),
   m_detectorStore("DetectorStore", name),
   m_inputMetaDataStore("StoreGateSvc/InputMetaDataStore", name),
@@ -107,14 +108,6 @@ StatusCode HltEventLoopMgr::initialize()
   // JobOptions type
   SmartIF<IProperty> propMgr = serviceLocator()->service<IProperty>("ApplicationMgr");
   if (propMgr.isValid()) {
-    try {
-      if (m_jobOptionsType.assign( propMgr->getProperty("JobOptionsType") ))
-        ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_jobOptionsType);
-    }
-    catch (...) {
-      ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << m_jobOptionsType.name() << "' from DataFlow";
-    }
-
     if ( m_topAlgNames.value().empty() ) {
       if (setProperty(propMgr->getProperty("TopAlg")).isFailure()) {
         ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set the TopAlg property from ApplicationMgr";
@@ -125,39 +118,28 @@ StatusCode HltEventLoopMgr::initialize()
     ATH_REPORT_MESSAGE(MSG::WARNING) << "Error retrieving IProperty interface of ApplicationMgr";
   }
 
-  // get JobOptionsSvc to read the configuration of NumConcurrentEvents and NumThreads
-  ServiceHandle<IJobOptionsSvc> jobOptionsSvc("JobOptionsSvc", name());
-  if ((jobOptionsSvc.retrieve()).isFailure()) {
-    ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not find JobOptionsSvc to read configuration";
-  }
+  ATH_CHECK( m_jobOptionsSvc.retrieve() );
 
   // print properties
   ATH_MSG_INFO(" ---> ApplicationName         = " << m_applicationName);
-  ATH_MSG_INFO(" ---> PartitionName           = " << m_partitionName);
-  ATH_MSG_INFO(" ---> JobOptionsType          = " << m_jobOptionsType);
-  ATH_MSG_INFO(" ---> HardTimeout             = " << m_hardTimeout);
-  ATH_MSG_INFO(" ---> SoftTimeoutFraction     = " << m_softTimeoutFraction);
-  ATH_MSG_INFO(" ---> MaxFrameworkErrors      = " << m_maxFrameworkErrors);
-  ATH_MSG_INFO(" ---> FwkErrorDebugStreamName = " << m_fwkErrorDebugStreamName);
-  ATH_MSG_INFO(" ---> AlgErrorDebugStreamName = " << m_algErrorDebugStreamName);
+  ATH_MSG_INFO(" ---> HardTimeout             = " << m_hardTimeout.value());
+  ATH_MSG_INFO(" ---> SoftTimeoutFraction     = " << m_softTimeoutFraction.value());
+  ATH_MSG_INFO(" ---> MaxFrameworkErrors      = " << m_maxFrameworkErrors.value());
+  ATH_MSG_INFO(" ---> FwkErrorDebugStreamName = " << m_fwkErrorDebugStreamName.value());
+  ATH_MSG_INFO(" ---> AlgErrorDebugStreamName = " << m_algErrorDebugStreamName.value());
   ATH_MSG_INFO(" ---> EventContextWHKey       = " << m_eventContextWHKey.key());
   ATH_MSG_INFO(" ---> EventInfoRHKey          = " << m_eventInfoRHKey.key());
-  if (jobOptionsSvc.isValid()) {
-    const Gaudi::Details::PropertyBase* prop = jobOptionsSvc->getClientProperty("EventDataSvc","NSlots");
-    if (prop)
-      ATH_MSG_INFO(" ---> NumConcurrentEvents     = " << *prop);
-    else
-      ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property EventDataSvc.NSlots";
-    prop = jobOptionsSvc->getClientProperty("AvalancheSchedulerSvc","ThreadPoolSize");
-    if (prop)
-      ATH_MSG_INFO(" ---> NumThreads              = " << *prop);
-    else
-      ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property AvalancheSchedulerSvc.ThreadPoolSize";
-  }
-  ATH_MSG_INFO(" ---> Enabled ROBs: size = " << m_enabledROBs.value().size()
-               << (m_enabledROBs.value().size()==0 ? ". No check will be performed" : " "));
-  ATH_MSG_INFO(" ---> Enabled Sub Detectors: size = " << m_enabledSubDetectors.value().size()
-               << (m_enabledSubDetectors.value().size()==0 ? ". No check will be performed" : " "));
+
+  const Gaudi::Details::PropertyBase* prop = m_jobOptionsSvc->getClientProperty("EventDataSvc","NSlots");
+  if (prop)
+    ATH_MSG_INFO(" ---> NumConcurrentEvents     = " << prop->toString());
+  else
+    ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property EventDataSvc.NSlots";
+  prop = m_jobOptionsSvc->getClientProperty("AvalancheSchedulerSvc","ThreadPoolSize");
+  if (prop)
+    ATH_MSG_INFO(" ---> NumThreads              = " << prop->toString());
+  else
+    ATH_REPORT_MESSAGE(MSG::WARNING) << "Failed to retrieve the job property AvalancheSchedulerSvc.ThreadPoolSize";
 
   //----------------------------------------------------------------------------
   // Create and initialise the top level algorithms
@@ -447,7 +429,7 @@ StatusCode HltEventLoopMgr::hltUpdateAfterFork(const ptree& /*pt*/)
   ATH_MSG_VERBOSE("start of " << __FUNCTION__);
 
   updateDFProps();
-  ATH_MSG_INFO("Post-fork initialization for " << m_applicationName.value());
+  ATH_MSG_INFO("Post-fork initialization for " << m_applicationName);
 
   ATH_MSG_DEBUG("Initialising the scheduler after forking");
   m_schedulerSvc = serviceLocator()->service(m_schedulerName, /*createIf=*/ true);
@@ -473,7 +455,9 @@ StatusCode HltEventLoopMgr::hltUpdateAfterFork(const ptree& /*pt*/)
   SmartIF<IIoComponent> histsvc = serviceLocator()->service("THistSvc", /*createIf=*/ false).as<IIoComponent>();
   if ( !m_ioCompMgr->io_retrieve(histsvc.get()).empty() ) {
     boost::filesystem::path worker_dir = boost::filesystem::absolute("athenaHLT_workers");
-    worker_dir /= m_applicationName.value();
+    std::ostringstream oss;
+    oss << "athenaHLT-" << std::setfill('0') << std::setw(2) << m_workerId;
+    worker_dir /= oss.str();
     // Delete worker directory if it exists already
     if ( boost::filesystem::exists(worker_dir) ) {
       if ( !boost::filesystem::remove_all(worker_dir) ) {
@@ -759,56 +743,19 @@ StatusCode HltEventLoopMgr::executeEvent(void* pEvtContext)
 // =============================================================================
 void HltEventLoopMgr::updateDFProps()
 {
-  ATH_MSG_VERBOSE("start of " << __FUNCTION__);
-  ServiceHandle<IJobOptionsSvc> p_jobOptionsSvc("JobOptionsSvc", name());
-  if ((p_jobOptionsSvc.retrieve()).isFailure()) {
-    ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not find JobOptionsSvc to set DataFlow properties";
-  } else {
-    auto dfprops = p_jobOptionsSvc->getProperties("DataFlowConfig");
-
-    // Application name
-    auto pname = "DF_ApplicationName";
-    const auto * prop = Gaudi::Utils::getProperty(dfprops, pname);
-    if(prop && m_applicationName.assign(*prop)) {
-      ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_applicationName);
-    } else {
-      ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << pname << "' from DataFlow";
-    }
-
-    // Partition name
-    pname = "DF_PartitionName";
-    prop = Gaudi::Utils::getProperty(dfprops, pname);
-    if (prop && m_partitionName.assign(*prop)) {
-      ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: " << m_partitionName);
-    } else {
-      ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not set Property '" << pname << "' from DataFlow";
-    }
-
-    // get the list of enabled ROBs
-    pname = "DF_Enabled_ROB_IDs";
-    prop = Gaudi::Utils::getProperty(dfprops, pname);
-    if (prop && m_enabledROBs.assign(*prop)) {
-      ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: "
-                    << m_enabledROBs.value().size() << " enabled ROB IDs");
-    } else {
-      // this is only info, because it is normal in athenaHLT
-      ATH_MSG_INFO("Could not set Property '" << pname << "' from DataFlow");
-    }
-
-    // get the list of enabled Sub Detectors
-    pname = "DF_Enabled_SubDet_IDs";
-    prop = Gaudi::Utils::getProperty(dfprops, pname);
-    if (prop && m_enabledSubDetectors.assign(*prop)) {
-      ATH_MSG_DEBUG(" ---> Read from DataFlow configuration: "
-                    << m_enabledSubDetectors.value().size() << " enabled Sub Detector IDs");
-    } else {
-      // this is only info, because it is normal in athenaHLT
-      ATH_MSG_INFO("Could not set Property '" << pname << "' from DataFlow");
-    }
-  }
-
-  p_jobOptionsSvc.release().ignore();
-  ATH_MSG_VERBOSE("end of " << __FUNCTION__);
+  auto getDFProp = [&](const std::string& name, std::string& value, bool required = true) {
+                     const auto* prop = m_jobOptionsSvc->getClientProperty("DataFlowConfig", name);
+                     if (prop) {
+                       value = prop->toString();
+                       ATH_MSG_INFO(" ---> Read from DataFlow configuration: " << name << " = " << value);
+                     } else {
+                       msg() << (required ? MSG::WARNING : MSG::INFO)
+                             << "Could not set Property " << name << " from DataFlow" << endmsg;
+                     }
+                   };
+
+  getDFProp( "DF_ApplicationName", m_applicationName );
+  getDFProp( "DF_WorkerId", m_workerId, false );
 }
 
 // =============================================================================
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
index 3b237ed7c1c..b6940b08920 100644
--- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
+++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
@@ -43,6 +43,7 @@ class IAlgorithm;
 class IAlgResourcePool;
 class IHiveWhiteBoard;
 class IIncidentSvc;
+class IJobOptionsSvc;
 class IROBDataProviderSvc;
 class IScheduler;
 class ITHistSvc;
@@ -116,9 +117,6 @@ private:
 
   // ------------------------- Helper methods ----------------------------------
 
-  /// Check if running in partition
-  bool validPartition() const;
-
   /// Read DataFlow configuration properties
   void updateDFProps();
 
@@ -168,6 +166,7 @@ private:
 
   // ------------------------- Handles to required services/tools --------------
   ServiceHandle<IIncidentSvc>        m_incidentSvc;
+  ServiceHandle<IJobOptionsSvc>      m_jobOptionsSvc;
   ServiceHandle<StoreGateSvc>        m_evtStore;
   ServiceHandle<StoreGateSvc>        m_detectorStore;
   ServiceHandle<StoreGateSvc>        m_inputMetaDataStore;
@@ -186,17 +185,6 @@ private:
   SmartIF<ITrigROBDataProviderSvc> m_hltROBDataProviderSvc;
 
   // ------------------------- Other properties --------------------------------------
-  Gaudi::Property<std::string> m_jobOptionsType{
-    this, "JobOptionsType", "NONE", "'NONE' or 'DB'"};
-
-  Gaudi::Property<std::string> m_applicationName{
-    this, "ApplicationName", "None",
-    "Application Name (='None' or 'athenaHLT' for simulated data, 'HLTMPPU-xx' in online environment)"};
-
-  Gaudi::Property<std::string> m_partitionName{
-    this, "PartitionName", "None",
-    "Partition Name (='None' for offline, real partition name in online environment)"};
-
   Gaudi::Property<std::string> m_schedulerName{
     this, "SchedulerSvc", "AvalancheSchedulerSvc", "Name of the scheduler"};
 
@@ -206,12 +194,6 @@ private:
   Gaudi::Property<std::vector<std::string> > m_topAlgNames{
     this, "TopAlg", {}, "List of top level algorithms names"};
 
-  Gaudi::Property<std::vector<uint32_t>> m_enabledROBs{
-    this, "enabledROBs", {}, "list of all enabled ROBs which can be retrieved"};
-
-  Gaudi::Property<std::vector<uint32_t>> m_enabledSubDetectors{
-    this, "enabledSubDetectors", {}, "list of enabled Subdetectors"};
-
   Gaudi::Property<float> m_hardTimeout{
     this, "HardTimeout", 10*60*1000/*=10min*/, "Hard event processing timeout in milliseconds"};
 
@@ -274,11 +256,12 @@ private:
   std::atomic<bool> m_runEventTimer;
   /// Counter of framework errors
   int m_nFrameworkErrors;
-};
+  /// Application name
+  std::string m_applicationName;
+  /// Worker ID
+  std::string m_workerId;
 
-//==============================================================================
-inline bool HltEventLoopMgr::validPartition() const {
-  return (m_partitionName.value()!="None" && m_partitionName.value()!="NONE");
-}
+
+};
 
 #endif // TRIGSERVICES_HLTEVENTLOOPMGR_H
-- 
GitLab


From 75337832faaacec110d24186fd8929f9b8f01fa0 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Tue, 12 Feb 2019 16:31:48 +0100
Subject: [PATCH 052/404] Move IDC overlay debug print into a separate file

---
 .../IDC_OverlayBase/IDC_OverlayBase.h         |  3 +-
 .../IDC_OverlayBase/IDC_OverlayCommon.h       |  3 --
 .../IDC_OverlayBase/IDC_OverlayCommon.icc     | 23 +------------
 .../IDC_OverlayBase/IDC_OverlayHelpers.h      | 25 ++++++++++++++
 .../IDC_OverlayBase/IDC_OverlayHelpers.icc    | 33 +++++++++++++++++++
 5 files changed, 61 insertions(+), 26 deletions(-)
 create mode 100644 Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.h
 create mode 100644 Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.icc

diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
index 4bd1cf5b48a..ad713366ef1 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
@@ -21,6 +21,7 @@
 
 #include "OverlayAlgBase/OverlayAlgBase.h"
 #include "IDC_OverlayBase/IDC_OverlayCommon.h"
+#include "IDC_OverlayBase/IDC_OverlayHelpers.h"
 
 class IDC_OverlayBase;
 
@@ -71,7 +72,7 @@ public:
   }
 
   template<class IDC_Container> std::string shortPrint(const IDC_Container *container, unsigned numprint = 25) {
-    return Overlay::shortPrint(container, numprint);
+    return Overlay::debugPrint(container, numprint);
   }
 
   /**
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
index 25079244bb2..fe26915711d 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
@@ -40,9 +40,6 @@ namespace Overlay {
 
   template<class IDC_Container, class OvlAlg> void overlayContainerNew(const IDC_Container* dataContainer, const IDC_Container* mcContainer, IDC_Container* outputContainer, OvlAlg *parent);
 
-  /** Diagnostic output */
-  template<class IDC_Container> std::string shortPrint(const IDC_Container *container, unsigned numprint = 25);
-
 }
 
 #include "IDC_OverlayBase/IDC_OverlayCommon.icc"
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
index 8459c06beb8..c5741622d52 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
@@ -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
 */
 
 // Generic overlaying code for Identifiable Containers.
@@ -20,27 +20,6 @@
 #include <sstream>
 
 namespace Overlay {
-  
-  template<class IDC_Container> 
-  std::string shortPrint(const IDC_Container *container, unsigned maxprint) {
-    std::ostringstream os;
-    if(container) {
-      for(unsigned i=0; i<maxprint; i++) {
-	typename IDC_Container::const_iterator p = container->indexFind(i);
-	if(p != container->end()) {
-	  os<<" "<< (*p)->size();
-	}
-	else {
-	  os<<" *";
-	}
-      }
-    }
-    else {
-      os<<"(NULL)";
-    }
-    return os.str();
-  }
-
 
   //================================================================
   template<class IDC_Container, class OvlAlg>
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.h b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.h
new file mode 100644
index 00000000000..81023c354b8
--- /dev/null
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.h
@@ -0,0 +1,25 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/// @brief Helpers for overlaying Identifiable Containers
+/// @author Tadej Novak
+
+#ifndef IDC_OVERLAYHELPERS_H
+#define IDC_OVERLAYHELPERS_H
+
+#include <string>
+
+namespace Overlay
+{
+
+/// @brief Diagnostic output of Identifiable Containers
+template <class IDC_Container>
+std::string debugPrint(const IDC_Container *container,
+                       unsigned numprint = 25);
+
+} // namespace Overlay
+
+#include "IDC_OverlayHelpers.icc"
+
+#endif
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.icc b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.icc
new file mode 100644
index 00000000000..0c2052c966b
--- /dev/null
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayHelpers.icc
@@ -0,0 +1,33 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/// Helpers for overlaying Identifiable Containers
+/// @author Tadej Novak
+
+#include <sstream>
+
+namespace Overlay
+{
+
+template <class IDC_Container>
+std::string debugPrint(const IDC_Container *container,
+                       unsigned maxprint)
+{
+  std::ostringstream os;
+  if (container) {
+    for (unsigned i = 0; i < maxprint; i++) {
+      typename IDC_Container::const_iterator p = container->indexFind(i);
+      if (p != container->end()) {
+        os << " " << (*p)->size();
+      } else {
+        os << " *";
+      }
+    }
+  } else {
+    os << "(NULL)";
+  }
+  return os.str();
+}
+
+} // namespace Overlay
-- 
GitLab


From 301a6bdf990be156994e21e660f889c34c4ce7c8 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 10:21:58 +0100
Subject: [PATCH 053/404] athenaHLT: enable unit tests and fix log file names

- Enable unit tests for basic athenaHLT command line functionality
- Update references
- Make sure the application_name is unique to allow running multiple
  athenaHLT processes in paralle on the same machine
- Adapt the log_name to the new convention in HLTMPPU-00-01-16
---
 .../TrigControl/TrigCommon/CMakeLists.txt     |  8 ++---
 .../TrigControl/TrigCommon/bin/athenaHLT.py   | 10 +++---
 .../TrigCommon/share/athenaHLT_jo_allopts.ref | 31 ++++++++-----------
 .../TrigCommon/share/athenaHLT_jo_noopts.ref  | 31 ++++++++-----------
 .../TrigCommon/share/test_athenaHLT.sh        |  5 ++-
 5 files changed, 38 insertions(+), 47 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigCommon/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigCommon/CMakeLists.txt
index e042bad54e1..da7204ccbb8 100644
--- a/HLT/Trigger/TrigControl/TrigCommon/CMakeLists.txt
+++ b/HLT/Trigger/TrigControl/TrigCommon/CMakeLists.txt
@@ -24,8 +24,8 @@ atlas_add_test( test_AthHLT
    POST_EXEC_SCRIPT nopost.sh
    PROPERTIES TIMEOUT 300 )
 
-#atlas_add_test( athenaHLT_jo_noopts
-#   SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/test_athenaHLT.sh dummy.py)
+atlas_add_test( athenaHLT_jo_noopts
+   SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/test_athenaHLT.sh dummy.py)
 
-#atlas_add_test( athenaHLT_jo_allopts
-#   SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/test_athenaHLT.sh --number-of-events 3 --skip-events 7 -l ERROR,FATAL -c 'x=1' -c 'y=2' -C 'x=2' -o out.data --threads 2 --nprocs 4 --timeout 777 --python-setup mysetup.py --partition mypart dummy.py)
+atlas_add_test( athenaHLT_jo_allopts
+   SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/test_athenaHLT.sh --number-of-events 3 --skip-events 7 -l ERROR,FATAL -c 'x=1' -c 'y=2' -C 'x=2' -o out.data --threads 2 --nprocs 4 --timeout 777 --oh-monitoring --python-setup mysetup.py --partition mypart dummy.py)
diff --git a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
index e2618adc6dd..70976eeeffb 100755
--- a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
+++ b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py
@@ -141,18 +141,16 @@ def set_athena_flags(args):
    jp.ConcurrencyFlags.NumProcs = args.nprocs
 
 def HLTMPPy_cfgdict(args):
-   """
-   Create the configuration dictionary as expected by HLTMPPy as defined in
-   https://gitlab.cern.ch/atlas-tdaq-software/HLTMPPU/blob/master/python/HLTMPPy/runner.py
-   """
+   """Create the configuration dictionary as expected by HLTMPPy as defined in
+   https://gitlab.cern.ch/atlas-tdaq-software/HLTMPPU/blob/master/python/HLTMPPy/runner.py"""
 
    cdict = {}
    cdict['HLTMPPU'] = {
-      'application_name' : 'athenaHLT',
+      'application_name' : 'athenaHLT-%d' % os.getpid(),  # unique name required to avoid interference
       'extra_params' : None,
       'interactive' : args.interactive,
       'log_root' : os.getcwd(),
-      'log_name' : ('' if args.unique_log_files else 'worker'),
+      'log_name' : ('' if args.unique_log_files else 'athenaHLT:'),
       'module' : 'HLTMPPU',
       'num_forks' : args.nprocs,
       'num_threads' : args.threads,
diff --git a/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_allopts.ref b/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_allopts.ref
index 9cda86352a9..ad3e0dc196f 100644
--- a/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_allopts.ref
+++ b/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_allopts.ref
@@ -1,25 +1,24 @@
 <Configuration>
   <HLTMPPUApplication>
+    <childLogName>athenaHLT:</childLogName>
     <numForks>4</numForks>
-    <childLogRoot>/scratch/fwinkl/athenaHLT/HLT/Trigger/TrigControl/TrigCommon/unitTestRun</childLogRoot>
     <InfoServiceLibrary>MonSvcInfoService</InfoServiceLibrary>
     <softTimeoutFraction>0.9</softTimeoutFraction>
     <HLTImplementationLibraries>
-      <library>TrigServices</library>
       <library>TrigPSC</library>
     </HLTImplementationLibraries>
     <UID>HLTMPPy</UID>
     <HardTimeout>777</HardTimeout>
     <finalizeTimeout>120</finalizeTimeout>
     <numberOfEventSlots>2</numberOfEventSlots>
-    <DataSourceLibrary>DFFileBackend</DataSourceLibrary>
+    <DataSourceLibrary>DFDcmEmuBackend</DataSourceLibrary>
     <numberOfAthenaMTThreads>2</numberOfAthenaMTThreads>
     <DataSource>
       <HLTDFFileBackend>
         <preload>False</preload>
         <numEvents>3</numEvents>
         <start_id>1</start_id>
-        <library>DFFileBackend</library>
+        <library>DFDcmEmuBackend</library>
         <fileOffset>-1</fileOffset>
         <UID>DataSource-is-DCM</UID>
         <compressionLevel>2</compressionLevel>
@@ -30,7 +29,7 @@
         <fileList>
           <file>dummy.data</file>
         </fileList>
-        <extraL1Robs/>
+        <extraL1Robs />
       </HLTDFFileBackend>
     </DataSource>
     <InfoService>
@@ -42,7 +41,7 @@
             <UID>HltpuConfigurationRuleBundle</UID>
             <Rules>
               <ConfigurationRule>
-                <ExcludeFilter></ExcludeFilter>
+                <ExcludeFilter />
                 <Name>Dumm</Name>
                 <UID>HltpuOHRule</UID>
                 <Parameters>
@@ -57,7 +56,7 @@
                 <IncludeFilter>.*</IncludeFilter>
               </ConfigurationRule>
               <ConfigurationRule>
-                <ExcludeFilter></ExcludeFilter>
+                <ExcludeFilter />
                 <Name>DummDumm</Name>
                 <UID>HltpuISRule</UID>
                 <Parameters>
@@ -78,7 +77,6 @@
   </HLTMPPUApplication>
   <Partition>
     <UID>mypart</UID>
-    <LogRoot>/scratch/fwinkl/athenaHLT/HLT/Trigger/TrigControl/TrigCommon/unitTestRun</LogRoot>
     <TriggerConfiguration>
       <TriggerConfiguration>
         <L1TriggerConfiguration>
@@ -99,24 +97,21 @@
               <preCommand>x=1</preCommand>
               <preCommand>y=2</preCommand>
               <preCommand>_run_number=327265</preCommand>
-              <preCommand>include('TrigServices/OfflineTHistSvc.py')</preCommand>
             </preCommands>
+            <showInclude>false</showInclude>
             <postCommands>
               <postCommand>x=2</postCommand>
             </postCommands>
             <UID>HLTImplementationJobOptions-1</UID>
-            <evtSel>NONE</evtSel>
             <HLTCommonParameters>
               <HLTCommonParameters>
-                <factoryName></factoryName>
-                <dllName></dllName>
                 <messageSvcType>TrigMessageSvc</messageSvcType>
                 <jobOptionsSvcType>JobOptionsSvc</jobOptionsSvcType>
               </HLTCommonParameters>
             </HLTCommonParameters>
             <logLevels>
-              <logLevel>INFO</logLevel>
               <logLevel>ERROR</logLevel>
+              <logLevel>FATAL</logLevel>
             </logLevels>
             <pythonSetupFile>mysetup.py</pythonSetupFile>
             <jobOptionsPath>dummy.py</jobOptionsPath>
@@ -128,8 +123,8 @@
             <Name>dummy</Name>
             <Server>TRIGGERDB</Server>
             <Alias>TRIGGERDB</Alias>
-            <User></User>
-            <Password></Password>
+            <User />
+            <Password />
             <Type>Coral</Type>
             <SuperMasterKey>0</SuperMasterKey>
           </TriggerDBConnection>
@@ -137,7 +132,7 @@
       </TriggerConfiguration>
     </TriggerConfiguration>
   </Partition>
-  <ROS2ROBS/>
+  <ROS2ROBS />
 </Configuration>
 <RunParams>
   <totalTime>0</totalTime>
@@ -145,12 +140,12 @@
   <timeEOR>1/1/70 01:00:00</timeEOR>
   <det_mask>00000000000000000001fffffffffff7</det_mask>
   <beam_type>0</beam_type>
-  <filename_tag></filename_tag>
+  <filename_tag />
   <max_events>0</max_events>
   <run_number>327265</run_number>
   <timeSOR>22/11/18 11:02:32.703856</timeSOR>
   <trigger_type>0</trigger_type>
-  <T0_project_tag></T0_project_tag>
+  <T0_project_tag />
   <beam_energy>0</beam_energy>
   <recording_enabled>0</recording_enabled>
 </RunParams>
diff --git a/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_noopts.ref b/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_noopts.ref
index 6083e1b27b9..6a9df1bf153 100644
--- a/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_noopts.ref
+++ b/HLT/Trigger/TrigControl/TrigCommon/share/athenaHLT_jo_noopts.ref
@@ -1,25 +1,24 @@
 <Configuration>
   <HLTMPPUApplication>
+    <childLogName>athenaHLT:</childLogName>
     <numForks>1</numForks>
-    <childLogRoot>/scratch/fwinkl/athenaHLT/HLT/Trigger/TrigControl/TrigCommon/unitTestRun</childLogRoot>
     <InfoServiceLibrary>MonSvcInfoService</InfoServiceLibrary>
     <softTimeoutFraction>0.9</softTimeoutFraction>
     <HLTImplementationLibraries>
-      <library>TrigServices</library>
       <library>TrigPSC</library>
     </HLTImplementationLibraries>
     <UID>HLTMPPy</UID>
     <HardTimeout>36000</HardTimeout>
     <finalizeTimeout>120</finalizeTimeout>
     <numberOfEventSlots>1</numberOfEventSlots>
-    <DataSourceLibrary>DFFileBackend</DataSourceLibrary>
+    <DataSourceLibrary>DFDcmEmuBackend</DataSourceLibrary>
     <numberOfAthenaMTThreads>1</numberOfAthenaMTThreads>
     <DataSource>
       <HLTDFFileBackend>
         <preload>False</preload>
         <numEvents>-1</numEvents>
         <start_id>1</start_id>
-        <library>DFFileBackend</library>
+        <library>DFDcmEmuBackend</library>
         <fileOffset>-1</fileOffset>
         <UID>DataSource-is-DCM</UID>
         <compressionLevel>2</compressionLevel>
@@ -29,7 +28,7 @@
         <fileList>
           <file>dummy.data</file>
         </fileList>
-        <extraL1Robs/>
+        <extraL1Robs />
       </HLTDFFileBackend>
     </DataSource>
     <InfoService>
@@ -41,7 +40,7 @@
             <UID>HltpuConfigurationRuleBundle</UID>
             <Rules>
               <ConfigurationRule>
-                <ExcludeFilter></ExcludeFilter>
+                <ExcludeFilter />
                 <Name>Dumm</Name>
                 <UID>HltpuOHRule</UID>
                 <Parameters>
@@ -56,7 +55,7 @@
                 <IncludeFilter>.*</IncludeFilter>
               </ConfigurationRule>
               <ConfigurationRule>
-                <ExcludeFilter></ExcludeFilter>
+                <ExcludeFilter />
                 <Name>DummDumm</Name>
                 <UID>HltpuISRule</UID>
                 <Parameters>
@@ -77,7 +76,6 @@
   </HLTMPPUApplication>
   <Partition>
     <UID>athenaHLT</UID>
-    <LogRoot>/scratch/fwinkl/athenaHLT/HLT/Trigger/TrigControl/TrigCommon/unitTestRun</LogRoot>
     <TriggerConfiguration>
       <TriggerConfiguration>
         <L1TriggerConfiguration>
@@ -96,15 +94,12 @@
             </libraries>
             <preCommands>
               <preCommand>_run_number=327265</preCommand>
-              <preCommand>include('TrigServices/OfflineTHistSvc.py')</preCommand>
             </preCommands>
-            <postCommands/>
+            <showInclude>false</showInclude>
+            <postCommands />
             <UID>HLTImplementationJobOptions-1</UID>
-            <evtSel>NONE</evtSel>
             <HLTCommonParameters>
               <HLTCommonParameters>
-                <factoryName></factoryName>
-                <dllName></dllName>
                 <messageSvcType>TrigMessageSvc</messageSvcType>
                 <jobOptionsSvcType>JobOptionsSvc</jobOptionsSvcType>
               </HLTCommonParameters>
@@ -123,8 +118,8 @@
             <Name>dummy</Name>
             <Server>TRIGGERDB</Server>
             <Alias>TRIGGERDB</Alias>
-            <User></User>
-            <Password></Password>
+            <User />
+            <Password />
             <Type>Coral</Type>
             <SuperMasterKey>0</SuperMasterKey>
           </TriggerDBConnection>
@@ -132,7 +127,7 @@
       </TriggerConfiguration>
     </TriggerConfiguration>
   </Partition>
-  <ROS2ROBS/>
+  <ROS2ROBS />
 </Configuration>
 <RunParams>
   <totalTime>0</totalTime>
@@ -140,12 +135,12 @@
   <timeEOR>1/1/70 01:00:00</timeEOR>
   <det_mask>00000000000000000001fffffffffff7</det_mask>
   <beam_type>0</beam_type>
-  <filename_tag></filename_tag>
+  <filename_tag />
   <max_events>0</max_events>
   <run_number>327265</run_number>
   <timeSOR>22/11/18 11:02:32.703856</timeSOR>
   <trigger_type>0</trigger_type>
-  <T0_project_tag></T0_project_tag>
+  <T0_project_tag />
   <beam_energy>0</beam_energy>
   <recording_enabled>0</recording_enabled>
 </RunParams>
diff --git a/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh b/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
index 4ae2f732aae..8ee0600f174 100755
--- a/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
+++ b/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 # Configuration testing script for athenaHLT.py
 #
@@ -22,4 +23,6 @@ detmask="00000000000000000001fffffffffff7"
 
 # Run only config stage (exit immediately via interactive mode) and filter final ptree
 # If there was a failure, the exit code will be non-zero
-echo "e" | athenaHLT.py --file ${file} --detector-mask ${detmask} --run-number ${run} --sor-time ${sortime} --interactive ${test_options} | sed -n '/<Configuration>/,/<\/Magnets>/p;/<\/Magnets>/q' | grep '<'
+log=test_athenaHLT-${BASHPID}
+echo "e" | athenaHLT.py --file ${file} --detector-mask ${detmask} --run-number ${run} --sor-time ${sortime} --interactive ${test_options} &> $log
+cat $log | sed -n '/<Configuration>/,/<\/Magnets>/p;/<\/Magnets>/q' | grep '<' | grep -v 'LogRoot'
-- 
GitLab


From 6afdd46edd570144372f1b9b933214e200d363b2 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 11:03:05 +0100
Subject: [PATCH 054/404] Update overlay reference file to v8 as random seeds
 have changed in CscDigitizationTool

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index ee44df56021..53401f9f5bb 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -24,5 +24,5 @@ ciRefFileMap = {
                 's3126-22.0'           : 'v2',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
-                'overlay-d1498-22.0'   : 'v7',
+                'overlay-d1498-22.0'   : 'v8',
                }
-- 
GitLab


From 4c45f94f9efbbe580a2fbeafb0640a1c523b1697 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 11:09:34 +0100
Subject: [PATCH 055/404] Add caching of the SOR information read from COOL

This significantly reduces the startup time of athenaHLT, i.e. if one
always uses the same run for testing/development.
---
 .../TrigControl/TrigCommon/python/AthHLT.py   | 24 ++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigCommon/python/AthHLT.py b/HLT/Trigger/TrigControl/TrigCommon/python/AthHLT.py
index 4a4050670f6..c5ab6a3d595 100644
--- a/HLT/Trigger/TrigControl/TrigCommon/python/AthHLT.py
+++ b/HLT/Trigger/TrigControl/TrigCommon/python/AthHLT.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 # Utilities used in athenaHLT.py
 #
@@ -23,8 +23,20 @@ class CondDB:
 
 @memoize
 def get_sor_params(run_number):
+   import cPickle as pickle
+   cool_cache = 'AthHLT.sor.pkl'
 
-   log.info('Reading SOR record for run %s from COOL' % run_number)
+   try:
+      # Try to load the SOR record from the file cache
+      d = pickle.load(open(cool_cache, 'rb'))
+      if d['RunNumber'] != run_number:
+         raise Exception('Cache does not contain current run')
+      log.info('Reading cached SOR record for run %s from %s' % (run_number, cool_cache))
+      return d
+   except Exception as e:
+      d = {}
+      log.verbose('Could not read SOR reacord from cache: %s' % e)
+      log.info('Reading SOR record for run %s from COOL' % run_number)
 
    from CoolConvUtilities import AtlCoolLib
    cdb = CondDB(run_number)
@@ -41,7 +53,13 @@ def get_sor_params(run_number):
       return None        # This can happen for unknown run numbers
 
    payload = sor.payload()
-   return {k: payload[k] for k in payload}
+   d = {k: payload[k] for k in payload}
+   try:
+      pickle.dump(d, open(cool_cache, 'wb'))
+   except Exception:
+      log.info('Could not store SOR record in cache %s' % cool_cache)
+
+   return d
 
 
 #
-- 
GitLab


From b3cf4a07e3e64197ab02c6008239177300bb8124 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Wed, 27 Feb 2019 11:48:46 +0100
Subject: [PATCH 056/404] Add more debug messages

---
 .../TrigEFMissingET/src/EFMissingETFromHelper.cxx          | 3 ++-
 .../TrigMissingETMuon/src/TrigMissingETMuon.cxx            | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index a241e50a3c7..0287e0396de 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -128,7 +128,8 @@ void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *const met, TrigEFMis
     Ntot       += met->usedChannelsComponent(add_i);
   }
 
-  if (!strcmp(comp_name, "") && !addComponent) 
+  if (strcmp(comp_name, "") // If the new component name is not ""
+      && !addComponent)     // and if we are not adding a component
     met->setNameOfComponent(        comp_i, comp_name );
   met->setExComponent(              comp_i, ex );
   met->setEyComponent(              comp_i, ey );
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index f07dcaf5c4b..60ab40480c4 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -355,6 +355,13 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
     msg() << MSG::DEBUG << "Muon correction calculated." << endmsg;
   }
 
+  msg() << MSG::WARNING << "Before we go into the inevitable crash, let's take a look at what the MET components are: "  << endmsg;
+  msg() << MSG::WARNING << "m_met i" << '\t' << "m_met->nameOfComponent(i)" << endmsg;
+  for (uint i=0; i < m_met->getNumberOfComponents(); i++)
+  {
+    msg() << MSG::WARNING << i << '\t' << m_met->nameOfComponent(i) << endmsg;
+  }
+
   if ( msgLvl() <= MSG::DEBUG ) msg()  << MSG::DEBUG << "Setting energies and flag" << endmsg;
   unsigned int muonComp = m_met->getNumberOfComponents() - 1;
   // Suggested by Diego: Checking the component name of the input
-- 
GitLab


From 221d9d68f3d897d82d12d42a5c04e4dbecb6c59e Mon Sep 17 00:00:00 2001
From: Susumu Oda <Susumu.Oda@cern.ch>
Date: Wed, 27 Feb 2019 12:24:12 +0100
Subject: [PATCH 057/404] Add an encode test with --threads=5

---
 .../InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
index 3a86119ce94..8259be5b134 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
@@ -40,9 +40,13 @@ atlas_add_test( TestSCTDecode
                 SCRIPT athena.py --threads=5 SCT_RawDataByteStreamCnv/testSCTDecode.py
                 PROPERTIES TIMEOUT 600
                 ENVIRONMENT THREADS=5 )
-atlas_add_test( TestSCTEncode
+atlas_add_test( TestSCTEncodeSerial
                 SCRIPT athena.py SCT_RawDataByteStreamCnv/testSCTEncode.py
                 PROPERTIES TIMEOUT 300 )
+atlas_add_test( TestSCTEncode
+                SCRIPT athena.py --threads=5 SCT_RawDataByteStreamCnv/testSCTEncode.py
+                PROPERTIES TIMEOUT 300
+                ENVIRONMENT THREADS=5 )
 
 # Install files from the package:
 atlas_install_headers( SCT_RawDataByteStreamCnv )
-- 
GitLab


From 5104a2b108e3b6c75289fedb906bd8909aa76bca Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Tue, 12 Feb 2019 16:37:40 +0100
Subject: [PATCH 058/404] Reorganise RPC and TGC overlays

---
 .../MuonOverlayBase/IDC_MultiHitOverlayBase.h |  75 ----------
 .../IDC_MultiHitOverlayBase.icc               | 117 ----------------
 .../IDC_MultiHitOverlayCommon.h               |  47 +++++++
 .../IDC_MultiHitOverlayCommon.icc             | 128 ++++++++++++++++++
 .../MuonOverlayBase/IDC_MuonOverlayBase.h     |  63 +++++++++
 .../MuonOverlayBase/IDC_MuonOverlayBase.icc   | 114 ++++++++++++++++
 .../RpcOverlay/RpcOverlay/RpcOverlay.h        |  31 ++---
 .../RpcOverlay/python/RpcOverlayConfig.py     |  12 +-
 .../MuonOverlay/RpcOverlay/src/RpcOverlay.cxx |  96 +++++--------
 .../TgcOverlay/TgcOverlay/TgcOverlay.h        |  33 ++---
 .../TgcOverlay/python/TgcOverlayConfig.py     |  12 +-
 .../MuonOverlay/TgcOverlay/src/TgcOverlay.cxx |  96 +++++--------
 12 files changed, 458 insertions(+), 366 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.h
 delete mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.icc
 create mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.h
 create mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.icc
 create mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
 create mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc

diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.h b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.h
deleted file mode 100644
index 2634e61ea7f..00000000000
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
- * @file
- * 
- * Common base class and generic overlaying code for boolean-like hits.
- * Multi hit overlay n1 hits + n hits -> m hits
- *
- * @author Ketevi A. Assamagan, 2009
- *
- */
-
-#ifndef IDC_MULTIHITOVERLAYBASE_H
-#define IDC_MULTIHITOVERLAYBASE_H
-
-#include <string>
-#include <vector>
-
-#include "OverlayAlgBase/OverlayAlgBase.h"
-#include "IDC_OverlayBase/IDC_OverlayCommon.h"
-
-class IDC_MultiHitOverlayBase;
-
-namespace Overlay {
-
-  /**
-   *  Merging of hits on the same channel.  Modifies the first argument by adding data from the second..
-   *  Implementations can assume that the arguments have the same Id.  (That is, correspond to the same readout channel.)
-   *  
-   *  A generic implementation of this template is provided in this package, 
-   *  but subdetectors can provide specializations suitable for their RDO type.
-   *  A simple example of providing a specialization is in InDetOverlay.cxx (for TRT_RDORawData).
-   *  A more elaborate implementation can be found e.g. in MdtOverlay.cxx
-   *  Here we general same channel hit  merging to the case where we have
-      n1 hits + n2 Hits -> n3 Hits. This may corresponds to the cases of the RPC and TGC
-   *  
-   */
-  template<class Datum> 
-  void mergeMultiHits(std::vector<Datum*>& dataHits, std::vector<Datum*>& mcHits, 
-                      std::vector<Datum*>& outHits, IDC_MultiHitOverlayBase* parent);
-}
-
-
-class IDC_MultiHitOverlayBase : public OverlayAlgBase  {
-public:
-  
-  IDC_MultiHitOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
-    : OverlayAlgBase(name, pSvcLocator)
-  {}
-
-  /**
-   *  Transfers all collections from the first and second arguments to the output the first merging where necessary.
-   */
-  template<class IDC_Container> void overlayContainer(const IDC_Container* data, const IDC_Container* mc, IDC_Container* output) {
-    Overlay::overlayContainer(data, mc, output, this);
-  }
-
-  template<class IDC_Container> std::string shortPrint(const IDC_Container *container, unsigned numprint = 25) {
-    return Overlay::shortPrint(container, numprint);
-  }
-
-  /**
-   *  Adds data from the second collection to the first merging where necessary.
-   *  After this call the "data" collection contains all information, and the "mc"
-   *  collection is empty.
-   */
-  template<class Collection> void mergeCollections(Collection *mc_coll, Collection *data_coll, Collection *out_coll);
- 
-};
-
-#include "MuonOverlayBase/IDC_MultiHitOverlayBase.icc"
-
-#endif/*IDC_MULTIHITOVERLAYBASE_H*/
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.icc b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.icc
deleted file mode 100644
index ccaf2c43b48..00000000000
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayBase.icc
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-// Ketevi A. Assamagan, 2009
- 
-#include "Identifier/Identifier.h"
-#include "Identifier/IdentifierHash.h"
-
-#include "AthenaBaseComps/AthMsgStreamMacros.h"
-
-#include "AthContainers/DataVector.h"
-
-#include "StoreGate/StoreGateSvc.h"
-#include <memory>
-
-#include <sstream>
-
-#include <set>
-
-//================================================================
-namespace Overlay {
-  
-  template<class Datum>  
-  void mergeMultiHits(std::vector<Datum*>& dataHits, 
-                      std::vector<Datum*>& mcHits,                        
-                      std::vector<Datum*>& outHits, IDC_MultiHitOverlayBase* parent) {
-  
-     parent->msg(MSG::DEBUG) << "Overlay::mergeMultiHits() : " << typeid(Datum).name() << endmsg;
-
-     outHits.clear();
-
-     /** here we take all the hits. SubSystems can to more sophisticated selections
-         in their template specializations */ 
-     for (unsigned int i=0; i<dataHits.size(); ++i) outHits.push_back( dataHits.at(i) );
-     for (unsigned int j=0; j<mcHits.size(); ++j) outHits.push_back( mcHits.at(j) );
-  }
-}
-
-//================================================================
-template<class Collection>
-void IDC_MultiHitOverlayBase::mergeCollections(Collection *mc_coll, 
-				       Collection *data_coll, 
-				       Collection *out_coll)
-{
-  DataVector<typename Collection::base_value_type> mc;
-  mc_coll->swap(mc);
-
-  DataVector<typename Collection::base_value_type> data;
-  data_coll->swap(data);
-  
-  //################################################################
-  // Merge by copying ptrs from data and mc to mc_coll
-
-  typename Collection::size_type idata = 0;
-  typename Collection::size_type imc = 0;
-  typename Collection::size_type j;
-  typename Collection::size_type k;
- 
-  /** this is the set of the all the hits treated
-      when all is done, it should be the union of data and MC hits */
-  std::set<Identifier> ids;
-
-  /** merge hits on the same channel */
-  while ( imc < mc.size() ) {
-    /** collect all the mc hits of a given Identifer id */
-    typename Collection::base_value_type *p_rdo(0);
-    std::vector<typename Collection::base_value_type *> vect1;
-    if ( !mc[imc] ) { imc++; continue; }
-    Identifier id = mc[imc]->identify();
-    if(!(ids.insert(id)).second) { imc++; continue; } // this Id already treated -> move on 
-    mc.swapElement(imc++, 0, p_rdo);
-    vect1.push_back(p_rdo);
-    for ( j=imc; j<mc.size(); j++ ) {
-       if ( !mc[j] ) continue;
-       if ( mc[j]->identify() == id ) {
-          mc.swapElement(j, 0, p_rdo);
-          vect1.push_back(p_rdo);
-       }
-    }
-
-    /** collect all the data hits of the same Identifier id */
-    typename Collection::base_value_type *p_data(0);
-    std::vector<typename Collection::base_value_type *> vect2; 
-    for ( k=0; k<data.size(); k++ ) {
-       if ( !data[k] ) continue;
-       if ( data[k]->identify() == id ) {
-          data.swapElement(k, 0, p_data);
-          vect2.push_back(p_data);
-       }
-    }
-
-    /** now we have vect1 and vect2 for same Id channels, 
-        call the multi hit overlay and save the merged hits */
-    if ( vect2.size() > 0 ) { // no need to merge hits if data in empty 
-       std::vector<typename Collection::base_value_type *> vect;
-       Overlay::mergeMultiHits(vect1,vect2,vect,this);
-       for (unsigned int n=0; n<vect.size(); ++n) out_coll->push_back( vect.at(n) );
-    } else {                    // copy directly mc if data is empty
-       for (unsigned int n=0; n<vect1.size(); ++n) out_coll->push_back( vect1.at(n) );
-    }
-  }
-   
-  /** now there must be some hits in the data that are not treated yet -
-      deal with those at this time. These should be the hit Ids that
-      are in the data but not found in the MC */
-  while( idata < data.size() ) {
-   if ( !data[idata] ) { idata++; continue; }
-   Identifier id = data[idata]->identify();
-   if(!(ids.insert(id)).second) { idata++; continue; } // this Id was found and treated already above -> continue
-   typename Collection::base_value_type *p_data(0);
-   data.swapElement(idata++, 0, p_data);
-   out_coll->push_back( p_data );
-  }
- 
-}
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.h b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.h
new file mode 100644
index 00000000000..717f06b3204
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.h
@@ -0,0 +1,47 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @file
+ *
+ * Common base class and generic overlaying code for boolean-like hits.
+ * Multi hit overlay n1 hits + n hits -> m hits
+ *
+ * @author Tadej Novak
+ * @author Ketevi A. Assamagan, 2009
+ */
+
+#ifndef IDC_MULTIHITOVERLAYCOMMON_H
+#define IDC_MULTIHITOVERLAYCOMMON_H
+
+#include <vector>
+
+namespace Overlay
+{
+
+/**
+ *  Merging of hits on the same channel.  Modifies the first argument by adding
+ data from the second..
+ *  Implementations can assume that the arguments have the same Id.  (That is,
+ correspond to the same readout channel.)
+ *
+ *  A generic implementation of this template is provided in this package,
+ *  but subdetectors can provide specializations suitable for their RDO type.
+ *
+ *  As a Collection is usually based on the DataVector elements are not const.
+ */
+template <class Datum>
+void mergeMultiHits(const std::vector<Datum *> &bkgHits,
+                    const std::vector<Datum *> &signalHits,
+                    std::vector<Datum *> &outputHits);
+
+template <class Collection>
+void mergeMultiHitCollections(Collection *bkgCollection,
+                              Collection *signalCollection,
+                              Collection *outputCollection);
+} // namespace Overlay
+
+#include "MuonOverlayBase/IDC_MultiHitOverlayCommon.icc"
+
+#endif
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.icc b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.icc
new file mode 100644
index 00000000000..6456569a619
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MultiHitOverlayCommon.icc
@@ -0,0 +1,128 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Ketevi A. Assamagan, 2009
+
+#include <Identifier/Identifier.h>
+#include <Identifier/IdentifierHash.h>
+
+#include <set>
+
+namespace Overlay
+{
+
+template <class Datum>
+void mergeMultiHits(const std::vector<Datum *> &bkgHits,
+                    const std::vector<Datum *> &signalHits,
+                    std::vector<Datum *> &outputHits)
+{
+  outputHits.clear();
+  outputHits.insert(outputHits.end(), bkgHits.begin(), bkgHits.end());
+  outputHits.insert(outputHits.end(), signalHits.begin(), signalHits.end());
+}
+
+
+
+template <class Collection>
+void mergeMultiHitCollections(Collection *bkgCollection,
+                              Collection *signalCollection,
+                              Collection *outputCollection)
+{
+  typedef typename Collection::base_value_type Datum;
+  typedef typename Collection::size_type size_type;
+
+  /** this is the set of the all the hits treated
+      when all is done, it should be the union of signal and background hits */
+  std::set<Identifier> ids;
+
+  /** merge hits on the same channel */
+  size_type ibkg = 0;
+  while (ibkg < bkgCollection->size()) {
+    // collect all the background hits of a given Identifer id
+    std::vector<Datum *> vectBkg;
+    Datum *element = bkgCollection->at(ibkg);
+    if (!element) {
+      // element already processed, continue
+      ibkg++;
+      continue;
+    }
+
+    // Identify the element and check if we already processed it
+    Identifier id = element->identify();
+    if (!ids.insert(id).second) {
+      // this Id already treated -> move on
+      ibkg++;
+      continue;
+    }
+
+    // Swap out the element
+    Datum *tmpRdo{};
+    bkgCollection->swapElement(ibkg++, nullptr, tmpRdo);
+    vectBkg.push_back(tmpRdo);
+
+    // Process the rest with the same Identifier id
+    for (size_type i = ibkg; i < bkgCollection->size(); i++) {
+      Datum *element = bkgCollection->at(i);
+      if (!element) // already processed, continue
+        continue;
+      if (element->identify() == id) {
+        // Swap out the element
+        Datum *tmpRdo{};
+        bkgCollection->swapElement(i, nullptr, tmpRdo);
+        vectBkg.push_back(tmpRdo);
+      }
+    }
+
+    // Collect all the signal hits of the same Identifier id
+    std::vector<Datum *> vectSig;
+    for (size_type i = 0; i < signalCollection->size(); i++) {
+      Datum *element = signalCollection->at(i);
+      if (!element) // already processed, continue
+        continue;
+      if (element->identify() == id) {
+        Datum *tmpRdo{};
+        signalCollection->swapElement(i, nullptr, tmpRdo);
+        vectSig.push_back(tmpRdo);
+      }
+    }
+
+    /** now we have vectBkg and vectSig for same Id channels,
+        call the multi hit overlay and save the merged hits */
+    if (!vectSig.empty()) { // no need to merge hits if signal not empty
+      std::vector<Datum *> vect;
+      Overlay::mergeMultiHits(vectBkg, vectSig, vect);
+      for (Datum *element : vect)
+        outputCollection->push_back(element);
+    } else { // copy directly background if signal is empty
+      for (Datum *element : vectBkg)
+        outputCollection->push_back(element);
+    }
+  }
+
+  /** now there must be some hits in the signal collection that are not treated yet -
+      deal with those at this time. These should be the hit Ids that
+      are in the signal but not found in the background */
+  size_type isig = 0;
+  while (isig < signalCollection->size()) {
+    Datum *element = signalCollection->at(isig);
+    if (!element) {
+      // element already processed, continue
+      isig++;
+      continue;
+    }
+
+    Identifier id = element->identify();
+    if (!ids.insert(id).second) {
+      // this Id already treated -> move on
+      isig++;
+      continue;
+    }
+
+    Datum *tmpRdo{};
+    signalCollection->swapElement(isig++, 0, tmpRdo);
+    outputCollection->push_back(tmpRdo);
+  }
+}
+
+} // namespace Overlay
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
new file mode 100644
index 00000000000..27986c5a8e8
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
@@ -0,0 +1,63 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Dear emacs, this is -*-c++-*-
+
+/**
+ * @file
+ *
+ * Overlaying of Identifiable Containers.  Functions common to the
+ * single-hit-per-readout-channel-in-an-event case and the
+ * possible-multiple-hits-on-a-channel case are declared in this file.
+ *
+ * @author Tadej Novak <tadej@cern.ch>
+ * @author Andrei Gaponenko <agaponenko@lbl.gov>, 2009
+ *
+ */
+
+#ifndef IDC_MUONOVERLAYCOMMON_H
+#define IDC_MUONOVERLAYCOMMON_H
+
+#include <AthenaBaseComps/AthAlgorithm.h>
+
+
+class IDC_MuonOverlayBase : public AthAlgorithm
+{
+public:
+  IDC_MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
+    : AthAlgorithm(name, pSvcLocator) {}
+
+protected:
+  template <class IDC_Container>
+  StatusCode overlayContainer(const IDC_Container *bkgContainer,
+                              const IDC_Container *signalContainer,
+                              IDC_Container *outputContainer)
+  {
+    return overlayContainerBase(bkgContainer, signalContainer, outputContainer, false);
+  }
+
+  template <class IDC_Container>
+  StatusCode overlayMultiHitContainer(const IDC_Container *bkgContainer,
+                                      const IDC_Container *signalContainer,
+                                      IDC_Container *outputContainer)
+  {
+    return overlayContainerBase(bkgContainer, signalContainer, outputContainer, true);
+  }
+
+private:
+  template <class IDC_Container>
+  StatusCode overlayContainerBase(const IDC_Container *bkgContainer,
+                                  const IDC_Container *signalContainer,
+                                  IDC_Container *outputContainer,
+                                  bool isMultiHitCollection);
+
+  template <class Collection>
+  std::unique_ptr<Collection> copyCollection(const IdentifierHash &hashId,
+                                             const Collection *collection);
+
+};
+
+#include "IDC_MuonOverlayBase.icc"
+
+#endif
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc
new file mode 100644
index 00000000000..72b9504d794
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc
@@ -0,0 +1,114 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Generic overlaying code for Muon Identifiable Containers.
+// Tadej Novak
+// Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
+
+#include <Identifier/Identifier.h>
+#include <Identifier/IdentifierHash.h>
+
+#include "IDC_MultiHitOverlayCommon.h"
+
+
+template <class Collection>
+std::unique_ptr<Collection> IDC_MuonOverlayBase::copyCollection(const IdentifierHash &hashId,
+                                                                const Collection *collection)
+{
+  typedef typename Collection::base_value_type Datum;
+
+  auto outputCollection = std::make_unique<Collection>(collection->identify(), hashId);
+
+  for (const Datum *existingDatum : *collection) {
+    // Owned by the collection
+    Datum *datumCopy = new Datum(*existingDatum);
+    outputCollection->push_back(datumCopy);
+  }
+
+  return outputCollection;
+}
+
+
+
+template <class IDC_Container>
+StatusCode IDC_MuonOverlayBase::overlayContainerBase(const IDC_Container *bkgContainer,
+                                                     const IDC_Container *signalContainer,
+                                                     IDC_Container *outputContainer,
+                                                     bool isMultiHitCollection)
+{
+  typedef typename IDC_Container::base_value_type Collection;
+  typedef typename Collection::base_value_type Datum;
+
+  ATH_MSG_DEBUG("overlayContainer<>() begin");
+
+  // Get all the hashes for both signal and background container
+  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);
+  }
+
+  // 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<Collection> bkgCollection = copyCollection(hashId, 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;
+    }
+  }
+
+  // Finally loop through the map and process the signal and overlay if
+  // necessary
+  for (const auto &[hashId, overlap] : overlapMap) {
+    // Copy the signal collection
+    std::unique_ptr<Collection> signalCollection = copyCollection(hashId, signalContainer->indexFindPtr(hashId));
+
+    if (overlap) { // Do overlay
+      // Create the output collection
+      auto outputCollection = std::make_unique<Collection>(signalCollection->identify(), hashId);
+      // Copy the background collection
+      std::unique_ptr<Collection> bkgCollection = copyCollection(hashId, bkgContainer->indexFindPtr(hashId));
+
+      // Merge collections
+      if (isMultiHitCollection) {
+        Overlay::mergeMultiHitCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get());
+      } else {
+        // TODO: single-hit case not used at the moment
+        // Overlay::mergeCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get());
+      }
+
+      outputContainer->removeCollection(hashId);
+      if (outputContainer->addCollection(outputCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding overlaid Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        outputCollection.release();
+      }
+    } else { // Only write signal out
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
+      }
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
diff --git a/MuonSpectrometer/MuonOverlay/RpcOverlay/RpcOverlay/RpcOverlay.h b/MuonSpectrometer/MuonOverlay/RpcOverlay/RpcOverlay/RpcOverlay.h
index 482a6b51129..a14a251415f 100644
--- a/MuonSpectrometer/MuonOverlay/RpcOverlay/RpcOverlay/RpcOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/RpcOverlay/RpcOverlay/RpcOverlay.h
@@ -7,9 +7,7 @@
 // Overlaying RpcDigits from two different events for RPC subdetectors.
 //
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008 
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
 #ifndef RPCOVERLAY_H
@@ -17,32 +15,23 @@
 
 #include <string>
 
-#include "MuonOverlayBase/IDC_MultiHitOverlayBase.h"
-#include "MuonDigitContainer/RpcDigitContainer.h"
+#include <MuonDigitContainer/RpcDigitContainer.h>
+#include <MuonOverlayBase/IDC_MuonOverlayBase.h>
 
-class RpcIdHelper;
 
-class RpcOverlay : public IDC_MultiHitOverlayBase  {
+class RpcOverlay : public IDC_MuonOverlayBase
+{
 public:
 
-  RpcOverlay(const std::string &name,ISvcLocator *pSvcLocator);
+  RpcOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
-  /** Framework implemenrtation for the event loop */
-  virtual StatusCode overlayInitialize();
-  virtual StatusCode overlayExecute();
-  virtual StatusCode overlayFinalize();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
 private:
-  // ----------------------------------------------------------------
-
-  // jO controllable properties.
-  // "Main" containers are read, have data from "overlay" containers added,
-  // and written out with the original SG keys.
-  SG::ReadHandleKey<RpcDigitContainer> m_mainInputDigitKey{this,"MainInputDigitKey","OriginalEvent_SG+RPC_DIGITS","ReadHandleKey for Main Input RpcDigitContainer"};
-  SG::ReadHandleKey<RpcDigitContainer> m_overlayInputDigitKey{this,"OverlayInputDigitKey","BkgEvent_0_SG+RPC_DIGITS","ReadHandleKey for Overlay Input RpcDigitContainer"};
-  SG::WriteHandleKey<RpcDigitContainer> m_outputDigitKey{this,"OutputDigitKey","StoreGateSvc+RPC_DIGITS","WriteHandleKey for Output RpcDigitContainer"};
-
-  const RpcIdHelper   * m_rpcHelper{nullptr};
+  SG::ReadHandleKey<RpcDigitContainer> m_bkgInputKey{ this, "BkgInputKey", "OriginalEvent_SG+RPC_DIGITS", "ReadHandleKey for Background Input RpcDigitContainer" };
+  SG::ReadHandleKey<RpcDigitContainer> m_signalInputKey{ this, "SignalInputKey", "BkgEvent_0_SG+RPC_DIGITS", "ReadHandleKey for Signal Input RpcDigitContainer" };
+  SG::WriteHandleKey<RpcDigitContainer> m_outputKey{ this, "OutputKey","StoreGateSvc+RPC_DIGITS", "WriteHandleKey for Output RpcDigitContainer" };
 
 };
 
diff --git a/MuonSpectrometer/MuonOverlay/RpcOverlay/python/RpcOverlayConfig.py b/MuonSpectrometer/MuonOverlay/RpcOverlay/python/RpcOverlayConfig.py
index bc7d41075ff..37bd4ef3f7e 100644
--- a/MuonSpectrometer/MuonOverlay/RpcOverlay/python/RpcOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/RpcOverlay/python/RpcOverlayConfig.py
@@ -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
 
 from AthenaCommon import CfgMgr
 
 def getRpcOverlay(name="RpcOverlay", **kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
-    kwargs.setdefault("MainInputDigitKey",overlayFlags.dataStore()+"+RPC_DIGITS")
-    kwargs.setdefault("OverlayInputDigitKey",overlayFlags.evtStore()+"+RPC_DIGITS")
-    kwargs.setdefault("OutputDigitKey",overlayFlags.outputStore()+"+RPC_DIGITS")
-    kwargs.setdefault("MCStore",overlayFlags.evtStore())
-    kwargs.setdefault("DataStore", overlayFlags.dataStore())
+
+    kwargs.setdefault("BkgInputKey", overlayFlags.dataStore() + "+RPC_DIGITS")
+    kwargs.setdefault("SignalInputKey", overlayFlags.evtStore() + "+RPC_DIGITS")
+    kwargs.setdefault("OutputKey", overlayFlags.outputStore() + "+RPC_DIGITS")
+
     return CfgMgr.RpcOverlay(name, **kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/RpcOverlay/src/RpcOverlay.cxx b/MuonSpectrometer/MuonOverlay/RpcOverlay/src/RpcOverlay.cxx
index bfeeb0d07e1..a1ff92f5eeb 100644
--- a/MuonSpectrometer/MuonOverlay/RpcOverlay/src/RpcOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/RpcOverlay/src/RpcOverlay.cxx
@@ -3,98 +3,76 @@
 */
 
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
-#include "RpcOverlay/RpcOverlay.h"
+#include <RpcOverlay/RpcOverlay.h>
 
-#include "StoreGate/StoreGateSvc.h"
-#include "StoreGate/DataHandle.h"
-#include "StoreGate/ReadHandle.h"
-#include "StoreGate/WriteHandle.h"
+#include <StoreGate/ReadHandle.h>
+#include <StoreGate/WriteHandle.h>
 
-#include "MuonIdHelpers/RpcIdHelper.h"
-#include "MuonDigitContainer/RpcDigitContainer.h"
-
-#include <iostream>
-#include <typeinfo>
+#include <IDC_OverlayBase/IDC_OverlayHelpers.h>
 
 
 //================================================================
 RpcOverlay::RpcOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
-  IDC_MultiHitOverlayBase(name, pSvcLocator)
+  IDC_MuonOverlayBase(name, pSvcLocator)
 {
 }
 
 //================================================================
-StatusCode RpcOverlay::overlayInitialize()
+StatusCode RpcOverlay::initialize()
 {
-  ATH_MSG_INFO("RpcOverlay initialized");
-
-  /** access to the CSC Identifier helper */
-  ATH_CHECK(detStore()->retrieve(m_rpcHelper, "RPCIDHELPER"));
-  ATH_MSG_DEBUG(" Found the RpcIdHelper. ");
+  ATH_MSG_DEBUG("Initializing...");
 
-  ATH_CHECK(m_mainInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_mainInputDigitKey );
-  ATH_CHECK(m_overlayInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_overlayInputDigitKey );
-  ATH_CHECK(m_outputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputDigitKey );
+  ATH_CHECK(m_bkgInputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_bkgInputKey );
+  ATH_CHECK(m_signalInputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_signalInputKey );
+  ATH_CHECK(m_outputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey );
 
   return StatusCode::SUCCESS;
 }
 
 //================================================================
-StatusCode RpcOverlay::overlayFinalize()
+StatusCode RpcOverlay::execute()
 {
-  ATH_MSG_INFO("RpcOverlay finalized");
-  return StatusCode::SUCCESS;
-}
-
-//================================================================
-StatusCode RpcOverlay::overlayExecute() {
   ATH_MSG_DEBUG("RpcOverlay::execute() begin");
 
-  //----------------------------------------------------------------
 
-  SG::ReadHandle<RpcDigitContainer> dataContainer (m_mainInputDigitKey);
-  if (!dataContainer.isValid()) {
-    ATH_MSG_ERROR("Could not get data RPC container " << dataContainer.name() << " from store " << dataContainer.store());
+  SG::ReadHandle<RpcDigitContainer> bkgContainer (m_bkgInputKey);
+  if (!bkgContainer.isValid()) {
+    ATH_MSG_ERROR("Could not get background RPC container " << bkgContainer.name() << " from store " << bkgContainer.store());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Found data RpcDigitContainer called " << dataContainer.name() << " in store " << dataContainer.store());
-  ATH_MSG_INFO("RPC Data     = "<<shortPrint(dataContainer.cptr()));
+  ATH_MSG_DEBUG("Found background RpcDigitContainer called " << bkgContainer.name() << " in store " << bkgContainer.store());
+  ATH_MSG_DEBUG("RPC Background = " << Overlay::debugPrint(bkgContainer.cptr()));
+  ATH_MSG_VERBOSE("RPC background has digit_size " << bkgContainer->digit_size());
 
-  ATH_MSG_VERBOSE("Retrieving MC  input RPC container");
-  SG::ReadHandle<RpcDigitContainer> mcContainer(m_overlayInputDigitKey);
-  if(!mcContainer.isValid() ) {
-    ATH_MSG_ERROR("Could not get overlay RPC container " << mcContainer.name() << " from store " << mcContainer.store());
+  SG::ReadHandle<RpcDigitContainer> signalContainer(m_signalInputKey);
+  if (!signalContainer.isValid() ) {
+    ATH_MSG_ERROR("Could not get signal RPC container " << signalContainer.name() << " from store " << signalContainer.store());
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Found signal RpcDigitContainer called " << signalContainer.name() << " in store " << signalContainer.store());
+  ATH_MSG_DEBUG("RPC Signal     = " << Overlay::debugPrint(signalContainer.cptr()));
+  ATH_MSG_VERBOSE("RPC signal has digit_size " << signalContainer->digit_size());
+
+  SG::WriteHandle<RpcDigitContainer> outputContainer(m_outputKey);
+  ATH_CHECK(outputContainer.record(std::make_unique<RpcDigitContainer>(bkgContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output RpcDigitContainer called " << outputContainer.name() << " to store " << outputContainer.store());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Found overlay RpcDigitContainer called " << mcContainer.name() << " in store " << mcContainer.store());
-  ATH_MSG_INFO("RPC MC       = "<<shortPrint(mcContainer.cptr()));
-
-  ATH_MSG_VERBOSE("RPC data has digit_size "<<dataContainer->digit_size());
-
-  ATH_MSG_VERBOSE("RPC signal data has digit_size "<<mcContainer->digit_size());
-
-  SG::WriteHandle<RpcDigitContainer> outputContainer(m_outputDigitKey);
-  ATH_CHECK(outputContainer.record(std::make_unique<RpcDigitContainer>(dataContainer->size())));
   ATH_MSG_DEBUG("Recorded output RpcDigitContainer called " << outputContainer.name() << " in store " << outputContainer.store());
 
-  //Do the actual overlay
-  if(dataContainer.isValid() && mcContainer.isValid() && outputContainer.isValid()) {
-    this->overlayContainer(dataContainer.cptr(), mcContainer.cptr(), outputContainer.ptr());
-  }
-  ATH_MSG_INFO("RPC Result   = "<<shortPrint(outputContainer.cptr()));
+  // Do the actual overlay
+  ATH_CHECK(overlayMultiHitContainer(bkgContainer.cptr(), signalContainer.cptr(), outputContainer.ptr()));
+  ATH_MSG_DEBUG("RPC Result     = " << Overlay::debugPrint(outputContainer.cptr()));
+
 
-  //----------------------------------------------------------------
   ATH_MSG_DEBUG("RpcOverlay::execute() end");
 
   return StatusCode::SUCCESS;
 }
-
-// EOF
diff --git a/MuonSpectrometer/MuonOverlay/TgcOverlay/TgcOverlay/TgcOverlay.h b/MuonSpectrometer/MuonOverlay/TgcOverlay/TgcOverlay/TgcOverlay.h
index 636940126da..40c313805af 100644
--- a/MuonSpectrometer/MuonOverlay/TgcOverlay/TgcOverlay/TgcOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/TgcOverlay/TgcOverlay/TgcOverlay.h
@@ -7,42 +7,29 @@
 // Overlaying TgcDigits from two different events for TGC subdetectors.
 //
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008 
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
 #ifndef TGCOVERLAY_H
 #define TGCOVERLAY_H
 
-#include <string>
-
-#include "MuonOverlayBase/IDC_MultiHitOverlayBase.h"
-#include "MuonDigitContainer/TgcDigitContainer.h"
+#include <MuonDigitContainer/TgcDigitContainer.h>
+#include <MuonOverlayBase/IDC_MuonOverlayBase.h>
 
-class TgcIdHelper;
 
-class TgcOverlay : public IDC_MultiHitOverlayBase  {
+class TgcOverlay : public IDC_MuonOverlayBase
+{
 public:
 
-  TgcOverlay(const std::string &name,ISvcLocator *pSvcLocator);
+  TgcOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
-  /** Framework implemenrtation for the event loop */
-  virtual StatusCode overlayInitialize();
-  virtual StatusCode overlayExecute();
-  virtual StatusCode overlayFinalize();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
 private:
-  // ----------------------------------------------------------------
-
-  // jO controllable properties.
-  // "Main" containers are read, have data from "overlay" containers added,
-  // and written out with the original SG keys.
-  SG::ReadHandleKey<TgcDigitContainer> m_mainInputDigitKey{this,"MainInputDigitKey","OriginalEvent_SG+TGC_DIGITS","ReadHandleKey for Main Input TgcDigitContainer"};
-  SG::ReadHandleKey<TgcDigitContainer> m_overlayInputDigitKey{this,"OverlayInputDigitKey","BkgEvent_0_SG+TGC_DIGITS","ReadHandleKey for Overlay Input TgcDigitContainer"};
-  SG::WriteHandleKey<TgcDigitContainer> m_outputDigitKey{this,"OutputDigitKey","StoreGateSvc+TGC_DIGITS","WriteHandleKey for Output TgcDigitContainer"};
-
-  const TgcIdHelper   * m_tgcHelper{nullptr};
+  SG::ReadHandleKey<TgcDigitContainer> m_bkgInputKey{ this, "BkgInputKey", "OriginalEvent_SG+TGC_DIGITS", "ReadHandleKey for Background Input TgcDigitContainer" };
+  SG::ReadHandleKey<TgcDigitContainer> m_signalInputKey{ this, "SignalInputKey", "BkgEvent_0_SG+TGC_DIGITS", "ReadHandleKey for Signal Input TgcDigitContainer" };
+  SG::WriteHandleKey<TgcDigitContainer> m_outputKey{ this, "OutputKey", "StoreGateSvc+TGC_DIGITS", "WriteHandleKey for Output TgcDigitContainer" };
 
 };
 
diff --git a/MuonSpectrometer/MuonOverlay/TgcOverlay/python/TgcOverlayConfig.py b/MuonSpectrometer/MuonOverlay/TgcOverlay/python/TgcOverlayConfig.py
index 3384f69168e..d4d92780c51 100644
--- a/MuonSpectrometer/MuonOverlay/TgcOverlay/python/TgcOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/TgcOverlay/python/TgcOverlayConfig.py
@@ -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
 
 from AthenaCommon import CfgMgr
 
 def getTgcOverlay(name="TgcOverlay", **kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
-    kwargs.setdefault("MainInputDigitKey",overlayFlags.dataStore()+"+TGC_DIGITS")
-    kwargs.setdefault("OverlayInputDigitKey",overlayFlags.evtStore()+"+TGC_DIGITS")
-    kwargs.setdefault("OutputDigitKey",overlayFlags.outputStore()+"+TGC_DIGITS")
-    kwargs.setdefault("MCStore",overlayFlags.evtStore())
-    kwargs.setdefault("DataStore", overlayFlags.dataStore())
+
+    kwargs.setdefault("BkgInputKey", overlayFlags.dataStore() + "+TGC_DIGITS")
+    kwargs.setdefault("SignalInputKey", overlayFlags.evtStore() + "+TGC_DIGITS")
+    kwargs.setdefault("OutputKey", overlayFlags.outputStore() + "+TGC_DIGITS")
+
     return CfgMgr.TgcOverlay(name, **kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/TgcOverlay/src/TgcOverlay.cxx b/MuonSpectrometer/MuonOverlay/TgcOverlay/src/TgcOverlay.cxx
index 2d0681498b8..2fea1d3c1cb 100644
--- a/MuonSpectrometer/MuonOverlay/TgcOverlay/src/TgcOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/TgcOverlay/src/TgcOverlay.cxx
@@ -3,97 +3,75 @@
 */
 
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
-#include "TgcOverlay/TgcOverlay.h"
+#include <TgcOverlay/TgcOverlay.h>
 
-#include "StoreGate/StoreGateSvc.h"
-#include "StoreGate/DataHandle.h"
-#include "StoreGate/ReadHandle.h"
-#include "StoreGate/WriteHandle.h"
+#include <StoreGate/ReadHandle.h>
+#include <StoreGate/WriteHandle.h>
 
-#include "MuonIdHelpers/TgcIdHelper.h"
-#include "MuonDigitContainer/TgcDigitContainer.h"
+#include <IDC_OverlayBase/IDC_OverlayHelpers.h>
 
-#include <iostream>
-#include <typeinfo>
 
 //================================================================
 TgcOverlay::TgcOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
-  IDC_MultiHitOverlayBase(name, pSvcLocator)
+  IDC_MuonOverlayBase(name, pSvcLocator)
 {
 }
 
 //================================================================
-StatusCode TgcOverlay::overlayInitialize()
+StatusCode TgcOverlay::initialize()
 {
-  ATH_MSG_INFO("TgcOverlay initialized");
-
-  /** access to the TGC Identifier helper */
-  ATH_CHECK(detStore()->retrieve(m_tgcHelper, "TGCIDHELPER"));
-  ATH_MSG_DEBUG(" Found the TgcIdHelper. ");
-
-  ATH_CHECK(m_mainInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_mainInputDigitKey );
-  ATH_CHECK(m_overlayInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_overlayInputDigitKey );
-  ATH_CHECK(m_outputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputDigitKey );
+  ATH_MSG_DEBUG("Initializing...");
 
-  return StatusCode::SUCCESS;
-}
+  ATH_CHECK(m_bkgInputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_bkgInputKey );
+  ATH_CHECK(m_signalInputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_signalInputKey );
+  ATH_CHECK(m_outputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey );
 
-//================================================================
-StatusCode TgcOverlay::overlayFinalize()
-{
-  ATH_MSG_INFO("TgcOverlay finalized");
   return StatusCode::SUCCESS;
 }
 
 //================================================================
-StatusCode TgcOverlay::overlayExecute() {
+StatusCode TgcOverlay::execute() {
   ATH_MSG_DEBUG("TgcOverlay::execute() begin");
 
-  //----------------------------------------------------------------
 
-  SG::ReadHandle<TgcDigitContainer> dataContainer (m_mainInputDigitKey);
-  if (!dataContainer.isValid()) {
-    ATH_MSG_ERROR("Could not get data TGC container " << dataContainer.name() << " from store " << dataContainer.store());
+  SG::ReadHandle<TgcDigitContainer> bkgContainer (m_bkgInputKey);
+  if (!bkgContainer.isValid()) {
+    ATH_MSG_ERROR("Could not get background TgcDigitContainer called " << bkgContainer.name() << " from store " << bkgContainer.store());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Found data TgcDigitContainer called " << dataContainer.name() << " in store " << dataContainer.store());
-  ATH_MSG_INFO("TGC Data     = "<<shortPrint(dataContainer.cptr()));
+  ATH_MSG_DEBUG("Found background TgcDigitContainer called " << bkgContainer.name() << " in store " << bkgContainer.store());
+  ATH_MSG_DEBUG("TGC Background = " << Overlay::debugPrint(bkgContainer.cptr()));
+  ATH_MSG_VERBOSE("TGC background has digit_size " << bkgContainer->digit_size());
 
-  ATH_MSG_VERBOSE("Retrieving MC  input TGC container");
-  SG::ReadHandle<TgcDigitContainer> mcContainer(m_overlayInputDigitKey);
-  if(!mcContainer.isValid() ) {
-    ATH_MSG_ERROR("Could not get overlay TGC container " << mcContainer.name() << " from store " << mcContainer.store());
+  SG::ReadHandle<TgcDigitContainer> signalContainer(m_signalInputKey);
+  if (!signalContainer.isValid() ) {
+    ATH_MSG_ERROR("Could not get signal TgcDigitContainer called " << signalContainer.name() << " from store " << signalContainer.store());
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Found overlay TgcDigitContainer called " << signalContainer.name() << " in store " << signalContainer.store());
+  ATH_MSG_DEBUG("TGC Signal       = " << Overlay::debugPrint(signalContainer.cptr()));
+  ATH_MSG_VERBOSE("TGC signal has digit_size " << signalContainer->digit_size());
+
+  SG::WriteHandle<TgcDigitContainer> outputContainer(m_outputKey);
+  ATH_CHECK(outputContainer.record(std::make_unique<TgcDigitContainer>(bkgContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output TgcDigitContainer called " << outputContainer.name() << " to store " << outputContainer.store());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Found overlay TgcDigitContainer called " << mcContainer.name() << " in store " << mcContainer.store());
-  ATH_MSG_INFO("TGC MC       = "<<shortPrint(mcContainer.cptr()));
-
-  ATH_MSG_VERBOSE("TGC data has digit_size "<<dataContainer->digit_size());
-
-  ATH_MSG_VERBOSE("TGC signal data has digit_size "<<mcContainer->digit_size());
-
-  SG::WriteHandle<TgcDigitContainer> outputContainer(m_outputDigitKey);
-  ATH_CHECK(outputContainer.record(std::make_unique<TgcDigitContainer>(dataContainer->size())));
   ATH_MSG_DEBUG("Recorded output TgcDigitContainer called " << outputContainer.name() << " in store " << outputContainer.store());
 
-  //Do the actual overlay
-  if(dataContainer.isValid() && mcContainer.isValid() && outputContainer.isValid()) {
-    this->overlayContainer(dataContainer.cptr(), mcContainer.cptr(), outputContainer.ptr());
-  }
-  ATH_MSG_INFO("TGC Result   = "<<shortPrint(outputContainer.cptr()));
+  // Do the actual overlay
+  ATH_CHECK(overlayMultiHitContainer(bkgContainer.cptr(), signalContainer.cptr(), outputContainer.ptr()));
+  ATH_MSG_DEBUG("TGC Result     = " << Overlay::debugPrint(outputContainer.cptr()));
+
 
-  //----------------------------------------------------------------
   ATH_MSG_DEBUG("TgcOverlay::execute() end");
 
   return StatusCode::SUCCESS;
 }
-
-// EOF
-- 
GitLab


From 8e0ff809f13ab7d3386d28841797b8d4db5931e0 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Wed, 27 Feb 2019 14:45:32 +0100
Subject: [PATCH 059/404] Add more debug messages

---
 .../TrigEFMissingET/src/EFMissingETFromHelper.cxx     |  5 +++--
 .../TrigMissingETMuon/src/TrigMissingETMuon.cxx       | 11 +++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 0287e0396de..b1bf26ef606 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -162,7 +162,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
                                         const xAOD::VertexContainer * /*vertexContainer*/,
                                         const xAOD::MuonContainer * /*muonContainer*/ )
 {
-  ATH_MSG_DEBUG( "EFMissingETFromHelper::execute() called" );
+  ATH_MSG_WARNING( "EFMissingETFromHelper::execute() called" );
 
   if (met==0 || metHelper==0) {
     ATH_MSG_ERROR( "ERROR: null pointers as input!" );
@@ -180,7 +180,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   unsigned char elem = metHelper->GetElements(); // no. of transient aux. compon.
   if (elem!=42) {
     ATH_MSG_WARNING( "Found " << elem << " aux components in the transient helper class.  Not supported!" );
-  }
+  } else ATH_MSG_WARNING( "Found " << elem << " aux components in the transient helper class" );
 
   bool skipAuxInfo=false;
   bool save9comp=false;
@@ -214,6 +214,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
       ATH_MSG_WARNING( "Found " << comp << " aux components in TrigMissingET.  Not supported.  NOT SAVING AUX INFO" );
       skipAuxInfo=true;
   }
+      ATH_MSG_WARNING( "Found " << comp << " aux components in TrigMissingET." );
 
   // Initialize EDM by setting all components to zero
   met->setEx(0.); met->setEy(0.); met->setEz(0.);
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 60ab40480c4..f8d78af9391 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -130,6 +130,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   switch (tes_in_size) {
 
   case 1: // unseeded mode with TrigMissingET.
+      msg() << MSG::WARNING << "Running in unseeded mode" << endmsg;
 
     if (msgLvl() <= MSG::DEBUG) {
       msg() << MSG::DEBUG << "Running in unseeded mode" << endmsg;
@@ -167,6 +168,8 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
       return status;
     }
   case 2:			// Seeded mode
+      msg() << MSG::WARNING << "Running seeded mode" << endmsg;
+
     muonIndex=1;
 
     tes_in0_size=tes_in[0].size();
@@ -229,6 +232,14 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   if(vectorOfMET.size() == 0) 
     return HLT::NAV_ERROR;
 
+  msg() << MSG::WARNING << "vectorOfMET.size()=" << vectorOfMET.size() << endmsg;
+  msg() << MSG::WARNING << "i\t vectorOfMET[i][component] \t vectorOfMET[i][component][componentName] " << endmsg;
+  for(uint i=0; i<vectorOfMET.size(); i++){
+    msg() << MSG::WARNING << i << endmsg;
+    for(uint comp=0; comp<vectorOfMET[i]->getNumberOfComponents(); comp++)
+      msg() << MSG::WARNING << '\t' << comp << '\t' << vectorOfMET[i]->nameOfComponent(comp) << endmsg;
+  }
+
   // ++++++++++++++++++++++++++++++++++++++++++
   const xAOD::TrigMissingET *met_temp=vectorOfMET[0];
   m_met = const_cast<xAOD::TrigMissingET *>(met_temp);
-- 
GitLab


From cb4db3c5cb031db63986dac790c29b1164435839 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 27 Feb 2019 16:12:15 +0100
Subject: [PATCH 060/404] Updated all projects to atlasexternals-2.0.23.

---
 Projects/AnalysisBase/externals.txt   | 2 +-
 Projects/AnalysisTop/externals.txt    | 2 +-
 Projects/AthDataQuality/externals.txt | 2 +-
 Projects/AthSimulation/externals.txt  | 2 +-
 Projects/Athena/externals.txt         | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index d997d78201e..119d56c789a 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.22
+AnalysisBaseExternalsVersion = 2.0.23
diff --git a/Projects/AnalysisTop/externals.txt b/Projects/AnalysisTop/externals.txt
index 512940671ae..59bef4b7c15 100644
--- a/Projects/AnalysisTop/externals.txt
+++ b/Projects/AnalysisTop/externals.txt
@@ -1,4 +1,4 @@
 # Versions of the various externals to build before starting the build of
 # this project, when doing a full stack nightly build.
 
-AnalysisBaseExternalsVersion = 2.0.22
+AnalysisBaseExternalsVersion = 2.0.23
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index 5c4945ab845..cd387a019d7 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.22
+AtlasExternalsVersion = 2.0.23
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index dc776ca5b19..a8a7d88cbed 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.22
+AthSimulationExternalsVersion = 2.0.23
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 2b9bbe042be..eba68852703 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.22
+AthenaExternalsVersion = 2.0.23
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
-- 
GitLab


From bbf4adfce34839aebe2cef9e00662cfb8c3d1c86 Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Wed, 27 Feb 2019 16:13:11 +0100
Subject: [PATCH 061/404] Updated Athena to use LCG_95.

This required changing to newer versions of tdaq and tdaq-common, and
a newer version of HEPUtils as well.
---
 Projects/Athena/CMakeLists.txt           | 5 +++--
 Projects/Athena/build_externals.sh       | 2 +-
 Projects/Athena/externals/HEPUtils.cmake | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Projects/Athena/CMakeLists.txt b/Projects/Athena/CMakeLists.txt
index fc404a6add2..0a911811086 100644
--- a/Projects/Athena/CMakeLists.txt
+++ b/Projects/Athena/CMakeLists.txt
@@ -26,9 +26,9 @@ if( LCG_NIGHTLY )
     set( TDAQ_VERSION "99-00-00" CACHE STRING
        "The version of tdaq to use for the build" )
 else()
-    set( TDAQ-COMMON_VERSION "03-00-00" CACHE STRING
+    set( TDAQ-COMMON_VERSION "03-02-00" CACHE STRING
        "The version of tdaq-common to use for the build" )
-    set( TDAQ_VERSION "08-01-02" CACHE STRING
+    set( TDAQ_VERSION "08-02-00" CACHE STRING
        "The version of tdaq to use for the build" )
 endif()
 
@@ -52,6 +52,7 @@ find_package( Gaudi REQUIRED )
 # Find some auxiliary packages:
 find_package( Doxygen )
 find_package( PNG )
+find_package( VDT )
 
 # Load all the files from the externals/ subdirectory:
 file( GLOB _externals "${CMAKE_CURRENT_SOURCE_DIR}/externals/*.cmake" )
diff --git a/Projects/Athena/build_externals.sh b/Projects/Athena/build_externals.sh
index 37757246086..bdd649acd15 100755
--- a/Projects/Athena/build_externals.sh
+++ b/Projects/Athena/build_externals.sh
@@ -22,7 +22,7 @@ BUILDDIR=""
 BUILDTYPE="RelWithDebInfo"
 FORCE=""
 CI=""
-EXTRACMAKE=(-DLCG_VERSION_NUMBER=94 -DLCG_VERSION_POSTFIX="a")
+EXTRACMAKE=(-DLCG_VERSION_NUMBER=95 -DLCG_VERSION_POSTFIX="")
 while getopts ":t:b:x:fch" opt; do
     case $opt in
         t)
diff --git a/Projects/Athena/externals/HEPUtils.cmake b/Projects/Athena/externals/HEPUtils.cmake
index 27acb546c01..8344158ac50 100644
--- a/Projects/Athena/externals/HEPUtils.cmake
+++ b/Projects/Athena/externals/HEPUtils.cmake
@@ -2,6 +2,6 @@
 # File specifying the location of HEPUtils to use.
 #
 
-set( HEPUTILS_LCGVERSION 1.1.0 )
+set( HEPUTILS_LCGVERSION 1.3.2 )
 set( HEPUTILS_LCGROOT
    ${LCG_RELEASE_DIR}/MCGenerators/heputils/${HEPUTILS_LCGVERSION}/${LCG_PLATFORM} )
-- 
GitLab


From 95a27ff979469e4d58404b69f2b8180e3e263db7 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Wed, 27 Feb 2019 16:25:10 +0100
Subject: [PATCH 062/404] Clean up TrigMissingETMuon

---
 .../src/TrigMissingETMuon.cxx                 | 315 ++++++------------
 1 file changed, 103 insertions(+), 212 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 8d2fd60d94b..993a3ee3bd3 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -69,9 +69,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   // CACHING
   // first check whether we executed this instance before:
   if (m_useCachedResult) {
-    if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "Executing this xAOD::TrigMissingETMuon " << name() << " in cached mode" << endmsg;
-    }
+    ATH_MSG_DEBUG("Executing this xAOD::TrigMissingETMuon " << name() << " in cached mode");
     // Only count MET as an input TE (for seeding relation of navigation structure)
     HLT::TEVec allTEs;
     if ( (tes_in.size()>0) && (tes_in[0].size()>0) ) allTEs.push_back( tes_in[0][0] );
@@ -99,137 +97,70 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   m_mu_ey_log = -9e9;
   m_mu_set_log = -9e9;
 
-  unsigned int tes_in_size=tes_in.size(); // = 2 (seeded) or 1 (unseeded). The TrigMissingET object is necessary.
-  unsigned int muonIndex=0;               // = 1 if seeded
-  unsigned int tes_in0_size=0;  // size of result (must be 1)
-  unsigned int tes_in1_size=0;  // size of muon container
-
-  if(msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "Executing xAOD::TrigMissingETMuon::hltExecute()" << endmsg;
+  ATH_MSG_DEBUG("Executing xAOD::TrigMissingETMuon::hltExecute()" );
+  ATH_MSG_DEBUG("REGTEST: tes_in.size() = " );
+  for (unsigned u=0; u<tes_in.size(); ++u) {
+    ATH_MSG_DEBUG("REGTEST: tes_in[" << u << "].size() = " << tes_in[u].size());
   }
 
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "REGTEST: tes_in.size() = " << tes_in_size << endmsg;
-
-    for (unsigned u=0; u<tes_in_size; ++u) {
-      msg() << MSG::DEBUG << "REGTEST: tes_in[" << u << "].size() = " << tes_in[u].size() << endmsg;
-    }
-  }
   //algorithm is muon seeded, therefore:
   //    algorithm has TrigMissingET as only seed if in unseeded mode
   //                  muon as second seed of in seeded mode  
   //so number of TEs must be 1 or 2 
   // ======================================================
-  switch (tes_in_size) {
-
-  case 1: // unseeded mode with TrigMissingET.
-
-    if (msgLvl() <= MSG::DEBUG) {
-      msg() << MSG::DEBUG << "Running in unseeded mode" << endmsg;
-      msg() << MSG::DEBUG
-	    << "No muon feature found: skipping muon correction" << endmsg;
-    }
-    tes_in0_size=tes_in[0].size();
-    if (tes_in0_size != 1) {
-      msg() << MSG::WARNING // ERROR
-	    << "Configuration error: expecting exactly 1 TrigMissingET object.  Aborting chain" << endmsg;
-      return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);
-    }
-    else{
-      std::vector<const xAOD::TrigMissingET*> vectorOfMET;
-      for (HLT::TEVec::const_iterator met_it = tes_in[0].begin(); met_it != tes_in[0].end(); ++met_it) {
-	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
-	if(status != HLT::OK) {
-	  msg() << MSG::ERROR 
-		<< "no TrigMissingET object found for this TE ... ?!?"
-		<< endmsg;
-	  return HLT::NAV_ERROR;
-	}
-      }
-      if (msgLvl() <= MSG::DEBUG) {
-	msg() << MSG::DEBUG << "REGTEST: Florian: No muon input. Will save the input TE without updating it " << endmsg;
-      }
-
-      // Check if EDM is there
-      if(vectorOfMET.size() == 0) 
-        return HLT::NAV_ERROR;      
-      
-      const xAOD::TrigMissingET *met_temp=vectorOfMET[0];
-      m_met = const_cast<xAOD::TrigMissingET *>(met_temp);      
-      HLT::ErrorCode status = makeOutputTE(tes_in, type_out);
-      return status;
-    }
-  case 2:			// Seeded mode
-    muonIndex=1;
+  bool seeded = false;
+  switch(tes_in.size()){
+    case 1: seeded = false; ATH_MSG_DEBUG("Running in unseeded mode"); break;
+    case 2: seeded = true; ATH_MSG_DEBUG("Running in seeded mode"); break;
+    default:
+      ATH_MSG_WARNING ( "Configuration error: tes_in.size() is " << tes_in.size()
+        << " but can only be 2 in seeded mode or 1 in unseeded mode.  Aborting chain");
+        return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);
 
-    tes_in0_size=tes_in[0].size();
-    tes_in1_size=tes_in[1].size();
-
-    if (tes_in0_size != 1) {
-      msg() << MSG::WARNING // ERROR
-	    << "Configuration error: expecting exactly 1 L2 or EF result.  Aborting chain" << endmsg;
-      return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);
-    }
-    if (tes_in1_size == 0) {
-      if (msgLvl() <= MSG::DEBUG){
-	msg() << MSG::DEBUG
-	      << "No muon feature found: skipping muon correction" << endmsg;
-      }
-
-      // Save ouput TE before leaving.
-      std::vector<const xAOD::TrigMissingET*> vectorOfMET;
-      for (HLT::TEVec::const_iterator met_it = tes_in[0].begin(); met_it != tes_in[0].end(); ++met_it) {
-	HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
-	if(status != HLT::OK) {
-	  msg() << MSG::ERROR 
-		<< "no TrigMissingET object found for this TE ... ?!?"
-		<< endmsg;
-	  return HLT::NAV_ERROR;
-	}
-      }
-
-      // Check if EDM is there
-      if(vectorOfMET.size() == 0) 
-        return HLT::NAV_ERROR;
-   	  
-      const xAOD::TrigMissingET *met_temp=vectorOfMET[0];
-      m_met = const_cast<xAOD::TrigMissingET *>(met_temp);      
-      HLT::ErrorCode status = makeOutputTE(tes_in, type_out);
-      return status;
-    }
-    break;
+  }
 
-  default:
-    msg() << MSG::WARNING	// ERROR
-	  << "Configuration error: tes_in.size() is " << tes_in_size
-	  << " but can only be 1 in seeded mode or 0 in unseeded mode.  Aborting chain" << endmsg;
+  // 0th element in this tes_in vector must have exactly one object
+  if (tes_in[0].size() != 1) {
+    ATH_MSG_WARNING("Configuration error: expecting exactly 1 TrigMissingET object. Aborting chain");
     return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);
   }
 
-  // First we retrieve the TrigMissingET object
+  // Muon features? Not present if unseeded, or seeded but tes_in[1].size==0.
+  if(!seeded || (seeded && tes_in[1].size()==0))
+  {
+    ATH_MSG_DEBUG("No muon feature found: skipping muon correction");
+    HLT::ErrorCode status = makeOutputTE(tes_in, type_out);
+    return status;
+  }
+
+  /* If muon features are present,
+     then get the stuff and start doing the stuff
+   */
+
+  // Retrieve the TrigMissingET object
   std::vector<const xAOD::TrigMissingET*> vectorOfMET;
   for (HLT::TEVec::const_iterator met_it = tes_in[0].begin(); met_it != tes_in[0].end(); ++met_it) {
     HLT::ErrorCode status = getFeatures( (*met_it) , vectorOfMET);
     if(status != HLT::OK) {
-      msg() << MSG::ERROR 
-	    << "no TrigMissingET object found for this TE ... ?!?"
-	    << endmsg;
+      ATH_MSG_ERROR("no TrigMissingET object found for this TE ... ?!?");
       return HLT::NAV_ERROR;
     }
   }
 
   // Check if EDM is there
-  if(vectorOfMET.size() == 0) 
-    return HLT::NAV_ERROR;
+  if(vectorOfMET.size() == 0) {
+    ATH_MSG_ERROR("vectorOfMET.size() == 0 !");
+    return HLT::NAV_ERROR;      
+  }
 
   // ++++++++++++++++++++++++++++++++++++++++++
   const xAOD::TrigMissingET *met_temp=vectorOfMET[0];
   m_met = const_cast<xAOD::TrigMissingET *>(met_temp);
   // ++++++++++++++++++++++++++++++++++++++++++
-  msg() << MSG::DEBUG << "xAOD::TrigMissingET object retrieved." <<endmsg;
+  ATH_MSG_DEBUG("xAOD::TrigMissingET object retrieved.");
 
   flag=m_met->flag();
-  msg() << MSG::DEBUG << "Flag got." <<endmsg;
+  ATH_MSG_DEBUG("Flag got.");
 
   // Now we loop over all the muons
   float muon_ex=0;
@@ -238,82 +169,68 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
   float muon_sum_et=0;
   float muon_sum_e=0;
   //int muon_charge=0;
-  unsigned int Nmuons=0;
+  unsigned int nMuons=0;
   bool MuonError=false;
 
-  msg() << MSG::DEBUG << "REGTEST: Ready to access xAOD::MuonContainer  muons " << endmsg;
+  ATH_MSG_DEBUG("REGTEST: Ready to access xAOD::MuonContainer  muons ");
 
   std::vector<const xAOD::TrackParticle*> vecOfMuonTrk;
 
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG
-        << "REGTEST: Using muon pt threshold "<<m_muonptcut<<" GeV."<< endmsg;
-  }
-
-  for (HLT::TEVec::const_iterator muon_it = tes_in[muonIndex].begin();
-       muon_it != tes_in[muonIndex].end(); ++muon_it) {
+  ATH_MSG_DEBUG("REGTEST: Using muon pt threshold "<<m_muonptcut<<" GeV.");
 
+  // Muon TE in tes_in[1] // for some reason \_( )_/
+  for (HLT::TEVec::const_iterator muon_it = tes_in[1].begin(); muon_it != tes_in[1].end(); ++muon_it) 
+  {
     // Get the muon container linked to the TE
     const xAOD::MuonContainer* muonContainer(0);
 
     HLT::ErrorCode status = getFeature( (*muon_it) , muonContainer);
   
-    if(status != HLT::OK || muonContainer==0) {
-      if (msgLvl() <= MSG::DEBUG) {
-        msg() << MSG::DEBUG
-              << "no MuonContainer found for this TE ... ?!?"
-              << endmsg;
-      }
+    if(status != HLT::OK || muonContainer==0) 
+    {
+      ATH_MSG_DEBUG( "no MuonContainer found for this TE ... ?!?");
       continue;
     }
 
-    int NofMuons=muonContainer->size();
-
     // Check that there is at least one muon in TrigMuonEFInfoContainer
-    if (NofMuons == 0){
-      if (msgLvl() <= MSG::DEBUG) {
-        msg() << MSG::DEBUG << "Size of vectorOfMuons is 0. Skipping muon correction" << endmsg;
-      }
+    if (muonContainer->size() == 0)
+    {
+      ATH_MSG_DEBUG("Size of vectorOfMuons is 0. Skipping muon correction");
       MuonError=true;
       continue;
       //       return HLT::NAV_ERROR;
     }
-    unsigned int kk=0;
-    for(auto muon : *muonContainer) {
-      if (msgLvl() <= MSG::DEBUG) {
-        msg() << MSG::DEBUG << "Looking at muon " << kk << "pt = " << muon->pt() << "eta= " << 
-                              muon->eta() << "phi= " << muon->phi() << endmsg;
-      }
-      const xAOD::Muon::MuonType muontype = muon->muonType();
-      if(muontype == xAOD::Muon::MuonType::Combined || muontype == xAOD::Muon::MuonType::SegmentTagged ) { 
-        // combined or segment tagged muon
-
-        // double counting removal and minimum pt cut
-        bool sel = true;
-        float Et = fabs(muon->pt());
-        if (Et/CLHEP::GeV < m_muonptcut) sel = false;
-        if(!sel) continue;
 
-        const xAOD::TrackParticle* idtrk = muon->trackParticle( xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle );
+    unsigned int kk=0;
+    for(auto muon : *muonContainer) 
+    {
+      ATH_MSG_DEBUG("Looking at muon " << ++kk << "pt = " << muon->pt() << "eta= " << muon->eta() << "phi= " << muon->phi());
 
-        if(idtrk==0) {sel = false;} // Reject muons without IDtracks
+      // combined or segment tagged muon
+      if(muon->muonType() == xAOD::Muon::MuonType::Combined 
+          || muon->muonType() == xAOD::Muon::MuonType::SegmentTagged ) 
+      { 
 
-        if(!sel) continue;
+        // Minimum pt cut
+        float Et = fabs(muon->pt());
+        if (Et/CLHEP::GeV < m_muonptcut) continue;
 
-        for(std::vector<const xAOD::TrackParticle*>::size_type idx=0; idx<vecOfMuonTrk.size(); idx++) {
-          const xAOD::TrackParticle* idtrk_sel = vecOfMuonTrk[idx];
-          //if((*idtrk) == (*idtrk_sel)) { //  == operator not defined for this class, so comment it out 
-          if((idtrk) == (idtrk_sel)) {
-            sel = false;
+        // Reject muons without IDtracks
+        const xAOD::TrackParticle* idtrk = muon->trackParticle( xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle );
+        if (!idtrk) continue;
+
+        // Skip double counted muons
+        bool doubleCounted=false;
+        for(auto existingMuonTrk : vecOfMuonTrk)
+          if (existingMuonTrk == idtrk)
+          {
+            doubleCounted = true;
             break;
           }
-        } //end of loop over stored muon tracks
+        if(doubleCounted) continue;
 
-        if(!sel) continue;
+        vecOfMuonTrk.push_back(idtrk);  // store for double counting prevention
 
-        vecOfMuonTrk.push_back(idtrk);  // store for testing future muon tracks for double counting prevention
-
-        //int charge = muon->Charge()>0 ? 1 : -1;
         float eta = muon->eta();
         float phi = muon->phi();
         float cosPhi, sinPhi;
@@ -328,79 +245,62 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
         muon_ez     -= Ez;
         muon_sum_et += Et;
         muon_sum_e  += E;
-        //muon_charge += charge;
-        ++Nmuons;
-
-        if (msgLvl() <= MSG::DEBUG) {
-          msg() << MSG::DEBUG << "REGTEST: Adding muon with pT = " << Et
-                << " MeV, phi = " << phi << " rad, eta = " << eta << endmsg;
-        }
+        ++nMuons;
 
-      } // end muon-type if statement
-    } // end loop over muons
-  } // end loop over muons te's
+        ATH_MSG_DEBUG("REGTEST: Adding muon with pT = " << Et << " MeV, phi = " << phi << " rad, eta = " << eta );
+      } // end if muonType
+    } // end for(muon : muonContainer)
+  } // end for(te : muonTE's)
 
   m_mu_ex = muon_ex;
   m_mu_ey = muon_ey;
   m_mu_set = muon_sum_et;
   
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "Muon correction calculated." << endmsg;
-  }
+  ATH_MSG_DEBUG("Muon correction calculated.");
+
+  ATH_MSG_DEBUG("Setting energies and flag");
 
-  if ( msgLvl() <= MSG::DEBUG ) msg()  << MSG::DEBUG << "Setting energies and flag" << endmsg;
-  unsigned int muonComp = m_met->getNumberOfComponents() - 1;
+  unsigned int muonComp = m_met->getNumberOfComponents() - 1; // Muons are always the last component \_( )_/
   // Suggested by Diego: Checking the component name of the input
-  if( (m_met->nameOfComponent(muonComp)).substr(0,4)!="Muon") {
-    msg() << MSG::ERROR << "Could not find MET container with muon information!!! Exit..." << endmsg;
+  // Turns out to be a good test 
+  if( (m_met->nameOfComponent(muonComp)).substr(0,4)!="Muon") 
+  {
+    ATH_MSG_ERROR("Could not find MET container with muon information!!! Exit...");
     return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::BAD_JOB_SETUP);    
   }
-  // Fetch Muon Components
-  // Set muon variables
+  // Fetch Muon Components and set muon variables
   m_met->setExComponent(muonComp,muon_ex);
   m_met->setEyComponent(muonComp,muon_ey);
   m_met->setEzComponent(muonComp,muon_ez);
   m_met->setSumEtComponent(muonComp,muon_sum_et);
   m_met->setSumEComponent(muonComp,muon_sum_e);
-  m_met->setUsedChannelsComponent(muonComp, Nmuons);
+  m_met->setUsedChannelsComponent(muonComp, nMuons);
 
   if (MuonError){ // set muon error bit 
     flag |= m_maskErrMuon; flag |= m_maskCompErrors;
   }
   m_met->setFlag(flag);
-  if ( msgLvl() <= MSG::DEBUG ) msg()  << MSG::DEBUG << "Setting energies and flag done." << endmsg;
+  ATH_MSG_DEBUG( "Setting energies and flag done.");
 
   if (msgLvl() <= MSG::DEBUG) {
     char buff[128];
     std::snprintf(buff,128,"REGTEST: (Muon FEX) Event status = 0x%08x", (unsigned)flag);
-    msg() << MSG::DEBUG << buff << endmsg;
-    msg() << MSG::DEBUG << "REGTEST: (Muon FEX) Nmuons = " << Nmuons << endmsg;
-    if (Nmuons>0) {
-      msg() << MSG::DEBUG << "REGTEST: (Muon FEX) muon_ex = " << muon_ex*1e-3 << " GeV" << endmsg;
-      msg() << MSG::DEBUG << "REGTEST: (Muon FEX) muon_ey = " << muon_ey*1e-3 << " GeV" << endmsg;
-      msg() << MSG::DEBUG << "REGTEST: (Muon FEX) muon_ez = " << muon_ez*1e-3 << " GeV" << endmsg;
-      msg() << MSG::DEBUG << "REGTEST: (Muon FEX) muon_sum_et = " << muon_sum_et*1e-3 << " GeV" << endmsg;
-      msg() << MSG::DEBUG << "REGTEST: (Muon FEX) muon_sum_e = " << muon_sum_e*1e-3 << " GeV" << endmsg;
+    ATH_MSG_DEBUG( buff );
+    ATH_MSG_DEBUG( "REGTEST: (Muon FEX) nMuons = " << nMuons );
+    if (nMuons>0) {
+      ATH_MSG_DEBUG( "REGTEST: (Muon FEX) muon_ex = " << muon_ex*1e-3 << " GeV" );
+      ATH_MSG_DEBUG( "REGTEST: (Muon FEX) muon_ey = " << muon_ey*1e-3 << " GeV" );
+      ATH_MSG_DEBUG( "REGTEST: (Muon FEX) muon_ez = " << muon_ez*1e-3 << " GeV" );
+      ATH_MSG_DEBUG( "REGTEST: (Muon FEX) muon_sum_et = " << muon_sum_et*1e-3 << " GeV" );
+      ATH_MSG_DEBUG( "REGTEST: (Muon FEX) muon_sum_e = " << muon_sum_e*1e-3 << " GeV" );
     }
   }
 
   // monitoring: log-scale quantities
   float epsilon = 1e-6;  // 1 keV
-
-  if (fabsf(m_mu_ex)>epsilon)
-    m_mu_ex_log = copysign(log10(fabsf(m_mu_ex)), m_mu_ex);
-  else
-    m_mu_ex_log = 0;
-
-  if (fabsf(m_mu_ey)>epsilon)
-    m_mu_ey_log = copysign(log10(fabsf(m_mu_ey)), m_mu_ey);
-  else
-    m_mu_ey_log = 0;
-
-  if (fabsf(m_mu_set)>epsilon)
-    m_mu_set_log = copysign(log10(fabsf(m_mu_set)), m_mu_set);
-  else
-    m_mu_set_log = 0;
+  m_mu_ex_log  = fabsf( m_mu_ex)>epsilon ? copysign(log10(fabsf( m_mu_ex)),  m_mu_ex) : 0;
+  m_mu_ey_log  = fabsf( m_mu_ey)>epsilon ? copysign(log10(fabsf( m_mu_ey)),  m_mu_ey) : 0;
+  m_mu_set_log = fabsf(m_mu_set)>epsilon ? copysign(log10(fabsf(m_mu_set)), m_mu_set) : 0;
 
   HLT::ErrorCode status = makeOutputTE(tes_in, type_out);
   if(status != HLT::OK) return status;
@@ -423,25 +323,16 @@ HLT::ErrorCode TrigMissingETMuon::makeOutputTE(std::vector<std::vector<HLT::Trig
   HLT::ErrorCode status = HLT::OK;
   m_config->getNavigation()->copyAllFeatures(tes_in[0][0], outputTE);
   if (status != HLT::OK){
-    msg() << MSG::ERROR
-	  << "Write of xAOD::TrigMissingET feature into outputTE failed"
-	  << endmsg;
+    ATH_MSG_ERROR("Write of xAOD::TrigMissingET feature into outputTE failed");
     return status;
   }
 
-  // Some debug output:
-  if(msgLvl() <= MSG::DEBUG){
-    msg() << MSG::DEBUG
-	  << "We assume success, set TE with label "
-	  << " active to signal positive result."
-	  << endmsg;
-  }
+  ATH_MSG_DEBUG("We assume success, set TE with label active to signal positive result.");
+
 
   // CACHING
   // if we got here, everything was okay. so, we cache the feature for further execution of this instance in e.g. other MET Sequences:
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "Updated feature copied to output TE." << endmsg;
-  }
+  ATH_MSG_DEBUG("Updated feature copied to output TE.");
   m_useCachedResult = true;
   m_cachedTE = outputTE;
 
-- 
GitLab


From 8fa7b2ff88e819f740747a36e467c8ae5b131583 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 17:02:10 +0100
Subject: [PATCH 063/404] Const fix for
 ITrkVKalVrtFitter::setMassInputParticles

The input masses should be taken as const reference.
---
 .../TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h   | 4 ++--
 .../TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h    | 4 ++--
 .../TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx  | 4 ++--
 .../TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx          | 6 +++---
 .../TrigBphysHypo/src/TrigBphysHelperUtilsTool.h            | 6 +++---
 Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx  | 2 +-
 .../TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx    | 6 +++---
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h
index e3092ad7da3..f367be5cebf 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.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
 */
 
 // ITrkVKalVrtFitter.h  - old VKalVrtInterface
@@ -114,7 +114,7 @@ namespace Trk{
       virtual void setVertexForConstraint(double,double,double)=0;
       virtual void setCovVrtForConstraint(double,double,double,
                                           double,double,double)=0;
-      virtual void setMassInputParticles( std::vector<double>& )=0;
+      virtual void setMassInputParticles( const std::vector<double>& )=0;
       virtual void setDefault() =0;
       virtual void setZeroCharge(int)=0;
 //
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
index 3d8db24b31c..b34da3a0278 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.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
 */
 
 // TrkVKalVrtFitter.h
@@ -226,7 +226,7 @@ namespace Trk{
         void setVertexForConstraint(double,double,double);
         void setCovVrtForConstraint(double,double,double,double,double,double);
 				  
-        void setMassInputParticles( std::vector<double>& );
+        void setMassInputParticles( const std::vector<double>& );
         void setMomCovCalc(int);
         void setDefault();
         void setZeroCharge(int);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
index 00b6aff91ec..66bc669292a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.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
 */
 
 // Header include
@@ -274,7 +274,7 @@ namespace Trk{
      m_CovVrtForConstraint.push_back(ZZ);
   }			  
 
-  void TrkVKalVrtFitter::setMassInputParticles( std::vector<double>& mass)
+  void TrkVKalVrtFitter::setMassInputParticles( const std::vector<double>& mass)
   { m_MassInputParticles.clear();
     for(int i=0; i<(int)mass.size(); i++) m_MassInputParticles.push_back(fabs(mass[i]));
   }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx
index bf39cbc29eb..6a902c8c9d8 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.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
 */
 
 // TrigBphysHelperUtilsTool.cxx 
@@ -373,7 +373,7 @@ StatusCode TrigBphysHelperUtilsTool::buildDiMu(const std::vector<ElementLink<xAO
 
 StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
                                                const std::vector<ElementLink<xAOD::TrackParticleContainer> > &particles,
-                                               std::vector<double>& inputMasses) { // inputmasses not const, as vertex code doesn't allowit
+                                               const std::vector<double>& inputMasses) {
     ATH_MSG_DEBUG("In vertexFit" );
     if (!result) {
         ATH_MSG_DEBUG("Need to provide valid TrigBphys object" );
@@ -463,7 +463,7 @@ StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
 
 StatusCode TrigBphysHelperUtilsTool::vertexFit(xAOD::TrigBphys * result,
                                                const std::vector<const xAOD::TrackParticle*> &trks,
-                                               std::vector<double>& inputMasses) { // inputmasses not const, as vertex code doesn't allowit
+                                               const std::vector<double>& inputMasses) {
     ATH_MSG_DEBUG("In vertexFit" );
     if (!result) {
         ATH_MSG_DEBUG("Need to provide valid TrigBphys object" );
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h
index 58dcbef2e68..64851ca3142 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBphysHelperUtilsTool.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
 */
 
 
@@ -92,12 +92,12 @@ class TrigBphysHelperUtilsTool: virtual public ::AthAlgTool
     
     StatusCode vertexFit(xAOD::TrigBphys * result,
                          const std::vector<ElementLink<xAOD::TrackParticleContainer> > &particles,
-			 std::vector<double>& inputMasses);
+                         const std::vector<double>& inputMasses);
 
 
     StatusCode vertexFit(xAOD::TrigBphys * result,
 		       const std::vector<const xAOD::TrackParticle*> &trks,
-		       std::vector<double>& inputMasses);
+		       const std::vector<double>& inputMasses);
 
     // simplify this using templates perhaps? 
     double invariantMass(const xAOD::IParticle *p1, const xAOD::IParticle* p2, double m1, double m2) const;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
index abe2d286213..ef549e0d4f7 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBEEXFex.cxx
@@ -1308,7 +1308,7 @@ xAOD::TrigBphys* TrigEFBEEXFex::checkBplusEEKplus(const ElementLink<xAOD::TrackP
     ATH_MSG_DEBUG("Try to build B+ -> mu mu K+ with track " << *eltrack1 );
     float massKEE = KEEMass(*ellep1,*ellep2,*eltrack1);
     
-    static std::vector<double> masses = {KPLUSMASS,EMASS,EMASS};
+    static const std::vector<double> masses = {KPLUSMASS,EMASS,EMASS};
     
     if( !(massKEE > m_lowerKEEMassCut && massKEE < m_upperKEEMassCut) ) {
         ATH_MSG_DEBUG(" B+ -> mu mu K+ candidate rejected by mass cut: m = " << massKEE );
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx
index 8ffef67f3cf..57d8af4184d 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigEFBMuMuXFex.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
 */
 
 // vim: tabstop=2:shiftwidth=2:expandtab
@@ -2387,7 +2387,7 @@ xAOD::TrigBphys* TrigEFBMuMuXFex::checkBplusMuMuKplus(const ElementLink<xAOD::Tr
     ATH_MSG_DEBUG("Try to build B+ -> mu mu K+ with track " << *eltrack1 );
     float massKMuMu = KMuMuMass(*elmu1,*elmu2,*eltrack1);
     
-    static std::vector<double> masses = {KPLUSMASS,MUMASS,MUMASS};
+    static const std::vector<double> masses = {KPLUSMASS,MUMASS,MUMASS};
     
     if( !(massKMuMu > m_lowerKMuMuMassCut && massKMuMu < m_upperKMuMuMassCut) ) {
         ATH_MSG_DEBUG(" B+ -> mu mu K+ candidate rejected by mass cut: m = " << massKMuMu );
@@ -4355,4 +4355,4 @@ double TrigEFBMuMuXFex::XKPiPiMuMuMass(const xAOD::TrackParticle* mu1, const xAO
     bTracks.push_back(particle3);
     return m_bphysHelperTool->invariantMass(bTracks, massHypo);
     
-}
\ No newline at end of file
+}
-- 
GitLab


From 174cb591763178a9a25c92a21fe5b5fec250e51e Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 26 Feb 2019 13:02:03 +0100
Subject: [PATCH 064/404] Migrate TRTOverlay Algorithm to use thread-safe
 random number service

Switching `TRTOverlay` to use `IAthRNGSvc` will change the TRT Overlay
output as the random seeds will change slightly.

Also took the opportunity to update the syntax used for some other
configurable properties.
---
 .../InDetOverlay/InDetOverlay/TRTOverlay.h    | 27 +++++++------
 .../InDetOverlay/python/InDetOverlayConfig.py |  3 --
 .../InDetOverlay/src/TRTOverlay.cxx           | 39 ++++++-------------
 3 files changed, 25 insertions(+), 44 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
index 4bc4fba12cd..f733d00712f 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.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 INDETOVERLAY_TRTOVERLAY_H
@@ -8,7 +8,7 @@
 #include "IDC_OverlayBase/IDC_OverlayBase.h"
 #include "InDetRawData/TRT_RDO_Container.h"
 
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/IAthRNGSvc.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "InDetSimData/InDetSimDataCollection.h"
 #include "TRT_ElectronPidTools/ITRT_LocalOccupancy.h"
@@ -25,7 +25,7 @@ typedef InDetRawDataCollection<TRT_RDORawData> TRT_RDO_Collection;
 class TRTOverlay : public IDC_OverlayBase
 {
 public:
-  
+
   TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
   virtual StatusCode initialize();
@@ -39,13 +39,14 @@ private:
                             std::map<int, double> &occupancyMap,
                             const InDetSimDataCollection &SDO_Map);
 
-  void mergeTRTCollections(TRT_RDO_Collection *bkgCollection, 
-                           TRT_RDO_Collection *signalCollection, 
-                           TRT_RDO_Collection *outputCollection, 
-                           double occupancy, 
-                           const InDetSimDataCollection &SDO_Map);
+  void mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
+                           TRT_RDO_Collection *signalCollection,
+                           TRT_RDO_Collection *outputCollection,
+                           double occupancy,
+                           const InDetSimDataCollection &SDO_Map,
+                           CLHEP::HepRandomEngine* rndmEngine);
 
-  const TRT_ID *m_trtId;
+  const TRT_ID *m_trtId{};
 
   SG::ReadHandleKey<TRT_RDO_Container> m_bkgInputKey{this, "BkgInputKey", "OriginalEvent_SG+TRT_RDOs"," ReadHandleKey for Background Input TRT_RDO_Container"};
   SG::ReadHandleKey<TRT_RDO_Container> m_signalInputKey{this, "SignalInputKey", "BkgEvent_0_SG+TRT_RDOs", "ReadHandleKey for Signal Input TRT_RDO_Container"};
@@ -55,16 +56,14 @@ private:
   BooleanProperty m_includeBkg { this, "includeBkg", true, "Include Background RDO Container" };
 
   // Following tools, services and configurables are there only for the correct of HT hits
-  ServiceHandle<IAtRndmGenSvc> m_rndmSvc;
-  std::string                  m_rndmEngineName;
-  CLHEP::HepRandomEngine      *m_rndmEngine;
+  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"};      // Random number service
 
   double                                 m_HTOccupancyCorrectionB;
   double                                 m_HTOccupancyCorrectionEC;
   double                                 m_HTOccupancyCorrectionB_noE;
   double                                 m_HTOccupancyCorrectionEC_noE;
-  ToolHandle<InDet::ITRT_LocalOccupancy> m_TRT_LocalOccupancyTool; 
-  ServiceHandle<ITRT_StrawStatusSummarySvc>   m_TRTStrawSummarySvc;
+  ToolHandle<InDet::ITRT_LocalOccupancy> m_TRT_LocalOccupancyTool{this, "TRT_LocalOccupancyTool", "TRT_LocalOccupancy", ""};
+  ServiceHandle<ITRT_StrawStatusSummarySvc>   m_TRTStrawSummarySvc{this, "TRTStrawSummarySvc", "TRT_StrawStatusSummarySvc", ""};
 
 };
 
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/python/InDetOverlayConfig.py b/InnerDetector/InDetRawAlgs/InDetOverlay/python/InDetOverlayConfig.py
index 759f8e04e9d..089df11c04d 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/python/InDetOverlayConfig.py
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/python/InDetOverlayConfig.py
@@ -75,9 +75,6 @@ def getTRTOverlay(name="TRTOverlay", **kwargs):
 
     kwargs.setdefault("includeBkg", True);
 
-    kwargs.setdefault("RndmEngine", "TRTOverlay")
-    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc.get_Value())
-
     kwargs.setdefault("TRT_LocalOccupancyTool", "TRT_LocalOccupancy")
 
     # HT hit correction fraction
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index c4431e59184..72def77cadf 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.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
 */
 
-#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "AthenaKernel/RNGWrapper.h"
 #include "CLHEP/Random/RandomEngine.h"
 #include "CLHEP/Random/RandFlat.h"
 #include "CLHEP/Units/SystemOfUnits.h"
-#include "GeneratorObjects/McEventCollection.h"
+#include "HepMC/GenParticle.h"
 
 #include "InDetIdentifier/TRT_ID.h"
 #include "InDetOverlay/TRTOverlay.h"
@@ -65,25 +65,12 @@ namespace Overlay
 
 
 TRTOverlay::TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
-  : IDC_OverlayBase(name, pSvcLocator),
-    m_trtId(nullptr),
-    m_rndmSvc("AtRndmGenSvc",name),
-    m_rndmEngineName("TRTOverlay"),
-    m_rndmEngine(nullptr),
-    m_TRT_LocalOccupancyTool("TRT_LocalOccupancy",this),
-    m_TRTStrawSummarySvc("TRT_StrawStatusSummarySvc","TRT_StrawStatusSummarySvc")
+  : IDC_OverlayBase(name, pSvcLocator)
 {
-  declareProperty("RndmSvc", m_rndmSvc, "Random Number Service");
-  declareProperty("RndmEngine", m_rndmEngineName, "Random engine name");
-
-  declareProperty("TRT_LocalOccupancyTool", m_TRT_LocalOccupancyTool);
-
   declareProperty("TRT_HT_OccupancyCorrectionBarrel", m_HTOccupancyCorrectionB=0.110);
   declareProperty("TRT_HT_OccupancyCorrectionEndcap", m_HTOccupancyCorrectionEC=0.090);
   declareProperty("TRT_HT_OccupancyCorrectionBarrelNoE", m_HTOccupancyCorrectionB_noE=0.060);
   declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE", m_HTOccupancyCorrectionEC_noE=0.050);
-  
-  declareProperty("TRTStrawSummarySvc",  m_TRTStrawSummarySvc);  
 }
 
 StatusCode TRTOverlay::initialize()
@@ -113,13 +100,6 @@ StatusCode TRTOverlay::initialize()
 
   // Initialize random number generator
   CHECK(m_rndmSvc.retrieve());
-  m_rndmEngine = m_rndmSvc->GetEngine(m_rndmEngineName);
-  if (!m_rndmEngine) {
-    ATH_MSG_ERROR("Could not find RndmEngine : " << m_rndmEngineName);
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_DEBUG("Found RndmEngine : " << m_rndmEngineName);
-  }
 
   // Retrieve TRT local occupancy tool
   CHECK(m_TRT_LocalOccupancyTool.retrieve());
@@ -217,6 +197,10 @@ void TRTOverlay::overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
      }
    }
 
+   ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+   rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+   CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
+
    /** Add data from the signal container to the output one */
    TRT_RDO_Container::const_iterator p_signal = signalContainer->begin();
    TRT_RDO_Container::const_iterator p_signal_end = signalContainer->end();
@@ -238,7 +222,7 @@ void TRTOverlay::overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
          Retrieve q */
          std::unique_ptr <TRT_RDO_Collection> coll_bkg ((TRT_RDO_Collection *) *q);
          int det =  m_trtId->barrel_ec( (*p_signal)->identify() );
-         mergeTRTCollections(coll_bkg.get(), coll_signal.get(), coll_out.get(), occupancyMap[det], SDO_Map);
+         mergeTRTCollections(coll_bkg.get(), coll_signal.get(), coll_out.get(), occupancyMap[det], SDO_Map, rndmEngine);
 
          outputContainer->removeCollection(p_signal.hashId());
          if (outputContainer->addCollection(coll_out.release(), coll_id).isFailure() ) {
@@ -259,7 +243,8 @@ void TRTOverlay::mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
                                      TRT_RDO_Collection *signalCollection,
                                      TRT_RDO_Collection *outputCollection,
                                      double occupancy,
-                                     const InDetSimDataCollection& SDO_Map)
+                                     const InDetSimDataCollection& SDO_Map,
+                                     CLHEP::HepRandomEngine* rndmEngine)
 {
 
   if (bkgCollection->identify() != signalCollection->identify()) {
@@ -369,7 +354,7 @@ void TRTOverlay::mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
               HTOccupancyCorrection = abs(det) > 1 ? m_HTOccupancyCorrectionEC_noE : m_HTOccupancyCorrectionB_noE;
             }
 
-            if( isXenonStraw && occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1) )
+            if( isXenonStraw && occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot( rndmEngine, 0, 1) )
               newword += 1 << (26-9);
             //
             TRT_LoLumRawData newrdo( pr1->identify(), newword);
-- 
GitLab


From ef08f083da25f68d578b27fcf9d80dc0310f4c9a Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 11:48:07 +0100
Subject: [PATCH 065/404] Update overlay reference file to v9 as random seeds
 have changed in TRTOverlay

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index 53401f9f5bb..09236596115 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -24,5 +24,5 @@ ciRefFileMap = {
                 's3126-22.0'           : 'v2',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
-                'overlay-d1498-22.0'   : 'v8',
+                'overlay-d1498-22.0'   : 'v9',
                }
-- 
GitLab


From 262fd5f5500a1a9edbc155b35860c3ea4269c902 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 27 Feb 2019 17:12:37 +0100
Subject: [PATCH 066/404] fixed egammaRun test, tuned diagnostics

---
 .../src/TriggerEDMSerialiserTool.cxx          |   4 +-
 .../src/TriggerEDMSerialiserTool.h            |   2 +-
 .../TrigUpgradeTest/share/egammaRunData.ref   | 346 +++++++++---------
 3 files changed, 175 insertions(+), 177 deletions(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
index 0a5718ad93d..25d2072e59e 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
@@ -176,10 +176,8 @@ StatusCode TriggerEDMSerialiserTool::serialiseDynAux( DataObject* dObj, const Ad
 
     if ( mem ) delete [] static_cast<const char*>( mem );
     
-    ATH_MSG_DEBUG("Fragment size :" << fragment.size()*sizeof(uint32_t) << " bytes" );    
     buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
     ++nDynWritten;
-
   }
   return StatusCode::SUCCESS;
 }
@@ -205,7 +203,7 @@ StatusCode TriggerEDMSerialiserTool::serialiseContainer( void* data, const Addre
     if ( mem ) delete [] static_cast<const char*>( mem );
     
 
-    ATH_MSG_DEBUG("Fragment size :" << fragment.size()*sizeof(uint32_t) << " bytes");
+    ATH_MSG_DEBUG( address.transType << "#" << address.key << " Fragment size :" << fragment.size()*sizeof(uint32_t) << " bytes");
     fragment[0] = fragment.size();    
     buffer.insert( buffer.end(), fragment.begin(), fragment.end() );
     
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
index 7842c313969..b381cab8795 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
@@ -37,7 +37,7 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
   virtual StatusCode  initialize() override;
 
  private: 
-  Gaudi::Property<std::map<std::string,std::vector<uint16_t>>> m_collectionsToSerialize {
+  Gaudi::Property<std::map< std::string,std::vector<uint16_t> > > m_collectionsToSerialize {
     this, "CollectionsToSerialize", {},
     "EDM streaming map {collectionKey, moduleIdVec} where collectionKey is a string formatted like for "
     "AthenaOutputStream, e.g. TYPE#SG.aux1.aux2..etc. The type has to be an exact type, i.e. with _vN not the alias "
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
index 9278e815268..1cf0f1c5d49 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
@@ -1,176 +1,176 @@
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :348 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG     Fragment size including 68 bytes from 1x DynAux: 416 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :772 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG     Fragment size including 52 bytes from 1x DynAux: 824 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :716 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG     Fragment size including 892 bytes from 14x DynAux: 1608 bytes
-HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :632 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG     Fragment size including 124 bytes from 1x DynAux: 756 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1732 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG     Fragment size including 64 bytes from 1x DynAux: 1796 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2832 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG     Fragment size including 2180 bytes from 14x DynAux: 5012 bytes
-HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :824 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG     Fragment size including 144 bytes from 1x DynAux: 968 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :2372 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG     Fragment size including 72 bytes from 1x DynAux: 2444 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1728 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG     Fragment size including 1508 bytes from 14x DynAux: 3236 bytes
-HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :632 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG     Fragment size including 112 bytes from 1x DynAux: 744 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1732 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG     Fragment size including 64 bytes from 1x DynAux: 1796 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3292 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG     Fragment size including 2460 bytes from 14x DynAux: 5752 bytes
-HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :444 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG     Fragment size including 92 bytes from 1x DynAux: 536 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1092 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG     Fragment size including 56 bytes from 1x DynAux: 1148 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :992 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG     Fragment size including 1060 bytes from 14x DynAux: 2052 bytes
-HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :916 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG     Fragment size including 152 bytes from 1x DynAux: 1068 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :2692 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG     Fragment size including 76 bytes from 1x DynAux: 2768 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :4580 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG     Fragment size including 3244 bytes from 14x DynAux: 7824 bytes
-HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :348 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG     Fragment size including 72 bytes from 1x DynAux: 420 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :772 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG     Fragment size including 52 bytes from 1x DynAux: 824 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1176 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG     Fragment size including 1172 bytes from 14x DynAux: 2348 bytes
-HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :536 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG     Fragment size including 100 bytes from 1x DynAux: 636 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1412 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG     Fragment size including 60 bytes from 1x DynAux: 1472 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3016 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG     Fragment size including 2292 bytes from 14x DynAux: 5308 bytes
-HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :444 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG     Fragment size including 100 bytes from 1x DynAux: 544 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1092 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG     Fragment size including 56 bytes from 1x DynAux: 1148 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :808 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG     Fragment size including 948 bytes from 14x DynAux: 1756 bytes
-HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :252 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :452 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :440 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :632 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG     Fragment size including 144 bytes from 1x DynAux: 776 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1732 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG     Fragment size including 64 bytes from 1x DynAux: 1796 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3476 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG     Fragment size including 2572 bytes from 14x DynAux: 6048 bytes
-HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :348 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG     Fragment size including 68 bytes from 1x DynAux: 416 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :772 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG     Fragment size including 52 bytes from 1x DynAux: 824 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :808 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG     Fragment size including 948 bytes from 14x DynAux: 1756 bytes
-HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :1012 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG     Fragment size including 196 bytes from 1x DynAux: 1208 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :3012 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG     Fragment size including 80 bytes from 1x DynAux: 3092 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3844 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG     Fragment size including 2796 bytes from 14x DynAux: 6640 bytes
-HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :444 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG     Fragment size including 104 bytes from 1x DynAux: 548 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1092 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG     Fragment size including 56 bytes from 1x DynAux: 1148 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :2464 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG     Fragment size including 1956 bytes from 14x DynAux: 4420 bytes
-HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :348 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG     Fragment size including 72 bytes from 1x DynAux: 420 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :772 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG     Fragment size including 52 bytes from 1x DynAux: 824 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :716 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG     Fragment size including 892 bytes from 14x DynAux: 1608 bytes
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :252 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :452 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :440 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :348 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG     Fragment size including 64 bytes from 1x DynAux: 412 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :772 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG     Fragment size including 52 bytes from 1x DynAux: 824 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :440 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :444 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG     Fragment size including 104 bytes from 1x DynAux: 548 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1092 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG     Fragment size including 56 bytes from 1x DynAux: 1148 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :1360 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG     Fragment size including 1284 bytes from 14x DynAux: 2644 bytes
-HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :444 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG     Fragment size including 100 bytes from 1x DynAux: 544 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1092 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG     Fragment size including 56 bytes from 1x DynAux: 1148 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :808 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG     Fragment size including 948 bytes from 14x DynAux: 1756 bytes
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigCompositeAuxContainer_v2#remap_EgammaCaloDecisionsAux. Fragment size :536 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG     Fragment size including 92 bytes from 1x DynAux: 628 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigCompositeContainer_v1#remap_EgammaCaloDecisions Fragment size :152 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigEMClusterAuxContainer_v2#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :1412 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG     Fragment size including 60 bytes from 1x DynAux: 1472 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigEMClusterContainer_v1#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :172 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigElectronAuxContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :3292 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG     Fragment size including 2460 bytes from 14x DynAux: 5752 bytes
-HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigElectronContainer_v1#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :168 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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
+HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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          14  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
+HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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
+HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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          18  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 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        
-- 
GitLab


From d1d88d3a17b4ae879a2a4ae98faa736e96f23ef2 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 16:53:07 +0100
Subject: [PATCH 067/404] Switch to using a simpler Algorithm for CSC Digit to
 RDO conversion during Overlay

Based on the discussion in ATLASSIM-3813 it is no longer necessary to support
producing CSCRDOs with two samples rather than the current standard of four, so
we can switch to a simpler Digit to RDO conversion Algorithm which only supports
the latter.
---
 .../share/MuonOverlay_jobOptions.py                          | 2 +-
 .../python/MuonByteStreamCnvTestConfig.py                    | 5 +++++
 .../python/MuonByteStreamCnvTestConfigDb.py                  | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
index 3089e0fda30..a0a6b12b426 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/MuonOverlay_jobOptions.py
@@ -34,7 +34,7 @@ if DetFlags.overlay.MDT_on() or DetFlags.overlay.CSC_on() or DetFlags.overlay.RP
 
     if DetFlags.overlay.CSC_on():
         job += CfgGetter.getAlgorithm("CscOverlayDigitBuilder")
-        job += CfgGetter.getAlgorithm("CscOverlayDigitToRDO")
+        job += CfgGetter.getAlgorithm("OverlayCscDigitToCscRDO")
         job += CfgGetter.getAlgorithm("CscOverlay")
         if not overlayFlags.isDataOverlay():
             job += CfgGetter.getAlgorithm("CscTruthOverlay")
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfig.py b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfig.py
index a9070f20eeb..b486572625c 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfig.py
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfig.py
@@ -71,6 +71,11 @@ def getSigTgcDigitToTgcRDO(name="SigTgcDigitToTgcRDO", **kwargs):
     return CfgMgr.TgcDigitToTgcRDO(name, **kwargs)
 
 
+def getOverlayCscDigitToCscRDO(name="OverlayCscDigitToCscRDO", **kwargs):
+    kwargs.setdefault("CscDigitToRDOTool","CscDigitToCscRDOTool4")
+    return CfgMgr.CscDigitToCscRDO(name, **kwargs)
+
+
 def getOverlayMdtDigitToMdtRDO(name="OverlayMdtDigitToMdtRDO", **kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
     kwargs.setdefault("InputObjectName",overlayFlags.outputStore()+"+MDT_DIGITS")
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py
index 2e976381d2b..585691bf4ca 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/python/MuonByteStreamCnvTestConfigDb.py
@@ -12,6 +12,7 @@ addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getTgcRdoToTgcDi
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigMdtDigitToMdtRDO" , "SigMdtDigitToMdtRDO")
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigRpcDigitToRpcRDO" , "SigRpcDigitToRpcRDO")
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getSigTgcDigitToTgcRDO" , "SigTgcDigitToTgcRDO")
+addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayCscDigitToCscRDO" , "OverlayCscDigitToCscRDO")
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayMdtDigitToMdtRDO" , "OverlayMdtDigitToMdtRDO")
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayRpcDigitToRpcRDO" , "OverlayRpcDigitToRpcRDO")
 addAlgorithm("MuonByteStreamCnvTest.MuonByteStreamCnvTestConfig.getOverlayTgcDigitToTgcRDO" , "OverlayTgcDigitToTgcRDO")
-- 
GitLab


From 65e2a9290a42f80cae04550212e7c23f41ff1b53 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 16:55:52 +0100
Subject: [PATCH 068/404] Remove obsolete CscOverlayDigitToRDO Algorithm

---
 .../CscOverlay/CscOverlayDigitToRDO.h         | 30 --------
 .../CscOverlay/python/CscOverlayConfig.py     | 10 ---
 .../CscOverlay/python/CscOverlayConfigDb.py   |  1 -
 .../CscOverlay/src/CscOverlayDigitToRDO.cxx   | 68 -------------------
 .../src/components/CscOverlay_entries.cxx     |  2 -
 5 files changed, 111 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
 delete mode 100644 MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx

diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
deleted file mode 100644
index 7a5c08d5d11..00000000000
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlayDigitToRDO.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef CSCOVERLAY_CSCOVERLAYDIGITTORDO_H
-#define CSCOVERLAY_CSCOVERLAYDIGITTORDO_H
-
-#include <string>
-
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "MuonDigToolInterfaces/IMuonDigitizationTool.h"
-
-#include "MuonRDO/CscRawDataContainer.h"
-
-class CscOverlayDigitToRDO : public AthAlgorithm  {
-public:
-  CscOverlayDigitToRDO(const std::string &name, ISvcLocator *pSvcLocator);
-  virtual ~CscOverlayDigitToRDO() = default;
-  /** Framework implemenrtation for the event loop */
-  virtual StatusCode initialize() override final;
-  virtual StatusCode execute() override final;
-
-private:
-  SG::ReadHandleKey<CscRawDataContainer> m_inputBkgRDOKey{this,"InputBkgRDOKey","OriginalEvent_SG+CSCRDO",""};
-  ToolHandle<IMuonDigitizationTool> m_rdoTool2{this, "MakeRDOTool2", "CscDigitToCscRDOTool2", ""};
-  ToolHandle<IMuonDigitizationTool> m_rdoTool4{this, "MakeRDOTool4", "CscDigitToCscRDOTool4", ""};
-};
-
-#endif/*CSCOVERLAY_CSCOVERLAYDIGITTORDO_H*/
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
index 76e1333a632..5135ff83567 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfig.py
@@ -7,13 +7,3 @@ def getCscOverlay(name="CscOverlay", **kwargs):
 
     from AthenaCommon import CfgMgr
     return CfgMgr.CscOverlay(name,**kwargs)
-
-
-def getCscOverlayDigitToRDO(name="CscOverlayDigitToRDO", **kwargs):
-    from OverlayCommonAlgs.OverlayFlags import overlayFlags
-    kwargs.setdefault("InputBkgRDOKey", overlayFlags.dataStore()+"+CSCRDO")
-    kwargs.setdefault("MakeRDOTool2", "CscDigitToCscRDOTool2")
-    kwargs.setdefault("MakeRDOTool4", "CscDigitToCscRDOTool4")
-
-    from AthenaCommon import CfgMgr
-    return CfgMgr.CscOverlayDigitToRDO(name,**kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
index 5e224e49d71..34eabc4ad87 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/python/CscOverlayConfigDb.py
@@ -1,3 +1,2 @@
 from AthenaCommon.CfgGetter import addAlgorithm
 addAlgorithm("CscOverlay.CscOverlayConfig.getCscOverlay", "CscOverlay")
-addAlgorithm("CscOverlay.CscOverlayConfig.getCscOverlayDigitToRDO", "CscOverlayDigitToRDO")
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx
deleted file mode 100644
index 90650f03d82..00000000000
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlayDigitToRDO.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "CscOverlay/CscOverlayDigitToRDO.h"
-
-#include "StoreGate/ReadHandle.h"
-
-//================================================================
-CscOverlayDigitToRDO::CscOverlayDigitToRDO(const std::string &name, ISvcLocator *pSvcLocator) :
-  AthAlgorithm(name, pSvcLocator)
-{
-}
-
-//================================================================
-StatusCode CscOverlayDigitToRDO::initialize()
-{
-  ATH_MSG_INFO("CscOverlayDigitToRDO initialized");
-
-  ATH_CHECK(m_rdoTool2.retrieve());
-  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 2.");
-
-  ATH_CHECK(m_rdoTool4.retrieve());
-  ATH_MSG_DEBUG("Retrieved CSC Digit -> RDO Tool 4.");
-
-  ATH_CHECK( m_inputBkgRDOKey.initialize() );
-  return StatusCode::SUCCESS;
-}
-
-//================================================================
-StatusCode CscOverlayDigitToRDO::execute() {
-  ATH_MSG_DEBUG("CscOverlayDigitToRDO::execute() begin");
-  //----------------------------------------------------------------
-  unsigned int numsamples=0;//to be determined from the data
-  SG::ReadHandle<CscRawDataContainer> inputBkgRDO(m_inputBkgRDOKey);
-  if(!inputBkgRDO.isValid()) {
-    ATH_MSG_WARNING("Could not get background CscRawDataContainer  \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
-    return StatusCode::SUCCESS;
-  }
-  ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
-  if ((inputBkgRDO->begin()==inputBkgRDO->end()) || !*(inputBkgRDO->begin())){
-        ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
-  }
-  else{
-    numsamples=inputBkgRDO->begin()->numSamples();
-  }
-
-  if (numsamples==2) {
-    if ( m_rdoTool2->digitize().isFailure() ) {
-      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 2 failed ");
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_DEBUG("Digitizing with 2 samples");
-  }
-  else if (numsamples==4) {
-    if ( m_rdoTool4->digitize().isFailure() ) {
-      ATH_MSG_WARNING("On the fly CSC Digit -> RDO 4 failed ");
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_DEBUG("Digitizing with 4 samples");
-  }
-  else{
-    ATH_MSG_WARNING("On the fly CSC Digit -> RDO failed - not 2 or 4 samples!");
-    //return StatusCode::SUCCESS;
-  }
-  ATH_MSG_DEBUG("CscOverlayDigitToRDO::execute() end");
-  return StatusCode::SUCCESS;
-}
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
index b2c1d874a32..d7d673cb4a2 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/components/CscOverlay_entries.cxx
@@ -1,6 +1,4 @@
 #include "CscOverlay/CscOverlay.h"
-#include "CscOverlay/CscOverlayDigitToRDO.h"
 
 DECLARE_COMPONENT( CscOverlay )
-DECLARE_COMPONENT( CscOverlayDigitToRDO )
 
-- 
GitLab


From 4c79999437e9bd90470f5eb3d174bcfb2907b384 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 16:58:15 +0100
Subject: [PATCH 069/404] Drop unnecessary checks on CscRawData::numSamples()
 from CscOverlay::execute

---
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx | 26 +++++++------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index 9a4faae036c..aa847d094ed 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -54,7 +54,6 @@ StatusCode CscOverlay::initialize()
 StatusCode CscOverlay::execute() {
   ATH_MSG_DEBUG("CscOverlay::execute() begin");
   //----------------------------------------------------------------
-  unsigned int numsamples=0;//to be determined from the data
   SG::ReadHandle<CscRawDataContainer> inputBkgRDO(m_bkgInputKey);
   if(!inputBkgRDO.isValid()) {
     ATH_MSG_WARNING("Could not get background CscRawDataContainer  \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
@@ -62,24 +61,19 @@ StatusCode CscOverlay::execute() {
   }
   ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
   if ((inputBkgRDO->begin()==inputBkgRDO->end()) || !*(inputBkgRDO->begin())){
-        ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
+    ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
   }
-  else{
-    numsamples=inputBkgRDO->begin()->numSamples();
-  }
-
-  if (numsamples>0) {
-    ATH_MSG_DEBUG("Retrieving signal input CSC container");
-    SG::ReadHandle<CscRawDataContainer> inputSignalRDO(m_signalInputKey);
-    if(!inputSignalRDO.isValid()) {
-      ATH_MSG_WARNING("Could not get signal CscRawDataContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_VERBOSE("Found CscRawOverlayContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
 
-    /* now do the overlay */
-    this->overlayContainer(inputBkgRDO.cptr(), inputSignalRDO.cptr());
+  ATH_MSG_DEBUG("Retrieving signal input CSC container");
+  SG::ReadHandle<CscRawDataContainer> inputSignalRDO(m_signalInputKey);
+  if(!inputSignalRDO.isValid()) {
+    ATH_MSG_WARNING("Could not get signal CscRawDataContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
+    return StatusCode::SUCCESS;
   }
+  ATH_MSG_VERBOSE("Found CscRawOverlayContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
+
+  /* now do the overlay */
+  this->overlayContainer(inputBkgRDO.cptr(), inputSignalRDO.cptr());
 
   //----------------------------------------------------------------
   ATH_MSG_DEBUG("CscOverlay::execute() end");
-- 
GitLab


From e8590bdc17850d6ee309810b7d104160f4deda58 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 17:49:45 +0100
Subject: [PATCH 070/404] TrigL2CaloRinger: Use AsgMessaging as base class

Use AsgMessaging as base class for messaging.
---
 .../TrigEgammaL2CaloRingerSelectorTool.cxx    |  1 -
 .../TrigMultiVarHypo/CMakeLists.txt           | 15 +++++++-------
 .../tools/TrigL2CaloRingerReader.h            | 20 +++++--------------
 .../src/TrigL2CaloRingerFex.cxx               |  1 -
 .../src/TrigL2CaloRingerHypo.cxx              |  1 -
 .../src/tools/TrigL2CaloRingerReader.cxx      |  5 +++--
 6 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaL2CaloRingerSelectorTool.cxx b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaL2CaloRingerSelectorTool.cxx
index cd4c9c9fe1d..e4fb9df3e55 100644
--- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaL2CaloRingerSelectorTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaL2CaloRingerSelectorTool.cxx
@@ -35,7 +35,6 @@ TrigEgammaL2CaloRingerSelectorTool( const std::string& myname )
   declareProperty("CalibPathThresholds", m_calibPath_thresholds=""            );
 
   m_output    = 0;
-  m_reader.setMsgStream(msg());
   m_useLumiVar=false;
   m_useEtaVar=false;
 
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigMultiVarHypo/CMakeLists.txt
index 35fc2753b25..70931bd15fd 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/CMakeLists.txt
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/CMakeLists.txt
@@ -9,6 +9,7 @@ atlas_subdir( TrigMultiVarHypo )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
+                          Control/AthToolSupport/AsgTools
                           Event/xAOD/xAODTrigCalo
                           Event/xAOD/xAODTrigRinger
                           Trigger/TrigEvent/TrigCaloEvent
@@ -28,17 +29,17 @@ atlas_add_library( TrigMultiVarHypoLib
                    src/tools/*.cxx
                    src/preproc/*.cxx
                    PUBLIC_HEADERS TrigMultiVarHypo
-                   LINK_LIBRARIES xAODTrigCalo xAODTrigRinger TrigCaloEvent
-		   TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib
-		   LumiBlockCompsLib PathResolver DecisionHandlingLib
+                   LINK_LIBRARIES AsgTools xAODTrigCalo xAODTrigRinger TrigCaloEvent
+                   TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib
+                   LumiBlockCompsLib PathResolver DecisionHandlingLib
                    PRIVATE_LINK_LIBRARIES GaudiKernel AthViews )
 
 atlas_add_component( TrigMultiVarHypo
                      src/components/*.cxx
-                     LINK_LIBRARIES xAODTrigCalo xAODTrigRinger TrigCaloEvent
-		     TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib
-		     GaudiKernel TrigMultiVarHypoLib PathResolver
-		     LumiBlockCompsLib DecisionHandlingLib)
+                     LINK_LIBRARIES AsgTools xAODTrigCalo xAODTrigRinger TrigCaloEvent
+                     TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib
+                     GaudiKernel TrigMultiVarHypoLib PathResolver
+                     LumiBlockCompsLib DecisionHandlingLib)
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/tools/TrigL2CaloRingerReader.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/tools/TrigL2CaloRingerReader.h
index ca19d0b7dec..71ff2a8f516 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/tools/TrigL2CaloRingerReader.h
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/tools/TrigL2CaloRingerReader.h
@@ -7,18 +7,19 @@
 //#include "TrigMultiVarHypo/preproc/TrigRingerPreprocessor.h"
 #include "TrigMultiVarHypo/tools/TrigRingerHelper.h"
 #include "TrigMultiVarHypo/tools/MultiLayerPerceptron.h"
+
+#include "AsgTools/AsgMessaging.h"
 #include "PathResolver/PathResolver.h"
-#include "GaudiKernel/MsgStream.h"
 #include <vector>
 #include <string>
 #include "TTree.h"
 #include "TFile.h"
 
-class TrigL2CaloRingerReader{
+class TrigL2CaloRingerReader : public asg::AsgMessaging {
 
   public:
     /* constructor */
-    TrigL2CaloRingerReader( std::string );
+    TrigL2CaloRingerReader(const std::string& name);
     /* destructor */
     ~TrigL2CaloRingerReader();
     /* use this methods to retrieve the tools from the archieve */
@@ -36,27 +37,16 @@ class TrigL2CaloRingerReader{
     bool  doPileupCorrection(){return m_doPileupCorrection;};
     /* return the threshold lumi */
     int lumiCut(){return m_lumiCut;};
-    /* use this to set the messenger stream output */
-    void setMsgStream( MsgStream &msg ){
-       m_log = new MsgStream(msg);
-    }
-
 
   private:
     // Use this to retrieve all branch values
     template <class T>
     void InitBranch(TTree* fChain, std::string branch_name, T* param);
-    // msg output 
-    MsgStream& msg() const{
-       return (*m_log);
-    }
-    
+
     std::string m_name;
     
     int m_version;
     
-    MsgStream *m_log;
-
     // archieve variables holder
     int  m_lumiCut;
     bool m_useEtaVar;
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
index 35ddc377234..ead3fd197d4 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerFex.cxx
@@ -38,7 +38,6 @@ TrigL2CaloRingerFex::TrigL2CaloRingerFex(const std::string& name, ISvcLocator* p
   declareProperty("LuminosityTool"    , m_lumiBlockMuTool, "Luminosity Tool"  );
   declareMonitoredVariable("NeuralNetworkOutput", m_output                    );
   
-  m_reader.setMsgStream(msg());
   m_useLumiVar=false;
   m_useEtaVar=false;
   m_key       = "";
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
index d9f3f087df9..7be8014552a 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypo.cxx
@@ -25,7 +25,6 @@ TrigL2CaloRingerHypo::TrigL2CaloRingerHypo(const std::string& name, ISvcLocator*
   declareProperty("CalibPath"         , m_calibPath = ""                      );
   declareProperty("HltFeature"        , m_hlt_feature = "TrigRingerNeuralFex" );  
   
-  m_reader.setMsgStream(msg());
   m_useNoActivationFunctionInTheLastLayer=false;
   m_doPileupCorrection=false;
   m_lumiCut=50;
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/TrigL2CaloRingerReader.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/TrigL2CaloRingerReader.cxx
index 6b0a2d91b5a..7df0907ad7c 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/TrigL2CaloRingerReader.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/TrigL2CaloRingerReader.cxx
@@ -10,9 +10,10 @@
 // Use this to find the absoluty path
 #include "PathResolver/PathResolver.h"
 
-TrigL2CaloRingerReader::TrigL2CaloRingerReader(std::string  name):m_name(name)
+TrigL2CaloRingerReader::TrigL2CaloRingerReader(const std::string& name) :
+  asg::AsgMessaging(name),
+  m_name(name)
 {
-  //m_log = new MsgStream(0, m_name);
   m_etaBins=nullptr;
   m_etBins=nullptr;
   m_thresholds=nullptr;
-- 
GitLab


From 71bcb70eefc8aa7a987f4c5ebec9b39a46d14175 Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <gemmeren@anl.gov>
Date: Wed, 27 Feb 2019 11:07:32 -0600
Subject: [PATCH 071/404] Remove reference to library that is no longer
 needed/build.

---
 Database/AthenaPOOL/RootFileTools/CMakeLists.txt | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Database/AthenaPOOL/RootFileTools/CMakeLists.txt b/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
index b33ff5d69af..3773d2b516f 100644
--- a/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
+++ b/Database/AthenaPOOL/RootFileTools/CMakeLists.txt
@@ -15,14 +15,11 @@ atlas_depends_on_subdirs( PUBLIC
 # External dependencies:
 find_package( ROOT COMPONENTS RIO Core Tree MathCore Hist pthread )
 
-# this line failed automatic conversion in cmt2cmake :
-# action releaseFileCache "$(cpp_name) $(src)releaseFileCache.cxx -o $(bin)releaseFileCache.exe;mkdir -p $(CMTINSTALLAREA)/$(tag)/bin; cd $(CMTINSTALLAREA)/$(tag)/bin;rm -f releaseFileCache.exe; ln -s ../../../Database/AthenaPOOL/RootFileTools/$(tag)/releaseFileCache.exe releaseFileCache.exe "
-
 # Component(s) in the package:
 atlas_add_executable( mergePOOL
                       src/merge.cxx
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel RootFileToolsLib )
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} GaudiKernel AthenaBaseComps PersistentDataModel )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
-- 
GitLab


From ab2e5288f38e3af1160fc9a3e497f0bddd616ca4 Mon Sep 17 00:00:00 2001
From: Sven Menke <sven.menke@cern.ch>
Date: Wed, 27 Feb 2019 18:14:37 +0100
Subject: [PATCH 072/404] RadiationMapsMaker: porting latest 21.0 additions to
 master (2 more rad maps)

---
 .../G4UserActions/RadiationMapsMaker.h        | 12 ++++
 .../G4UserActions/src/RadiationMapsMaker.cxx  | 58 +++++++++++++++--
 .../src/RadiationMapsMakerTool.cxx            | 62 +++++++++++++++++++
 3 files changed, 126 insertions(+), 6 deletions(-)

diff --git a/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h b/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
index b4628348009..34dfd248d8b 100644
--- a/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
+++ b/Simulation/G4Utilities/G4UserActions/G4UserActions/RadiationMapsMaker.h
@@ -65,6 +65,10 @@ namespace G4UA
 	std::vector<double> m_rz_niel;
         /// vector of >20 MeV hadron flux seen by thread in zoomed area
 	std::vector<double> m_rz_h20;
+        /// vector of >100 keV hadron flux seen by thread in zoomed area
+	std::vector<double> m_rz_neut;
+        /// vector of charged hadron flux seen by thread in zoomed area
+	std::vector<double> m_rz_chad;
 
 	///  next two vectors are used only in case maps are needed for a particular material instead of all
 
@@ -81,6 +85,10 @@ namespace G4UA
 	std::vector<double> m_full_rz_niel;
         /// vector of >20 MeV hadron flux seen by thread in full area
 	std::vector<double> m_full_rz_h20;
+        /// vector of >100 keV hadron flux seen by thread in full area
+	std::vector<double> m_full_rz_neut;
+        /// vector of charged hadron flux seen by thread in full area
+	std::vector<double> m_full_rz_chad;
 
 	///  next two vectors are used only in case maps are needed for a particular material instead of all
 
@@ -97,6 +105,10 @@ namespace G4UA
 	std::vector<double> m_3d_niel;
         /// vector of >20 MeV hadron flux seen by thread in 3d
 	std::vector<double> m_3d_h20;
+        /// vector of >100 keV hadron flux seen by thread in 3d
+	std::vector<double> m_3d_neut;
+        /// vector of charged hadron flux seen by thread in 3d
+	std::vector<double> m_3d_chad;
 
 	///  next two vectors are used only in case maps are needed for a particular material instead of all
 
diff --git a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
index 70155768108..1647b4bec83 100644
--- a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMaker.cxx
@@ -74,12 +74,16 @@ namespace G4UA{
       m_rz_eion[i] += maps.m_rz_eion[i];
       m_rz_niel[i] += maps.m_rz_niel[i];
       m_rz_h20 [i] += maps.m_rz_h20 [i];
+      m_rz_neut[i] += maps.m_rz_neut[i];
+      m_rz_chad[i] += maps.m_rz_chad[i];
 
       // full 2d
       m_full_rz_tid [i] += maps.m_full_rz_tid [i];
       m_full_rz_eion[i] += maps.m_full_rz_eion[i];
       m_full_rz_niel[i] += maps.m_full_rz_niel[i];
       m_full_rz_h20 [i] += maps.m_full_rz_h20 [i];
+      m_full_rz_neut[i] += maps.m_full_rz_neut[i];
+      m_full_rz_chad[i] += maps.m_full_rz_chad[i];
     }
 
     for(unsigned int i=0;i<maps.m_rz_vol.size();i++) {
@@ -97,6 +101,8 @@ namespace G4UA{
       m_3d_eion[i] += maps.m_3d_eion[i];
       m_3d_niel[i] += maps.m_3d_niel[i];
       m_3d_h20 [i] += maps.m_3d_h20 [i];
+      m_3d_neut[i] += maps.m_3d_neut[i];
+      m_3d_chad[i] += maps.m_3d_chad[i];
     }
 
     for(unsigned int i=0;i<maps.m_3d_vol.size();i++) {
@@ -114,16 +120,22 @@ namespace G4UA{
     m_maps.m_rz_eion.resize(0);
     m_maps.m_rz_niel.resize(0);
     m_maps.m_rz_h20 .resize(0);
+    m_maps.m_rz_neut.resize(0);
+    m_maps.m_rz_chad.resize(0);
 
     m_maps.m_full_rz_tid .resize(0);
     m_maps.m_full_rz_eion.resize(0);
     m_maps.m_full_rz_niel.resize(0);
     m_maps.m_full_rz_h20 .resize(0);
+    m_maps.m_full_rz_neut.resize(0);
+    m_maps.m_full_rz_chad.resize(0);
 
     m_maps.m_3d_tid .resize(0);
     m_maps.m_3d_eion.resize(0);
     m_maps.m_3d_niel.resize(0);
     m_maps.m_3d_h20 .resize(0);
+    m_maps.m_3d_neut.resize(0);
+    m_maps.m_3d_chad.resize(0);
 
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
@@ -141,16 +153,22 @@ namespace G4UA{
     m_maps.m_rz_eion.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     m_maps.m_rz_niel.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     m_maps.m_rz_h20 .resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    m_maps.m_rz_neut.resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    m_maps.m_rz_chad.resize(m_config.nBinsz*m_config.nBinsr,0.0);
 
     m_maps.m_full_rz_tid .resize(m_config.nBinsz*m_config.nBinsr,0.0);
     m_maps.m_full_rz_eion.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     m_maps.m_full_rz_niel.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     m_maps.m_full_rz_h20 .resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    m_maps.m_full_rz_neut.resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    m_maps.m_full_rz_chad.resize(m_config.nBinsz*m_config.nBinsr,0.0);
 
     m_maps.m_3d_tid .resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     m_maps.m_3d_eion.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     m_maps.m_3d_niel.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     m_maps.m_3d_h20 .resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
+    m_maps.m_3d_neut.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
+    m_maps.m_3d_chad.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
 
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
@@ -223,8 +241,7 @@ namespace G4UA{
 	       aStep->GetTrack()->GetDefinition()==G4KaonZeroLong::Definition() ||
 	       aStep->GetTrack()->GetDefinition()==G4KaonZero::Definition() ||
 	       aStep->GetTrack()->GetDefinition()==G4AntiKaonZero::Definition() ||
-	       aStep->GetTrack()->GetDefinition()==G4PionZero::Definition() ||
-	       aStep->GetTrack()->GetDefinition()==G4KaonPlus::Definition()){
+	       aStep->GetTrack()->GetDefinition()==G4PionZero::Definition()){
       pdgid=8; // particles not charged pions treated as charged pions for NIEL 
 
     } else if (aStep->GetTrack()->GetDefinition()==G4AntiProton::Definition() ||
@@ -259,12 +276,14 @@ namespace G4UA{
 	pdgid = 9;
       }
     }
-    // process NIEL, h20 and Edep particles only
+    // process NIEL, h20, Edep, NEUT and CHAD particles only
 
     if ( pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 || /* NIEL & h20*/
 	 aStep->GetTotalEnergyDeposit() > 0 || pdgid == 999) {
       
     
+      double absq = fabs(aStep->GetTrack()->GetDefinition()->GetPDGCharge());
+
       double rho = aStep->GetTrack()->GetMaterial()->GetDensity()/CLHEP::g*CLHEP::cm3; 
 
       bool goodMaterial(false);
@@ -333,7 +352,8 @@ namespace G4UA{
       double dE_NIEL = aStep->GetNonIonizingEnergyDeposit()/nStep;
       double dE_ION = dE_TOT-dE_NIEL;
       
-      if ( weight > 0 || eKin > 20 || dE_TOT > 0 || pdgid == 999) {
+      //   NIEL          SEE          TID           NEUT                                          CHAD                                                    geantino  
+      if ( weight > 0 || eKin > 20 || dE_TOT > 0 || ((pdgid == 6 || pdgid == 7) && eKin > 0.1) || (absq>0 && (pdgid == 1 || pdgid == 2 || pdgid == 8 || pdgid == 9)) || pdgid == 999 ) {
 
 	for(unsigned int i=0;i<nStep;i++) {
 	  double absz = fabs(z0+dz*(i+0.5));
@@ -395,6 +415,7 @@ namespace G4UA{
 	    }
 	  }
 	  
+	  // TID & EION
 	  if ( goodMaterial && vBinZoom >=0 ) {
 	    if ( pdgid == 999 ) {
 	      m_maps.m_rz_tid [vBinZoom] += 1;
@@ -425,9 +446,9 @@ namespace G4UA{
 	      m_maps.m_3d_eion[vBin3d] += dE_ION;
 	    }
 	  }
-	    
+
 	  if ( goodMaterial && (pdgid == 1 || pdgid == 2 || pdgid == 4 || pdgid == 5 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9 )) {
-	    
+	    // NIEL
 	    if ( weight > 0 ) {
 	      if ( vBinZoom >=0 ) {
 		m_maps.m_rz_niel [vBinZoom] += weight*dl;
@@ -439,6 +460,7 @@ namespace G4UA{
 		m_maps.m_3d_niel [vBin3d] += weight*dl;
 	      }
 	    }
+	    // SEE
 	    if ( eKin > 20 && (pdgid == 1 || pdgid == 2 || pdgid == 6 || pdgid == 7 || pdgid == 8 || pdgid == 9) ) {
 	      if ( vBinZoom >=0 ) {
 		m_maps.m_rz_h20 [vBinZoom] += dl;
@@ -450,6 +472,30 @@ namespace G4UA{
 		m_maps.m_3d_h20 [vBin3d] += dl;
 	      }
 	    }
+	    // NEUT
+	    if ( eKin > 0.1 && (pdgid == 6 || pdgid == 7 ) ) {
+	      if ( vBinZoom >=0 ) {
+		m_maps.m_rz_neut [vBinZoom] += dl;
+	      }
+	      if ( vBinFull >=0 ) {
+		m_maps.m_full_rz_neut [vBinFull] += dl;
+	      }
+	      if ( vBin3d >=0 ) {
+		m_maps.m_3d_neut [vBin3d] += dl;
+	      }
+	    }
+	    // CHAD
+	    if ( absq > 0 && (pdgid == 1 || pdgid == 2 || pdgid == 8 || pdgid == 9 ) ) {
+	      if ( vBinZoom >=0 ) {
+		m_maps.m_rz_chad [vBinZoom] += dl;
+	      }
+	      if ( vBinFull >=0 ) {
+		m_maps.m_full_rz_chad [vBinFull] += dl;
+	      }
+	      if ( vBin3d >=0 ) {
+		m_maps.m_3d_chad [vBin3d] += dl;
+	      }
+	    }
 	  }
 	  if (!m_config.material.empty()) {
 	    // need volume fraction only if particular material is selected
diff --git a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
index 1f4b7074090..de6c9f17a0f 100644
--- a/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/RadiationMapsMakerTool.cxx
@@ -81,16 +81,22 @@ namespace G4UA{
     maps.m_rz_eion.resize(0);
     maps.m_rz_niel.resize(0);
     maps.m_rz_h20 .resize(0);
+    maps.m_rz_neut.resize(0);
+    maps.m_rz_chad.resize(0);
 
     maps.m_full_rz_tid .resize(0);
     maps.m_full_rz_eion.resize(0);
     maps.m_full_rz_niel.resize(0);
     maps.m_full_rz_h20 .resize(0);
+    maps.m_full_rz_neut.resize(0);
+    maps.m_full_rz_chad.resize(0);
 
     maps.m_3d_tid .resize(0);
     maps.m_3d_eion.resize(0);
     maps.m_3d_niel.resize(0);
     maps.m_3d_h20 .resize(0);
+    maps.m_3d_neut.resize(0);
+    maps.m_3d_chad.resize(0);
 
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
@@ -111,16 +117,22 @@ namespace G4UA{
     maps.m_rz_eion.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     maps.m_rz_niel.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     maps.m_rz_h20 .resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    maps.m_rz_neut.resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    maps.m_rz_chad.resize(m_config.nBinsz*m_config.nBinsr,0.0);
 
     maps.m_full_rz_tid .resize(m_config.nBinsz*m_config.nBinsr,0.0);
     maps.m_full_rz_eion.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     maps.m_full_rz_niel.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     maps.m_full_rz_h20 .resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    maps.m_full_rz_neut.resize(m_config.nBinsz*m_config.nBinsr,0.0);
+    maps.m_full_rz_chad.resize(m_config.nBinsz*m_config.nBinsr,0.0);
     
     maps.m_3d_tid .resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     maps.m_3d_eion.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     maps.m_3d_niel.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
     maps.m_3d_h20 .resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
+    maps.m_3d_neut.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
+    maps.m_3d_chad.resize(m_config.nBinsz3d*m_config.nBinsr3d*m_config.nBinsphi3d,0.0);
 
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
@@ -146,66 +158,92 @@ namespace G4UA{
     TH2D * h_rz_eion = new TH2D("rz_eion","rz_eion",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom);
     TH2D * h_rz_niel = new TH2D("rz_niel","rz_niel",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom);
     TH2D * h_rz_h20  = new TH2D("rz_h20" ,"rz_h20" ,m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom);
+    TH2D * h_rz_neut = new TH2D("rz_neut","rz_neut",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom);
+    TH2D * h_rz_chad = new TH2D("rz_chad","rz_chad",m_config.nBinsz,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr,m_config.rMinZoom,m_config.rMaxZoom);
 
     h_rz_tid  ->SetXTitle("|z| [cm]");
     h_rz_eion ->SetXTitle("|z| [cm]");
     h_rz_niel ->SetXTitle("|z| [cm]");
     h_rz_h20  ->SetXTitle("|z| [cm]");
+    h_rz_neut ->SetXTitle("|z| [cm]");
+    h_rz_chad ->SetXTitle("|z| [cm]");
 
     h_rz_tid  ->SetYTitle("r [cm]");
     h_rz_eion ->SetYTitle("r [cm]");
     h_rz_niel ->SetYTitle("r [cm]");
     h_rz_h20  ->SetYTitle("r [cm]");
+    h_rz_neut ->SetYTitle("r [cm]");
+    h_rz_chad ->SetYTitle("r [cm]");
 
     h_rz_tid  ->SetZTitle("TID [Gy]");
     h_rz_eion ->SetZTitle("E_{ion}/V [MeV/cm^{3}]");
     h_rz_niel ->SetZTitle("NIEL [n_{eq}/cm^{2}]");
     h_rz_h20  ->SetZTitle("SEE [h_{>20 MeV}/cm^{2}]");
+    h_rz_neut ->SetZTitle("FLUX [n_{>100 keV}/cm^{2}]");
+    h_rz_chad ->SetZTitle("FLUX [h_{charged}/cm^{2}]");
 
     TH2D *h_full_rz_tid  = new TH2D("full_rz_tid" ,"full_rz_tid" ,m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
     TH2D *h_full_rz_eion = new TH2D("full_rz_eion","full_rz_eion",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
     TH2D *h_full_rz_niel = new TH2D("full_rz_niel","full_rz_niel",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
     TH2D *h_full_rz_h20  = new TH2D("full_rz_h20" ,"full_rz_h20" ,m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
+    TH2D *h_full_rz_neut = new TH2D("full_rz_neut","full_rz_neut",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
+    TH2D *h_full_rz_chad = new TH2D("full_rz_chad","full_rz_chad",m_config.nBinsz,m_config.zMinFull,m_config.zMaxFull,m_config.nBinsr,m_config.rMinFull,m_config.rMaxFull);
 
     h_full_rz_tid  ->SetXTitle("|z| [cm]");
     h_full_rz_eion ->SetXTitle("|z| [cm]");
     h_full_rz_niel ->SetXTitle("|z| [cm]");
     h_full_rz_h20  ->SetXTitle("|z| [cm]");
+    h_full_rz_neut ->SetXTitle("|z| [cm]");
+    h_full_rz_chad ->SetXTitle("|z| [cm]");
 
     h_full_rz_tid  ->SetYTitle("r [cm]");
     h_full_rz_eion ->SetYTitle("r [cm]");
     h_full_rz_niel ->SetYTitle("r [cm]");
     h_full_rz_h20  ->SetYTitle("r [cm]");
+    h_full_rz_neut ->SetYTitle("r [cm]");
+    h_full_rz_chad ->SetYTitle("r [cm]");
 
     h_full_rz_tid  ->SetZTitle("TID [Gy]");
     h_full_rz_eion ->SetZTitle("E_{ion}/V [MeV/cm^{3}]");
     h_full_rz_niel ->SetZTitle("NIEL [n_{eq}/cm^{2}]");
     h_full_rz_h20  ->SetZTitle("SEE [h_{>20 MeV}/cm^{2}]");
+    h_full_rz_neut ->SetZTitle("FLUX [n_{>100 keV}/cm^{2}]");
+    h_full_rz_chad ->SetZTitle("FLUX [h_{charged}/cm^{2}]");
 
     TH3D * h_3d_tid  = new TH3D("h3d_tid" ,"h3d_tid" ,m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
     TH3D * h_3d_eion = new TH3D("h3d_eion","h3d_eion",m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
     TH3D * h_3d_niel = new TH3D("h3d_niel","h3d_niel",m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
     TH3D * h_3d_h20  = new TH3D("h3d_h20" ,"h3d_h20" ,m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
+    TH3D * h_3d_neut = new TH3D("h3d_neut","h3d_neut",m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
+    TH3D * h_3d_chad = new TH3D("h3d_chad","h3d_chad",m_config.nBinsz3d,m_config.zMinZoom,m_config.zMaxZoom,m_config.nBinsr3d,m_config.rMinZoom,m_config.rMaxZoom,m_config.nBinsphi3d,m_config.phiMinZoom,m_config.phiMaxZoom);
 
     h_3d_tid  ->SetXTitle("|z| [cm]");
     h_3d_eion ->SetXTitle("|z| [cm]");
     h_3d_niel ->SetXTitle("|z| [cm]");
     h_3d_h20  ->SetXTitle("|z| [cm]");
+    h_3d_neut ->SetXTitle("|z| [cm]");
+    h_3d_chad ->SetXTitle("|z| [cm]");
 
     h_3d_tid  ->SetYTitle("r [cm]");
     h_3d_eion ->SetYTitle("r [cm]");
     h_3d_niel ->SetYTitle("r [cm]");
     h_3d_h20  ->SetYTitle("r [cm]");
+    h_3d_neut ->SetYTitle("r [cm]");
+    h_3d_chad ->SetYTitle("r [cm]");
 
     h_3d_tid  ->SetZTitle("#phi [#circ]");
     h_3d_eion ->SetZTitle("#phi [#circ]");
     h_3d_niel ->SetZTitle("#phi [#circ]");
     h_3d_h20  ->SetZTitle("#phi [#circ]");
+    h_3d_neut ->SetZTitle("#phi [#circ]");
+    h_3d_chad ->SetZTitle("#phi [#circ]");
 
     h_3d_tid  ->SetTitle("TID [Gy]");
     h_3d_eion ->SetTitle("E_{ion}/V [MeV/cm^{3}]");
     h_3d_niel ->SetTitle("NIEL [n_{eq}/cm^{2}]");
     h_3d_h20  ->SetTitle("SEE [h_{>20 MeV}/cm^{2}]");
+    h_3d_neut ->SetTitle("FLUX [n_{>100 keV}/cm^{2}]");
+    h_3d_chad ->SetTitle("FLUX [h_{charged}/cm^{2}]");
 
     TH2D * h_rz_vol  = 0;
     TH2D * h_rz_norm = 0;
@@ -278,6 +316,12 @@ namespace G4UA{
 	// SEE
 	val =maps.m_rz_h20[vBin];
 	h_rz_h20->SetBinContent(iBin,val/vol);
+	// NEUT
+	val =maps.m_rz_neut[vBin];
+	h_rz_neut->SetBinContent(iBin,val/vol);
+	// CHAD
+	val =maps.m_rz_chad[vBin];
+	h_rz_chad->SetBinContent(iBin,val/vol);
 	if (!m_config.material.empty()) {
 	  // need volume fraction only if particular material is selected
 	  // VOL
@@ -293,6 +337,8 @@ namespace G4UA{
     h_rz_eion->Write();
     h_rz_niel->Write();
     h_rz_h20->Write();
+    h_rz_neut->Write();
+    h_rz_chad->Write();
 
     // normalize to volume element per bin
     for(int i=0;i<h_full_rz_tid->GetNbinsX();i++) { 
@@ -317,6 +363,12 @@ namespace G4UA{
 	// SEE
 	val =maps.m_full_rz_h20[vBin];
 	h_full_rz_h20->SetBinContent(iBin,val/vol);
+	// NEUT
+	val =maps.m_full_rz_neut[vBin];
+	h_full_rz_neut->SetBinContent(iBin,val/vol);
+	// CHAD
+	val =maps.m_full_rz_chad[vBin];
+	h_full_rz_chad->SetBinContent(iBin,val/vol);
 	if (!m_config.material.empty()) {
 	  // need volume fraction only if particular material is selected
 	  // VOL
@@ -332,6 +384,8 @@ namespace G4UA{
     h_full_rz_eion->Write();
     h_full_rz_niel->Write();
     h_full_rz_h20->Write();
+    h_full_rz_neut->Write();
+    h_full_rz_chad->Write();
 
     // normalize to volume element per bin
     for(int i=0;i<h_3d_tid->GetNbinsX();i++) { /* |z| */
@@ -364,6 +418,12 @@ namespace G4UA{
 	  // SEE
 	  val =maps.m_3d_h20[vBin];
 	  h_3d_h20->SetBinContent(iBin,val/vol);
+	  // NEUT
+	  val =maps.m_3d_neut[vBin];
+	  h_3d_neut->SetBinContent(iBin,val/vol);
+	  // CHAD
+	  val =maps.m_3d_chad[vBin];
+	  h_3d_chad->SetBinContent(iBin,val/vol);
 	  if (!m_config.material.empty()) {
 	    // need volume fraction only if particular material is selected
 	    // VOL
@@ -380,6 +440,8 @@ namespace G4UA{
     h_3d_eion->Write();
     h_3d_niel->Write();
     h_3d_h20->Write();
+    h_3d_neut->Write();
+    h_3d_chad->Write();
 
     if (!m_config.material.empty()) {
       // need volume fraction only if particular material is selected
-- 
GitLab


From 9af790ab061ff2091fbc6a732c4fa0549829e3d6 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 27 Feb 2019 18:29:31 +0100
Subject: [PATCH 073/404] fixed typo

---
 .../TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx  | 9 ++++-----
 .../TrigOutputHandling/src/TriggerEDMSerialiserTool.h    | 6 +++---
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
index 25d2072e59e..b9c9f0fae3b 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
@@ -16,15 +16,14 @@
 #include "TriggerEDMSerialiserTool.h"
 
 TriggerEDMSerialiserTool::TriggerEDMSerialiserTool( const std::string& type, 
-		      const std::string& name, 
-		      const IInterface* parent ) : 
-  base_class( type, name, parent ) {
-}
+						    const std::string& name, 
+						    const IInterface* parent ) 
+    : base_class( type, name, parent ) {}
 
 TriggerEDMSerialiserTool::~TriggerEDMSerialiserTool() {}
 
 StatusCode TriggerEDMSerialiserTool::initialize() {
-  
+
   ATH_CHECK( m_serializerSvc.retrieve() );
   ATH_CHECK( m_clidSvc.retrieve() );
   for ( const auto& [typeKeyAux, moduleIdVec] : m_collectionsToSerialize ) {
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
index b381cab8795..deace3b35d8 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
@@ -50,13 +50,13 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
   ///
 
   struct Address {
-    enum Catrgory { xAODInterface, xAODAux, OldTP, xAODDecoration, None };
+    enum Category { xAODInterface, xAODAux, OldTP, xAODDecoration, None };
     Address( const std::string& transType_,
 	     const std::string& persType_,
 	     const CLID clid_,
 	     const std::string& key_,
 	     const std::vector<uint16_t> module_={},
-	     const Catrgory category_ = None,
+	     const Category category_ = None,
 	     const xAOD::AuxSelection& sel_ = {} )
     : transType(transType_),
       persType(persType_),
@@ -72,7 +72,7 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
     std::string key;
     std::vector<uint16_t> moduleIdVec;
 
-    Catrgory category;
+    Category category;
     xAOD::AuxSelection sel = {}; //!< xAOD dynamic varaibles selection, relevant only for xAODAux category
 
   };
-- 
GitLab


From f6ba024763303f7c42b959d10a88c276d5966ed1 Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Wed, 27 Feb 2019 18:51:07 +0100
Subject: [PATCH 074/404] optimizing CaloLCWeightTool

---
 Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h | 7 +++----
 Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx     | 7 ++++++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h b/Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h
index ceb28383620..37d41138487 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloLCWeightTool.h
@@ -68,12 +68,11 @@ class CaloLCWeightTool : public AthAlgTool, virtual public IClusterCellWeightToo
 
 
   /**
-   * @brief map to indices inside the data for individual samplings
+   * @brief vector of names of individual samplings
    *
-   * Since not all samplings might have weighting coefficients this map
-   * holds the index (for valid) or -1 (for invalid) for each sampling. */
+   * needed to not call many times CaloSamplingHelper::getSamplingName */
 
-  std::vector<int> m_isampmap;
+  std::vector<std::string> m_sampnames;
 
   /**
    * @brief interpolate correction coefficients */
diff --git a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
index c2adee22cdf..3ccafd148b4 100644
--- a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
@@ -99,6 +99,11 @@ StatusCode CaloLCWeightTool::initialize()
     ATH_MSG_INFO(  "Noise Tool retrieved"  );
   } 
  
+  m_sampnames.resize(CaloSampling::Unknown);
+  for (int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
+     m_sampnames[iSamp] = CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp);
+  }
+
   return StatusCode::SUCCESS;
 }
 
@@ -115,7 +120,7 @@ StatusCode CaloLCWeightTool::weight(xAOD::CaloCluster *theCluster) const
   std::vector<int> isAmpMap(CaloSampling::Unknown,-1);
   for (int iArea=0;iArea<data->getSizeAreaSet();iArea++) {
     for (int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
-      if ( CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp) == data->getArea(iArea)->getTitle() ) {
+      if ( m_sampnames[iSamp] == data->getArea(iArea)->getTitle() ) {
         ATH_MSG_DEBUG("Found Area for Sampling " << CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp));
         isAmpMap[iSamp] = iArea;
         break;
-- 
GitLab


From fb38b4f145aac7c35fee5dcd71b8910d3262ffa6 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Wed, 27 Feb 2019 19:38:24 +0100
Subject: [PATCH 075/404] doMuGirlLowBeta True in
 MuonCombinedRec_myTopOptions.py to stop crashing

---
 .../share/MuonCombinedRec_myTopOptions.py                       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
index 127c0386c32..1445305ce66 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
@@ -277,7 +277,7 @@ muonCombinedRecFlags.doMuonSegmentTagger = True
 #muonCombinedRecFlags.doxAOD = True
 muonCombinedRecFlags.doAOD = False
 muonCombinedRecFlags.doCaloTrkMuId = True
-muonCombinedRecFlags.doMuGirlLowBeta = False
+muonCombinedRecFlags.doMuGirlLowBeta = True
 
 muonRecFlags.doCreateClusters = False 
 muonRecFlags.prdToxAOD = False
-- 
GitLab


From 92290d8257b3d99f8737c17bdd9da69e5b9333b4 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 27 Feb 2019 20:45:14 +0100
Subject: [PATCH 076/404] Fix BCM digi configuration test

---
 .../Digitization/test/test_MC16a_Digi_tf_configuration.py       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py b/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
index 834c41c170b..72963b2a879 100755
--- a/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
+++ b/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
@@ -212,7 +212,7 @@ class TestDigitizationMC16a(unittest.TestCase):
 
     def test___BCM_DigitizationTool_properties(self):
         tested_configurable_name = 'ToolSvc.BCM_DigitizationTool'
-        expected_property_list = ['DetStore', 'EffDistanceParam', 'EffSharpnessParam', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FirstXing', 'HitCollName', 'LastXing', 'MIPDeposit', 'ModNoise', 'ModSignal', 'NinoThr', 'RndmSvc', 'TimeDelay']
+        expected_property_list = ['DetStore', 'EffDistanceParam', 'EffSharpnessParam', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FirstXing', 'HitCollName', 'LastXing', 'MIPDeposit', 'ModNoise', 'ModSignal', 'NinoThr', 'OutputRDOKey', 'OutputSDOKey', 'RndmSvc', 'TimeDelay']
         expected_nonstring_properties = {'LastXing': '0', 'FirstXing': '-25'}
         expected_string_properties = {'HitCollName': 'BCMHits'}
         self._detailed_ConfigurablePropertiesCheck(
-- 
GitLab


From ae68dd4e2236a8cb1fa5833608a7cbe0e77f05d2 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Wed, 27 Feb 2019 20:55:59 +0100
Subject: [PATCH 077/404] adding MdtCalibDbAlg after development

---
 .../MdtCalibData/MdtCorFuncSetCollection.h    |    3 +
 .../MdtCalibData/MdtRtRelationCollection.h    |    3 +
 .../MdtTubeCalibContainerCollection.h         |    3 +
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h     |  145 +++
 .../src/MdtCalibDbAlg.cxx                     | 1100 +++++++++++++++++
 .../MdtCalibDbCoolStrTool_entries.cxx         |    4 +-
 .../MuonCnvExample/python/MuonCalibConfig.py  |   29 +-
 7 files changed, 1284 insertions(+), 3 deletions(-)
 create mode 100644 MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
 create mode 100644 MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
index 05590256213..b2025f61605 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
@@ -25,4 +25,7 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtCorFuncSet> MdtCorFuncSetCollection;
 CLASS_DEF(MdtCorFuncSetCollection , 1176811704 , 1 )
 
+#include "AthenaKernel/CondCont.h"
+CONDCONT_DEF( MdtCorFuncSetCollection, 1338477494 );
+
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
index 290a5de7260..806acd06420 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
@@ -25,4 +25,7 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtRtRelation> MdtRtRelationCollection;
 CLASS_DEF(MdtRtRelationCollection, 1270996316, 1 )
 
+#include "AthenaKernel/CondCont.h"
+CONDCONT_DEF( MdtRtRelationCollection, 1160701058 );
+
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
index 10d2d60aceb..0b18baef327 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
@@ -25,4 +25,7 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtTubeCalibContainer> MdtTubeCalibContainerCollection;
 CLASS_DEF(MdtTubeCalibContainerCollection, 1221928754, 1 )
 
+#include "AthenaKernel/CondCont.h"
+CONDCONT_DEF( MdtTubeCalibContainerCollection, 1164762092 );
+
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
new file mode 100644
index 00000000000..f3632e446ca
--- /dev/null
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
@@ -0,0 +1,145 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+   MdtCalibDbAlg reads raw condition data and writes derived condition data to the condition store
+*/
+
+#ifndef MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
+#define MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "GaudiKernel/ICondSvc.h"
+//#include "GaudiKernel/Property.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+
+//new code to replace dummy 
+//members from MdtCalibDbCoolStrTool.h
+//removing obsolete ones for me 
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "MdtCalibInterfaces/IMdtCalibDBTool.h"
+#include "MdtCalibData/MdtTubeCalibContainerCollection.h"
+#include "MdtCalibData/MdtRtRelationCollection.h"
+#include "MdtCalibData/MdtCorFuncSetCollection.h"
+#include "MuonCalibITools/IIdToFixedIdTool.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "CLHEP/Random/RandomEngine.h"
+
+#include "AthenaKernel/IAtRndmGenSvc.h"
+
+//c - c++
+#include "zlib.h"
+#include "vector"
+
+class MdtCalibrationRegionSvc;
+class Identifier; 
+class MdtIdHelper;
+class IIOVDbSvc;
+class MsgStream;
+class IAtRndmGenSvc;
+
+namespace MuonGM{
+  class MuonDetectorManager;
+}
+
+namespace coral	{
+  class Blob;
+}
+
+//namespace MuonCalib {
+
+//class RtResolutionLookUp;
+//class SamplePoint;
+
+#include "MdtCalibData/RtResolutionLookUp.h"
+#include "MuonCalibMath/SamplePoint.h"
+
+class MdtCalibDbAlg: public AthAlgorithm {
+
+ public:
+
+  MdtCalibDbAlg (const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~MdtCalibDbAlg() = default;
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
+  
+ private:
+  
+  ServiceHandle<ICondSvc> m_condSvc;
+
+  //like MdtCalibDbCoolStrTool
+  //removing obsolete ones
+
+  MuonCalib::MdtTubeCalibContainer* buildMdtTubeCalibContainer(const Identifier &id);
+  
+  StatusCode loadRt();
+  StatusCode defaultRt(std::unique_ptr<MdtRtRelationCollection>& writeCdoRt);
+  StatusCode loadTube();
+  StatusCode defaultT0s(std::unique_ptr<MdtTubeCalibContainerCollection>& writeCdoTube);
+
+  const MdtIdHelper *m_mdtIdHelper;
+  const MuonGM::MuonDetectorManager *m_detMgr;
+  ToolHandle<MuonCalib::IIdToFixedIdTool> m_idToFixedIdTool;
+  ServiceHandle<MdtCalibrationRegionSvc> m_regionSvc;
+
+  std::string      m_rtFolder;
+  std::string      m_tubeFolder;
+
+  //like MdtCalibrationDbSvc
+  //for corData in loadRt
+  bool m_create_b_field_function;
+  bool m_createWireSagFunction;
+  bool m_createSlewingFunction;
+  void initialize_B_correction(MuonCalib::MdtCorFuncSet *funcSet, const MuonCalib::MdtRtRelation *rt);
+  void initializeSagCorrection(MuonCalib::MdtCorFuncSet *funcSet);
+
+  //if m_TimeSlewingCorrection is set to true then it is assumed that the
+  //time slewing correction is applied. If false not. If this flag does 
+  //not match the bit in the creation parameters, the rt-relation and t0 
+  //will be corrected.  
+  //NOTE: This is a preliminary solution for 17.2. In principle each
+  //MdtDriftCircleOnTrackCreator could decide individually if it wants to
+  //have TS-correction. In the default reco-jobs however, this is
+  //configured by one muonRecFlag, that will be used to set this job-option.
+  
+  bool   m_TimeSlewingCorrection;
+  bool   m_UseMLRt;
+  std::vector<float> m_MeanCorrectionVsR;
+  float  m_TsCorrectionT0;
+  double m_defaultT0;
+  double m_t0Shift;
+  double m_t0Spread;
+  double m_rtShift;
+  double m_rtScale;
+  double m_prop_beta;
+  ServiceHandle<IAtRndmGenSvc> m_AtRndmGenSvc;
+  CLHEP::HepRandomEngine *p_engine;
+
+  StringArrayProperty m_RTfileNames; //temporary!!!
+
+  //decompression buffer and length of buffer
+  uLongf m_buffer_length;
+  Bytef *m_decompression_buffer;
+  
+  //wrapper function for the zlib uncompress, 
+  //that automatically creates or increases the buffer if needed.    
+  inline bool uncompressInMyBuffer(const coral::Blob &blob);
+  inline MuonCalib::RtResolutionLookUp* getRtResolutionInterpolation(const std::vector<MuonCalib::SamplePoint> &sample_points);
+  inline StatusCode extractString(std::string& input, std::string& output, std::string separator);  
+
+  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyRt;
+  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyTube;
+  SG::WriteCondHandleKey<MdtRtRelationCollection> m_writeKeyRt;
+  SG::WriteCondHandleKey<MdtTubeCalibContainerCollection> m_writeKeyTube;
+  SG::WriteCondHandleKey<MdtCorFuncSetCollection> m_writeKeyCor;
+   
+};
+
+//}  //namespace MuonCalib 
+
+#endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
new file mode 100644
index 00000000000..6b2ccbc604e
--- /dev/null
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -0,0 +1,1100 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MdtCalibDbCoolStrTool/MdtCalibDbAlg.h"
+
+//includes from MdtCalibDbCoolStrTool.cxx
+
+#include "StoreGate/StoreGateSvc.h"
+#include "SGTools/TransientAddress.h"
+#include "CoralBase/Attribute.h"
+#include "CoralBase/AttributeListSpecification.h"
+#include "CoralBase/Blob.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+
+#include "Identifier/IdentifierHash.h"
+#include "MuonIdHelpers/MdtIdHelper.h"
+
+#include "MdtCalibData/CalibFunc.h"
+#include "MuonCalibStl/ToString.h"
+#include "MdtCalibUtils/RtDataFromFile.h"
+#include "PathResolver/PathResolver.h"
+#include "MdtCalibData/MdtCalibrationFactory.h"
+#include "MdtCalibData/IRtRelation.h"
+#include "MdtCalibData/IRtResolution.h"
+#include "MuonCalibMath/SamplePoint.h"
+#include "MuonCalibTools/IdToFixedIdTool.h"
+#include "MuonCalibIdentifier/MuonFixedId.h"
+#include "MuonCalibIdentifier/MdtCalibCreationFlags.h"
+#include <fstream>
+#include <string>
+#include <vector>
+
+#include "MdtCalibSvc/MdtCalibrationRegionSvc.h"
+#include "MdtCalibSvc/MdtCalibrationDbSvc.h"
+
+#include "MdtCalibData/MdtRtRelationCollection.h"
+#include "MdtCalibData/MdtTubeCalibContainerCollection.h"
+#include "MdtCalibData/RtFromPoints.h"
+#include "MdtCalibData/RtResolutionFromPoints.h"
+
+//#include "MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool.h"
+
+#include "MuonReadoutGeometry/MuonDetectorManager.h"
+#include "MuonReadoutGeometry/MdtReadoutElement.h"
+
+#include "AthenaKernel/IIOVDbSvc.h"
+#include "AthenaKernel/IAtRndmGenSvc.h"
+#include "CLHEP/Random/RandGaussZiggurat.h"
+
+#include "TSpline.h"
+#include "TFile.h"
+
+//like MdtCalibrationDbSvc
+//for corData in loadRt
+#include "MdtCalibData/MdtCorFuncSetCollection.h"
+#include "MdtCalibData/MdtFullCalibData.h"
+#include "MdtCalibData/BFieldCorFunc.h"
+#include "MdtCalibData/WireSagCorFunc.h"
+#include "MdtCalibData/MdtSlewCorFuncHardcoded.h"
+#include "MdtCalibData/CalibFunc.h"
+
+
+MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator) :
+  AthAlgorithm(name, pSvcLocator),
+  m_condSvc{"CondSvc", name},
+  m_idToFixedIdTool("MuonCalib::IdToFixedIdTool"),
+  m_regionSvc("MdtCalibrationRegionSvc", name),
+  m_rtFolder("/MDT/RTBLOB"),
+  m_tubeFolder("/MDT/T0BLOB"),
+  m_TimeSlewingCorrection(false),
+  m_UseMLRt(true),
+  m_TsCorrectionT0(0.),
+  m_defaultT0(40.),
+  m_t0Shift(0.),
+  m_t0Spread(0.),
+  m_rtShift(0.),
+  m_rtScale(1.),
+  m_prop_beta(1.0),
+  m_AtRndmGenSvc ("AtRndmGenSvc", name),
+  m_buffer_length(0),
+  m_decompression_buffer(NULL),
+  m_readKeyRt("/MDT/RTBLOB"),
+  m_readKeyTube("/MDT/T0BLOB"),
+  m_writeKeyRt("MdtRtRelationCollection"),
+  m_writeKeyTube("MdtTubeCalibContainerCollection"),
+  m_writeKeyCor("MdtCorFuncSetCollection")
+{
+
+  //declareInterface< IMdtCalibDBTool >(this);
+
+  //Db Folders
+  declareProperty("TubeFolder",m_tubeFolder,"DB folder containing the tube constants");
+  declareProperty("RtFolder",m_rtFolder,"DB folder containing the RT calibrations");
+  
+  //Properties to deform the t0 and rt relationship
+  declareProperty("T0Shift",m_t0Shift,"for simulation: common shift of all T0s, in ns");
+  declareProperty("T0Spread",m_t0Spread,"for simulation: sigma for random smeraing of T0s, in ns");
+  declareProperty("RTShift",m_rtShift,"for simulations: maximum RT distortion, in mm");
+  declareProperty("RTScale",m_rtScale,"for simulations: a muliplicitive scale to the drift r");
+
+  //is this the simplest way to initialize a list?
+  std::ostringstream myse;
+  std::vector<std::string> myord;
+  myse << "DC2_rt_default.dat";
+  myord.push_back(myse.str());
+
+  declareProperty("RT_InputFiles",m_RTfileNames=myord,"single input ascii file for default RT to be applied in absence of DB information");
+
+  //defaultT0, used for tubes not found in DB
+  declareProperty("defaultT0",m_defaultT0,"default T0 value to be used in absence of DB information");
+  declareProperty("TimeSlewingCorrection", m_TimeSlewingCorrection);
+  declareProperty("MeanCorrectionVsR", m_MeanCorrectionVsR);
+  declareProperty("UseMLRt", m_UseMLRt,"Enable use of ML-RTs from COOL");
+  declareProperty("PropagationSpeedBeta", m_prop_beta);
+
+  //like MdtCalibrationDbSvc
+  //for corData in loadRt
+  declareProperty("CreateBFieldFunctions", m_create_b_field_function = false,
+		  "If set to true, the B-field correction functions are initialized for each rt-relation that is loaded.");
+  declareProperty("CreateWireSagFunctions", m_createWireSagFunction = false,
+		  "If set to true, the wire sag correction functions are initialized for each rt-relation that is loaded.");
+  declareProperty("CreateSlewingFunctions", m_createSlewingFunction = false,
+		  "If set to true, the slewing correction functions are initialized for each rt-relation that is loaded.");
+
+}
+
+StatusCode MdtCalibDbAlg::initialize(){
+
+  ATH_MSG_DEBUG( "initialize " << name() );
+  ATH_CHECK(m_condSvc.retrieve());
+
+  //if timeslew correction vector m_MeanCorrectionVsR has non-zero size then set
+  //m_TsCorrectionT0=m_MeanCorrectionVsR[0] and subtract this each value in the vector.
+  if(m_MeanCorrectionVsR.size()) {
+    m_TsCorrectionT0 = m_MeanCorrectionVsR[0];
+    for(std::vector<float>::iterator it=m_MeanCorrectionVsR.begin(); it!=m_MeanCorrectionVsR.end(); it++) {
+      (*it) -= m_TsCorrectionT0;
+    }
+  }
+
+  ATH_CHECK( detStore()->retrieve(m_mdtIdHelper, "MDTIDHELPER" ) );
+  ATH_CHECK( detStore()->retrieve( m_detMgr ) );
+  ATH_CHECK( m_regionSvc.retrieve() );
+  ATH_CHECK( m_idToFixedIdTool.retrieve() );
+
+  // initialize MdtRtRelationCollection 
+  // if COOL RT folder is called /MDT/RTUNIQUE then only read one RT from COOL and use for all chambers
+  // Not sure this option has ever been used, perhaps could be used for simulated data.
+  // Job option RtFolder would need to be set to "/MDT/RTUNIQUE" to make this work.
+  if(m_rtFolder == "/MDT/RTUNIQUE") {
+    m_regionSvc->remapRtRegions("OneRt"); 
+  } else if( m_UseMLRt ) {
+    m_regionSvc->remapRtRegions("OnePerMultilayer");
+  } else {
+    m_regionSvc->remapRtRegions("OnePerChamber");
+  }
+  
+  //initiallize random number generator if doing t0 smearing (for robustness studies)
+  if( m_t0Spread != 0. ) {
+    ATH_CHECK( m_AtRndmGenSvc.retrieve() );
+    ATH_MSG_DEBUG( " initialize Random Number Service: running with t0 shift "
+                    << m_t0Shift << " spread " << m_t0Spread << " rt shift " << m_rtShift );
+      
+    // getting our random numbers stream
+    p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBASCIITOOL");
+  }
+
+  if ( m_rtShift != 0. || m_rtScale != 1. || m_t0Shift != 0. || m_t0Spread != 0.) {
+    ATH_MSG_INFO( "************************************" << std::endl
+                   << " Running with Calibration Deformations! " << std::endl
+                   << " For performance studies only!" << std::endl
+                   << " **************************************" );
+    ATH_MSG_DEBUG( " rt scale " << m_rtScale << " t0 shift " 
+                    << m_t0Shift << " spread " << m_t0Spread << " rt shift " << m_rtShift );
+  }
+
+  ATH_CHECK(m_readKeyRt.initialize());
+  ATH_CHECK(m_readKeyTube.initialize());
+  ATH_CHECK(m_writeKeyRt.initialize());
+  ATH_CHECK(m_writeKeyTube.initialize());
+  ATH_CHECK(m_writeKeyCor.initialize());
+
+  if(m_condSvc->regHandle(this, m_writeKeyRt).isFailure()) {
+    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyRt.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+  if(m_condSvc->regHandle(this, m_writeKeyTube).isFailure()) {
+    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyTube.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+  if(m_condSvc->regHandle(this, m_writeKeyCor).isFailure()) {
+    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyCor.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode MdtCalibDbAlg::execute(){
+  
+  ATH_MSG_DEBUG( "execute " << name() );  
+
+  if ( loadRt().isFailure() ) {
+    ATH_MSG_FATAL("loadRt().isFailure()");
+    return StatusCode::FAILURE;
+  }
+
+  if ( loadTube().isFailure() ) {
+    ATH_MSG_FATAL("loadTube().isFailure()");
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& writeCdoRt){
+  ATH_MSG_DEBUG( "defaultRt " << name() );
+
+  if ( writeCdoRt == nullptr ) {
+    ATH_MSG_ERROR("writeCdoRt == nullptr");
+    return StatusCode::FAILURE; 
+  }   
+
+  //Build the transient structure in StoreGate and load default RT function read from a text file
+  //In principle, a list of text files can be specified in the job options, and each text file
+  //may potentially contain multiple RT functions.  However, only the first valid RT function in
+  //the first text file is used as the default for all chambers.
+
+  writeCdoRt->resize(m_regionSvc->numberOfRegions());
+  ATH_MSG_DEBUG( "Created new MdtRtRelationCollection size " << writeCdoRt->size() );
+
+  // Check that an RT text file has been specified in job options
+  std::vector<std::string>::const_iterator it     = m_RTfileNames.value().begin();
+  std::vector<std::string>::const_iterator it_end = m_RTfileNames.value().end();
+  if (it == it_end ) {
+    ATH_MSG_FATAL( "No input RT file declared in jobOptions");
+    return StatusCode::FAILURE;
+  } else if (it_end-it>1) {
+    ATH_MSG_WARNING( "Only first RT file declared in jobOptions will be used");
+  }
+
+  // Open the Ascii file with the RT relations
+  std::string fileName = PathResolver::find_file(it->c_str(),"DATAPATH");
+  if(fileName.length() == 0) {
+    ATH_MSG_ERROR( "RT Ascii file \"" <<  it->c_str() << "\" not found" );
+  }
+  std::ifstream inputFile( fileName.c_str() );
+  if( !inputFile ) {
+    ATH_MSG_ERROR( "Unable to open RT Ascii file: " << fileName.c_str() );
+    return StatusCode::FAILURE;
+  } else {
+    ATH_MSG_DEBUG( "Opened RT Ascii file: " <<  fileName.c_str() );
+  }
+
+  // Read the RTs from the text file
+  MuonCalib::RtDataFromFile rts;
+  rts.read(inputFile);
+  ATH_MSG_VERBOSE( "File contains " << rts.nRts() << " RT relations " );
+
+  // Loop over all RTs in the file (but the default file only has 1 RT)
+  // Use the first valid RT found in the file as the default for all chambers.
+  for(unsigned int n=0;n<rts.nRts();++n) {
+    MuonCalib::RtDataFromFile::RtRelation *rt = rts.getRt( n );
+
+    const MuonCalib::RtDataFromFile::RtRelation::DataVec &times = rt->times();
+    const MuonCalib::RtDataFromFile::RtRelation::DataVec &radii = rt->radii();
+    const MuonCalib::RtDataFromFile::RtRelation::DataVec &reso  = rt->resolution();
+
+    // check if rt contains data, at least two points on the rt are required
+    if( times.size() < 2 ) {
+      ATH_MSG_ERROR( " defaultRt rt table has too few entries" );
+      continue;
+    }
+
+    // check if all tables have same size
+    if( times.size() != radii.size() || times.size() != reso.size() ) {
+      ATH_MSG_ERROR( "defaultRt rt table size mismatch " );
+      continue;
+    }
+
+    // check for negative time bins, i.e. decreasing time value with radius
+    double t_min    = times[0];
+    double bin_size = times[1]-t_min;
+    if( bin_size <= 0 ) {
+      ATH_MSG_ERROR( "defaultRt rt table negative binsize " );
+      continue;
+    }
+
+    // create a vector to hold the r values,
+    // we need two extra fields to store t_min and bin_size
+    MuonCalib::CalibFunc::ParVec rtPars;
+    rtPars.push_back( t_min );
+    rtPars.push_back( bin_size );
+
+    // copy r values into vector
+    rtPars.insert( rtPars.end(), radii.begin(), radii.end() );
+
+    ATH_MSG_DEBUG( "defaultRt new MuonCalib::IRtRelation" );
+
+    MuonCalib::CalibFunc::ParVec resoPars;
+    resoPars.push_back( t_min );
+    resoPars.push_back( bin_size );
+
+    // copy r values into vector
+    resoPars.insert( resoPars.end(), reso.begin(), reso.end() );
+
+    ATH_MSG_DEBUG( "defaultRt new MuonCalib::IRtResolution" );
+
+    // create RT and resolution "I" objects
+    MuonCalib::IRtRelation *rtRel = 
+      MuonCalib::MdtCalibrationFactory::createRtRelation( "RtRelationLookUp", rtPars );
+    if( !rtRel ) ATH_MSG_WARNING( "ERROR creating RtRelationLookUp " );
+
+    MuonCalib::IRtResolution *resoRel = 
+      MuonCalib::MdtCalibrationFactory::createRtResolution( "RtResolutionLookUp", resoPars );
+    if( !resoRel ) ATH_MSG_WARNING( "ERROR creating RtResolutionLookUp " );
+
+    // if either RT and resolution are not OK then delete both and try next RT in file
+    if( !resoRel || !rtRel ) {
+      if(resoRel) delete resoRel;
+      if(rtRel) delete rtRel;
+      delete rt;
+      continue;
+    }
+
+    //Since the same RT is loaded for all chambers you might be tempted to create it once
+    //and simply store the same pointer in writeCdoRt for all regions.
+    //However it seems that when StoreGate clears writeCdoRt (which will happen in LoadRt
+    //by detStore()->removeDataAndProxy) it will crash unless there are unique pointers/objects
+    //for rtRel, resoRel, and MdtRtRelation
+
+    //Loop over RT regions and store the default RT in each
+    for(unsigned int iregion=0; iregion<writeCdoRt->size(); iregion++) {
+      ATH_MSG_DEBUG( "Inserting default Rt for region "<<iregion);
+      // create RT and resolution "I" objects, again, so they can all be cleanly deleted later.
+      rtRel   = MuonCalib::MdtCalibrationFactory::createRtRelation( "RtRelationLookUp", rtPars );
+      resoRel = MuonCalib::MdtCalibrationFactory::createRtResolution( "RtResolutionLookUp", resoPars );
+      (*writeCdoRt)[iregion] = new MuonCalib::MdtRtRelation( rtRel, resoRel, 0. );
+    }   //end loop over RT regions
+
+    //if VERBOSE enabled print out RT function
+    if( msgLvl(MSG::VERBOSE) ) {
+      int npoints = rtRel->nPar()-2;
+      ATH_MSG_VERBOSE( "defaultRt npoints from rtRel="<< npoints );
+      for( int ipt=0;ipt<npoints;++ipt ){
+	double t = t_min + ipt*bin_size;
+	ATH_MSG_VERBOSE(" "<<ipt<<" "<<t<<" "<< rtRel->radius(t)<<" "<< resoRel->resolution(t));
+      }
+    }
+    delete rt;
+    break;            //only need the first good RT from the text file
+  }  //end loop over RTs in file
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode MdtCalibDbAlg::loadRt(){
+  ATH_MSG_DEBUG( "loadRt " << name() );
+
+  SG::WriteCondHandle<MdtRtRelationCollection> writeHandleRt{m_writeKeyRt};
+  if ( writeHandleRt.isValid() ) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandleRt.fullKey() << " is already valid.");
+    return StatusCode::SUCCESS; 
+  }
+  std::unique_ptr<MdtRtRelationCollection> writeCdoRt{std::make_unique<MdtRtRelationCollection>()};
+
+  SG::WriteCondHandle<MdtCorFuncSetCollection> writeHandleCor{m_writeKeyCor};
+  if ( writeHandleCor.isValid() ) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandleCor.fullKey() << " is already valid.");
+    return StatusCode::SUCCESS;
+  }
+  std::unique_ptr<MdtCorFuncSetCollection> writeCdoCor{std::make_unique<MdtCorFuncSetCollection>()};
+
+  //like MdtCalibDbCoolStrTool::loadRt()
+  //m_rtData is writeCdoRt here
+  //atrc is readCdoRt here
+
+  //tr-relation creators
+  //MuonCalib::RtResolutionFromPoints res_from_points;//never used
+  MuonCalib::RtFromPoints rt_fromPoints;
+
+  if ( defaultRt(writeCdoRt).isFailure() ){
+    ATH_MSG_FATAL("defaultRt(writeCdoRt).isFailure()");
+    return StatusCode::FAILURE;
+  }
+  
+  //Read Cond Handle  
+  SG::ReadCondHandle<CondAttrListCollection> readHandleRt{ m_readKeyRt };
+  const CondAttrListCollection* readCdoRt{*readHandleRt}; 
+  if ( readCdoRt==nullptr ) {
+    ATH_MSG_ERROR("readCdoRt==nullptr");
+    return StatusCode::FAILURE; 
+  }   
+  EventIDRange rangeRt;
+  if ( !readHandleRt.range(rangeRt) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleRt.key());
+    return StatusCode::FAILURE;
+  }  
+  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleRt.fullKey() << " readCdoRt->size()= " << readCdoRt->size());
+  ATH_MSG_INFO("Range of input is " << rangeRt);
+
+  // unpack the strings in the collection and update the writeCdoRt
+  CondAttrListCollection::const_iterator itr;
+  for (itr = readCdoRt->begin(); itr != readCdoRt->end(); ++itr) {
+    const coral::AttributeList &atr=itr->second;
+    bool rt_ts_applied = (atr["tech"].data<int>() & MuonCalib::TIME_SLEWING_CORRECTION_APPLIED);
+    std::string header="",payload="",trailer="";
+    // if BLOB data
+    if (atr["data"].specification().type() == typeid(coral::Blob)){
+      ATH_MSG_VERBOSE( "Data load is a blob. Uncompressing");
+      if(!uncompressInMyBuffer(atr["data"].data<coral::Blob>())) {
+	ATH_MSG_FATAL( "Cannot uncompress buffer" );
+	return StatusCode::FAILURE;
+      }
+      std::string istr(reinterpret_cast<char*>(m_decompression_buffer));
+      ATH_CHECK( extractString(istr, header, "\n") );
+      ATH_CHECK( extractString(istr, payload, "\n") );
+      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
+    } else {      // else CLOB data
+      std::string data;
+      data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
+      ATH_MSG_VERBOSE( "Data load is " << data );
+      // interpret as string stream
+      std::string istr(data.c_str());
+      ATH_CHECK( extractString(istr, header, " ") );
+      ATH_CHECK( extractString(istr, payload, " ") );
+      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, " ") );
+    }
+    ATH_MSG_VERBOSE( "Read header:" << header << " payload:" << payload << " trailer:" << trailer );
+
+    // the header contains the muonfixedid rather than the hash
+    char *parameters = new char [header.size()+1];
+    strncpy(parameters, header.c_str(), header.size()+1);
+    parameters[header.size()]='\0';
+    unsigned int regionId, npoints(0);
+    Identifier  athenaId; 
+    char *pch = strtok(parameters," _,");
+    regionId = atoi(pch);
+    //Long ago the hash was put in the RT file header, but now (2016) 
+    //the muonfixedid of the chamber is in the header.  Hence the "if" below will always be true.    
+    if(regionId>2500) {
+      MuonCalib::MuonFixedId id(regionId);
+      athenaId = m_idToFixedIdTool->fixedIdToId(id);
+      // If using chamber RTs skip RTs for ML2 -- use ML1 RT for entire chamber
+      if( m_regionSvc->RegionType()==ONEPERCHAMBER && m_mdtIdHelper->multilayer(athenaId)==2 ) {
+        ATH_MSG_VERBOSE("MdtCalibDbAlg::loadRt Ignore ML2 RT for region "<<regionId<<" "<<
+			m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(athenaId))<<"_"<<
+			m_mdtIdHelper->stationPhi(athenaId)<<"_"<<m_mdtIdHelper->stationEta(athenaId)<<
+			" ML"<<m_mdtIdHelper->multilayer(athenaId));  //TEMP
+	continue;
+      }
+      IdentifierHash hash;  //chamber hash
+      IdContext idCont = m_mdtIdHelper->module_context();
+      idCont = m_mdtIdHelper->module_context();
+      m_mdtIdHelper->get_hash( athenaId, hash, &idCont );
+      ATH_MSG_VERBOSE( "Fixed region Id "<<regionId<<" converted into athena Id "<<athenaId <<" and then into hash "<<hash);
+      regionId = hash;      //reset regionId to chamber hash
+    }
+    // extract npoints in RT function
+    pch = strtok (NULL, "_,");
+    npoints = atoi(pch);
+    delete [] parameters;
+    MuonCalib::CalibFunc::ParVec rtPars;
+    MuonCalib::CalibFunc::ParVec resoPars;
+
+    MuonCalib::SamplePoint tr_point, ts_point;  //pairs of numbers; tr = (time,radius); ts = (time,sigma)  [sigma=resolution]
+    std::vector<MuonCalib::SamplePoint> tr_points(0), ts_points(0);  //all the points in time,radius [RT] and time,sigma [resolution func]
+    float multilayer_tmax_diff(-9e9);
+
+    char *RTPar= new char [payload.size()+1];
+    strncpy(RTPar, payload.c_str(), payload.size()+1);
+    RTPar[payload.size()]='\0';   //terminate string (not sure this is really needed because payload.c_str() should be terminated in \0)
+    char *pch1 = strtok (RTPar,",");
+    unsigned int n=0;
+    //loop over RT function payload (triplets of radius,time,sigma(=resolution) )
+    for( int k=1; pch1!=NULL && n<=npoints; pch1=strtok(NULL,", "), k++ ) {
+      if(k==1) {    //radius point
+	float radius = atof(pch1);       
+	if( m_rtShift != 0. ) {
+	  float oldradius = radius;
+	  float rshift = m_rtShift*1.87652e-2*radius*(radius-14.6);
+	  radius = oldradius + rshift;
+	  ATH_MSG_DEBUG( "DEFORM RT: old radius " << oldradius << " new radius " 
+			  << radius << " shift " << rshift << " max shift " << m_rtShift );
+	}
+       
+	if( m_rtScale !=1. ) {
+	  radius = radius*m_rtScale;
+	  ATH_MSG_DEBUG( "DEFORM RT: old radius " << radius << " new radius " 
+			  << radius << " scale factor " << m_rtScale );
+	}
+       
+	tr_point.set_x2(radius);
+      } else if(k==2) {     //time
+	float time= atof(pch1);
+	tr_point.set_x1(time);
+	ts_point.set_x1(time);
+      } else if(k==3) {     //sigma or resolution
+	float sigma= atof(pch1);
+	ts_point.set_x2(sigma);
+	ts_point.set_error(1.0);
+	tr_point.set_error(1.0);
+	if(tr_point.x2()<-99) {    //if radius is < -99 then treat time as ML Tmax difference
+	  //		std::cout<<"XXxxXX Multilayer t_max diff found!"<<tr_point.x1() <<std::endl;
+	  multilayer_tmax_diff = tr_point.x1();
+	} else if(n==0 || (tr_points[n-1].x1()<tr_point.x1() && tr_points[n-1].x2()<tr_point.x2())) {
+	  tr_points.push_back(tr_point);	       
+	  ts_points.push_back(ts_point);
+	  n++;  //count points in RT
+	}
+	k=0;
+      }
+    }   //end loop over RT function payload (triplets of radius,time,resolution)
+    delete [] RTPar;
+
+    //Must have at least 3 points to have a valid RT
+    if(ts_points.size()<3) {
+      ATH_MSG_FATAL( "Rt relation broken!");
+      ATH_MSG_FATAL( "file='"<<atr["file"].data<std::string>()<<"'");
+      ATH_MSG_FATAL( "header='"<<header<<"'");
+      return StatusCode::FAILURE;
+    }
+
+    if(rt_ts_applied != m_TimeSlewingCorrection) {
+      float sign(rt_ts_applied ? -1.0 : 1.0);
+      float slice_width = 14.6/static_cast<float>(m_MeanCorrectionVsR.size());
+      for(std::vector<MuonCalib::SamplePoint>::iterator it=tr_points.begin(); it!=tr_points.end(); it++) {
+	int slice_number=static_cast<int>(std::floor(it->x2()/slice_width));		
+	if (slice_number<0)
+	  slice_number=0;
+	if (slice_number >= static_cast<int>(m_MeanCorrectionVsR.size()))
+	  slice_number = static_cast<int>(m_MeanCorrectionVsR.size()) - 1;
+	it->set_x1(it->x1() + sign * m_MeanCorrectionVsR[slice_number]);	
+      }
+    }
+    
+    //Create resolution function from ts_points
+    MuonCalib::IRtResolution *reso = getRtResolutionInterpolation(ts_points);
+    if (msgLvl(MSG::DEBUG)) {
+      ATH_MSG_DEBUG( "Resolution points :");
+      for(std::vector<MuonCalib::SamplePoint>::const_iterator it=tr_points.begin(); it!=tr_points.end(); it++) {
+	ATH_MSG_DEBUG( it->x1()<<"|"<<it->x2()<<"|"<<it->error());
+      }
+	
+      ATH_MSG_DEBUG( "Resolution parameters :");
+      for(unsigned int i=0; i<reso->nPar(); i++) {
+	ATH_MSG_DEBUG(  i<<" "<<reso->par(i) );
+      }
+    }
+
+    //Create RT function from tr_points and load RT and resolution functions 
+    try {
+      MuonCalib::IRtRelation *rt = new MuonCalib::RtRelationLookUp(rt_fromPoints.getRtRelationLookUp(tr_points));
+      if( reso && rt ){
+	if(regionId>=writeCdoRt->size()) {
+	  delete reso; delete rt;
+	  ATH_MSG_WARNING( "Illegal regionId "<< regionId );
+	} else { 
+	  if (rt->par(1)==0.) {
+	    ATH_MSG_WARNING( "Bin size is 0");
+	    for(std::vector<MuonCalib::SamplePoint>::const_iterator it=tr_points.begin(); it!=tr_points.end(); it++)
+	      ATH_MSG_WARNING( it->x1() << " " <<it->x2() <<" "<< it->error() );
+	  }
+	  //Save ML difference if it is available
+	  if(multilayer_tmax_diff>-8e8) {
+	    rt->SetTmaxDiff(multilayer_tmax_diff);
+	  }
+	  //Store RT and resolution functions for this region
+	  if( m_regionSvc->RegionType() == ONERT ) {
+	    (*writeCdoRt)[0] = new MuonCalib::MdtRtRelation( rt, reso, 0.);
+	    break;   // only read one RT from COOL for ONERT option.
+	  // If doing ML2 RTs, and this is a ML2 RT function then add it to the end of writeCdoRt
+	  } else if( m_regionSvc->RegionType()==ONEPERMULTILAYER && m_mdtIdHelper->multilayer(athenaId)==2 ) {
+	    ATH_MSG_VERBOSE("MdtCalibDbAlg::loadRt Load ML2 RT for region "<<regionId<<" "<<
+			 m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(athenaId))<<"_"<<
+			 m_mdtIdHelper->stationPhi(athenaId)<<"_"<<m_mdtIdHelper->stationEta(athenaId)<<
+			 " ML"<<m_mdtIdHelper->multilayer(athenaId));
+	    (*writeCdoRt).push_back(new MuonCalib::MdtRtRelation( rt, reso, 0.));
+	    IdentifierHash mlHash;
+	    m_mdtIdHelper->get_detectorElement_hash( athenaId, mlHash ); 
+	    m_regionSvc->setRegionHash(mlHash);
+	  } else {   //store RT for chamber or ML1 if doing ONEPERMULTILAYER
+	    (*writeCdoRt)[regionId] = new MuonCalib::MdtRtRelation( rt, reso, 0.);
+	  }
+	}      //end else regionId is OK
+      }        //end if reso && rt
+    }          //end try
+    catch (int i) {
+      ATH_MSG_FATAL( "Error in creating rt-relation!" );
+      ATH_MSG_FATAL( "npoints="<<tr_points.size());
+      ATH_MSG_FATAL( "Offending input: header=" << header );
+      ATH_MSG_FATAL( "Offending input: payload=" << payload );
+      return StatusCode::FAILURE;
+    }
+    
+  }//end loop over itr (strings read from COOL)
+  ATH_MSG_INFO("MdtCalibDbAlg::loadRt Read "<<m_regionSvc->numberOfRegions()<<"RTs from COOL");
+
+  //like MdtCalibrationDbSvc
+  //for corData in loadRt
+
+  //Check if doing corrections; return if not
+  //if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ) return StatusCode::SUCCESS;
+  //here at least record default as an Alg
+  //and then check flags again in the DbSvc
+
+  writeCdoCor->resize(writeCdoRt->size());
+  ATH_MSG_DEBUG( "Initializing " << writeCdoCor->size() << " b-field functions" );
+  for (unsigned int i=0; i < writeCdoCor->size(); i++) {
+    (*writeCdoCor)[i] = new MuonCalib::MdtCorFuncSet();
+    if(m_create_b_field_function) initialize_B_correction((*writeCdoCor)[i], (*writeCdoRt)[i]);
+    if(m_createWireSagFunction)   initializeSagCorrection((*writeCdoCor)[i]);
+    if(m_createSlewingFunction)   (*writeCdoCor)[i]->setSlewing(new MuonCalib::MdtSlewCorFuncHardcoded(MuonCalib::CalibFunc::ParVec()));
+  }
+
+  //finally record writeCdo
+
+  if ( writeCdoRt->size()==0 ) {
+    ATH_MSG_WARNING("writeCdoRt->size()==0"); 
+    return StatusCode::FAILURE;
+  }
+  if (writeHandleRt.record(rangeRt, std::move(writeCdoRt)).isFailure()) {
+    ATH_MSG_FATAL("Could not record " << writeHandleRt.key()
+		  << " with EventRange " << rangeRt
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_INFO("recorded new " << writeHandleRt.key()
+	       << " with range " << rangeRt
+	       << " into Conditions Store");
+
+  if ( writeCdoCor->size()==0 ) {
+    ATH_MSG_WARNING("writeCdoCor->size()==0");
+    return StatusCode::FAILURE;
+  }
+  if (writeHandleCor.record(rangeRt, std::move(writeCdoCor)).isFailure()) {
+    ATH_MSG_FATAL("Could not record " << writeHandleCor.key()
+		  << " with EventRange " << rangeRt
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_INFO("recorded new " << writeHandleCor.key()
+	       << " with range " << rangeRt
+	       << " into Conditions Store");
+  
+  return StatusCode::SUCCESS;
+}
+
+
+// build the transient structure and load some defaults for T0s
+StatusCode MdtCalibDbAlg::defaultT0s(std::unique_ptr<MdtTubeCalibContainerCollection>& writeCdoTube) {
+
+  if ( writeCdoTube == nullptr ) {
+    ATH_MSG_ERROR("writeCdoTube == nullptr");
+    return StatusCode::FAILURE; 
+  }
+  
+  //like MdtCalibDbCoolStrTool::defaultT0s()
+  //m_tubeData is writeCdoTube here
+
+  writeCdoTube->resize( m_mdtIdHelper->module_hash_max() );
+  ATH_MSG_DEBUG( " Created new MdtTubeCalibContainerCollection size " << writeCdoTube->size() );
+
+  // Inverse of wire propagation speed
+  float inversePropSpeed = 1./(299.792458*m_prop_beta);
+
+  //loop over modules (MDT chambers) and create an MdtTubeContainer for each
+  MdtIdHelper::const_id_iterator it     = m_mdtIdHelper->module_begin();
+  MdtIdHelper::const_id_iterator it_end = m_mdtIdHelper->module_end();
+  for(; it!=it_end;++it ) {
+    MuonCalib::MdtTubeCalibContainer *tubes=0;
+    //create an MdtTubeContainer
+    tubes = buildMdtTubeCalibContainer(*it);
+
+    // is tubes ever 0?  how could that happen?
+    if(tubes) {
+      std::string rName=tubes->regionKey();
+      double t0 = m_defaultT0;
+
+      int nml=tubes->numMultilayers();
+      int nlayers=tubes->numLayers();
+      int ntubes=tubes->numTubes();
+      int size = nml*nlayers*ntubes;
+      ATH_MSG_VERBOSE( "Adding chamber " << m_mdtIdHelper->print_to_string(*it) );
+      ATH_MSG_VERBOSE( " size " << size << " ml " << nml << " l " << nlayers << " t " 
+		       << ntubes << " address " << tubes );
+      for( int ml=0;ml<nml;++ml ){
+	for( int l=0;l<nlayers;++l ){
+	  for( int t=0;t<ntubes;++t ){
+	    MuonCalib::MdtTubeCalibContainer::SingleTubeCalib data;
+	    data.t0 = t0;
+	    data.adcCal = 1.;
+	    data.inversePropSpeed = inversePropSpeed;
+	    tubes->setCalib( ml,l,t,data );
+	  }
+	}
+      }
+    }  //end loop over chambers (modules)
+    ATH_MSG_VERBOSE( " set t0's done " );
+    IdentifierHash hash;
+    IdContext idCont = m_mdtIdHelper->module_context();
+    m_mdtIdHelper->get_hash( *it, hash, &idCont );
+
+    if( hash < writeCdoTube->size() ){
+      (*writeCdoTube)[hash] = tubes;
+      ATH_MSG_VERBOSE( " adding tubes at " << hash << " current size " << writeCdoTube->size() );
+//write out string for chamberlist
+      if(tubes) {
+	int nml     = tubes->numMultilayers();
+	int nlayers = tubes->numLayers();
+	int ntubes  = tubes->numTubes();	
+	ATH_MSG_VERBOSE( "CHAMBERLIST: " << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(*it)) << " " << m_mdtIdHelper->stationEta(*it) << " " << m_mdtIdHelper->stationPhi(*it) << " " << nml*nlayers*ntubes << " " << nml << " " << nlayers << " " << ntubes << " dummy " << hash );
+      }
+    } else {
+      if(tubes) delete tubes;
+      ATH_MSG_WARNING( " HashId out of range " << hash << " max " << writeCdoTube->size() );
+    }
+  }
+  ATH_MSG_DEBUG( " Done defaultT0s " << writeCdoTube->size() );
+
+  return StatusCode::SUCCESS;
+}  //end MdtCalibDbAlg::defaultT0s
+
+
+StatusCode MdtCalibDbAlg::loadTube(){
+  ATH_MSG_DEBUG( "loadTube " << name() );
+
+  SG::WriteCondHandle<MdtTubeCalibContainerCollection> writeHandleTube{m_writeKeyTube};
+  if ( writeHandleTube.isValid() ) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandleTube.fullKey() << " is already valid.");
+    return StatusCode::SUCCESS; 
+  }
+  std::unique_ptr<MdtTubeCalibContainerCollection> writeCdoTube{std::make_unique<MdtTubeCalibContainerCollection>()};
+
+  //like MdtCalibDbCoolStrTool::loadTube()
+  //m_tubeData is writeCdoTube here
+  //atrc is readCdoTube here
+
+  if ( defaultT0s(writeCdoTube).isFailure() ) {
+    ATH_MSG_FATAL("defaultT0s().isFailure()");
+    return StatusCode::FAILURE;
+  }
+  
+  //Read Cond Handle  
+  SG::ReadCondHandle<CondAttrListCollection> readHandleTube{ m_readKeyTube };
+  const CondAttrListCollection* readCdoTube{*readHandleTube}; 
+  if ( readCdoTube==nullptr ) {
+    ATH_MSG_ERROR("readCdoTube==nullptr");
+    return StatusCode::FAILURE; 
+  }   
+  EventIDRange rangeTube;
+  if ( !readHandleTube.range(rangeTube) ) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleTube.key());
+    return StatusCode::FAILURE;
+  }  
+  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleTube.fullKey() << " readCdoTube->size()= " << readCdoTube->size());
+  ATH_MSG_INFO("Range of input is " << rangeTube);
+  
+  // Inverse of wire propagation speed
+  float inversePropSpeed = 1./(299.792458*m_prop_beta);
+
+  // unpack the strings in the collection and update the 
+  // MdtTubeCalibContainers in TDS
+  CondAttrListCollection::const_iterator itr;
+  for (itr = readCdoTube->begin(); itr != readCdoTube->end(); ++itr) {
+    const coral::AttributeList &atr = itr->second;
+    std::string header="",payload="",trailer="";
+
+    bool t0_ts_applied = (atr["tech"].data<int>() & MuonCalib::TIME_SLEWING_CORRECTION_APPLIED);
+    // If BLOB data then uncompress
+    if (atr["data"].specification().type() == typeid(coral::Blob)) {
+      ATH_MSG_VERBOSE( "Data load is a blob. Uncompressing");
+      if(!uncompressInMyBuffer(atr["data"].data<coral::Blob>())) {
+	ATH_MSG_FATAL( "Cannot uncompress buffer" );
+	return StatusCode::FAILURE;
+      }
+      std::string istr(reinterpret_cast<char*>(m_decompression_buffer));
+      ATH_CHECK( extractString(istr, header, "\n") );
+      ATH_CHECK( extractString(istr, payload, "\n") );
+      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
+    } else {        //else is uncompressed CLOB (no longer used)
+      std::string data;
+      data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
+      ATH_MSG_VERBOSE( "Data load is " << data );
+
+      // interpret as string stream
+      std::string istr(data.c_str());
+      ATH_CHECK( extractString(istr, header, "\n") );
+      ATH_CHECK( extractString(istr, payload, "\n") );
+      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
+    }
+    ATH_MSG_VERBOSE( "Read header:" << header << " payload:" << payload << " trailer:" << trailer );
+
+    // Extract info from the header line, chamber name, number of tubes.
+    int ieta=-99, iphi=-99, region=-99, ntubes=-99;
+    //    std::string rName;
+
+    // parameters for the MdtTubeContainer
+    // header filename,version,region,tubes
+    char *parameters = new char [header.size()+1];
+    strncpy(parameters, header.c_str(), header.size()+1);
+    parameters[header.size()] = '\0';      //terminate string
+    char *pch = strtok(parameters," _,");  //split using delimiters "_" and ","
+    std::string name(pch,2,3);             //extract 3-character station to "name" (e.g. BIL) 
+
+    // Split header line and extract phi, eta, region, ntubes
+    pch = strtok (NULL, "_,");
+    for( int i=1; pch!=NULL; pch=strtok(NULL,"_,"), i++ ) {
+      std::istringstream is(pch);
+      if(i==1) {
+	is >> iphi; 
+      } else if(i==2) {
+	is >> ieta; 
+      } else if(i==4) {
+	is >> region; 
+      } else if(i==5) {
+	is >> ntubes; 
+      }
+    }
+    delete [] parameters;
+
+    // find chamber ID
+    Identifier chId = m_mdtIdHelper->elementID(name,ieta,iphi);
+ 
+    MuonCalib::MdtTubeCalibContainer *tubes = NULL;
+
+    // get chamber hash
+    IdentifierHash hash;
+    IdContext idCont = m_mdtIdHelper->module_context();
+    m_mdtIdHelper->get_hash( chId , hash, &idCont );
+
+    if( msgLvl(MSG::VERBOSE) ) {
+      ATH_MSG_VERBOSE( "name of chamber is " << pch << " station name is " << name );
+      ATH_MSG_VERBOSE( "phi value is " << iphi );
+      ATH_MSG_VERBOSE( "eta value is " << ieta );
+      ATH_MSG_VERBOSE( "region value is " << region );
+      ATH_MSG_VERBOSE( "ntubes value is " << ntubes );
+      ATH_MSG_VERBOSE( "station name is " << name << " chamber ID  is " << chId );
+      ATH_MSG_VERBOSE( "corresponding hash is " << hash );
+    }
+    
+   //skip illegal stations.     
+    if (hash>=writeCdoTube->size()) {
+      ATH_MSG_INFO( "Illegal station (1)! (" << name << "," << iphi << "," << ieta << ")" );
+      continue;
+    }
+                                                                                
+    // retrieve the existing one (created by defaultt0() )
+    tubes = (*writeCdoTube)[hash];
+
+    if(tubes==NULL) {
+      ATH_MSG_INFO( "Illegal station (2)! (" << name << "," << iphi << "," << ieta << ")" );
+      continue;
+    }
+    
+    int nml       = tubes->numMultilayers();
+    int nlayers   = tubes->numLayers();
+    int ntubesLay = tubes->numTubes();
+    int size      = nml*nlayers*ntubesLay;
+
+    if(size!=ntubes) {
+      ATH_MSG_ERROR( "Pre-existing MdtTubeCalibContainer for chamber ID " <<chId<< " size does not match the one found in DB ");
+      return StatusCode::FAILURE;
+    }
+
+    //Extract T0, ADCcal, valid flag for each tube from payload.
+    MuonCalib::MdtTubeCalibContainer::SingleTubeCalib datatube;
+    char *TubePar= new char [payload.size()+1];
+    strncpy(TubePar, payload.c_str(), payload.size()+1);
+    TubePar[payload.size()]='\0';
+    
+    //Loop over payload 
+    char *pch1=strtok(TubePar,",");
+    int ml=1, l=1, t=1;
+    for( int k=1; pch1!=NULL; pch1=strtok(NULL,", "), k++) { 
+      if(k==1) {
+	double tzero = atof(pch1);
+	if( m_t0Shift != 0. ){
+	  tzero += m_t0Shift;
+	  ATH_MSG_VERBOSE( "T0 shift " << m_t0Shift << " t0 " << tzero 
+			   << " id " << ml << " " << l << " " << t );
+	}
+	if(m_t0Spread != 0. ){
+	  double sh = CLHEP::RandGaussZiggurat::shoot(p_engine,0.,m_t0Spread);
+	  tzero += sh;
+	  ATH_MSG_VERBOSE( "T0 spread " << sh << " t0 " << tzero 
+			   << " id " << ml << " " << l << " " << t );
+	}
+	if(!t0_ts_applied && m_TimeSlewingCorrection) {
+	  tzero += m_TsCorrectionT0;
+	}
+	if(t0_ts_applied && !m_TimeSlewingCorrection) {
+	  tzero -= m_TsCorrectionT0;
+	}
+	datatube.t0=tzero;
+      } else if(k==2) {
+	datatube.statusCode = atoi(pch1);
+      } else if(k==3) {
+        datatube.adcCal = atof(pch1);
+        datatube.inversePropSpeed = inversePropSpeed;
+        tubes->setCalib( ml-1,l-1,t-1,datatube);
+        ATH_MSG_VERBOSE( "Loading T0s "<<ml << " " << l << " " << t << " " << datatube.t0 );
+        t++; k=0;
+        if (t>ntubesLay) {
+          l++; 
+          t=1;
+        }
+        if (l>nlayers) {
+          ml++;
+          l=1;
+        }
+      }
+    }
+    delete [] TubePar;
+  }//end loop over readCdoTube
+
+  //finally record writeCdo
+
+  if ( writeCdoTube->size()==0 ) {
+    ATH_MSG_WARNING("writeCdoTube->size()==0"); 
+    return StatusCode::FAILURE;
+  }
+  if (writeHandleTube.record(rangeTube, std::move(writeCdoTube)).isFailure()) {
+    ATH_MSG_FATAL("Could not record " << writeHandleTube.key()
+		  << " with EventRange " << rangeTube
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_INFO("recorded new " << writeHandleTube.key()
+	       << " with range " << rangeTube
+	       << " into Conditions Store");
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode MdtCalibDbAlg::finalize(){  
+  ATH_MSG_DEBUG( "finalize " << name() );
+  return StatusCode::SUCCESS;
+}
+
+
+// Build a MuonCalib::MdtTubeCalibContainer for a given Identifier
+MuonCalib::MdtTubeCalibContainer* MdtCalibDbAlg::buildMdtTubeCalibContainer(const Identifier &id) {    
+  MuonCalib::MdtTubeCalibContainer *tubes = 0;
+
+  const MuonGM::MdtReadoutElement *detEl = m_detMgr->getMdtReadoutElement( m_mdtIdHelper->channelID(id,1,1,1) );
+  const MuonGM::MdtReadoutElement *detEl2 = 0;
+  if (m_mdtIdHelper->numberOfMultilayers(id) == 2){
+    detEl2 = m_detMgr->getMdtReadoutElement(m_mdtIdHelper->channelID(id,2,1,1) );
+  } else {
+    ATH_MSG_VERBOSE( "A single multilayer for this station " << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(id))<<","<< m_mdtIdHelper->stationPhi(id) <<","<< m_mdtIdHelper->stationEta(id) );
+  }
+
+  ATH_MSG_VERBOSE( " new det el " << detEl );
+  
+  if( !detEl ){ 
+    ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_mdtIdHelper->print_to_string(id) );
+  } else {
+    int nml = 2;
+    if( !detEl2 ) nml = 1;
+    
+    int nlayers = detEl->getNLayers();
+    if( detEl2 && detEl2->getNLayers() > nlayers ){
+      ATH_MSG_DEBUG( "Second multilayer has more layers " << detEl2->getNLayers() << " then first " << nlayers );
+      nlayers = detEl2->getNLayers();
+    }
+
+    int ntubes = detEl->getNtubesperlayer();
+    if( detEl2 && detEl2->getNtubesperlayer() > ntubes ){
+      ATH_MSG_DEBUG( "Second multilayer has more tubes " << detEl2->getNtubesperlayer() << " then first " << ntubes );
+      ntubes = detEl2->getNtubesperlayer();
+    }
+
+    // build the region name in the format STATION_ETA_PHI
+    std::string rName;
+
+    int stName = m_mdtIdHelper->stationName(id);
+    int stPhi  = m_mdtIdHelper->stationPhi(id);
+    int stEta  = m_mdtIdHelper->stationEta(id);
+  
+    std::string separator("_");
+    MuonCalib::ToString ts;
+    rName = m_mdtIdHelper->stationNameString(stName);
+    rName += separator + ts( stPhi ) + separator + ts( stEta );
+    tubes = new MuonCalib::MdtTubeCalibContainer( rName,nml, nlayers, ntubes );
+  }
+
+  return tubes;
+}  //end MdtCalibDbAlg::buildMdtTubeCalibContainer
+
+inline bool MdtCalibDbAlg::uncompressInMyBuffer(const coral::Blob &blob) {
+  if (!m_decompression_buffer) {
+    m_buffer_length= 50000;
+    m_decompression_buffer = new Bytef[m_buffer_length];
+  }
+  uLongf actual_length;	
+  while(1) {
+    actual_length=m_buffer_length;
+    int res(uncompress(m_decompression_buffer, &actual_length, reinterpret_cast<const Bytef *>(blob.startingAddress()), static_cast<uLongf>(blob.size())));
+    if (res == Z_OK) break;
+    //double buffer if it was not big enough
+    if( res == Z_BUF_ERROR) {
+      m_buffer_length*=2;
+      ATH_MSG_VERBOSE(  "Increasing buffer to " << m_buffer_length);
+      delete [] m_decompression_buffer;
+      m_decompression_buffer = new Bytef[m_buffer_length];
+      continue;
+    }
+    //something else is wrong
+    return false;
+  }
+  //append 0 to terminate string, increase buffer if it is not big enough
+  if (actual_length >= m_buffer_length)	{
+    Bytef * old_buffer=m_decompression_buffer;
+    size_t old_length=m_buffer_length;
+    m_buffer_length*=2;
+    m_decompression_buffer = new Bytef[m_buffer_length];
+    memcpy(m_decompression_buffer, old_buffer, old_length);
+    delete [] old_buffer;
+  }
+  m_decompression_buffer[actual_length]=0;
+  return true;
+}
+
+inline MuonCalib::RtResolutionLookUp* MdtCalibDbAlg::getRtResolutionInterpolation( const std::vector<MuonCalib::SamplePoint> &sample_points) {
+
+  ///////////////
+  // VARIABLES //
+  ///////////////
+  Double_t *x = new Double_t[sample_points.size()];
+  Double_t *y = new Double_t[sample_points.size()];
+	
+  for (unsigned int i=0; i<sample_points.size(); i++) {
+    x[i] = sample_points[i].x1();
+    y[i] = sample_points[i].x2();
+  }
+  TSpline3 sp("Rt Res Tmp", x, y, sample_points.size());
+  ///////////////////////////////////////////////////////////////////
+  // CREATE AN RtRelationLookUp OBJECT WITH THE CORRECT PARAMETERS //
+  ///////////////////////////////////////////////////////////////////
+  unsigned int nb_points(100);
+  std::vector<double> res_param(nb_points+2); // r-t parameters
+  Double_t bin_width=(x[sample_points.size() -1] - x[0]) / static_cast<Double_t>(nb_points);
+	
+  res_param[0] = x[0];
+  res_param[1] = bin_width;
+  for (unsigned int k=0; k<nb_points; k++) {
+    Double_t xx = x[0] + k*bin_width;
+    res_param[k+2] = sp.Eval(xx);
+    if (std::isnan(res_param[k+2])) {
+      TFile outf("kacke.root", "RECREATE");
+      sp.Write("kacke");
+      exit(99);
+    }
+  }
+  delete [] x;
+  delete [] y;
+  return new MuonCalib::RtResolutionLookUp(res_param);
+}
+
+inline StatusCode MdtCalibDbAlg::extractString(std::string &input, std::string &output, std::string separator) {
+  unsigned long int pos = 0;
+  std::string::size_type start = input.find_first_not_of(separator.c_str(),pos);
+  if(start == std::string::npos) {
+    ATH_MSG_ERROR("MdtCalibDbAlg::extractString: Cannot extract string in a proper way!");
+    return StatusCode::FAILURE;
+  }
+  std::string::size_type stop = input.find_first_of(separator.c_str(),start+1);
+  if (stop == std::string::npos) stop = input.size();
+  output = input.substr(start,stop-start);
+  input.erase(pos,stop-pos);
+
+  return StatusCode::SUCCESS;
+}
+
+
+//like MdtCalibrationDbSvc
+//for corData in loadRt
+void MdtCalibDbAlg::initialize_B_correction(MuonCalib::MdtCorFuncSet *funcSet,
+                                                  const MuonCalib::MdtRtRelation *rt_rel) {
+  if (rt_rel==NULL) {
+    funcSet->setBField(NULL);
+    return;
+  }
+  ATH_MSG_VERBOSE( "initialize_B_correction..." );
+  std::vector<double> corr_params(2);
+  corr_params[0] = 3080.0; // high voltage (not correct for sMDT which use 2730V!)
+  corr_params[1] = 0.11;   // epsilon parameter
+  funcSet->setBField(new MuonCalib::BFieldCorFunc(std::string("medium"), corr_params, rt_rel->rt()));
+}
+
+void MdtCalibDbAlg::initializeSagCorrection(MuonCalib::MdtCorFuncSet *funcSet) {
+  ATH_MSG_VERBOSE( "initializeSagCorrection..." );
+  std::vector<double> corr_params(0);
+  funcSet->wireSag(new MuonCalib::WireSagCorFunc(corr_params));
+}
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
index ba05e576b4a..fc50e753e77 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
@@ -1,6 +1,8 @@
 #include "MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool.h"
+#include "MdtCalibDbCoolStrTool/MdtCalibDbAlg.h"
+#include "MdtCalibSvc/MdtCalibrationRegionSvc.h"
 
 using namespace MuonCalib;
 
 DECLARE_COMPONENT( MdtCalibDbCoolStrTool )
-
+DECLARE_COMPONENT( MdtCalibDbAlg )
diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
index f887b3d422e..b0411708424 100644
--- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
+++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
@@ -143,13 +143,38 @@ def setupMdtCondDB():
     from IOVDbSvc.CondDB import conddb
 
     if mdtCalibFlags.mdtCalibrationSource()=="MDT":
-        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix)
-        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix)
+        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix, className='CondAttrListCollection')
+        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix, className='CondAttrListCollection')
     else:
         from AthenaCommon.AppMgr import ServiceMgr
         ServiceMgr.TagInfoMgr.ExtraTagValuePairs += ["MDTCalibrationSource", mdtCalibFlags.mdtCalibrationSource()]
         specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(), '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix)
         specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(), '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix)
+
+    from AthenaCommon.AlgSequence import AthSequencer
+    from MdtCalibDbCoolStrTool.MdtCalibDbCoolStrToolConf import MdtCalibDbAlg
+    condSequence = AthSequencer("AthCondSeq")
+    condSequence += MdtCalibDbAlg("MdtCalibDbAlg")
+
+    if conddb.isOnline and not conddb.isMC:
+        MdtCalibDbAlg.TubeFolder = "/MDT/T0"
+        MdtCalibDbAlg.RtFolder = "/MDT/RT"
+    else:
+        MdtCalibDbAlg.TubeFolder = "/MDT/T0" + mdt_folder_name_appendix
+        MdtCalibDbAlg.RtFolder = "/MDT/RT" + mdt_folder_name_appendix
+    MdtCalibDbAlg.RT_InputFiles = ["Muon_RT_default.data"]
+    if globalflags.DataSource == 'data':
+        MdtCalibDbAlg.defaultT0 = 40
+    elif globalflags.DataSource == 'geant4':
+        MdtCalibDbAlg.defaultT0 = 799
+    MdtCalibDbAlg.UseMLRt = mdtCalibFlags.useMLRt()
+    MdtCalibDbAlg.TimeSlewingCorrection = mdtCalibFlags.correctMdtRtForTimeSlewing()
+    MdtCalibDbAlg.MeanCorrectionVsR = [ -5.45973, -4.57559, -3.71995, -3.45051, -3.4505, -3.4834, -3.59509, -3.74869, -3.92066, -4.10799, -4.35237, -4.61329, -4.84111, -5.14524 ]
+    MdtCalibDbAlg.PropagationSpeedBeta = mdtCalibFlags.mdtPropagationSpeedBeta()
+    MdtCalibDbAlg.CreateBFieldFunctions = mdtCalibFlags.correctMdtRtForBField()
+    MdtCalibDbAlg.CreateWireSagFunctions = mdtCalibFlags.correctMdtRtWireSag()
+    MdtCalibDbAlg.CreateSlewingFunctions = mdtCalibFlags.correctMdtRtForTimeSlewing()
+
 # end of function setupMdtCondDB()
 
 def MdtCalibDbTool(name="MdtCalibDbTool",**kwargs):
-- 
GitLab


From 1221c7b9abbda9268d2e22c3679e88657a940802 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Wed, 27 Feb 2019 21:31:06 +0100
Subject: [PATCH 078/404] using ReadCondHandle in MdtCalibrationDbSvc

---
 .../MdtCalibSvc/MdtCalibrationDbSvc.h         |  6 ++
 .../MdtCalibSvc/src/MdtCalibrationDbSvc.cxx   | 68 ++++++++++++-------
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
index 1056500b973..7bbc9aa90dc 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
@@ -34,6 +34,8 @@ namespace MuonCalib{
   struct MdtFullCalibData;
 }
 
+#include "StoreGate/ReadCondHandleKey.h"
+
 /** handles the retreival of constants from the DB: it uses a Tool 
  * derived from MuonCalib::IMdtCalibDBTool to access different types of DB
  * (currently implemented ASCII files and COOL CLOBS)*/
@@ -127,6 +129,10 @@ private:
 
   bool m_getTubeConstants; //<! flag to switch off loading of tube constants
   bool m_getCorrections;   //<! flag to switch off loading of correction function constants
+
+  SG::ReadCondHandleKey<MdtRtRelationCollection> m_readKeyRt;
+  SG::ReadCondHandleKey<MdtTubeCalibContainerCollection> m_readKeyTube;
+  SG::ReadCondHandleKey<MdtCorFuncSetCollection> m_readKeyCor;
     
 };
 
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
index c9cf4d6ec26..299fa546fdb 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
@@ -33,7 +33,10 @@ MdtCalibrationDbSvc::MdtCalibrationDbSvc(const std::string &n,ISvcLocator *sl)
     m_detStore("StoreGateSvc/DetectorStore", name()),
     m_tubeDataLocation("TubeKey"),
     m_rtDataLocation("RtKey"),
-    m_corDataLocation("CorKey")
+    m_corDataLocation("CorKey"),
+    m_readKeyRt("MdtRtRelationCollection"),
+    m_readKeyTube("MdtTubeCalibContainerCollection"),
+    m_readKeyCor("MdtCorFuncSetCollection")
 {
   declareProperty("DBTool", m_dbTool,
 		  "the Tool to be used to retrieve the constants");
@@ -105,7 +108,11 @@ StatusCode MdtCalibrationDbSvc::initialize() {
       return StatusCode::FAILURE;
     }
   }
-    
+
+  ATH_CHECK(m_readKeyRt.initialize());
+  ATH_CHECK(m_readKeyTube.initialize());
+  ATH_CHECK(m_readKeyCor.initialize());
+
   return StatusCode::SUCCESS;
 }  //end MdtCalibrationDbSvc::initialize
 
@@ -234,11 +241,15 @@ const MuonCalib::MdtTubeCalibContainer* MdtCalibrationDbSvc::getTubeCalibContain
 }
 
 const MuonCalib::MdtTubeCalibContainer* MdtCalibrationDbSvc::getTubeCalibContainer( const IdentifierHash &hash ) const {
-  if( !m_tubeData ) return 0;
 
-  // single tube calibrations are accessed per chamber 
-  if ( hash.is_valid() && hash < m_tubeData->size() ) { 
-    return (*m_tubeData)[ hash ]; 
+  SG::ReadCondHandle<MdtTubeCalibContainerCollection> readHandleTube{ m_readKeyTube };
+  const MdtTubeCalibContainerCollection* readCdoTube{*readHandleTube};
+  if ( readCdoTube==nullptr ) {
+    ATH_MSG_ERROR("readCdoTube==nullptr");
+    return 0;
+  }
+  if ( hash.is_valid() && hash < readCdoTube->size() ) {
+    return (*readCdoTube)[ hash ];
   }
   return 0;
 }
@@ -258,22 +269,22 @@ const MuonCalib::MdtRtRelation* MdtCalibrationDbSvc::getRtCalibration( const Ide
 }
 
 const MuonCalib::MdtRtRelation* MdtCalibrationDbSvc::getRtCalibration( const IdentifierHash &hash ) const {
-  // check whether there are cached rt's
-  if( !m_rtData ) {
-    ATH_MSG_WARNING( "No rt-calibrations loaded"  );
-    return 0;
-  }
   // check if hash is ok
   if ( !hash.is_valid() ) {
-    ATH_MSG_WARNING( "cannot get rt, invalid hash"  ); 
+    ATH_MSG_WARNING( "cannot get rt, invalid hash"  );
+    return 0;
+  }
+  SG::ReadCondHandle<MdtRtRelationCollection> readHandleRt{ m_readKeyRt };
+  const MdtRtRelationCollection* readCdoRt{*readHandleRt};
+  if ( readCdoRt==nullptr ) {
+    ATH_MSG_ERROR("readCdoRt==nullptr");
     return 0;
   }
-
   // Get the RT using the hash as an index
-  if( hash < m_rtData->size() ) { 
-    return (*m_rtData)[ hash ]; 
+  if( hash < readCdoRt->size() ) {
+    return (*readCdoRt)[ hash ];
   }
-  ATH_MSG_WARNING( "cannot get RT, region hash out of range"  ); 
+  ATH_MSG_WARNING( "cannot get RT, region hash out of range"  );
   return 0;
 }
 
@@ -292,17 +303,22 @@ const MuonCalib::MdtCorFuncSet* MdtCalibrationDbSvc::getCorFunctions( const Iden
 }
 
 const MuonCalib::MdtCorFuncSet* MdtCalibrationDbSvc::getCorFunctions( const IdentifierHash &hash ) const {
-  // check whether there are cached correction functions
-  if( !m_corData ) return 0;
-
-  // check if hash is ok
-  if ( !hash.is_valid() ) return 0;
-
-  // Get the correction functions using the hash as an index
-  if( hash < m_corData->size() ) { 
-    return (*m_corData)[ hash ]; 
+  if ( !hash.is_valid() ){
+    return 0;
+  }
+  //the loadRt was intended to keep m_corData nullptr and return 0 here so
+  if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ){
+    return 0;
+  }
+  SG::ReadCondHandle<MdtCorFuncSetCollection> readHandleCor{ m_readKeyCor };
+  const MdtCorFuncSetCollection* readCdoCor{*readHandleCor};
+  if ( readCdoCor==nullptr ) {
+    ATH_MSG_ERROR("readCdoCor==nullptr");
+    return 0;
+  }
+  if( hash < readCdoCor->size() ) {
+    return (*readCdoCor)[ hash ];
   }
-
   return 0;
 }
 
-- 
GitLab


From b26ebae8c3223da84f5ce73ec693b9a3e6af8948 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 21:29:25 +0100
Subject: [PATCH 079/404] Tidying CscOverlay Algorithm

Should return `StatusCode::FAILURE` if newly-created `SG::Read/WriteHandles` are invalid.

Drop obsolete code using `auto_ptr`. Make `overlayContainer` and `mergeCollections` methods private.
---
 .../CscOverlay/CscOverlay/CscOverlay.h        | 11 ++----
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx | 37 ++++++++++---------
 2 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index 4d612fd64cf..042c28904d7 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
@@ -28,8 +28,6 @@
 
 class CscIdHelper;
 
-namespace std { template<typename _Tp> class auto_ptr; }
-
 namespace CLHEP {
   class HepRandomEngine;
 }
@@ -43,20 +41,17 @@ public:
   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 */
-  void overlayContainer(const CscRawDataContainer* main, const CscRawDataContainer* overlay);
-  void overlayContainer(std::auto_ptr<CscRawDataContainer>& data, const CscRawDataContainer* mc) {
-    this->overlayContainer(data.get(), mc);
-  }
+  StatusCode overlayContainer(const CscRawDataContainer* main, const CscRawDataContainer* overlay);
 
   /** 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);
 
-private:
-
   /** get the data in one SPU of a chamber */
   void spuData( const CscRawDataCollection * coll, const uint16_t spuID, std::vector<const CscRawData*>& data);
 
diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
index aa847d094ed..7006962cdab 100644
--- a/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/CscOverlay/src/CscOverlay.cxx
@@ -54,26 +54,23 @@ StatusCode CscOverlay::initialize()
 StatusCode CscOverlay::execute() {
   ATH_MSG_DEBUG("CscOverlay::execute() begin");
   //----------------------------------------------------------------
-  SG::ReadHandle<CscRawDataContainer> inputBkgRDO(m_bkgInputKey);
-  if(!inputBkgRDO.isValid()) {
-    ATH_MSG_WARNING("Could not get background CscRawDataContainer  \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
-    return StatusCode::SUCCESS;
-  }
-  ATH_MSG_VERBOSE("Found CscRawDataContainer \"" << inputBkgRDO.name() << "\" in " << inputBkgRDO.store());
-  if ((inputBkgRDO->begin()==inputBkgRDO->end()) || !*(inputBkgRDO->begin())){
-    ATH_MSG_WARNING("Could not get nsamples, inputBkgRDO empty?");
+  SG::ReadHandle<CscRawDataContainer> bkgContainer(m_bkgInputKey);
+  if(!bkgContainer.isValid()) {
+    ATH_MSG_ERROR("Could not get signal CSC container " << 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> inputSignalRDO(m_signalInputKey);
-  if(!inputSignalRDO.isValid()) {
-    ATH_MSG_WARNING("Could not get signal CscRawDataContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
-    return StatusCode::SUCCESS;
+  SG::ReadHandle<CscRawDataContainer> signalContainer(m_signalInputKey);
+  if(!signalContainer.isValid()) {
+    ATH_MSG_ERROR("Could not get signal CSC container " << signalContainer.name() << " from store " << signalContainer.store());
+    return StatusCode::FAILURE;
   }
-  ATH_MSG_VERBOSE("Found CscRawOverlayContainer \"" << inputSignalRDO.name() << "\" in " << inputSignalRDO.store());
+  ATH_MSG_DEBUG("Found signal CscRawOverlayContainer called " << signalContainer.name() << " in store " << signalContainer.store());
 
   /* now do the overlay */
-  this->overlayContainer(inputBkgRDO.cptr(), inputSignalRDO.cptr());
+  ATH_CHECK(this->overlayContainer(bkgContainer.cptr(), signalContainer.cptr()));
 
   //----------------------------------------------------------------
   ATH_MSG_DEBUG("CscOverlay::execute() end");
@@ -81,14 +78,15 @@ StatusCode CscOverlay::execute() {
 }
 
 //================================================================
-void CscOverlay::overlayContainer(const CscRawDataContainer *main,
+StatusCode CscOverlay::overlayContainer(const CscRawDataContainer *main,
                                   const CscRawDataContainer *overlay)
 {
   ATH_MSG_DEBUG("overlayContainer<>() begin");
 
   SG::WriteHandle<CscRawDataContainer> outputContainer(m_outputKey);
   if (outputContainer.record(std::make_unique<CscRawDataContainer>()).isFailure()) {
-    ATH_MSG_ERROR("Failed to record " << m_outputKey);
+    ATH_MSG_ERROR("Could not record output CscRawDataContainer called " << outputContainer.name() << " to store " << outputContainer.store());
+    return StatusCode::FAILURE;
   }
 
   /** Add data from the main container to the output one */
@@ -219,11 +217,13 @@ void CscOverlay::overlayContainer(const CscRawDataContainer *main,
       }
 
       /** The new collection goes to m_storeGateOutput */
-      if(outputContainer->addCollection(out_coll.release(), out_coll->identify()).isFailure()) {
-        ATH_MSG_WARNING("overlayContainer(): Problem in outputContainer->addCollection(Identifier)");
+      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
       }
     }
 
@@ -231,6 +231,7 @@ void CscOverlay::overlayContainer(const CscRawDataContainer *main,
   }
 
   ATH_MSG_DEBUG("overlayContainer<>() end");
+  return StatusCode::SUCCESS;
 }
 
 // Copying CscRawDataCollection properties
-- 
GitLab


From 6c79829d15532756f9cd1cb72406841f0213c39c Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Wed, 27 Feb 2019 22:06:13 +0100
Subject: [PATCH 080/404] removed old callback functions and member data cache
 from MdtCalibrationDbSvc

---
 .../src/MdtCalibDbCoolStrTool.cxx             |  6 +-
 .../MdtCalibSvc/MdtCalibrationDbSvc.h         | 22 +----
 .../MdtCalibSvc/src/MdtCalibrationDbSvc.cxx   | 80 +------------------
 3 files changed, 7 insertions(+), 101 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
index b706960cc7a..6ebcd03bdb2 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
@@ -161,6 +161,10 @@ StatusCode MdtCalibDbCoolStrTool::initialize() {
 
   ATH_CHECK( m_idToFixedIdTool.retrieve() );
 
+  //In 2019 for the AthenaMT migration,
+  //old callback functions and member data cache were removed from MdtCalibrationDbSvc
+  //Please use MdtCalibDbAlg to provide derived data via the condition store
+  /*
   ServiceHandle<MdtCalibrationDbSvc> dbSvc("MdtCalibrationDbSvc", name());
   ATH_CHECK( dbSvc.retrieve() );
   ATH_MSG_DEBUG( "Retrieved MdtCalibrationDbSvc" );
@@ -173,7 +177,7 @@ StatusCode MdtCalibDbCoolStrTool::initialize() {
 				dynamic_cast<IMdtCalibDBTool*>(this),
 				&MdtCalibrationDbSvc::loadRt,
 				dynamic_cast<MdtCalibrationDbSvc*>(&*dbSvc)) );
-
+  */
   // initialize MdtTubeCalibContainers 
   ATH_CHECK( defaultT0s() );
   ATH_CHECK( detStore()->record( m_tubeData, m_tubeDataLocation, true ) );
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
index 7bbc9aa90dc..7fa7a07ef50 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
@@ -58,15 +58,7 @@ public:
   virtual StatusCode initialize(void);
   /** finalization */
   virtual StatusCode finalize(void);  
-    
-  /** to be called back to update the Collections : retrieve from database */
-  virtual StatusCode LoadCalibration(IOVSVC_CALLBACK_ARGS);
-  /** to be called back to update the Collections : retrieve RTs from database*/
-  virtual StatusCode loadRt(IOVSVC_CALLBACK_ARGS);
-  /** to be called back to update the Collections : 
-   * retrieve Tube inforsmation  from database */
-  virtual StatusCode loadTube(IOVSVC_CALLBACK_ARGS);
-    
+
   /** Access to calibration constants per calibration region/chamber */
   MuonCalib::MdtFullCalibData getCalibration( const Identifier &id ) const; 
     
@@ -95,15 +87,6 @@ public:
   const MuonCalib::MdtCorFuncSet* getCorFunctions( const IdentifierHash &detElHash ) const;
     
 private:
-  /** Indexed with MdtRegionHash for rt relations*/
-  mutable MdtRtRelationCollection *m_rtData;
-    
-  /** Indexed with MdtChamberHash */
-  mutable MdtTubeCalibContainerCollection *m_tubeData;
-    
-  /** Indexed with MdtRegionHash for correction function regions */
-  mutable MdtCorFuncSetCollection *m_corData;
-
   /** handle to region service */
   ServiceHandle<MdtCalibrationRegionSvc> m_regionSvc;
     
@@ -120,9 +103,6 @@ private:
   ServiceHandle<StoreGateSvc> m_detStore;
 
   /** Properties: */
-  std::string m_tubeDataLocation;
-  std::string m_rtDataLocation;
-  std::string m_corDataLocation;
   bool m_create_b_field_function; //<! flag to switch on loading of B field correction
   bool m_createWireSagFunction;   //<! flag to switch on loading of wire sag correction
   bool m_createSlewingFunction;   //<! flag to switch on loading of slewing correction
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
index 299fa546fdb..9716e798491 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
@@ -26,14 +26,11 @@
 #include "MdtCalibData/CalibFunc.h"
 
 MdtCalibrationDbSvc::MdtCalibrationDbSvc(const std::string &n,ISvcLocator *sl)
-  : AthService(n,sl), m_rtData(0), m_tubeData(0), m_corData(0), 
+  : AthService(n,sl),
     m_regionSvc("MdtCalibrationRegionSvc", name()),
     m_mdtIdHelper(0),
     m_dbTool("MuonCalib::MdtCalibDbAsciiTool"),
     m_detStore("StoreGateSvc/DetectorStore", name()),
-    m_tubeDataLocation("TubeKey"),
-    m_rtDataLocation("RtKey"),
-    m_corDataLocation("CorKey"),
     m_readKeyRt("MdtRtRelationCollection"),
     m_readKeyTube("MdtTubeCalibContainerCollection"),
     m_readKeyCor("MdtCorFuncSetCollection")
@@ -90,25 +87,6 @@ StatusCode MdtCalibrationDbSvc::initialize() {
     return StatusCode::FAILURE;
   }
 
-  // register call backs requiring to be called after the Tool 
-  // will work for Ascii Tool only
-  // for real DB access the callback is registered with 2 functions 
-  // within the Tool
-  if(m_dbTool.type()=="MuonCalib::MdtCalibDbAsciiTool"){
-    const DataHandle<MdtTubeCalibContainerCollection> tubeData;
-    if(m_detStore->regFcn(&MdtCalibrationDbSvc::LoadCalibration,dynamic_cast<MdtCalibrationDbSvc*>(this),tubeData,m_tubeDataLocation).isFailure()){
-      ATH_MSG_ERROR("Failed to register call-back on tube data");
-      return StatusCode::FAILURE;
-    }
-    const DataHandle<MdtRtRelationCollection> rtData;
-    if(m_detStore->regFcn(&MdtCalibrationDbSvc::LoadCalibration,
-			  dynamic_cast<MdtCalibrationDbSvc*>(this),
-			  rtData,m_rtDataLocation).isFailure() ){
-      ATH_MSG_ERROR("Failed to register call-back on rt data");
-      return StatusCode::FAILURE;
-    }
-  }
-
   ATH_CHECK(m_readKeyRt.initialize());
   ATH_CHECK(m_readKeyTube.initialize());
   ATH_CHECK(m_readKeyCor.initialize());
@@ -116,63 +94,7 @@ StatusCode MdtCalibrationDbSvc::initialize() {
   return StatusCode::SUCCESS;
 }  //end MdtCalibrationDbSvc::initialize
 
-StatusCode MdtCalibrationDbSvc::LoadCalibration(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
-  std::list<std::string>::const_iterator itr;
-  if( msgLvl(MSG::DEBUG) ) {
-    ATH_MSG_DEBUG( "LoadCalibration has been triggered for the following keys " );
-    for (itr=keys.begin(); itr!=keys.end(); ++itr) {
-      msg(MSG::DEBUG) << *itr << " I="<<I<<" ";
-    }
-    msg(MSG::DEBUG) << endmsg;
-  }
-  for (itr=keys.begin(); itr!=keys.end(); ++itr) {
-    msg(MSG::INFO) << *itr << " I="<<I<<" ";
-  }
-  msg(MSG::INFO) << endmsg;
-
-  for (itr=keys.begin(); itr!=keys.end(); ++itr) {
-    if(*itr==m_tubeDataLocation) {
-      if(loadTube(I,keys).isFailure()) return StatusCode::FAILURE;
-    }
-    if(*itr==m_rtDataLocation) {
-      if(loadRt(I,keys).isFailure()) return StatusCode::FAILURE;
-    }
-  }
-  return StatusCode::SUCCESS;
-}  //end MdtCalibrationDbSvc::LoadCalibration
-
-StatusCode MdtCalibrationDbSvc::loadTube(IOVSVC_CALLBACK_ARGS) { 
-  ATH_MSG_DEBUG( "In loadTube " );  
-  return m_detStore->retrieve(m_tubeData, m_tubeDataLocation);
-}
-
-StatusCode MdtCalibrationDbSvc::loadRt(IOVSVC_CALLBACK_ARGS) {
-  ATH_MSG_DEBUG( "In loadRt " );  
-
-  // Retrieve RT functions from StoreGate
-  if( m_detStore->retrieve(m_rtData, m_rtDataLocation).isFailure() ) return StatusCode::FAILURE;
-
-  // Check if doing corrections; return if not  
-  if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ) return StatusCode::SUCCESS;
-
-  //Delete old correction functions and create new ones
-  //The correction functions are made with the same regions as are used for RTs.
-  if( m_corData ) delete m_corData;
-  m_corData = new MdtCorFuncSetCollection();
-  m_corData->resize(m_rtData->size());
-  ATH_MSG_DEBUG( "Initializing " << m_corData->size() << " b-field functions" );
-  for (unsigned int i=0; i < m_corData->size(); i++) {
-    (*m_corData)[i] = new MuonCalib::MdtCorFuncSet();
-    if(m_create_b_field_function) initialize_B_correction((*m_corData)[i], (*m_rtData)[i]);
-    if(m_createWireSagFunction)   initializeSagCorrection((*m_corData)[i]);
-    if(m_createSlewingFunction)   (*m_corData)[i]->setSlewing(new MuonCalib::MdtSlewCorFuncHardcoded(MuonCalib::CalibFunc::ParVec()));
-  }
-
-  return StatusCode::SUCCESS;
-}  //end MdtCalibrationDbSvc::loadRt
-
 StatusCode MdtCalibrationDbSvc::finalize()  {
-  if( m_corData ) delete m_corData;
   return AthService::finalize();
 }
 
-- 
GitLab


From c7f2e9d3cb3de6757c97650f55aa0d28d928b916 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 27 Feb 2019 21:37:13 +0100
Subject: [PATCH 081/404] ISF_Config: Remove duplicate configuration entry.

Fix test failures in master.
---
 Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py b/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
index 2169138f6ba..d0265dae67a 100644
--- a/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
+++ b/Simulation/ISF/ISF_Config/python/ISF_ConfigConfigDb.py
@@ -46,7 +46,6 @@ addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_ATLFASTIIF_IDOnly",   "ISF_Ker
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_ATLFASTIIF_IDCalo",   "ISF_Kernel_ATLFASTIIF_IDCalo")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCalo",          "ISF_Kernel_G4FastCalo")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCaloDNN",          "ISF_Kernel_G4FastCaloDNN")
-addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCalo", "ISF_Kernel_G4FastCalo")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_G4FastCaloMT",         "ISF_Kernel_G4FastCaloMT")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_Fatras_newExtrapolation","ISF_Kernel_Fatras_newExtrapolation")
 addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_Fatras_newExtrapolation_IDOnly","ISF_Kernel_Fatras_newExtrapolation_IDOnly")
-- 
GitLab


From 7339c0653c0b3323ca658fc0082788bb4b676625 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:53:28 +0100
Subject: [PATCH 082/404] TGC_LinearSegmentMakerTool: Remove unConst().

IIntersector interfaces are now const; can remove unConst().
---
 .../src/TGC_LinearSegmentMakerTool.cxx                          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
index df63b2f8a9b..3af876cd36a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/TGC_LinearSegmentMakerTool/src/TGC_LinearSegmentMakerTool.cxx
@@ -255,7 +255,7 @@ void TGC_LinearSegmentMakerTool::find(const Trk::TrackRoad& road,
             goto done;
         }
         Trk::TrackSurfaceIntersection baseIsect(pos, dir, 0.0);
-        const Trk::TrackSurfaceIntersection* pNewBaseIsect = m_pIntersector.unConst()->intersectSurface(surface, &baseIsect, 0.0);
+        const Trk::TrackSurfaceIntersection* pNewBaseIsect = m_pIntersector->intersectSurface(surface, &baseIsect, 0.0);
         Amg::Vector2D pSegPos;
         bool loc_pos_ok(false);
 	if(pNewBaseIsect) {
-- 
GitLab


From 16fd46a90d21b0e04fc4e60e822124309161b5e7 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:33:31 +0100
Subject: [PATCH 083/404] AsgTools: Suppress cppcheck warning.

Suppress apparent cppcheck false positive.
---
 Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx b/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
index dd65ee6ebd9..f1cd7022093 100644
--- a/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
+++ b/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
@@ -500,6 +500,7 @@ namespace asg
 #ifdef XAOD_STANDALONE
       interfaceType_t *baseToolPtr = nullptr;
       AnaToolCleanup baseCleanup;
+      // cppcheck-suppress nullPointer
       ANA_CHECK (makeToolRootCore (toolName, baseToolPtr, baseCleanup));
       th = ToolHandle<interfaceType_t> (baseToolPtr);
       cleanup.swap (baseCleanup);
-- 
GitLab


From 3ce3c240e102b85c546d8e3824880bdfd5ee9d13 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:34:19 +0100
Subject: [PATCH 084/404] PathResolver: Fix cppcheck warnings.

cppcheck: Use compare() instead of find() for substrings that must be at the
start of a string.
---
 Tools/PathResolver/Root/PathResolver.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tools/PathResolver/Root/PathResolver.cxx b/Tools/PathResolver/Root/PathResolver.cxx
index c8aae45fb99..e521f202acc 100644
--- a/Tools/PathResolver/Root/PathResolver.cxx
+++ b/Tools/PathResolver/Root/PathResolver.cxx
@@ -310,7 +310,7 @@ std::string PathResolverFindDataFile (const std::string& logical_file_name)
 std::string PathResolver::find_calib_file (const std::string& logical_file_name)
 {
   msg(MSG::DEBUG) << "Trying to locate " << logical_file_name << endmsg;
-  if(logical_file_name.find("dev/")==0) {
+  if(logical_file_name.compare(0, 4, "dev/")==0) {
 #ifdef XAOD_ANALYSIS
     msg(MSG::WARNING)
 #else
@@ -332,7 +332,7 @@ std::string PathResolver::find_calib_file (const std::string& logical_file_name)
 std::string PathResolver::find_calib_directory (const std::string& logical_file_name)
 {
   msg(MSG::DEBUG) <<"Trying to locate " << logical_file_name << endmsg;
-  if(logical_file_name.find("dev/")==0) {
+  if(logical_file_name.compare(0, 4, "dev/")==0) {
 #ifdef XAOD_ANALYSIS
     msg(MSG::WARNING)
 #else
-- 
GitLab


From 8233fbd57bcc0b35a97d4c3479f5fc044828d685 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:49:18 +0100
Subject: [PATCH 085/404] TBRec: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 TestBeam/TBRec/src/CBNT_CaloH6.cxx            | 21 +++++++------------
 TestBeam/TBRec/src/CBNT_TBRecBase.cxx         | 11 +++++-----
 TestBeam/TBRec/src/CBNT_Timing.cxx            |  7 ++++---
 .../TBRec/src/TBBeamQualityEMFractionTool.cxx | 17 ++++++---------
 .../TBRec/src/TBBeamQualityEMFractionTool.h   |  5 +----
 .../TBRec/src/TBECLArRawChannelBuilder.cxx    | 11 +++-------
 TestBeam/TBRec/src/TBECLArRawChannelBuilder.h |  2 +-
 TestBeam/TBRec/src/TBLArRawChannelBuilder.cxx | 10 +++++----
 TestBeam/TBRec/src/TBLArRawChannelBuilder.h   |  2 +-
 TestBeam/TBRec/src/TBTree_CaloClusterH6.cxx   |  1 -
 .../TBRec/src/TBXMLCaloCellWriterTool.cxx     | 15 ++++---------
 11 files changed, 40 insertions(+), 62 deletions(-)

diff --git a/TestBeam/TBRec/src/CBNT_CaloH6.cxx b/TestBeam/TBRec/src/CBNT_CaloH6.cxx
index 1429de8253d..a575bfdf20a 100644
--- a/TestBeam/TBRec/src/CBNT_CaloH6.cxx
+++ b/TestBeam/TBRec/src/CBNT_CaloH6.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
 */
 
 //#####################################################
@@ -16,13 +16,8 @@
 
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloEvent/CaloCellContainer.h"
-
-//#include "CaloUtils/ICaloNoiseTool.h"
 #include "CaloInterface/ICaloNoiseTool.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
-// #include "CaloDetDescr/CaloDetDescrManager.h"
-
 #include "Identifier/Identifier.h"
 
 
@@ -66,22 +61,22 @@ StatusCode CBNT_CaloH6::CBNT_initialize()
   //   return sc;
   // }
   
-  //obtainine Identifier helpers
-  // m_hecID_help = m_larMgr->get_hec_id();
-  m_hecID_help = CaloIdManager::instance()->getHEC_ID();
+  // Identifier helpers
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_hecID_help = idHelper->hec_idHelper();
   if (!m_hecID_help) {
     ATH_MSG_ERROR ( "unable to obtain hec id " );
     return StatusCode::FAILURE;
   }
-  // m_emecID_help = m_larMgr->get_em_id();
-  m_emecID_help = CaloIdManager::instance()->getEM_ID();
+
+  m_emecID_help = idHelper->em_idHelper();
   if (!m_emecID_help) {
     ATH_MSG_ERROR ( "unable to obtain emec id " );
     return StatusCode::FAILURE;
   }
   
-  // m_fcalID_help = m_larMgr->get_fcal_id();
-  m_fcalID_help =  CaloIdManager::instance()->getFCAL_ID();
+  m_fcalID_help =  idHelper->fcal_idHelper();
   if (!m_fcalID_help) {
     ATH_MSG_ERROR ( "unable to obtain fcal id " );
     return StatusCode::FAILURE;
diff --git a/TestBeam/TBRec/src/CBNT_TBRecBase.cxx b/TestBeam/TBRec/src/CBNT_TBRecBase.cxx
index feecf4e6ebd..30dcb2cd63c 100644
--- a/TestBeam/TBRec/src/CBNT_TBRecBase.cxx
+++ b/TestBeam/TBRec/src/CBNT_TBRecBase.cxx
@@ -5,7 +5,7 @@
 #include "CBNT_TBRecBase.h"
 
 #include "LArIdentifier/LArOnlineID.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "GaudiKernel/ITHistSvc.h"
 
 
@@ -30,10 +30,11 @@ StatusCode CBNT_TBRecBase::initialize() {
     return sc;
   }
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
 
   if (!m_emId) {
diff --git a/TestBeam/TBRec/src/CBNT_Timing.cxx b/TestBeam/TBRec/src/CBNT_Timing.cxx
index 7f97df4ae5f..439e7572b11 100644
--- a/TestBeam/TBRec/src/CBNT_Timing.cxx
+++ b/TestBeam/TBRec/src/CBNT_Timing.cxx
@@ -9,7 +9,7 @@
 #include "CaloEvent/CaloCell.h"
 #include "CaloEvent/CaloCellContainer.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 #include "LArIdentifier/LArOnlineID.h"
 #include "TBEvent/TBScintillatorCont.h"
@@ -64,8 +64,9 @@ StatusCode CBNT_Timing::CBNT_initialize() {
 
   ATH_MSG_DEBUG  ( "CBNT_Timing in initialize()" );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
 
   ATH_CHECK( m_cablingKey.initialize() );
   ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
diff --git a/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.cxx b/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.cxx
index 88d4fb11027..d58d3aa42eb 100644
--- a/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.cxx
+++ b/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.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
 */
 
 //#####################################################
@@ -25,7 +25,6 @@ TBBeamQualityEMFractionTool::TBBeamQualityEMFractionTool(const std::string& name
   : TBBeamQualityTool(name,type,parent),
     m_StoreGate(nullptr),
     m_detStore(nullptr),
-    m_caloMgr(nullptr),
     m_emecID_help(nullptr),
     m_hecID_help(nullptr),
     m_fcalID_help(nullptr),
@@ -99,26 +98,22 @@ StatusCode TBBeamQualityEMFractionTool::initializeTool()
   
   
   // retrieve detector description manager for LAr subsystem
-  const DataHandle<CaloIdManager> m_caloMgr;
-  sc = m_detStore->retrieve(m_caloMgr);
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "unable to retrieve CaloIdManager from detector store"<< endmsg;
-    return sc;
-  }
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
   
   //obtainine Identifier helpers
-  m_hecID_help = m_caloMgr->getHEC_ID();
+  m_hecID_help = idHelper->hec_idHelper();
   if (!m_hecID_help) {
     log << MSG::ERROR << "unable to obtain hec id " << endmsg;
     return StatusCode::FAILURE;
   }
-  m_emecID_help = m_caloMgr->getEM_ID();
+  m_emecID_help = idHelper->em_idHelper();
   if (!m_emecID_help) {
     log << MSG::ERROR << "unable to obtain emec id " << endmsg;
     return StatusCode::FAILURE;
   }
   
-  m_fcalID_help = m_caloMgr->getFCAL_ID();
+  m_fcalID_help = idHelper->fcal_idHelper();
   if (!m_fcalID_help) {
     log << MSG::ERROR << "unable to obtain fcal id " << endmsg;
     return StatusCode::FAILURE;
diff --git a/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.h b/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.h
index 27c67b0191e..9b06e9242cb 100644
--- a/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.h
+++ b/TestBeam/TBRec/src/TBBeamQualityEMFractionTool.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,7 +20,6 @@
 //#include "LArDetDescr/LArDetDescrManager.h"
 
 #include "CaloIdentifier/CaloID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 class TBBeamQualityEMFractionTool : public TBBeamQualityTool
 {
@@ -42,8 +41,6 @@ class TBBeamQualityEMFractionTool : public TBBeamQualityTool
   
   //LArDetDescrManager* m_larMgr;
 
-  CaloIdManager* m_caloMgr;
-  
   // Identifier Pointers
   const LArEM_ID* m_emecID_help;
   const LArHEC_ID* m_hecID_help;
diff --git a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.cxx b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.cxx
index 9d878dbaac4..4ac9cf8ce19 100644
--- a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.cxx
+++ b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.cxx
@@ -111,7 +111,7 @@ StatusCode TBECLArRawChannelBuilder::initialize(){
     ATH_CHECK( m_adc2mevTool.retrieve() );
   } else {
     // pointer to detector manager:
-    m_calo_dd_man = CaloDetDescrManager::instance();
+    ATH_CHECK( detStore()->retrieve (m_calo_dd_man, "CaloMgr") );
     m_calo_id   = m_calo_dd_man->getCaloCell_ID();
     for (int i=0; i<30; i++) {
       m_adc2mev[i] = 0;
@@ -126,13 +126,8 @@ StatusCode TBECLArRawChannelBuilder::initialize(){
   }
   
   // ***
-  
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  if (!m_emId) {
-    ATH_MSG_ERROR ( "Could not get lar EM ID helper" );
-    return StatusCode::FAILURE;
-  }
+
+  m_emId=m_calo_id->em_idHelper();
   
   // translate offline ID into online ID
   ATH_CHECK( m_cablingKey.initialize() );
diff --git a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h
index 67a28d003b0..71af529c784 100644
--- a/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h
+++ b/TestBeam/TBRec/src/TBECLArRawChannelBuilder.h
@@ -20,7 +20,7 @@
 
 #include "LArIdentifier/LArOnlineID.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "StoreGate/ReadCondHandle.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "LArElecCalib/ILArHVScaleCorr.h"
diff --git a/TestBeam/TBRec/src/TBLArRawChannelBuilder.cxx b/TestBeam/TBRec/src/TBLArRawChannelBuilder.cxx
index c0fd74b537a..7411105fa6a 100644
--- a/TestBeam/TBRec/src/TBLArRawChannelBuilder.cxx
+++ b/TestBeam/TBRec/src/TBLArRawChannelBuilder.cxx
@@ -50,10 +50,12 @@ StatusCode TBLArRawChannelBuilder::initialize(){
     return StatusCode::FAILURE;
   }
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+
+  const CaloCell_ID* caloId = nullptr;
+  ATH_CHECK( detStore()->retrieve (caloId, "CaloCell_ID") );
+  m_emId=caloId->em_idHelper();
+  m_fcalId=caloId->fcal_idHelper();
+  m_hecId=caloId->hec_idHelper();
 
   ATH_CHECK( m_cablingKey.initialize() );
 
diff --git a/TestBeam/TBRec/src/TBLArRawChannelBuilder.h b/TestBeam/TBRec/src/TBLArRawChannelBuilder.h
index db994c499ed..142ba5d5ddf 100644
--- a/TestBeam/TBRec/src/TBLArRawChannelBuilder.h
+++ b/TestBeam/TBRec/src/TBLArRawChannelBuilder.h
@@ -14,7 +14,7 @@
 #include "LArRawEvent/LArRawChannelContainer.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
diff --git a/TestBeam/TBRec/src/TBTree_CaloClusterH6.cxx b/TestBeam/TBRec/src/TBTree_CaloClusterH6.cxx
index 6a0e92d734e..762cd037dcb 100644
--- a/TestBeam/TBRec/src/TBTree_CaloClusterH6.cxx
+++ b/TestBeam/TBRec/src/TBTree_CaloClusterH6.cxx
@@ -20,7 +20,6 @@
 
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloGain.h"
 #include "CaloGeoHelpers/CaloSampling.h"
 #include "CaloEvent/CaloCell.h"
diff --git a/TestBeam/TBRec/src/TBXMLCaloCellWriterTool.cxx b/TestBeam/TBRec/src/TBXMLCaloCellWriterTool.cxx
index 6c584eecfb5..f713b71d9af 100644
--- a/TestBeam/TBRec/src/TBXMLCaloCellWriterTool.cxx
+++ b/TestBeam/TBRec/src/TBXMLCaloCellWriterTool.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
 */
 
 
@@ -17,7 +17,6 @@
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 
 #include "CaloGeoHelpers/CaloSampling.h"
@@ -323,7 +322,8 @@ TBXMLCaloCellWriterTool::writeRunFiles(const std::string& fileDir,
   // Write Run Geometry //
   ////////////////////////
 
-  const CaloDetDescrManager* caloDetMgr = CaloDetDescrManager::instance();
+  const CaloDetDescrManager* caloDetMgr = nullptr;
+  ATH_CHECK( detStore()->retrieve (caloDetMgr, "CaloMgr") );
 
   IdentifierHash firstIndex, lastIndex, safeIndex;
   m_idHelper->calo_cell_hash_range((int)CaloCell_ID::LARFCAL,
@@ -431,14 +431,7 @@ TBXMLCaloCellWriterTool::convertProperties()
   MsgStream log(msgSvc(),name());
 
   // get calo id helper
-  m_idHelper = CaloIdManager::instance()->getCaloCell_ID();
-  if ( m_idHelper == 0 )
-    {
-      log << MSG::ERROR
-	  << "cannot allocate CaloCell_ID helper!"
-	  << endmsg;
-      return StatusCode::FAILURE;
-    }
+  ATH_CHECK( detStore()->retrieve (m_idHelper, "CaloCell_ID") );
 
   //////////////////////
   // Get Calo Indices //
-- 
GitLab


From a1507ac6b9f3a33f34b8254cdcf553aad31f080f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:47:27 +0100
Subject: [PATCH 086/404] TBMonitoring: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../src/TBCaloResponseMonTool.cxx             | 24 ++-----------------
 TestBeam/TBMonitoring/src/TBPhaseMonTool.cxx  |  1 -
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/TestBeam/TBMonitoring/src/TBCaloResponseMonTool.cxx b/TestBeam/TBMonitoring/src/TBCaloResponseMonTool.cxx
index f9ad09ab611..9159b89f6ab 100755
--- a/TestBeam/TBMonitoring/src/TBCaloResponseMonTool.cxx
+++ b/TestBeam/TBMonitoring/src/TBCaloResponseMonTool.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
 */
 
 
@@ -17,7 +17,6 @@
 #include "StoreGate/StoreGateSvc.h"
 
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 #include "CaloEvent/CaloCell.h"
 #include "CaloEvent/CaloCellContainer.h"
@@ -308,27 +307,8 @@ StatusCode TBCaloResponseMonTool::setupAction()
   // messaging
   MsgStream report(msgSvc(),name());
 
-  // get calo cell helper
-  const CaloIdManager* idManager = CaloIdManager::instance();
-  // problem
-  if ( idManager == 0 )
-    {
-      report << MSG::ERROR
-	     << "cannot allocate CaloCell Id manager object"
-	     << endmsg;
-      return StatusCode::FAILURE;
-    }
-
   // get cell id helper
-  m_caloCellHelper = idManager->getCaloCell_ID();
-  // check
-  if ( m_caloCellHelper == 0 )
-    {
-      report << MSG::ERROR
-	     << "cannot allocate CaloCell_ID helper"
-	     << endmsg;
-      return StatusCode::FAILURE;
-    }
+  ATH_CHECK( detStore()->retrieve (m_caloCellHelper, "CaloCell_ID") );
 
   // get calorimeter modules and regions
   std::vector<std::string>::const_iterator firstCalo = 
diff --git a/TestBeam/TBMonitoring/src/TBPhaseMonTool.cxx b/TestBeam/TBMonitoring/src/TBPhaseMonTool.cxx
index 1b80dbb5fb3..932961a965e 100644
--- a/TestBeam/TBMonitoring/src/TBPhaseMonTool.cxx
+++ b/TestBeam/TBMonitoring/src/TBPhaseMonTool.cxx
@@ -22,7 +22,6 @@
 #include "CaloEvent/CaloCellContainer.h"
 
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 // #include "CaloUtils/CaloSamplingHelper.h"
 
-- 
GitLab


From 2768f458a1fdf68562a1213f8fa1685153c9a018 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 27 Feb 2019 16:36:34 +0100
Subject: [PATCH 087/404] TBCnv: : Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
Further cleanups.
---
 TestBeam/TBCnv/src/ReadTBLArDigits.cxx | 116 +++++--------------------
 1 file changed, 21 insertions(+), 95 deletions(-)

diff --git a/TestBeam/TBCnv/src/ReadTBLArDigits.cxx b/TestBeam/TBCnv/src/ReadTBLArDigits.cxx
index e17b71acc2a..551d6f9935a 100644
--- a/TestBeam/TBCnv/src/ReadTBLArDigits.cxx
+++ b/TestBeam/TBCnv/src/ReadTBLArDigits.cxx
@@ -6,7 +6,7 @@
 #include "LArRawEvent/LArDigit.h"
 #include <vector>
 #include "GaudiKernel/IToolSvc.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 ReadTBLArDigits::SortDigits::SortDigits(const LArOnlineID* onlineHelper)
 {
@@ -37,28 +37,16 @@ ReadTBLArDigits::~ReadTBLArDigits()
 StatusCode ReadTBLArDigits::initialize()
 { MsgStream log(msgSvc(), name());
   log << MSG::INFO << "Initialize" << endmsg;
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
-  IToolSvc* toolSvc;
-  StatusCode sc=service( "ToolSvc",toolSvc  );
-  if (sc.isFailure()) {
-      log << MSG::ERROR << "Unable to retrieve ToolSvc" << endmsg;
-      return StatusCode::FAILURE;
-    }
 
-  sc=toolSvc->retrieveTool("LArCablingLegacyService",m_larCablingSvc);
-  if (sc.isFailure()) {
-      log << MSG::ERROR << "Unable to retrieve LArCablingService" << endmsg;
-      return StatusCode::FAILURE;
-    }
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
-  sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
+
+  ATH_CHECK( toolSvc()->retrieveTool("LArCablingLegacyService",m_larCablingSvc) );
 
   if (m_dumpFile.size()>0)
     m_outfile.open(m_dumpFile.c_str(),std::ios::out);
@@ -79,80 +67,18 @@ StatusCode ReadTBLArDigits::initialize()
      return StatusCode::FAILURE;
     }
 
-  sc=nt->addItem("icell",m_cellIndex,0,3600);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Cell Index' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  //sc=nt->addItem("layer",m_layer,0,4);
-  sc=nt->addItem("layer",m_cellIndex,m_layer);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Layer' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  //sc=nt->addItem("ieta",m_eta,0,510);
-  sc=nt->addItem("ieta",m_cellIndex,m_eta);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Eta' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("iphi",m_cellIndex,m_phi);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Phi' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'barrel_ec' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("pos_neg",m_cellIndex,m_pos_neg);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'pos_neg' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("FT",m_cellIndex,m_FT);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'FT' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("slot",m_cellIndex,m_slot);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'slot' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("channel",m_cellIndex,m_channel);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'channel' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("gain",m_cellIndex,m_gain);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Gain' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }  
-  
-  sc=nt->addItem("NSamples",m_Nsamples,0,32);
-  if (sc!=StatusCode::SUCCESS) {
-    log << MSG::ERROR << "addItem 'sampleIndex' failed" << endmsg;
-    return StatusCode::FAILURE;
-  }
-  
-  sc=nt->addItem("Samples",m_cellIndex,m_samples,32);
-  //sc=nt->addItem("Samples",m_cellIndex,m_samples,m_Nsamples);
-  if (sc!=StatusCode::SUCCESS) {
-    log << MSG::ERROR << "addItem failed" << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( nt->addItem("icell",m_cellIndex,0,3600) );
+  ATH_CHECK( nt->addItem("layer",m_cellIndex,m_layer) );
+  ATH_CHECK( nt->addItem("ieta",m_cellIndex,m_eta) );
+  ATH_CHECK( nt->addItem("iphi",m_cellIndex,m_phi) );
+  ATH_CHECK( nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec) );
+  ATH_CHECK( nt->addItem("pos_neg",m_cellIndex,m_pos_neg) );
+  ATH_CHECK( nt->addItem("FT",m_cellIndex,m_FT) );
+  ATH_CHECK( nt->addItem("slot",m_cellIndex,m_slot) );
+  ATH_CHECK( nt->addItem("channel",m_cellIndex,m_channel) );
+  ATH_CHECK( nt->addItem("gain",m_cellIndex,m_gain) );
+  ATH_CHECK( nt->addItem("NSamples",m_Nsamples,0,32) );
+  ATH_CHECK( nt->addItem("Samples",m_cellIndex,m_samples,32) );
   
   m_ntuplePtr=nt;
   m_count=0;
-- 
GitLab


From e3ed9e218cd5bb88b0a1c80e1dc773b8456715fc Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <john.kenneth.anders@cern.ch>
Date: Wed, 27 Feb 2019 14:32:56 +0000
Subject: [PATCH 088/404] Merge branch 'tilecal-new-laser-unpack-2019-02-19'
 into '21.0'

Tilecal new laser unpack 2019 02 19

See merge request atlas/athena!21336

(cherry picked from commit 23f84ad52c3e0eb68521bc9a4f51323ed7777a97)

06a074ae Added decoding of the timeout bits for QDC (bit 31) and TDC (bit 30) from the...
aadb60f9 Fixed intnesity bit mask
---
 .../src/TileLaserDefaultCalibTool.cxx          |  4 ++--
 .../TileEvent/TileEvent/TileLaserObject.h      | 18 ++++++++++++++++++
 .../TileEvent/src/TileLaserObject.cxx          | 10 ++++++++++
 .../TileByteStream/src/TileROD_Decoder.cxx     | 17 ++++++++++++-----
 4 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
index 0a8ec89e5aa..57c9288fd35 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
@@ -372,8 +372,8 @@ StatusCode TileLaserDefaultCalibTool::execute(){
   m_las_time = static_cast<double>(cispar[10])+static_cast<double>(cispar[11])/1000000;
   
   // Retrieve laser information
-  if(laserObj->getDiodeCurrOrd() == 0 || laserObj->getFiltNumber() == 0){
-    ATH_MSG_DEBUG ( "No filter number or diode current: wheel moving?" );
+  if(laserObj->getDiodeCurrOrd() == 0 || laserObj->getFiltNumber() == 0 || laserObj->getQDCTimeout()){
+    ATH_MSG_ERROR ( "No filter number or diode current: wheel moving or QDC timeout" );
     return StatusCode::SUCCESS; // This is expected for some events
   } // IF
   
diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h b/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h
index 7ffb999669f..d7c162c5327 100644
--- a/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h
+++ b/TileCalorimeter/TileEvent/TileEvent/TileLaserObject.h
@@ -99,6 +99,8 @@ public:
   int getShutter() const;
   int getInterlock() const;
   int getAlarm() const;
+  bool getQDCTimeout() const;
+  bool getTDCTimeout() const;
   
   void setLaser(const int Counter,
                 const int diodeCurrOrd,
@@ -143,6 +145,9 @@ public:
               const int alarm);
   
   void setDaqType(const unsigned int daqtype);
+  
+  void setTimeouts(const bool qdc, const bool tdc);
+
   enum daqType {daqPedestal=0x10, daqAlpha, daqLed, daqLinearity, daqLaser}; 
 
   
@@ -161,6 +166,8 @@ private:
   std::vector<TileLaserPmt> m_pmtsHG;
   std::vector<std::vector<TileLasCalib> > m_lascalib;
   TileLaserPLC m_plc;
+  bool m_qdctimeout; 
+  bool m_tdctimeout;
   
   int m_daqtype;
   // DAQ TYPES ARE RELEVANT FOR LASERII
@@ -297,6 +304,17 @@ inline int TileLaserObject::getAlarm() const
   return m_plc.getAlarm();
 }
 
+inline bool TileLaserObject::getQDCTimeout() const
+{
+  return m_qdctimeout;
+}
+
+inline bool TileLaserObject::getTDCTimeout() const
+{
+  return m_tdctimeout;
+}
+
+
 inline int TileLaserObject::getDaqType() const
 {
   return m_daqtype;
diff --git a/TileCalorimeter/TileEvent/src/TileLaserObject.cxx b/TileCalorimeter/TileEvent/src/TileLaserObject.cxx
index 39b90319b6b..4df70139807 100644
--- a/TileCalorimeter/TileEvent/src/TileLaserObject.cxx
+++ b/TileCalorimeter/TileEvent/src/TileLaserObject.cxx
@@ -23,6 +23,8 @@ TileLaserObject::TileLaserObject()
   , m_pmtsHG(nbPmts,TileLaserPmt())
   , m_lascalib(nbTypes,std::vector<TileLasCalib>(16))
   , m_plc()
+  , m_qdctimeout(false)
+  , m_tdctimeout(false)
   , m_daqtype(0)
   , m_BCID(0)
   , m_version(0)
@@ -287,6 +289,14 @@ void TileLaserObject::setPLC(const int alphaPos,
   
 }
 
+void TileLaserObject::setTimeouts(const bool qdc, 
+				  const bool tdc)
+{
+  m_qdctimeout = qdc;
+  m_tdctimeout = tdc;
+}
+
+
 void TileLaserObject::setDiode(const unsigned int diode,
                                const int diodeAdc,
                                const double diodePedestal,
diff --git a/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx b/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx
index 17700bc65db..fdb83180149 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx
+++ b/TileCalorimeter/TileSvc/TileByteStream/src/TileROD_Decoder.cxx
@@ -2415,20 +2415,27 @@ void TileROD_Decoder::unpack_frag17(uint32_t /* version */,
   // p[2]    00 00 00 tt    Daq Type
   // p[3]    nn nn nn nn    Laser Count
   // p[4]    rr rr mm mm    rrrr = Requested Intensity    mmmm = measured intensity
-  // p[5]    00 0f dd dd    f = filter    dddd = Delay Slama
+  // p[5]    t0 0f dd dd    t= timeout (bit 31 and 30) f = filter    dddd = Delay Slama
   // [[6]    00 00 ll ll    Linearity DAC Value
-  laserObject.setLaser(p[3], (p[4]>>16), (p[4] & 0xFFFF), (p[5]>>16) & 0x000F, (p[5] & 0xFFFF), 2);
-  laserObject.setControl(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99);
-  laserObject.setPLC(-99,-99,-99,-99,-99,-99);
-  laserObject.setDaqType(int(p[2]));
   
   ATH_MSG_DEBUG("SETTING DAQ TYPE IN DECODER = " << MSG::hex << "0x" << int(p[2]) << "  " << MSG::dec << int(p[2]));
   
   int countr = p[3];
   int idiode = (p[4]>>16);
+  int intensity = (p[4]&0xFFFF);
   int filter = (p[5]>>16) & 0x000F;
+  bool qdctimeout = !((p[5]>>31) & 0x1);
+  bool tdctimeout = !((p[5]>>30) & 0x1);
+
   int timing = (p[5] & 0xFFFF);
   int daqtyp = p[2];
+
+  laserObject.setLaser(countr, idiode, intensity, filter, timing, 2);
+  laserObject.setControl(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99);
+  laserObject.setPLC(-99,-99,-99,-99,-99,-99);
+  laserObject.setDaqType(daqtyp);
+  laserObject.setTimeouts(qdctimeout, tdctimeout);
+
   
   if(laserObject.isLASERII()) ATH_MSG_DEBUG("LASERII VERSION IS " << laserObject.getVersion());
   else                        ATH_MSG_DEBUG("LASERI VERSION IS "  << laserObject.getVersion());
-- 
GitLab


From 1f099d9dd5a730c5e9c7ab4ee65f71a81ee71acc Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Wed, 27 Feb 2019 11:03:08 +0000
Subject: [PATCH 089/404] Merge branch 'FTK_FastSim_Uncertainties_Compat' into
 '21.3'

Add new FTK uncertainty parametrization

See merge request atlas/athena!21432

(cherry picked from commit 561c22eba098222b809b03cd6a697b3726b73743)

7c54787a Minor cleanup
ac53edd6 Add new uncertainty parametrisation
fad3ce6e Double instead of float
3097ba14 Add new uncertainty parametrization, enabled by default
---
 .../IFTK_UncertaintyTool.h                    |  11 +-
 .../FTK_DataProviderSvc/FTK_UncertaintyTool.h |  11 +-
 .../src/FTK_UncertaintyTool.cxx               | 250 +++++++++++++++++-
 3 files changed, 253 insertions(+), 19 deletions(-)

diff --git a/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h b/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h
index 641b08749d8..815c2e75d88 100644
--- a/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h
+++ b/Trigger/TrigFTK/FTK_DataProviderInterfaces/FTK_DataProviderInterfaces/IFTK_UncertaintyTool.h
@@ -14,7 +14,7 @@ class FTK_RawTrack;
 //
 // Name the track paramaters
 //
-namespace FTKTrackParam{
+namespace FTKTrackParam {
   enum TP {
     d0          = 0,
     z0          = 1,
@@ -23,7 +23,7 @@ namespace FTKTrackParam{
     Ipt         = 4,
     qOp         = 5,
     theta       = 6,
-    pt          = 7
+    pt          = 7,
   };
 }
 
@@ -38,14 +38,13 @@ static const InterfaceID IID_IFTK_UncertaintyTool("IFTK_UncertaintyTool",1,0);
 
 class IFTK_UncertaintyTool : virtual public IAlgTool { 
 
- public:
+public:
   /** other standard AlgTool methods */
 
-  static const InterfaceID& interfaceID ()   //!< the Tool's interface
+  static const InterfaceID& interfaceID()   //!< the Tool's interface
   {  return IID_IFTK_UncertaintyTool; }  	
 
-  virtual double getParamCovMtx  (const FTK_RawTrack& trk, bool hasIBL, int id0, int id1) = 0;
-  
+  virtual double getParamCovMtx(const FTK_RawTrack& trk, bool hasIBL, int id0, int id1) = 0;
 };
 
 #endif
diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_UncertaintyTool.h b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_UncertaintyTool.h
index daf5db5b3ea..226db53bcc9 100644
--- a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_UncertaintyTool.h
+++ b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_UncertaintyTool.h
@@ -32,7 +32,7 @@
 class FTK_UncertaintyTool : public AthAlgTool, virtual public IFTK_UncertaintyTool
 {
 
- private :
+private:
 
   enum hasBL {
     noBL      = 0,
@@ -47,7 +47,7 @@ class FTK_UncertaintyTool : public AthAlgTool, virtual public IFTK_UncertaintyTo
     linear      = 1
   };
   
- public:
+public:
 
   FTK_UncertaintyTool( const std::string&, const std::string&, const IInterface* );
   virtual ~FTK_UncertaintyTool(){};
@@ -58,7 +58,7 @@ class FTK_UncertaintyTool : public AthAlgTool, virtual public IFTK_UncertaintyTo
   //
   //  Get the element of the covariance matrix for id0th and id1th track parameter 
   //
-  virtual double getParamCovMtx    (const FTK_RawTrack& trk, bool hasIBL, int id0, int id1);
+  virtual double getParamCovMtx(const FTK_RawTrack& trk, bool hasIBL, int id0, int id1);
 
   //
   //  Initialize the constants
@@ -69,6 +69,8 @@ class FTK_UncertaintyTool : public AthAlgTool, virtual public IFTK_UncertaintyTo
 
  private:
 
+  double getParamCovMtx_old(const FTK_RawTrack& trk, bool hasIBL, int id0, int id1);
+
   //
   //  Helper functions with the uncerianties
   //
@@ -186,7 +188,8 @@ class FTK_UncertaintyTool : public AthAlgTool, virtual public IFTK_UncertaintyTo
   //
   std::string m_ftkparversion;
 
-
+  // Enable old parametrisations
+  bool m_compatMode;
 };
 
 
diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
index 9f155f010b1..35da9583e15 100644
--- a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
+++ b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_UncertaintyTool.cxx
@@ -23,7 +23,144 @@
 #include "FTK_DataProviderSvc/FTK_UncertaintyTool.h"
 
 using std::map; using std::string;
-using std::cout; using std::endl; 
+using std::cout; using std::endl;
+
+namespace {
+  struct FastSimParameters
+  {
+    double amplCore;
+    double meanCore;
+    double aCore;
+    double bCore;
+    double amplTail;
+    double meanTail;
+    double aTail;
+    double bTail;
+  };
+
+  // Parameters in 2 IBL bins (hit/no hit) and 5 eta bins (0, 0.5, 1.0, 1.5, 2.0, 2.5)
+  using FastSimParameterSet = const FastSimParameters[2][5];
+
+  inline int EtaBin(double eta)
+  {
+    const double abseta = abs(eta);
+
+    if (abseta > 2.5)
+      return 4;
+
+    return static_cast<int>(abseta * 2);
+  }
+
+  inline int IBLBin(bool hasIBLHit)
+  {
+    return hasIBLHit ? 0 : 1;
+  }
+
+  inline double sigma(double a, double b, double invPt2)
+  {
+    return sqrt(a + b * (invPt2*invPt2));
+  }
+
+  double GetError(bool hasIBLHit, double eta, double invPt, FastSimParameterSet& parameters)
+  {
+    const int etabin = EtaBin(eta);
+    const int iblbin = IBLBin(hasIBLHit);
+
+    auto& params = parameters[iblbin][etabin];
+
+    const double invPt2 = 0.5 * invPt;
+
+    const double sigmaCore = sigma(params.aCore, params.bCore, invPt2);
+    const double sigmaTail = sigma(params.aTail, params.bTail, invPt2);
+
+    return (params.amplCore * sigmaCore + params.amplTail * sigmaTail) / (params.amplCore + params.amplTail);
+  }
+
+  const FastSimParameterSet FastSimParameters_d0 = {
+    {
+      {1.000000e+00, 0.000000e+00, 5.700200e-04, 5.437944e+04, 1.100000e-01, 0.000000e+00, 1.666591e-03, 3.586450e+05},
+      {1.000000e+00, 0.000000e+00, 4.844049e-04, 7.070505e+04, 1.100000e-01, 0.000000e+00, 2.693387e-03, 4.568432e+05},
+      {1.000000e+00, 0.000000e+00, 5.435634e-04, 1.064718e+05, 1.100000e-01, 0.000000e+00, 3.731382e-03, 6.174656e+05},
+      {1.000000e+00, 0.000000e+00, 9.325689e-04, 1.803775e+05, 1.100000e-01, 0.000000e+00, 6.702443e-03, 1.330276e+06},
+      {1.000000e+00, 0.000000e+00, 1.525671e-03, 3.459623e+05, 1.100000e-01, 0.000000e+00, 1.674857e-02, 3.133805e+06},
+    },
+    {
+      {1.000000e+00, 0.000000e+00, 3.365111e-04, 1.846811e+04, 1.100000e-01, 0.000000e+00, 1.164449e-03, 5.983721e+04},
+      {1.000000e+00, 0.000000e+00, 3.186037e-04, 2.331183e+04, 1.100000e-01, 0.000000e+00, 1.282122e-03, 7.966916e+04},
+      {1.000000e+00, 0.000000e+00, 4.012198e-04, 3.172024e+04, 1.100000e-01, 0.000000e+00, 1.644470e-03, 1.205381e+05},
+      {1.000000e+00, 0.000000e+00, 5.482587e-04, 4.827720e+04, 1.100000e-01, 0.000000e+00, 2.607949e-03, 1.921344e+05},
+      {1.000000e+00, 0.000000e+00, 8.326011e-04, 7.892970e+04, 1.100000e-01, 0.000000e+00, 6.407767e-03, 3.508604e+05},
+    },
+  };
+
+  const FastSimParameterSet FastSimParameters_z0 = {
+    {
+      {1.000000e+00, 0.000000e+00, 1.962677e-02, 9.086464e+04, 1.100000e-01, 0.000000e+00, 4.075973e-02, 1.726567e+06 },
+      {1.000000e+00, 0.000000e+00, 1.562178e-02, 2.516894e+05, 1.100000e-01, 0.000000e+00, 4.164214e-02, 1.302287e+06 },
+      {1.000000e+00, 0.000000e+00, 1.815425e-02, 5.192081e+05, 1.100000e-01, 0.000000e+00, 6.684842e-02, 2.826332e+06 },
+      {1.000000e+00, 0.000000e+00, 4.166662e-02, 1.631462e+06, 1.100000e-01, 0.000000e+00, 2.141205e-01, 1.240381e+07 },
+      {1.000000e+00, 0.000000e+00, 1.013725e-01, 8.650727e+06, 1.100000e-01, 0.000000e+00, 8.230914e-01, 8.169051e+07 },
+    },
+    {
+      {1.000000e+00, 0.000000e+00, 6.253207e-03, 5.240011e+04, 1.100000e-01, 0.000000e+00, 7.939942e-03, 1.517791e+05 },
+      {1.000000e+00, 0.000000e+00, 3.936087e-03, 7.066114e+04, 1.100000e-01, 0.000000e+00, 8.974887e-03, 2.283212e+05 },
+      {1.000000e+00, 0.000000e+00, 8.602167e-03, 1.869958e+05, 1.100000e-01, 0.000000e+00, 2.367743e-02, 6.415471e+05 },
+      {1.000000e+00, 0.000000e+00, 1.694396e-02, 5.427136e+05, 1.100000e-01, 0.000000e+00, 6.771001e-02, 1.933855e+06 },
+      {1.000000e+00, 0.000000e+00, 5.482604e-02, 1.907271e+06, 1.100000e-01, 0.000000e+00, 2.969994e-01, 8.139293e+06 },
+    },
+  };
+
+  const FastSimParameterSet FastSimParameters_eta = {
+    {
+      {1.000000e+00, 0.000000e+00, 1.204840e-06, 4.668120e+01, 1.100000e-01, 0.000000e+00, 2.043563e-06, 2.295754e+02 },
+      {1.000000e+00, 0.000000e+00, 6.419600e-07, 5.133359e+01, 1.100000e-01, 0.000000e+00, 1.496217e-06, 2.521133e+02 },
+      {1.000000e+00, 0.000000e+00, 5.447665e-07, 6.166226e+01, 1.100000e-01, 0.000000e+00, 1.546516e-06, 2.755418e+02 },
+      {1.000000e+00, 0.000000e+00, 5.665617e-07, 9.508760e+01, 1.100000e-01, 0.000000e+00, 3.171946e-06, 4.840149e+02 },
+      {1.000000e+00, 0.000000e+00, 9.373726e-07, 1.919797e+02, 1.100000e-01, 0.000000e+00, 6.897586e-06, 1.026491e+03 },
+    },
+    {
+      {1.000000e+00, 0.000000e+00, 7.496859e-07, 3.301107e+01, 1.100000e-01, 0.000000e+00, 1.642214e-06, 1.016009e+02 },
+      {1.000000e+00, 0.000000e+00, 4.564739e-07, 3.304368e+01, 1.100000e-01, 0.000000e+00, 1.254484e-06, 9.852592e+01 },
+      {1.000000e+00, 0.000000e+00, 4.366910e-07, 4.449627e+01, 1.100000e-01, 0.000000e+00, 1.937983e-06, 1.249774e+02 },
+      {1.000000e+00, 0.000000e+00, 5.777798e-07, 5.663534e+01, 1.100000e-01, 0.000000e+00, 2.589830e-06, 1.762125e+02 },
+      {1.000000e+00, 0.000000e+00, 9.363907e-07, 7.985674e+01, 1.100000e-01, 0.000000e+00, 5.036494e-06, 2.844372e+02 },
+    },
+  };
+
+  const FastSimParameterSet FastSimParameters_phi = {
+    {
+      {1.000000e+00, 0.000000e+00, 8.130652e-08, 3.158970e+01, 1.100000e-01, 0.000000e+00, 5.350961e-07, 1.538612e+02 },
+      {1.000000e+00, 0.000000e+00, 1.083964e-07, 4.038393e+01, 1.100000e-01, 0.000000e+00, 4.313475e-07, 2.150540e+02 },
+      {1.000000e+00, 0.000000e+00, 1.285549e-07, 6.095933e+01, 1.100000e-01, 0.000000e+00, 7.242223e-07, 2.976441e+02 },
+      {1.000000e+00, 0.000000e+00, 3.031775e-07, 1.054400e+02, 1.100000e-01, 0.000000e+00, 2.989829e-06, 6.108252e+02 },
+      {1.000000e+00, 0.000000e+00, 5.462634e-07, 1.970348e+02, 1.100000e-01, 0.000000e+00, 8.746469e-06, 1.054684e+03 },
+    },
+    {
+      {1.000000e+00, 0.000000e+00, 1.429275e-07, 1.833850e+01, 1.100000e-01, 0.000000e+00, 6.376208e-07, 5.786213e+01 },
+      {1.000000e+00, 0.000000e+00, 1.498748e-07, 2.295547e+01, 1.100000e-01, 0.000000e+00, 7.434808e-07, 7.394416e+01 },
+      {1.000000e+00, 0.000000e+00, 2.110908e-07, 3.174038e+01, 1.100000e-01, 0.000000e+00, 9.643213e-07, 1.106054e+02 },
+      {1.000000e+00, 0.000000e+00, 3.251302e-07, 4.917401e+01, 1.100000e-01, 0.000000e+00, 2.177912e-06, 1.753651e+02 },
+      {1.000000e+00, 0.000000e+00, 5.438376e-07, 7.807236e+01, 1.100000e-01, 0.000000e+00, 3.982290e-06, 3.344589e+02 },
+    },
+  };
+
+  const FastSimParameterSet FastSimParameters_Ipt = {
+    {
+      {1.000000e+00, 0.000000e+00, 2.176247e-12, 3.372455e-04, 1.100000e-01, 0.000000e+00, 1.619578e-11, 1.297069e-03 },
+      {1.000000e+00, 0.000000e+00, 2.515409e-12, 4.173315e-04, 1.100000e-01, 0.000000e+00, 1.640457e-11, 1.934070e-03 },
+      {1.000000e+00, 0.000000e+00, 2.969128e-12, 8.230829e-04, 1.100000e-01, 0.000000e+00, 3.165478e-11, 3.211156e-03 },
+      {1.000000e+00, 0.000000e+00, 1.241242e-11, 1.492929e-03, 1.100000e-01, 0.000000e+00, 1.667900e-10, 5.584656e-03 },
+      {1.000000e+00, 0.000000e+00, 1.853669e-11, 2.362025e-03, 1.100000e-01, 0.000000e+00, 2.258558e-10, 9.794419e-03 },
+    },
+    {
+      {1.000000e+00, 0.000000e+00, 1.826416e-12, 3.552206e-04, 1.100000e-01, 0.000000e+00, 8.161897e-12, 1.196878e-03 },
+      {1.000000e+00, 0.000000e+00, 1.934396e-12, 4.709845e-04, 1.100000e-01, 0.000000e+00, 8.623748e-12, 1.524293e-03 },
+      {1.000000e+00, 0.000000e+00, 3.033192e-12, 8.394077e-04, 1.100000e-01, 0.000000e+00, 1.796648e-11, 2.951569e-03 },
+      {1.000000e+00, 0.000000e+00, 9.374058e-12, 1.578456e-03, 1.100000e-01, 0.000000e+00, 9.828657e-11, 4.168337e-03 },
+      {1.000000e+00, 0.000000e+00, 1.328649e-11, 2.343957e-03, 1.100000e-01, 0.000000e+00, 1.007092e-10, 8.286561e-03 },
+    },
+  };
+}
 
 
 FTK_UncertaintyTool::FTK_UncertaintyTool(const std::string& t, 
@@ -31,7 +168,8 @@ FTK_UncertaintyTool::FTK_UncertaintyTool(const std::string& t,
 					       const IInterface*  p ): 
   AthAlgTool(t,n,p),
   m_noIBL(false),
-  m_ftkparversion("DEC2017_V1")
+  m_ftkparversion("FEB2019"),
+  m_compatMode(false)
 {
   declareInterface< IFTK_UncertaintyTool >( this );
   declareProperty( "NoIBL",  m_noIBL);
@@ -46,18 +184,24 @@ StatusCode FTK_UncertaintyTool::initialize() {
   //   Load Constants
   //
   if(m_noIBL){
+    m_compatMode = true;
     LoadConstants_NoIBL();
   }
   else{
-    if(m_ftkparversion == "LEGACY"){
+    if(m_ftkparversion == "LEGACY") {
+      m_compatMode = true;
       LoadConstants();
     }
-    else if(m_ftkparversion == "DEC2017_V1"){
+    else if(m_ftkparversion == "DEC2017_V1") {
+      m_compatMode = true;
       LoadConstants_DEC2017_V1();
     }
-    else{
-      ATH_MSG_WARNING("m_ftkparversion not supported, reverting to default DEC2017_V1 parameters");
-      LoadConstants_DEC2017_V1();
+    else if (m_ftkparversion == "FEB2019") {
+      m_compatMode = false;
+    }
+    else {
+      m_compatMode = false;
+      ATH_MSG_WARNING("m_ftkparversion not supported, reverting to default FEB2019 parameters");
     }
   }
 
@@ -74,9 +218,9 @@ StatusCode FTK_UncertaintyTool::finalize() {
 //
 // Covariance Matrix if there is a BLayer Hit
 //
-double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL, int id0, int id1)
+double FTK_UncertaintyTool::getParamCovMtx_old(const FTK_RawTrack &trk, bool hasIBL, int id0, int id1)
 {
-  ATH_MSG_VERBOSE("In getParamCovMtx: id0: " << id0 << " id1: " << id1); 
+  ATH_MSG_VERBOSE("In getParamCovMtx (old parametrization): id0: " << id0 << " id1: " << id1); 
 
 
   //
@@ -168,6 +312,94 @@ double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL,
 
 }
 
+double FTK_UncertaintyTool::getParamCovMtx(const FTK_RawTrack &trk, bool hasIBL, int id0, int id1)
+{
+  if (m_compatMode) {
+    return getParamCovMtx_old(trk, hasIBL, id0, id1);
+  }
+
+  //
+  // Use diagonal Maxtrix for now
+  //
+  if (id0 != id1) {
+    return 0.;
+  }
+
+  ATH_MSG_VERBOSE("Using new parametrization");
+
+  double trkIpt = trk.getInvPt();
+  double trkTheta = atan2(1.0,trk.getCotTh());
+  double trkEta = -log(tan(trkTheta/2));
+
+  FastSimParameterSet *paramSet = nullptr;
+  switch (id0) {
+  case FTKTrackParam::d0:
+    paramSet = &FastSimParameters_d0;
+    break;
+
+  case FTKTrackParam::z0:
+    paramSet = &FastSimParameters_z0;
+    break;
+
+  case FTKTrackParam::phi:
+    paramSet = &FastSimParameters_phi;
+    break;
+
+  case FTKTrackParam::eta:
+    paramSet = &FastSimParameters_eta;
+    break;
+
+  case FTKTrackParam::Ipt:
+    paramSet = &FastSimParameters_Ipt;
+    break;
+
+  case FTKTrackParam::qOp:
+    // derive from 1/pt errors
+    paramSet = &FastSimParameters_Ipt;
+    break;
+
+  case FTKTrackParam::theta:
+    // derive from eta errors
+    paramSet = &FastSimParameters_eta;
+    break;
+
+  case FTKTrackParam::pt:
+    // derive from 1/pt errors
+    paramSet = &FastSimParameters_Ipt;
+    break;
+  }
+
+  if (!paramSet) {
+    ATH_MSG_ERROR("Unknown track parameter ID: " << id0);
+    return 0.;
+  }
+
+  double sigmaTP = GetError(hasIBL, trkEta, trkIpt, *paramSet);
+
+  // handle derived uncertainties
+  switch (id0) {
+  case FTKTrackParam::qOp: {
+    // derive from 1/pt errors
+    const double sigmaEta = GetError(hasIBL, trkEta, trkIpt, FastSimParameters_eta);
+    sigmaTP= getSigmaQoverP(trkIpt, sigmaTP, trkEta, sigmaEta);
+  } break;
+
+  case FTKTrackParam::theta:
+    // derive from eta errors
+    sigmaTP = getSigmaTheta(trkEta, sigmaTP);
+    break;
+
+  case FTKTrackParam::pt:
+    // derive from 1/pt errors
+    sigmaTP = getSigmaPt(trkIpt, sigmaTP);
+    break;
+  }
+  
+  return sigmaTP*sigmaTP;
+}
+
+
+
 
 
 //
-- 
GitLab


From a6501e24998f5fbd3bb9d44d10f98b2cab3041b1 Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Thu, 28 Feb 2019 10:21:09 +0100
Subject: [PATCH 090/404] use reserve

---
 Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
index 3ccafd148b4..afca67d3bf2 100644
--- a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
@@ -99,7 +99,7 @@ StatusCode CaloLCWeightTool::initialize()
     ATH_MSG_INFO(  "Noise Tool retrieved"  );
   } 
  
-  m_sampnames.resize(CaloSampling::Unknown);
+  m_sampnames.reserve(CaloSampling::Unknown);
   for (int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
      m_sampnames[iSamp] = CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp);
   }
-- 
GitLab


From 85a708d226a99d205b15bec750a8b38e12e19f64 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Thu, 28 Feb 2019 09:56:10 +0000
Subject: [PATCH 091/404] Remove doMig5 logic. Add comment at top of file
 referencing the job options this is based on.

---
 .../share/RecExRecoTest_ART_muons_fromESD.py             | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
index f0113bfbb22..428977e8310 100644
--- a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
+++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_muons_fromESD.py
@@ -1,3 +1,4 @@
+#Based on MuonRecExample/MuonRec_myTopOptions.py
 from MuonRecExample.MuonRecFlags import muonRecFlags
 from RecExConfig.RecFlags import rec
 from RecExConfig.RecAlgsFlags import recAlgs
@@ -11,8 +12,6 @@ EvtMax = 10
 # Input
 #--------------------------------------------------------------------------------
 athenaCommonFlags.FilesInput = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root"]
-## flag for running in mig5
-doMig5 = False
 
 # in Standalone mode, don't allow any configuration errors
 athenaCommonFlags.AllowIgnoreConfigError = False
@@ -59,12 +58,6 @@ muonRecFlags.TrackPerfDebugLevel   = 5
 muonRecFlags.doCSCs                = True
 muonRecFlags.doNSWNewThirdChain    = True
 
-# flags to tweak standalone muon reconstruction
-if doMig5:
-    muonStandaloneFlags.doSegmentsOnly       = False
-    muonStandaloneFlags.patternsOnly         = False
-    muonStandaloneFlags.createTrackParticles = False
-
 muonStandaloneFlags.printSummary         = True
 muonCombinedRecFlags.doTrackPerformance  = True
 muonCombinedRecFlags.doMuGirl            = True
-- 
GitLab


From 33192284cd2c3e27d5de5de8623c077b8b007607 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 28 Feb 2019 10:48:12 +0100
Subject: [PATCH 092/404] LArByteStream: const fixes for Hid2RESrcID

Mark methods const where possible.
---
 .../LArByteStream/LArByteStream/Hid2RESrcID.h | 12 ++++-----
 .../LArCnv/LArByteStream/src/Hid2RESrcID.cxx  | 26 +++++++++----------
 .../TrigT2CaloCommon/LArCellCont.h            |  2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/Hid2RESrcID.h b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/Hid2RESrcID.h
index de7eb0bf108..61387bc893a 100644
--- a/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/Hid2RESrcID.h
+++ b/LArCalorimeter/LArCnv/LArByteStream/LArByteStream/Hid2RESrcID.h
@@ -45,27 +45,27 @@ public:
 
   StatusCode initialize(); 
 
-  bool isInitialized(){ return m_initialized;} 
+  bool isInitialized() const { return m_initialized;}
 
   /** make a ROD SrcID for a HWIdentifier 
   */ 
-  uint32_t getRodID  (const HWIdentifier& hid); 
+  uint32_t getRodID  (const HWIdentifier& hid) const ;
 
   /** make a ROD SrcID for a COLLECTION_ID
   */ 
-  uint32_t getRodIDFromROM  (const COLLECTION_ID& hid); 
+  uint32_t getRodIDFromROM  (const COLLECTION_ID& hid) const;
 
   /** Make a ROB Source ID from a ROD source ID
   */ 
-  uint32_t getRobID  ( uint32_t rod_id); 
+  uint32_t getRobID  ( uint32_t rod_id) const;
 
   /** Make a ROS Source ID from a ROB source ID
   */ 
-  uint32_t getRosID  ( uint32_t rob_id); 
+  uint32_t getRosID  ( uint32_t rob_id) const;
 
   /** Make a SubDetector ID from ROS source ID 
   */
-  uint32_t getDetID  ( uint32_t ros_id); 
+  uint32_t getDetID  ( uint32_t ros_id) const;
 
 private: 
   bool m_initialized;
diff --git a/LArCalorimeter/LArCnv/LArByteStream/src/Hid2RESrcID.cxx b/LArCalorimeter/LArCnv/LArByteStream/src/Hid2RESrcID.cxx
index c683c145751..ecbcc88b7da 100644
--- a/LArCalorimeter/LArCnv/LArByteStream/src/Hid2RESrcID.cxx
+++ b/LArCalorimeter/LArCnv/LArByteStream/src/Hid2RESrcID.cxx
@@ -99,7 +99,7 @@ StatusCode Hid2RESrcID::initialize()
       SourceIdentifier sid = SourceIdentifier(detid,m); 
       uint32_t rod_id =  sid.code(); 
 
-      assert( m_coll2ROD.count(mId) == 0 )  ; 
+      assert( m_coll2ROD.count(mId) == 0 );
       m_coll2ROD[ mId ]=rod_id;        
 
     } 
@@ -111,7 +111,7 @@ StatusCode Hid2RESrcID::initialize()
 }
 
 
-uint32_t  Hid2RESrcID::getRodIDFromROM(const COLLECTION_ID& id)
+uint32_t  Hid2RESrcID::getRodIDFromROM(const COLLECTION_ID& id) const
 { // this method returns a RESrcID for the ROD, for a given COLLECTION_ID
 
   COLL_MAP::const_iterator it = m_coll2ROD.find( id ); 
@@ -124,7 +124,7 @@ uint32_t  Hid2RESrcID::getRodIDFromROM(const COLLECTION_ID& id)
 }
 
 
-uint32_t  Hid2RESrcID::getRodID(const HWIdentifier& hid)
+uint32_t  Hid2RESrcID::getRodID(const HWIdentifier& hid) const
 { // this method returns a RESrcID for the ROD, for a given LArOnlineID
   // channel number is ignored.
   HWIdentifier febId =  m_onlineHelper->feb_Id(hid) ;
@@ -136,36 +136,36 @@ uint32_t  Hid2RESrcID::getRodID(const HWIdentifier& hid)
 
 /** mapping SrcID from ROD to ROB
  */ 
-uint32_t Hid2RESrcID::getRobID( uint32_t rod_id)
+uint32_t Hid2RESrcID::getRobID( uint32_t rod_id) const
 {
 //  Change Module Type to ROB 
 
- SourceIdentifier  id  = SourceIdentifier(rod_id)         ; 
- SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), id.module_id()) ; 
- return    id2.code()                  ;
+ SourceIdentifier  id  = SourceIdentifier(rod_id);
+ SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), id.module_id());
+ return    id2.code();
 
 }
 
 
 /** mapping SrcID from ROB to ROS
  */ 
-uint32_t Hid2RESrcID::getRosID( uint32_t rob_id)
+uint32_t Hid2RESrcID::getRosID( uint32_t rob_id) const
 {
 //  Change Module Type to ROS, moduleid = 0  
 
  SourceIdentifier  id  = SourceIdentifier(rob_id);
- SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), 0)      ; 
- return    id2.code()       ; 
+ SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), 0);
+ return    id2.code();
 
 }
 
 /** mapping SrcID from ROS to Det
  */ 
-uint32_t Hid2RESrcID::getDetID  ( uint32_t ros_id) 
+uint32_t Hid2RESrcID::getDetID  ( uint32_t ros_id) const
 {
 //  ROS to DET
 
  SourceIdentifier  id  = SourceIdentifier(ros_id);
- SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), 0) ; 
- return    id2.code() ; 
+ SourceIdentifier  id2 = SourceIdentifier(id.subdetector_id(), 0);
+ return    id2.code();
 }
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
index 596b05ff65b..efc58be4a70 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
@@ -90,7 +90,7 @@ private:
 	/** Hash ID Identifier mapping to collection index. */
 	LArRodIdHash m_hash;
 	/** Hardware to Source ID conversion */
-	mutable Hid2RESrcID m_conv;
+	Hid2RESrcID m_conv;
 	/** FEB Hardware Identifier for second FEBs in a
 	    Collection */
 	std::vector<HWIdentifier> m_second;
-- 
GitLab


From 384636531859f7d8118d8d9bf1762062f8a0d8ef Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 28 Feb 2019 11:19:13 +0100
Subject: [PATCH 093/404] TrigCaloRec: enable static thread safety checker

Enable the thread safety checker. Ignore files that contain legacy
trigger code and known to be not thread-safe.

References:
- https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins#thread_plugin
- https://gitlab.cern.ch/atlas/atlasexternals/tree/master/External/CheckerGccPlugins
---
 Trigger/TrigAlgorithms/TrigCaloRec/CMakeLists.txt              | 1 +
 .../TrigCaloRec/TrigCaloRec/ATLAS_CHECK_THREAD_SAFETY          | 1 +
 .../TrigCaloRec/TrigCaloRec/FullCaloCellContMaker.h            | 3 +++
 .../TrigCaloRec/TrigCaloRec/RoIFCalEmCellContMaker.h           | 3 +++
 .../TrigCaloRec/TrigCaloRec/RoIFCalHadCellContMaker.h          | 3 +++
 .../TrigCaloRec/TrigCaloRec/RoILArEMCellContMaker.h            | 3 +++
 .../TrigCaloRec/TrigCaloRec/RoILArHadCellContMaker.h           | 3 +++
 .../TrigCaloRec/TrigCaloRec/RoITileCellContMaker.h             | 3 +++
 .../TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx   | 1 +
 .../TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx  | 1 +
 .../TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx | 2 +-
 .../TrigAlgorithms/TrigCaloRec/src/RoILArEMCellContMaker.cxx   | 1 +
 .../TrigAlgorithms/TrigCaloRec/src/RoILArHadCellContMaker.cxx  | 2 +-
 .../TrigAlgorithms/TrigCaloRec/src/RoITileCellContMaker.cxx    | 1 +
 14 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigCaloRec/CMakeLists.txt
index 942152e38e7..6cbafbe726a 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/CMakeLists.txt
@@ -21,6 +21,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigTools/TrigTimeAlgs
                           PRIVATE
+                          Control/CxxUtils
                           Calorimeter/CaloDetDescr
                           Calorimeter/CaloGeoHelpers
                           Calorimeter/CaloIdentifier
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..376c34cc9bf
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigCaloRec
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/FullCaloCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/FullCaloCellContMaker.h
index f43475dec4a..d138ce722f7 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/FullCaloCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/FullCaloCellContMaker.h
@@ -26,6 +26,9 @@
 
 #include "AthenaMonitoring/IMonitorToolBase.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class FullCaloCellContMaker : public IAlgToolEFCalo {
 	 public:
            // Constructor
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalEmCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalEmCellContMaker.h
index be14fe27d6c..3ff5374ddf9 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalEmCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalEmCellContMaker.h
@@ -26,6 +26,9 @@
 
 #include "IRegionSelector/IRoiDescriptor.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class RoIFCalEmCellContMaker : public IAlgToolEFCalo {
 	 public:
            // Constructor
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalHadCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalHadCellContMaker.h
index c956f81c8ba..d2f1454a829 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalHadCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoIFCalHadCellContMaker.h
@@ -26,6 +26,9 @@
 
 #include "IRegionSelector/IRoiDescriptor.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class RoIFCalHadCellContMaker : public IAlgToolEFCalo {
 	 public:
            // Constructor
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArEMCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArEMCellContMaker.h
index 1e49c39f196..fef0c83d82d 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArEMCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArEMCellContMaker.h
@@ -26,6 +26,9 @@
 
 #include "IRegionSelector/IRoiDescriptor.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class RoILArEMCellContMaker : public IAlgToolEFCalo {
 
 	 public:
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArHadCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArHadCellContMaker.h
index 1d628b1d7a7..6e967c13b8c 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArHadCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoILArHadCellContMaker.h
@@ -26,6 +26,9 @@
 
 #include "IRegionSelector/IRoiDescriptor.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class RoILArHadCellContMaker : public IAlgToolEFCalo {
 	 public:
            // Constructor
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoITileCellContMaker.h b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoITileCellContMaker.h
index a8e8e5d1850..0f848a0e225 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoITileCellContMaker.h
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/TrigCaloRec/RoITileCellContMaker.h
@@ -25,6 +25,9 @@
 
 #include "IRegionSelector/IRoiDescriptor.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class RoITileCellContMaker : public IAlgToolEFCalo {
 	 public:
            // Constructor
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx
index a9cc4eed17d..9ebac24dc3a 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/FullCaloCellContMaker.cxx
@@ -32,6 +32,7 @@
 
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 FullCaloCellContMaker::FullCaloCellContMaker(const std::string & type, const std::string & name,
 //         const IInterface* parent): IAlgToolEFCalo(type, name, parent), 
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx
index 7cd279ad03c..591950d7ad7 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalEmCellContMaker.cxx
@@ -33,6 +33,7 @@
 
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 RoIFCalEmCellContMaker::RoIFCalEmCellContMaker(const std::string & type, const std::string & name,
 	     const IInterface* parent): IAlgToolEFCalo(type, name, parent),
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx
index afdf99a2e72..51d53b6f376 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoIFCalHadCellContMaker.cxx
@@ -29,9 +29,9 @@
 //#include <Identifier/HWIdentifier.h>
 #include "CaloInterface/ICalorimeterNoiseTool.h"
 
-
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 RoIFCalHadCellContMaker::RoIFCalHadCellContMaker(const std::string & type, const std::string & name,
 	 const IInterface* parent): IAlgToolEFCalo(type, name, parent),
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArEMCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArEMCellContMaker.cxx
index 42741598d03..9ea99b0f6eb 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArEMCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArEMCellContMaker.cxx
@@ -31,6 +31,7 @@
 
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 RoILArEMCellContMaker::RoILArEMCellContMaker(const std::string & type, const std::string & name,
 	 const IInterface* parent): IAlgToolEFCalo(type, name, parent),
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArHadCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArHadCellContMaker.cxx
index 1fd077ef110..331378ba1b3 100644
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArHadCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoILArHadCellContMaker.cxx
@@ -29,9 +29,9 @@
 //#include <Identifier/HWIdentifier.h>
 #include "CaloInterface/ICalorimeterNoiseTool.h"
 
-
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 RoILArHadCellContMaker::RoILArHadCellContMaker(const std::string & type, const std::string & name,
 	 const IInterface* parent): IAlgToolEFCalo(type, name, parent),
diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoITileCellContMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoITileCellContMaker.cxx
index 3a402d903d0..c86ec2a4c27 100755
--- a/Trigger/TrigAlgorithms/TrigCaloRec/src/RoITileCellContMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/RoITileCellContMaker.cxx
@@ -27,6 +27,7 @@
 
 #include <math.h>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // legacy trigger code
 
 RoITileCellContMaker::RoITileCellContMaker(const std::string & type, const std::string & name,
         const IInterface* parent): IAlgToolEFCalo(type, name, parent),
-- 
GitLab


From 36a3ae32734d34fecdcacf27f901c2f2ca208fed Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Thu, 28 Feb 2019 11:25:50 +0100
Subject: [PATCH 094/404] Updated all projects to atlasexternals-2.0.24.

---
 Projects/AnalysisBase/externals.txt   | 2 +-
 Projects/AnalysisTop/externals.txt    | 2 +-
 Projects/AthDataQuality/externals.txt | 2 +-
 Projects/AthSimulation/externals.txt  | 2 +-
 Projects/Athena/externals.txt         | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index 119d56c789a..ead962ca27d 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.23
+AnalysisBaseExternalsVersion = 2.0.24
diff --git a/Projects/AnalysisTop/externals.txt b/Projects/AnalysisTop/externals.txt
index 59bef4b7c15..33393f68871 100644
--- a/Projects/AnalysisTop/externals.txt
+++ b/Projects/AnalysisTop/externals.txt
@@ -1,4 +1,4 @@
 # Versions of the various externals to build before starting the build of
 # this project, when doing a full stack nightly build.
 
-AnalysisBaseExternalsVersion = 2.0.23
+AnalysisBaseExternalsVersion = 2.0.24
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index cd387a019d7..c4562fadd94 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.23
+AtlasExternalsVersion = 2.0.24
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index a8a7d88cbed..7a965a681ea 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.23
+AthSimulationExternalsVersion = 2.0.24
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index eba68852703..6344db7470d 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.23
+AthenaExternalsVersion = 2.0.24
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
-- 
GitLab


From a05e1eee7a158049bcc1f9633219c376b17128b7 Mon Sep 17 00:00:00 2001
From: Jing Chen <jing.chen@cern.ch>
Date: Thu, 28 Feb 2019 10:26:46 +0000
Subject: [PATCH 095/404] Update MM_Digitization package to use MMSimHit to
 produce digits (ATLASSIM-3755)

---
 .../MM_Digitization/MM_DigitizationTool.h     |  13 +-
 .../MM_Digitization/MM_SortedHitVector.h      |   6 +-
 .../python/MM_DigitizationConfig.py           |   4 +-
 .../src/MM_DigitizationTool.cxx               | 199 ++++++++----------
 4 files changed, 100 insertions(+), 122 deletions(-)

diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitizationTool.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitizationTool.h
index 74ac47149c3..19635ce53b5 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitizationTool.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 MM_DIGITIZATIONTOOL_H
@@ -39,8 +39,8 @@
 #include "MagFieldInterfaces/IMagFieldSvc.h" // 15/06/2015 T.Saito
 
 #include "HitManagement/TimedHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHitCollection.h"
-#include "MuonSimEvent/GenericMuonSimHit.h"
+#include "MuonSimEvent/MMSimHitCollection.h"
+#include "MuonSimEvent/MMSimHit.h"
 #include "PileUpTools/PileUpToolBase.h"
 #include "Identifier/Identifier.h"
 
@@ -139,7 +139,7 @@ class MM_DigitizationTool : virtual public IMuonDigitizationTool, public PileUpT
 		StatusCode getNextEvent();
 		StatusCode doDigitization();
 
-		bool  checkMMSimHit(const GenericMuonSimHit& /* hit */ ) const;
+		bool  checkMMSimHit(const MMSimHit& /* hit */ ) const;
 		MM_ElectronicsToolInput combinedStripResponseAllHits(const std::vector< MM_ElectronicsToolInput > & v_stripDigitOutput);
 
 		// Services
@@ -163,13 +163,13 @@ class MM_DigitizationTool : virtual public IMuonDigitizationTool, public PileUpT
 		const MmIdHelper*       m_idHelper;
 		MicromegasHitIdHelper*  m_muonHelper;
 		const MuonGM::MuonDetectorManager* m_MuonGeoMgr;
-		std::list<GenericMuonSimHitCollection*> m_MMHitCollList;
+		std::list<MMSimHitCollection*> m_MMHitCollList;
 
 		// Settings
 		double m_energyThreshold;
 		int m_maskMultiplet;
 		bool m_writeOutputFile;
-		TimedHitCollection<GenericMuonSimHit>* m_timedHitCollection_MM; // the pileup hits
+		TimedHitCollection<MMSimHit>* m_timedHitCollection_MM; // the pileup hits
 
 		std::string m_inputObjectName; // name of the input objects
 		std::string m_outputObjectName; // name of the output digits
@@ -183,7 +183,6 @@ class MM_DigitizationTool : virtual public IMuonDigitizationTool, public PileUpT
 
 		double m_timeWindowLowerOffset;
 		double m_timeWindowUpperOffset;
-		double m_DiffMagSecondMuonHit;
 
 		// StripsResponse stuff...
 		MM_StripsResponseSimulation *m_StripsResponseSimulation;
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_SortedHitVector.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_SortedHitVector.h
index ec8abb2862b..b7f51815ceb 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_SortedHitVector.h
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_SortedHitVector.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 MM_DIGITIZATION_MMSORTEDHITVECTOR_H
@@ -7,7 +7,7 @@
 /*******************************************************************************/
 class micromegas_hit_info {
  public:
-  micromegas_hit_info(Identifier i,double t,int ch,double strP,const TimedHitPtr<GenericMuonSimHit>* aHit) :
+  micromegas_hit_info(Identifier i,double t,int ch,double strP,const TimedHitPtr<MMSimHit>* aHit) :
     id(i),time(t),charge(ch),stripPos(strP),simhit(aHit) {}
     micromegas_hit_info(Identifier i,double t,int ch) : id(i),time(t),charge(ch),stripPos(0),simhit(0) {}
       micromegas_hit_info() : time(0.),charge(0),stripPos(0),simhit(0) {}
@@ -15,7 +15,7 @@ class micromegas_hit_info {
 	double time;
 	int charge;
 	double stripPos;
-	const TimedHitPtr<GenericMuonSimHit>* simhit;
+	const TimedHitPtr<MMSimHit>* simhit;
 	bool operator < (const micromegas_hit_info& aInfo) const
 	{
 	  if(id <  aInfo.id)
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py
index 40e2bc3f08a..256dc13ed03 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.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
 
 #
 # Import MM_Digitization job properties
@@ -41,7 +41,7 @@ def getMMRange(name="MMRange", **kwargs):
     kwargs.setdefault('FirstXing', MM_FirstXing() )
     kwargs.setdefault('LastXing',  MM_LastXing() )
     kwargs.setdefault('CacheRefreshFrequency', 1.0 ) #default 0 no dataproxy reset
-    kwargs.setdefault('ItemList', ["GenericMuonSimHitCollection#MicromegasSensitiveDetector"] )
+    kwargs.setdefault('ItemList', ["MMSimHitCollection#MicromegasSensitiveDetector"] )
     return CfgMgr.PileUpXingFolder(name, **kwargs)
 
 
diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx
index f1463d8a85c..93a34261ee7 100644
--- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.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
 */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -124,7 +124,6 @@ MM_DigitizationTool::MM_DigitizationTool(const std::string& type, const std::str
 
 	m_timeWindowLowerOffset(0),
 	m_timeWindowUpperOffset(0),
-	m_DiffMagSecondMuonHit (0),
 
 	// Strip Response
 	m_StripsResponseSimulation(0),
@@ -198,7 +197,6 @@ MM_DigitizationTool::MM_DigitizationTool(const std::string& type, const std::str
 	declareProperty("UseTimeWindow",       m_useTimeWindow  =  true);
 	declareProperty("WindowLowerOffset",   m_timeWindowLowerOffset = -300.); // processBunchXing between -250 and 150 ns (look at config file)
 	declareProperty("WindowUpperOffset",   m_timeWindowUpperOffset = +300.);
-	declareProperty("DiffMagSecondMuonHit",m_DiffMagSecondMuonHit = 0.1);
 
 	// Constants vars for the MM_StripsResponseSimulation class
 	// qThreshold=2e, we accept a good strip if the charge is >=2e
@@ -376,7 +374,7 @@ StatusCode MM_DigitizationTool::prepareEvent(unsigned int nInputEvents) {
 	m_MMHitCollList.clear();
 
 	if(!m_timedHitCollection_MM) {
-		m_timedHitCollection_MM = new TimedHitCollection<GenericMuonSimHit>();
+		m_timedHitCollection_MM = new TimedHitCollection<MMSimHit>();
 	} else {
 		ATH_MSG_ERROR ( "m_timedHitCollection_MM is not null" );
 		return StatusCode::FAILURE;
@@ -385,49 +383,48 @@ StatusCode MM_DigitizationTool::prepareEvent(unsigned int nInputEvents) {
 	return StatusCode::SUCCESS;
 }
 /*******************************************************************************/
-  StatusCode MM_DigitizationTool::processBunchXing(int bunchXing,
-						  SubEventIterator bSubEvents,
-						  SubEventIterator eSubEvents) {
+StatusCode MM_DigitizationTool::processBunchXing(int bunchXing,
+	SubEventIterator bSubEvents,
+	SubEventIterator eSubEvents) {
+
+	ATH_MSG_DEBUG ( "MM_DigitizationTool::in processBunchXing()"  << bunchXing );
+
+        typedef PileUpMergeSvc::TimedList<MMSimHitCollection>::type TimedHitCollList;
+        TimedHitCollList hitCollList;
+
+        if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName, hitCollList, bunchXing,
+                                                bSubEvents, eSubEvents).isSuccess()) &&
+            hitCollList.size() == 0) {
+          ATH_MSG_ERROR("Could not fill TimedHitCollList");
+          return StatusCode::FAILURE;
+        } else {
+          ATH_MSG_VERBOSE(hitCollList.size() << " MMSimHitCollection with key " <<
+                          m_inputObjectName << " found");
+        }
+      
+        TimedHitCollList::iterator iColl(hitCollList.begin());
+        TimedHitCollList::iterator endColl(hitCollList.end());
+
+        // Iterating over the list of collections
+        for( ; iColl != endColl; iColl++){
+     
+          MMSimHitCollection *hitCollPtr = new MMSimHitCollection(*iColl->second);
+          PileUpTimeEventIndex timeIndex(iColl->first);
+     
+          ATH_MSG_DEBUG("MMSimHitCollection found with " << hitCollPtr->size() <<
+                        " hits");
+          ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
+                          << " index: " << timeIndex.index()
+                          << " type: " << timeIndex.type());
+     
+          m_timedHitCollection_MM->insert(timeIndex, hitCollPtr);
+          m_MMHitCollList.push_back(hitCollPtr);
+     
+        }
 
-  ATH_MSG_DEBUG ( "MM_DigitizationTool::in processBunchXing()"  << bunchXing );
-
-  typedef PileUpMergeSvc::TimedList<GenericMuonSimHitCollection>::type TimedHitCollList;
-  TimedHitCollList hitCollList;
-
-  if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName, hitCollList, bunchXing,
-                                          bSubEvents, eSubEvents).isSuccess()) &&
-      hitCollList.size() == 0) {
-    ATH_MSG_ERROR("Could not fill TimedHitCollList");
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_VERBOSE(hitCollList.size() << " GenericMuonSimHitCollection with key " <<
-                    m_inputObjectName << " found");
-  }
-
-  TimedHitCollList::iterator iColl(hitCollList.begin());
-  TimedHitCollList::iterator endColl(hitCollList.end());
-
-  // Iterating over the list of collections
-  for( ; iColl != endColl; iColl++){
-
-    GenericMuonSimHitCollection *hitCollPtr = new GenericMuonSimHitCollection(*iColl->second);
-    PileUpTimeEventIndex timeIndex(iColl->first);
-
-    ATH_MSG_DEBUG("GenericMuonSimHitCollection found with " << hitCollPtr->size() <<
-                  " hits");
-    ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
-                    << " index: " << timeIndex.index()
-                    << " type: " << timeIndex.type());
-
-    m_timedHitCollection_MM->insert(timeIndex, hitCollPtr);
-    m_MMHitCollList.push_back(hitCollPtr);
-
-  }
-
-  return StatusCode::SUCCESS;
+	return StatusCode::SUCCESS;
 }
 
-
 /*******************************************************************************/
 StatusCode MM_DigitizationTool::getNextEvent() {
 
@@ -441,9 +438,9 @@ StatusCode MM_DigitizationTool::getNextEvent() {
 	}
 
 	//  get the container(s)
-	typedef PileUpMergeSvc::TimedList<GenericMuonSimHitCollection>::type TimedHitCollList;
+	typedef PileUpMergeSvc::TimedList<MMSimHitCollection>::type TimedHitCollList;
 
-	//this is a list<info<time_t, DataLink<GenericMuonSimHitCollection> > >
+	//this is a list<info<time_t, DataLink<MMSimHitCollection> > >
 	TimedHitCollList hitCollList;
 
 	ATH_CHECK( m_mergeSvc->retrieveSubEvtsData(m_inputObjectName, hitCollList) );
@@ -457,7 +454,7 @@ StatusCode MM_DigitizationTool::getNextEvent() {
 
 	// create a new hits collection - Define Hit Collection
 	if(!m_timedHitCollection_MM) {
-		m_timedHitCollection_MM = new TimedHitCollection<GenericMuonSimHit>();
+		m_timedHitCollection_MM = new TimedHitCollection<MMSimHit>();
 	}else{
 		ATH_MSG_ERROR ( "m_timedHitCollection_MM is not null" );
 		return StatusCode::FAILURE;
@@ -469,7 +466,7 @@ StatusCode MM_DigitizationTool::getNextEvent() {
 
 	// loop on the hit collections
 	while(iColl != endColl) {
-		const GenericMuonSimHitCollection* tmpColl(iColl->second);
+		const MMSimHitCollection* tmpColl(iColl->second);
 		m_timedHitCollection_MM->insert(iColl->first, tmpColl);
 		ATH_MSG_DEBUG ( "MMSimHitCollection found with " << tmpColl->size() << " hits"  );
 		++iColl;
@@ -493,8 +490,8 @@ StatusCode MM_DigitizationTool::mergeEvent() {
 	}
 
 	// remove cloned one in processBunchXing......
-	std::list<GenericMuonSimHitCollection*>::iterator MMHitColl = m_MMHitCollList.begin();
-	std::list<GenericMuonSimHitCollection*>::iterator MMHitCollEnd = m_MMHitCollList.end();
+	std::list<MMSimHitCollection*>::iterator MMHitColl = m_MMHitCollList.begin();
+	std::list<MMSimHitCollection*>::iterator MMHitCollEnd = m_MMHitCollList.end();
 	while(MMHitColl!=MMHitCollEnd) {
 		delete (*MMHitColl);
 		++MMHitColl;
@@ -565,11 +562,11 @@ StatusCode MM_DigitizationTool::recordDigitAndSdoContainers() {
 StatusCode MM_DigitizationTool::doDigitization() {
 
 
-	GenericMuonSimHitCollection* inputSimHitColl=nullptr;
+	MMSimHitCollection* inputSimHitColl=nullptr;
 
 	IdentifierHash detectorElementHash=0;
 
-	inputSimHitColl = new GenericMuonSimHitCollection("MicromegasSensitiveDetector");
+	inputSimHitColl = new MMSimHitCollection("MicromegasSensitiveDetector");
 	ATH_CHECK( m_storeGateService->record(inputSimHitColl,"InputMicroMegasHits") );
 
 	if( m_maskMultiplet == 3 ) {
@@ -587,8 +584,7 @@ StatusCode MM_DigitizationTool::doDigitization() {
 	v_stripDigitOutput.clear();
 
 	//iterate over hits and fill id-keyed drift time map
-	TimedHitCollection< GenericMuonSimHit >::const_iterator i, e;
-	const GenericMuonSimHit* previousHit = nullptr;
+	TimedHitCollection< MMSimHit >::const_iterator i, e;
 
 	std::map<Identifier,int> hitsPerChannel;
 	int nhits = 0;
@@ -606,28 +602,17 @@ StatusCode MM_DigitizationTool::doDigitization() {
 			//
 
 
-			TimedHitPtr<GenericMuonSimHit> phit = *i++;
+			TimedHitPtr<MMSimHit> phit = *i++;
 			m_eventTime = phit.eventTime();
-			const GenericMuonSimHit& hit(*phit);
-
-			if( previousHit && abs(hit.particleEncoding())==13 && abs(previousHit->particleEncoding())==13 ) {
-				Amg::Vector3D diff = previousHit->localPosition() - hit.localPrePosition();
-				ATH_MSG_DEBUG("Second hit from a muon: prev "
-								<<     previousHit->localPosition()
-								<< " current "
-								<<     hit.localPrePosition()
-								<< " diff "
-								<<     diff
-								);
-				if( diff.mag() < m_DiffMagSecondMuonHit ) continue;
-			}
+			const MMSimHit& hit(*phit);
+
 			m_n_hitPDGId = hit.particleEncoding();
 			m_n_hitDepositEnergy = hit.depositEnergy();
 			m_n_hitKineticEnergy = hit.kineticEnergy();
 
 			const Amg::Vector3D globalHitPosition = hit.globalPosition();
 
-			m_globalHitTime = hit.globalpreTime();
+			m_globalHitTime = hit.globalTime();
 			m_tofCorrection = globalHitPosition.mag()/CLHEP::c_light;
 			m_bunchTime = m_globalHitTime - m_tofCorrection + m_eventTime;
 
@@ -650,16 +635,16 @@ StatusCode MM_DigitizationTool::doDigitization() {
 			m_n_StrRespCharge.clear();
 			m_n_StrRespTime.clear();
 
-			const int hitID = hit.GenericId();
+			const int hitID = hit.MMId();
 			// the G4 time or TOF from IP
 			// double G4Time(hit.globalTime());
-			// see what are the members of GenericMuonSimHit
+			// see what are the members of MMSimHit
 
 			// convert sim id helper to offline id
 			MM_SimIdToOfflineId simToOffline(*m_idHelper);
 
 			//get the hit Identifier and info
-			int simId=hit.GenericId();
+			int simId=hit.MMId();
 			layerID = simToOffline.convert(simId);
 
 			// Read the information about the Micro Megas hit
@@ -689,18 +674,13 @@ StatusCode MM_DigitizationTool::doDigitization() {
 
 			// For collection of inputs to throw back in SG
 
-			GenericMuonSimHit* copyHit = new GenericMuonSimHit( hitID,
+			MMSimHit* copyHit = new MMSimHit( hitID,
 																m_globalHitTime+m_eventTime,
-																m_eventTime,
 																globalHitPosition,
-																hit.localPosition(),
-																hit.globalPrePosition(),
-																hit.localPrePosition(),
 																hit.particleEncoding(),
 																hit.kineticEnergy(),
 																hit.globalDirection(),
 																hit.depositEnergy(),
-																hit.StepLength(),
 																hit.trackNumber()
 																);
 
@@ -933,35 +913,35 @@ StatusCode MM_DigitizationTool::doDigitization() {
 
 
 			const MuonGM::MuonChannelDesign* mmChannelDesign = detectorReadoutElement->getDesign(digitID);
-            // As of September 12 2018, to reduce the number of errors and warnings in MM digitization,
-            // we assign the strips in the dead regions stripNumber=1 (short term fix).
-            // The distToChannel validation breaks when we do this so we must add another if statement
-            // These changes should be reverted once we arrive to a proper solution for these dead strips
-            // Alexandre Laurier 12 Sept 2018
-			double distToChannelWithStripID;
-			double distToChannel;
-            if (stripNumber ==1){
-			    distToChannelWithStripID =0.; 
-			    distToChannel =0.; 
-            }
-            else{
-			    distToChannelWithStripID = mmChannelDesign->distanceToChannel(positionOnSurface, stripNumber);
-			    distToChannel = mmChannelDesign->distanceToChannel(positionOnSurface);
-            }
-			ATH_MSG_DEBUG(" looking up collection using detectorElementHash "
-							<< (int)detectorElementHash
-							<< " "
-							<< m_idHelper->print_to_string(layerID)
-							<< " digitID: "
-							<< m_idHelper->print_to_string(digitID)
-							);
-
-			if ( fabs(distToChannelWithStripID - distToChannel) > mmChannelDesign->channelWidth(positionOnSurface)) {
-				ATH_MSG_WARNING( "Found: distToChannelWithStripID: " << distToChannelWithStripID << " != distToChannel: " << distToChannel  );
-				m_exitcode = 12;
-				if(m_writeOutputFile) m_ntuple->Fill();
-				continue;
-            }
+                        // As of September 12 2018, to reduce the number of errors and warnings in MM digitization,
+                        // we assign the strips in the dead regions stripNumber=1 (short term fix).
+                        // The distToChannel validation breaks when we do this so we must add another if statement
+                        // These changes should be reverted once we arrive to a proper solution for these dead strips
+                        // Alexandre Laurier 12 Sept 2018
+	                    	double distToChannelWithStripID;
+	                    	double distToChannel;
+                        if (stripNumber ==1){
+	                    	    distToChannelWithStripID =0.; 
+	                    	    distToChannel =0.; 
+                        }
+                        else{
+	                    	    distToChannelWithStripID = mmChannelDesign->distanceToChannel(positionOnSurface, stripNumber);
+	                    	    distToChannel = mmChannelDesign->distanceToChannel(positionOnSurface);
+                        }
+	                    	ATH_MSG_DEBUG(" looking up collection using detectorElementHash "
+	                    					<< (int)detectorElementHash
+	                    					<< " "
+	                    					<< m_idHelper->print_to_string(layerID)
+	                    					<< " digitID: "
+	                    					<< m_idHelper->print_to_string(digitID)
+	                    					);
+
+	                    	if ( fabs(distToChannelWithStripID - distToChannel) > mmChannelDesign->channelWidth(positionOnSurface)) {
+	                    		ATH_MSG_WARNING( "Found: distToChannelWithStripID: " << distToChannelWithStripID << " != distToChannel: " << distToChannel  );
+	                    		m_exitcode = 12;
+	                    		if(m_writeOutputFile) m_ntuple->Fill();
+	                    		continue;
+                        }
 
 			// Obtain Magnetic Field At Detector Surface
 			Amg::Vector3D hitOnSurfaceGlobal = surf.transform()*hitOnSurface;
@@ -1044,7 +1024,7 @@ StatusCode MM_DigitizationTool::doDigitization() {
 			    		}
 			    	}
 			    }
-            }
+                        }
 
 
 			v_stripDigitOutput.push_back(stripDigitOutput);
@@ -1054,7 +1034,6 @@ StatusCode MM_DigitizationTool::doDigitization() {
 			//
 			////////////////////////////////////////////////////////////////////
 
-			previousHit = &hit;
 
 		} // Hit Loop
 
@@ -1250,6 +1229,6 @@ MM_ElectronicsToolInput MM_DigitizationTool::combinedStripResponseAllHits(const
 	return stripDigitOutputAllHits;
 }
 /*******************************************************************************/
-bool MM_DigitizationTool::checkMMSimHit( const GenericMuonSimHit& /*hit*/ ) const {
+bool MM_DigitizationTool::checkMMSimHit( const MMSimHit& /*hit*/ ) const {
 	return true;
 }
-- 
GitLab


From bed6669518badda77bbd073d79fed267836341b9 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 28 Feb 2019 11:31:29 +0100
Subject: [PATCH 096/404] added TrigCaloDataAccess new JO config file + test
 +minor fixes

---
 .../TrigT2CaloCommon/CMakeLists.txt           |   7 +
 .../python/TrigCaloDataAccessConfig.py        | 130 +++++++++++
 .../src/TestCaloDataAccess.cxx                | 218 +++++++++---------
 .../src/TrigCaloDataAccessSvc.cxx             |   3 +-
 .../test/test_dataaccessNewJO.sh              |  16 ++
 5 files changed, 265 insertions(+), 109 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
 create mode 100755 Trigger/TrigAlgorithms/TrigT2CaloCommon/test/test_dataaccessNewJO.sh

diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
index d288348a954..3d2a182ba55 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
@@ -65,6 +65,13 @@ atlas_install_joboptions( share/*.py )
 
 atlas_add_test( TestService 
 		SCRIPT test/test_dataaccess.sh
+		POST_EXEC_SCRIPT nopost.sh
 		PROPERTIES TIMEOUT 1200)
 
+atlas_add_test( TestServiceNewJO 
+		SCRIPT test/test_dataaccessNewJO.sh
+		POST_EXEC_SCRIPT nopost.sh
+		PROPERTIES TIMEOUT 1200)
+
+
 
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
new file mode 100644
index 00000000000..3a27c1960df
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
@@ -0,0 +1,130 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+def createLArRoI_Map( flags ):
+    acc = ComponentAccumulator()
+    from LArRawUtils.LArRawUtilsConf import LArRoI_Map
+
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    from LArCabling.LArCablingConfig import LArFebRodMappingCfg, LArCalibIdMappingCfg
+    # LArOnOffIdMappingCfg, LArOnOffIdMappingSCCfg 
+
+    from LArCabling.LArCablingConf import LArCablingLegacyService
+    cablingTool = LArCablingLegacyService() # this is realy a tool
+    # needed by above
+    acc.merge( LArFebRodMappingCfg( flags )[0] )
+    acc.merge( LArCalibIdMappingCfg( flags )[0] )
+
+    from CaloTriggerTool.CaloTriggerToolConf import CaloTriggerTowerService
+    triggerTowerTool = CaloTriggerTowerService()                                              
+    acc.merge(addFolders(flags, ['/LAR/Identifier/LArTTCellMapAtlas'], 'LAR'))
+    acc.merge(addFolders(flags, ['/LAR/Identifier/OnOffIdMap'], 'LAR'))
+                                       
+    acc.merge(addFolders(flags, ['/CALO/Identifier/CaloTTOnOffIdMapAtlas', 
+                                 '/CALO/Identifier/CaloTTOnAttrIdMapAtlas',
+                                 '/CALO/Identifier/CaloTTPpmRxIdMapAtlas'], 'CALO'))
+    
+    LArRoI_Map = LArRoI_Map()
+    LArRoI_Map.CablingSvc = cablingTool 
+    LArRoI_Map.TriggerTowerSvc = triggerTowerTool
+    acc.addPublicTool( LArRoI_Map ) # should become private tool
+    
+    return acc
+
+def trigCaloDataAccessSvcCfg( flags ):    
+
+    acc = ComponentAccumulator()
+    from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc
+    svc = TrigCaloDataAccessSvc()
+
+    # since the svc depends on calo geometry configure it here
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    acc.merge( LArGMCfg( flags ) )
+
+    from TileGeoModel.TileGMConfig import TileGMCfg    
+    acc.merge( TileGMCfg( flags ) )
+    acc.getService('GeoModelSvc').DetectorTools['TileDetectorTool'].GeometryConfig = 'RECO'
+
+    from RegionSelector.RegSelConfig import RegSelConfig
+    acc.mergeAll( RegSelConfig( flags ) )
+    
+    acc.merge( createLArRoI_Map( flags ) )
+
+
+
+
+    from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool
+    import math
+    mon = GenericMonitoringTool("TrigCaloDataAccessSvcMon")
+    mon.defineHistogram("TIME_locking_LAr_RoI",
+                        path="EXPERT",
+                        title="Time spent in unlocking the LAr collection",
+                        xbins=100, xmin=0, xmax=100 ),
+    mon.defineHistogram("roiROBs_LAr",
+                        path="EXPERT",
+                        title="Number of ROBs unpacked in RoI requests",
+                        xbins=20, xmin=0, xmax=20 ),
+    mon.defineHistogram("TIME_locking_LAr_FullDet",
+                        path="EXPERT",
+                        title="Time spent in unlocking the LAr collection",
+                        xbins=100, xmin=0, xmax=100 ),
+    mon.defineHistogram("roiEta_LAr,roiPhi_LAr",
+                        type="TH2F",
+                        path="EXPERT",
+                        title="Geometric usage",
+                        xbins=50, xmin=-5, xmax=5,
+                        ybins=64, ymin=-math.pi, ymax=math.pi )    
+    svc.MonTool = mon
+    acc.addService( svc )
+    return acc
+
+
+if __name__ == "__main__":
+    from AthenaCommon.Configurable import Configurable
+
+    Configurable.configurableRun3Behavior = True
+    from AthenaConfiguration.TestDefaults import defaultTestFiles
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    ConfigFlags.Input.Files = defaultTestFiles.RAW
+    ConfigFlags.Input.isMC=False
+    ConfigFlags.lock()
+    acc = ComponentAccumulator()
+    
+    from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg
+    acc.merge( TrigBSReadCfg( ConfigFlags ) )
+
+    acc.merge( trigCaloDataAccessSvcCfg( ConfigFlags ) )
+    
+    from TrigT2CaloCommon.TrigT2CaloCommonConf import TestCaloDataAccess
+    testAlg = TestCaloDataAccess()
+    acc.addEventAlgo(testAlg)    
+    
+    # disable RegSel fro ID and muons, will change this to use flags once MR for it is integrated
+    regSel = acc.getService("RegSelSvc")
+
+    regSel.enableID    = False
+    regSel.enablePixel = False
+    regSel.enableSCT   = False
+    regSel.enableTRT   = False
+    regSel.enableMuon  = False
+    regSel.enableRPC   = False
+    regSel.enableMDT   = False
+    regSel.enableTGC   = False
+    regSel.enableCSC   = False
+
+    #acc.getService("MessageSvc").Format = "% F%60W%S%7W%R%T %0W%M"
+    #acc.MessageSvc.Format = "% F%60W%S%7W%R%T %0W%M"
+
+    acc.printConfig(True)
+
+    #print acc.getService("TrigCaloDataAccessSvc")
+    print acc.getPublicTool("LArRoI_Map")
+
+    print "running this configuration"
+    of = open("test.pkl", "w")
+    acc.store(of)
+    of.close()
+
+
+    
+    
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
index 99ac204d60a..779db7f64d9 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
@@ -16,8 +16,7 @@
 // little code to generate random numbers
 // in gaussian form instead of uniform distribution
 // used to generate RoIs. mu=mediam; sigma;
-double
-randn (double mu, double sigma)
+double randn (double mu, double sigma)
 {
   double U1, U2, W, mult;
   static double X1, X2;
@@ -47,8 +46,8 @@ randn (double mu, double sigma)
 }
 
 
-#define DIFF(_name, _a, _b) if ( _a != _b ) \
-    m_msg << MSG::WARNING << "Difference in " << _name << " " << _a << "  ref " << _b  << endmsg;  \
+#define DIFF(_name, _a, _b) if ( _a != _b )				\
+    m_msg << MSG::WARNING << "Difference in " << _name << " " << _a << "  ref " << _b  << endmsg; \
   else									\
     m_msg << MSG::DEBUG  << "Identical " << _name << " " << _a << "  ref " << _b  << endmsg; 
 
@@ -67,70 +66,71 @@ public:
       m_svc( svc ),
       m_msg( msg ),
       m_roi ( roi ) {
-      m_colRef = new ConstDataVector<CaloCellContainer>(SG::VIEW_ELEMENTS);
-   }
+    m_colRef = new ConstDataVector<CaloCellContainer>(SG::VIEW_ELEMENTS);
+  }
   ~AskForRoI() {
-     if ( m_colRef ) { m_colRef->clear(); delete m_colRef; }
+    if ( m_colRef ) { m_colRef->clear(); delete m_colRef; }
   }
 
   StatusCode request( LArTT_Selector<LArCellCont>& sel ) const {
-      if ( m_roi.isFullscan() ){
+    if ( m_roi.isFullscan() ){
       std::cout << "wrong RoI descriptor used for RoI" << std::endl;
       return StatusCode::FAILURE;
-      }
-      else{
+    }
+    else{
       // keep this for test reasons
       //usleep (5000);
       return m_svc->loadCollections( m_context, m_roi, TTEM, 2, sel );    
-      }
     }
+  }
 
   StatusCode request( ConstDataVector<CaloCellContainer>& c ) const {
-      if ( m_roi.isFullscan() ){
-      m_svc->loadFullCollections( m_context, c );
-      return StatusCode::SUCCESS;
-      }
-      else{
+    if ( m_roi.isFullscan() ){
+      return m_svc->loadFullCollections( m_context, c );
+    }
+    else{
       std::cout << "wrong RoI descriptor used for FS" << std::endl;
       return StatusCode::FAILURE;
-      }
     }
+  }
 
   // calculate reference quantities in the first call
   void firstCall() override { 
     if ( m_roi.isFullscan() ) {
-    struct timeval t1,t2;
-    gettimeofday(&t1,NULL);
-    m_statusRef = request( *m_colRef );
-    gettimeofday(&t2,NULL);
-
-    for ( const auto cell : *m_colRef ) {
-      if ( !cell ) continue;
-      m_etSumRef += cell->et();
-      m_countRef ++;
-      m_minEtaRef = std::min( m_minEtaRef, cell->eta() );
-      m_maxEtaRef = std::max( m_maxEtaRef, cell->eta() );
-      m_minPhiRef = std::min( m_minPhiRef, cell->phi() );
-      m_maxPhiRef = std::max( m_maxPhiRef, cell->phi() );
-    }
-    std::cout << "t lFC : " << m_context << " " << m_etSumRef << " " << t1.tv_sec << " " << t1.tv_usec << " " << t2.tv_sec << " " << t2.tv_usec << " " << ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec) )*1e-6 << std::endl;
-
+      struct timeval t1,t2;
+      gettimeofday(&t1,NULL);
+      m_statusRef = request( *m_colRef );
+      m_statusRef.ignore(); 
+      gettimeofday(&t2,NULL);
+      
+      for ( const auto cell : *m_colRef ) {
+	if ( !cell ) continue;
+	m_etSumRef += cell->et();
+	m_countRef ++;
+	m_minEtaRef = std::min( m_minEtaRef, cell->eta() );
+	m_maxEtaRef = std::max( m_maxEtaRef, cell->eta() );
+	m_minPhiRef = std::min( m_minPhiRef, cell->phi() );
+	m_maxPhiRef = std::max( m_maxPhiRef, cell->phi() );
+      }
+      std::cout << "t lFC : " << m_context << " " << m_etSumRef << " " << t1.tv_sec << " " << t1.tv_usec << " " << t2.tv_sec << " " << t2.tv_usec << " " << ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec) )*1e-6 << std::endl;
+      
     } else {
-
-    struct timeval t1,t2;
-    gettimeofday(&t1,NULL);
-    m_statusRef = request( m_selRef );
-    gettimeofday(&t2,NULL);
-
-    for ( const auto cell : m_selRef ) {
-      m_etSumRef += cell->et();
-      m_countRef ++;
-      m_minEtaRef = std::min( m_minEtaRef, cell->eta() );
-      m_maxEtaRef = std::max( m_maxEtaRef, cell->eta() );
-      m_minPhiRef = std::min( m_minPhiRef, cell->phi() );
-      m_maxPhiRef = std::max( m_maxPhiRef, cell->phi() );
-    }
-    std::cout << "t RoI : " << m_context << " " << m_etSumRef << " " << t1.tv_sec << " " << t1.tv_usec << " " << t2.tv_sec << " " << t2.tv_usec << " " << ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec) )*1e-6 << std::endl;
+      
+      struct timeval t1,t2;
+      gettimeofday(&t1,NULL);
+      m_statusRef = request( m_selRef );
+      m_statusRef.ignore();
+      gettimeofday(&t2,NULL);
+      
+      for ( const auto cell : m_selRef ) {
+	m_etSumRef += cell->et();
+	m_countRef ++;
+	m_minEtaRef = std::min( m_minEtaRef, cell->eta() );
+	m_maxEtaRef = std::max( m_maxEtaRef, cell->eta() );
+	m_minPhiRef = std::min( m_minPhiRef, cell->phi() );
+	m_maxPhiRef = std::max( m_maxPhiRef, cell->phi() );
+      }
+      std::cout << "t RoI : " << m_context << " " << m_etSumRef << " " << t1.tv_sec << " " << t1.tv_usec << " " << t2.tv_sec << " " << t2.tv_usec << " " << ((t2.tv_sec-t1.tv_sec)*1e6+(t2.tv_usec-t1.tv_usec) )*1e-6 << std::endl;
     }
   }
   
@@ -146,30 +146,32 @@ public:
     double maxPhi = -100;
     StatusCode status;
     if ( m_roi.isFullscan() ) {
-    status = request( col );      
-
-    for ( const auto cell : col ) {
-      if ( !cell ) continue;
-      etSum  += cell->et();
-      count ++;
-      minEta  = std::min( minEta, cell->eta() );
-      maxEta  = std::max( maxEta, cell->eta() );
-      minPhi  = std::min( minPhi, cell->phi() );
-      maxPhi  = std::max( maxPhi, cell->phi() );
-    }
+      status = request( col );      
+      status.ignore();
+      
+      for ( const auto cell : col ) {
+	if ( !cell ) continue;
+	etSum  += cell->et();
+	count ++;
+	minEta  = std::min( minEta, cell->eta() );
+	maxEta  = std::max( maxEta, cell->eta() );
+	minPhi  = std::min( minPhi, cell->phi() );
+	maxPhi  = std::max( maxPhi, cell->phi() );
+      }
     } else {
-
-    status = request( sel );      
-
-    for ( const auto cell : sel ) {
-      etSum  += cell->et();
-      count ++;
-      minEta  = std::min( minEta, cell->eta() );
-      maxEta  = std::max( maxEta, cell->eta() );
-      minPhi  = std::min( minPhi, cell->phi() );
-      maxPhi  = std::max( maxPhi, cell->phi() );
-    }
-    std::cout << "callAndCompare : " << m_context << " " << count << " " << etSum << " " << minEta << " " << maxEta << " " << minPhi << " " << maxPhi << " " << " " << m_minEtaRef << " " << m_maxEtaRef << " " << m_minPhiRef << " " << m_maxPhiRef << " " << m_etSumRef << " " << m_countRef << std::endl;
+      
+      status = request( sel );      
+      status.ignore();
+      
+      for ( const auto cell : sel ) {
+	etSum  += cell->et();
+	count ++;
+	minEta  = std::min( minEta, cell->eta() );
+	maxEta  = std::max( maxEta, cell->eta() );
+	minPhi  = std::min( minPhi, cell->phi() );
+	maxPhi  = std::max( maxPhi, cell->phi() );
+      }
+      std::cout << "callAndCompare : " << m_context << " " << count << " " << etSum << " " << minEta << " " << maxEta << " " << minPhi << " " << maxPhi << " " << " " << m_minEtaRef << " " << m_maxEtaRef << " " << m_minPhiRef << " " << m_maxPhiRef << " " << m_etSumRef << " " << m_countRef << std::endl;
     }
 
     DIFF( "RoI mask", status.getCode(), m_statusRef.getCode() );
@@ -224,7 +226,7 @@ private:
 };
 
 TestCaloDataAccess::TestCaloDataAccess( const std::string& name, 
-			  ISvcLocator* pSvcLocator ) : 
+					ISvcLocator* pSvcLocator ) : 
   ::AthReentrantAlgorithm( name, pSvcLocator ),
   m_dataAccessSvc( "TrigCaloDataAccessSvc/TrigCaloDataAccessSvc", name ),
   m_emulateRoIs ( true ),
@@ -252,46 +254,46 @@ void TestCaloDataAccess::emulateRoIs( const EventContext& context, std::vector<P
   double chance = ((double) rand () / RAND_MAX);
   double width = 0.1;
   TrigRoiDescriptor roi( RoI_eta1, RoI_eta1-width, RoI_eta1+width, // eta
-                             RoI_phi1, RoI_phi1-width, RoI_phi1+width, // phi
-                             0 );
+			 RoI_phi1, RoI_phi1-width, RoI_phi1+width, // phi
+			 0 );
   AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
   allRoIs.push_back( afr );
 
   chance = ((double) rand () / RAND_MAX);
   if ( chance > 0.6 ) {
-        double RoI_eta2 = -RoI_eta1 + randn(0,0.2);
-        double RoI_phi2 = -RoI_phi1 + randn(0,0.2);
-        if ( RoI_eta2 < -2.5 ) RoI_eta2 = -2.5;
-        if ( RoI_eta2 >  2.5 ) RoI_eta2 = 2.5;
-        TrigRoiDescriptor roi( RoI_eta2, RoI_eta2-width, RoI_eta2+width, // eta
-                             RoI_phi2, RoI_phi2-width, RoI_phi2+width, // phi
-                             0 );
-        AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
-        allRoIs.push_back( afr );
+    double RoI_eta2 = -RoI_eta1 + randn(0,0.2);
+    double RoI_phi2 = -RoI_phi1 + randn(0,0.2);
+    if ( RoI_eta2 < -2.5 ) RoI_eta2 = -2.5;
+    if ( RoI_eta2 >  2.5 ) RoI_eta2 = 2.5;
+    TrigRoiDescriptor roi( RoI_eta2, RoI_eta2-width, RoI_eta2+width, // eta
+			   RoI_phi2, RoI_phi2-width, RoI_phi2+width, // phi
+			   0 );
+    AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
+    allRoIs.push_back( afr );
   }
 
   for(int i=0;i<10;i++){
-  chance = ((double) rand () / RAND_MAX);
-  if ( chance > 0.75 ) {
-        double RoI_phi3 = M_PI*(-1.0 + ((double) rand () / RAND_MAX) * 2);
-        double RoI_eta3 = randn(0,1.7);
-        if ( RoI_eta3 < -2.5 ) RoI_eta3 = -2.5;
-        if ( RoI_eta3 >  2.5 ) RoI_eta3 = 2.5;
-        width = 0.1;
-        if ( chance > 0.8 ) width=0.3;
-        TrigRoiDescriptor roi( RoI_eta3, RoI_eta3-width, RoI_eta3+width, // eta
+    chance = ((double) rand () / RAND_MAX);
+    if ( chance > 0.75 ) {
+      double RoI_phi3 = M_PI*(-1.0 + ((double) rand () / RAND_MAX) * 2);
+      double RoI_eta3 = randn(0,1.7);
+      if ( RoI_eta3 < -2.5 ) RoI_eta3 = -2.5;
+      if ( RoI_eta3 >  2.5 ) RoI_eta3 = 2.5;
+      width = 0.1;
+      if ( chance > 0.8 ) width=0.3;
+      TrigRoiDescriptor roi( RoI_eta3, RoI_eta3-width, RoI_eta3+width, // eta
                              RoI_phi3, RoI_phi3-width, RoI_phi3+width, // phi
                              0 );
-        AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
-        allRoIs.push_back( afr );
-  }
+      AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
+      allRoIs.push_back( afr );
+    }
   }
 
   chance = ((double) rand () / RAND_MAX);
   if ( chance > 0.6 ) {
-        TrigRoiDescriptor roi( true );
-        AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
-        allRoIs.push_back( afr );
+    TrigRoiDescriptor roi( true );
+    AskForRoI* afr = new AskForRoI( context, m_dataAccessSvc, msg(), roi );
+    allRoIs.push_back( afr );
   }
 
 }
@@ -300,25 +302,25 @@ void TestCaloDataAccess::emulateFixedRoIs( const EventContext& context, std::vec
 
   std::vector<TrigRoiDescriptor> rois;
   TrigRoiDescriptor roi1( 0.7, 0.7-0.1, 0.7+0.1, // eta
-                        0.1, 0.1-0.1, 0.1+0.1, // phi
-                       0 );
+			  0.1, 0.1-0.1, 0.1+0.1, // phi
+			  0 );
   TrigRoiDescriptor roi2( 0.8, 0.8-0.2, 0.7+0.2, // eta
-                        0.2, 0.2-0.2, 0.2+0.2, // phi
-                       0 );
+			  0.2, 0.2-0.2, 0.2+0.2, // phi
+			  0 );
   TrigRoiDescriptor roi3( -1.7, -1.7-0.4, -1.7+0.4, // eta
-                        2.1, 2.1-0.4, 2.1+0.4, // phi
-                       0 );
+			  2.1, 2.1-0.4, 2.1+0.4, // phi
+			  0 );
   TrigRoiDescriptor roi4( -1.0, -1.0-1.4, -1.0+1.4, // eta
-                        1.1, 1.1-1.4, 1.1+1.4, // phi
-                       0 );
+			  1.1, 1.1-1.4, 1.1+1.4, // phi
+			  0 );
   rois.push_back(roi1);
   rois.push_back(roi2);
   rois.push_back(roi3);
   rois.push_back(roi4);
   TrigRoiDescriptor roi5( true );
   for( int i=0;i<std::min(m_nFixedRoIs,4);++i) {
-  AskForRoI* t1 = new AskForRoI( context, m_dataAccessSvc, msg(), rois[i]);
-  allRoIs.push_back(t1);
+    AskForRoI* t1 = new AskForRoI( context, m_dataAccessSvc, msg(), rois[i]);
+    allRoIs.push_back(t1);
   }
   AskForRoI* t6 = new AskForRoI( context, m_dataAccessSvc, msg(), roi5);  // FS
   allRoIs.push_back(t6);
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
index e12b73cce37..dc37eb0868f 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
@@ -36,8 +36,9 @@ StatusCode TrigCaloDataAccessSvc::finalize() {
       EventContext ec;
       ec.setSlot( slot );
       HLTCaloEventCache *cache = m_hLTCaloSlot.get( ec );
-      cache->larContainer->finalize();
+      CHECK( cache->larContainer->finalize() );
       delete cache->larContainer;
+      CHECK( cache->tileContainer->finalize() );
       delete cache->tileContainer;
       cache->lastFSEvent = 0xFFFFFFFF;
       delete cache->fullcont;
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/test/test_dataaccessNewJO.sh b/Trigger/TrigAlgorithms/TrigT2CaloCommon/test/test_dataaccessNewJO.sh
new file mode 100755
index 00000000000..1cda679309a
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/test/test_dataaccessNewJO.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# art-type: build
+# art-ci: master
+rm -rf test.pkl
+python -m TrigT2CaloCommon.TrigCaloDataAccessConfig
+STA=$?
+if [ ${STA} -ne 0 ]
+then
+    echo "Failed configuring job, status", ${STA} 
+    exit -1
+fi
+
+echo "configuration stored in the pickle"
+confTool.py --print test.pkl
+echo "running athena " 
+athena test.pkl
\ No newline at end of file
-- 
GitLab


From fb1cd6b0e2c918ae09d8cf9d0a2fd269cf3c6ffe Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 28 Feb 2019 12:12:56 +0100
Subject: [PATCH 097/404] TrigL2MuonSA: enable static thread-safety checker and
 fixes

- declare `MuonRoads` array as `const`
- ignore thread-safety warning about usage of circ library (tdaq-common)
- minor cleanup in `CMakeLists.txt` file
---
 Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt        | 4 ++--
 .../TrigL2MuonSA/TrigL2MuonSA/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 .../TrigAlgorithms/TrigL2MuonSA/src/BarrelRoadData.cxx    | 2 +-
 .../TrigAlgorithms/TrigL2MuonSA/src/MuCalStreamerTool.cxx | 8 +++++---
 4 files changed, 9 insertions(+), 6 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
index 453f3f71065..13f485628aa 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/CMakeLists.txt
@@ -33,6 +33,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigTools/TrigMuonBackExtrapolator
                           Trigger/TrigTools/TrigTimeAlgs
                           PRIVATE
+                          Control/CxxUtils
                           Control/StoreGate
                           Event/EventInfo
                           MuonSpectrometer/MuonCablings/MuonCablingData
@@ -59,8 +60,7 @@ atlas_add_library( TrigL2MuonSALib
 atlas_add_component( TrigL2MuonSA
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${GSL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${EIGEN_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GeoPrimitives Identifier RegionSelectorLib ByteStreamCnvSvcBaseLib xAODTrigMuon xAODTrigger GaudiKernel MuonMDT_CablingLib MuonTGC_CablingLib RPCcablingInterfaceLib MdtCalibSvcLib MuonRDO CscClusterizationLib MuonPrepRawData MuonRecToolInterfaces TrigMuonEvent TrigSteeringEvent TrigInterfacesLib TrigT1Interfaces TrigT1RPCRecRoiSvcLib TrigTimeAlgsLib StoreGateLib SGtests EventInfo MuonCablingData MuonCalibEvent MuonContainerManager MuonReadoutGeometry MuonIdHelpersLib PathResolver )
+                     LINK_LIBRARIES TrigL2MuonSALib )
 
 # Install files from the package:
 atlas_install_headers( TrigL2MuonSA )
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..71a0ea94ab2
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigL2MuonSA
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/BarrelRoadData.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/BarrelRoadData.cxx
index b02c52a96dd..ad77fe6dbc8 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/BarrelRoadData.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/BarrelRoadData.cxx
@@ -5,7 +5,7 @@
 #include "TrigL2MuonSA/BarrelRoadData.h"
 #include <iostream>
 
-float MuonRoads[2][12][8] = {{ // LOW PT threshold
+const float MuonRoads[2][12][8] = {{ // LOW PT threshold
 /*  HP data ... 96 % cut */
   { 11.23, 11.22, 10.80, 10.83,  9.73,  9.62,  9.43,  9.24}, // Large Inner  st.
   {  6.00,  5.72,  5.98,  5.18,  5.30,  5.38,  0.00,  0.00}, // Large Middle st.
diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuCalStreamerTool.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuCalStreamerTool.cxx
index 534705b1ddc..91327826053 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuCalStreamerTool.cxx
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/MuCalStreamerTool.cxx
@@ -24,6 +24,7 @@
 #include "circ/Circservice.h"
 
 #include "AthenaBaseComps/AthMsgStreamMacros.h"
+#include "CxxUtils/checker_macros.h"
 // --------------------------------------------------------------------------------
 // --------------------------------------------------------------------------------
 
@@ -147,8 +148,8 @@ StatusCode TrigL2MuonSA::MuCalStreamerTool::openStream(int calBufferSize)
       
     } 
     else {
-      
-      m_cid = CircOpenCircConnection(0, (char*)name.c_str(), calBufferSize);
+      char* chr ATLAS_THREAD_SAFE = const_cast<char*>(name.c_str());
+      m_cid = CircOpenCircConnection(0, chr, calBufferSize);
       if( m_cid == -1 ) {
 	ATH_MSG_WARNING("Could not open muon calibration buffer: name="
 			<< name << " buffer size=" << calBufferSize);
@@ -182,7 +183,8 @@ StatusCode TrigL2MuonSA::MuCalStreamerTool::closeStream()
     m_outputFile = NULL;
   }
   else if ( !m_writeToFile && m_cid>-1) {
-    if (CircCloseCircConnection (0,(char*)name.c_str(),m_cid) != 0 ) {
+    char* chr ATLAS_THREAD_SAFE = const_cast<char*>(name.c_str());
+    if (CircCloseCircConnection (0,chr,m_cid) != 0 ) {
       ATH_MSG_WARNING("Could not close the muon calibration stream. Stream name: " << m_calBufferName);
     }
     else {
-- 
GitLab


From 4c2f57028a5939f61385c0adbc1f899915da8fed Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Wed, 13 Feb 2019 12:15:00 +0100
Subject: [PATCH 098/404] debugging scheduler for met+jet

---
 .../DecisionHandling/src/InputMakerBase.cxx   | 11 ++++++---
 .../DecisionHandling/src/InputMakerForRoI.cxx |  3 ++-
 .../DecisionHandling/src/RoRSeqFilter.cxx     |  6 +++--
 .../python/HLTSignatureConfig.py              |  4 ++--
 .../share/EmuStepProcessingTest.py            | 23 +++++++++++--------
 .../TrigUpgradeTest/share/fullMenu.py         | 10 ++++----
 .../TrigUpgradeTest/test/test_jet_menu.sh     |  4 +++-
 7 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
index 9b121848d24..6406db2a9d7 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerBase.cxx
@@ -41,6 +41,7 @@ StatusCode InputMakerBase::sysInitialize() {
 
 
 // For each input Decision in the input container, create an output Decision in the corresponding output container and link them.
+// If the input is invalid or empty, the output is not created, resulting as invalid
 StatusCode InputMakerBase::decisionInputToOutput(const EventContext& context, std::vector< SG::WriteHandle<TrigCompositeUtils::DecisionContainer> > & outputHandles) const{
 
   if (!m_mergeOutputs)   ATH_MSG_DEBUG("Creating one output per input");
@@ -51,6 +52,7 @@ StatusCode InputMakerBase::decisionInputToOutput(const EventContext& context, st
   size_t outputIndex = 0;
   for ( auto inputKey: decisionInputs() ) {
     auto inputHandle = SG::makeHandle( inputKey, context );
+
     if( not inputHandle.isValid() ) {
       ATH_MSG_DEBUG( "Got no decisions from input "<< inputKey.key() << " because handle not valid");
       outputIndex++;
@@ -65,6 +67,8 @@ StatusCode InputMakerBase::decisionInputToOutput(const EventContext& context, st
     
     // create the output container
     TrigCompositeUtils::createAndStore(outputHandles[outputIndex]);
+
+
     auto outDecisions = outputHandles[outputIndex].ptr();
 
     //map all RoIs that are stored in this input container
@@ -130,15 +134,16 @@ StatusCode InputMakerBase::debugPrintOut(const EventContext& context, const std:
       }
     }
   }
+  ATH_MSG_DEBUG( "number of implicit ReadHandles for input decisions is " << decisionInputs().size() << ", " << validInput << " are valid/notempty" );
+  
   size_t validOutput=0;
-  ATH_MSG_DEBUG( "number of implicit ReadHandles for input decisions is " << decisionInputs().size() << ", " << validInput << " are valid" );
   for ( auto outHandle: outputHandles ) {
     if( not outHandle.isValid() ) continue;
     validOutput++;
   }
-  ATH_MSG_DEBUG("Produced " << validOutput << " output decisions containers");
+  ATH_MSG_DEBUG("Produced " << validOutput << " valid/notempty output decisions containers");
   if(validInput != validOutput) {
-    ATH_MSG_ERROR("Found " << validInput << " inputs and " << validOutput << " outputs");
+    ATH_MSG_ERROR("Found valid/notempty: " << validInput << " inputs and " << validOutput << " outputs");
   }
   
   for ( auto outHandle: outputHandles ) {
diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
index 1a382e1ef57..a527412adc0 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx
@@ -54,7 +54,8 @@ StatusCode  InputMakerForRoI::execute( const EventContext& context ) const {
       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?");
+      ATH_MSG_DEBUG( "Got no decisions from output "<< outputHandle.key()<<": handle is valid but container is empty. Is this expected?");
+      //      continue;
       return StatusCode::FAILURE;
     }
     ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" );
diff --git a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
index bd69ce7fb0b..dc97402c087 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/RoRSeqFilter.cxx
@@ -117,11 +117,13 @@ StatusCode RoRSeqFilter::execute() {
     }
   }
 
-  ATH_MSG_DEBUG( "Filter " << ( passCounter != 0 ? "passed" : "rejected") <<" creating "<< outputIndex<<" valid outDecisions DH");
+  setFilterPassed( passCounter != 0 );
+  ATH_MSG_DEBUG( "Filter " << ( filterPassed() ? "passed" : "rejected") <<"; creating "<< outputIndex<<" valid outDecisions DH:");
   for (auto output: outputHandles){
     if( output.isValid() ) ATH_MSG_DEBUG(" "<<output.key());
   }
-  setFilterPassed( passCounter != 0 );  
+
+  
   return StatusCode::SUCCESS;
 }
   
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py
index fcadcca4ad9..2786f7d6f25 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/HLTSignatureConfig.py
@@ -120,9 +120,9 @@ def elStep2Sequence(ConfigFlags, name):
     elstep2_sequence = seqAND(name+"elSeqStep2", [elIM2, elAlg2])
     return (elstep2_sequence, elIM2,elAlg2.Output)
     
-def elStep2MenuSequence(name):
+def elStep2MenuSequence(name, hyponame):
     (elstep2_sequence, elIM2, seqOut) = RecoFragmentsPool.retrieve(elStep2Sequence,ConfigFlags,name=name)
-    elHypo2 = ElGamHypo(name+"Step2ElHypo")
+    elHypo2 = ElGamHypo(hyponame+"Step2ElHypo")
     elHypo2.Input = seqOut    
     return MenuSequence( Maker=elIM2, Sequence=elstep2_sequence, Hypo=elHypo2, HypoToolGen=ElTestHypoTool)
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
index 8af36ddf767..041b8911184 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
@@ -15,7 +15,7 @@ from AthenaCommon.AlgScheduler import AlgScheduler
 AlgScheduler.ShowControlFlow( True )
 AlgScheduler.ShowDataFlow( True )
 
-
+# add chain names in Menu/MenuChains.py
 
 # 4 events
 
@@ -31,10 +31,11 @@ data['msmu']  = [';',
                  'eta:-1.2,phi:0.7,pt:6500,pt2:8500; eta:-1.1,phi:0.6,pt:8500,pt2:8500;',
                  'eta:-1.7,phi:-0.2,pt:9500,pt2:8500;']
 
+#data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_e5v22 HLT_g5',
 data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5',
-                'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5',
-                'HLT_mu8 HLT_mu8_1step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
-                'HLT_mu20 HLT_mu8 HLT_mu8_1step HLT_2mu8 HLT_e8' ]
+                'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5 HLT_e5v22',
+                'HLT_mu8 HLT_mu81step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
+                'HLT_mu20 HLT_mu8 HLT_mu81step HLT_2mu8 HLT_e8' ]
 
 
 data['l1emroi'] = [ ';',
@@ -80,9 +81,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep
 
 
-doMuon=True
+doMuon=False
 doElectron=True
-doCombo=True
+doCombo=False
 
 HLTChains = []
 EnabledElChains = []
@@ -115,14 +116,16 @@ if doElectron:
     from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, elStep2MenuSequence, gammStep1MenuSequence
     # electron
     elStep1 = elStep1MenuSequence("v1")
-    elStep2 = elStep2MenuSequence("v1")
-    elStep2v2 = elStep2MenuSequence("v2")
+    elStep2 = elStep2MenuSequence("v1","v1")
+    elStep2v2 = elStep2MenuSequence("v2","v2")
+    elStep2v22 = elStep2MenuSequence("v2","v22")
     # gamma
     gammStep1 = gammStep1MenuSequence("v1")
     
     ElChains  = [
         Chain(name='HLT_e5'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
-        Chain(name='HLT_e20' , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
+        Chain(name='HLT_e5v2' , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
+        Chain(name='HLT_e5v22', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v22_em",  [elStep2v22]) ] ),
         Chain(name='HLT_e8'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
         Chain(name='HLT_g5'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_gam", [gammStep1]) ] )
         ]
@@ -136,7 +139,7 @@ if doCombo:
     from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, muStep1MenuSequence, elStep2MenuSequence, muStep2MenuSequence
     elStep1 = elStep1MenuSequence("v1")
     muStep1 = muStep1MenuSequence("v1")
-    elStep2 = elStep2MenuSequence("v1")
+    elStep2 = elStep2MenuSequence("v1","v1")
     muStep2 = muStep2MenuSequence("v1")
 
     
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
index 007e6b9abdb..db620d1beb0 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
@@ -15,13 +15,13 @@ include("TrigUpgradeTest/testHLT_MT.py")
 # nightly/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/XML/TriggerMenuXML/LVL1config_Physics_pp_v7.xml
 ##########################################
 
-doElectron = True
-doPhoton = True
-doMuon   = True
+doElectron = False
+doPhoton = False
+doMuon   = False
 doJet    = True
-doMET    = False
+doMET    = True
 doBJet   = False
-doCombo  = True
+doCombo  = False
 
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_jet_menu.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_jet_menu.sh
index 2f2dd305f8b..372f41d5b5b 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_jet_menu.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_jet_menu.sh
@@ -3,4 +3,6 @@
 # art-include: master/Athena
 
 # 150 events
-athena   --threads=1  --evtMax=15  --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/jet.menu.py 
+
+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/jet.menu.py
+#athena   --threads=1  --evtMax=15  --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/jet.menu.py 
-- 
GitLab


From e424a9552a2b624d47e1734da774dfaed697a6f1 Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Wed, 27 Feb 2019 17:37:41 +0100
Subject: [PATCH 099/404] jethypo change

---
 .../TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
index e9d1626f137..23520a5218b 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
@@ -42,8 +42,11 @@ StatusCode TrigJetHypoAlgMT::execute( const EventContext& context ) const {
   // The container should have only one such Decision (for L1) as deding
   // on jets is a one step process.
   auto h_prevDecisions = SG::makeHandle(decisionInput(), context );
-  ATH_CHECK(h_prevDecisions.isValid());
-  
+
+  if( not h_prevDecisions.isValid() ) {//implicit
+    ATH_MSG_DEBUG( "No implicit RH for previous decisions "<<  decisionInput().key()<<": is this expected?" );
+    return StatusCode::SUCCESS;      
+  }
 
   if(h_prevDecisions->size() != 1){
     ATH_MSG_ERROR(" Expected one previous decisions (L1 RoIs not used), found "
-- 
GitLab


From c897faa7b32bfd3a981997a1dcd5ca24723fcb09 Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Thu, 28 Feb 2019 12:13:34 +0100
Subject: [PATCH 100/404] running MET in fullmenu

---
 .../TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx   |  2 +-
 .../share/EmuStepProcessingTest.py            | 22 +++++++++----------
 .../TrigUpgradeTest/share/fullMenu.py         |  8 +++----
 .../TrigUpgradeTest/share/fullMenu.ref        | 19 ++++++++++++++++
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  2 +-
 5 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
index 23520a5218b..a6ca525b17c 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoAlgMT.cxx
@@ -43,7 +43,7 @@ StatusCode TrigJetHypoAlgMT::execute( const EventContext& context ) const {
   // on jets is a one step process.
   auto h_prevDecisions = SG::makeHandle(decisionInput(), context );
 
-  if( not h_prevDecisions.isValid() ) {//implicit
+  if( not h_prevDecisions.isValid() || h_prevDecisions->size() ==0) {//implicit
     ATH_MSG_DEBUG( "No implicit RH for previous decisions "<<  decisionInput().key()<<": is this expected?" );
     return StatusCode::SUCCESS;      
   }
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
index 041b8911184..ce526f1aef9 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
@@ -33,9 +33,9 @@ data['msmu']  = [';',
 
 #data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_e5v22 HLT_g5',
 data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5',
-                'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5 HLT_e5v22',
-                'HLT_mu8 HLT_mu81step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
-                'HLT_mu20 HLT_mu8 HLT_mu81step HLT_2mu8 HLT_e8' ]
+                'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5 HLT_e5_v3',
+                'HLT_mu8 HLT_mu8_1step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
+                'HLT_mu20 HLT_mu8 HLT_mu8_1step HLT_2mu8 HLT_e8' ]
 
 
 data['l1emroi'] = [ ';',
@@ -81,9 +81,9 @@ from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep
 
 
-doMuon=False
+doMuon=True
 doElectron=True
-doCombo=False
+doCombo=True
 
 HLTChains = []
 EnabledElChains = []
@@ -118,16 +118,16 @@ if doElectron:
     elStep1 = elStep1MenuSequence("v1")
     elStep2 = elStep2MenuSequence("v1","v1")
     elStep2v2 = elStep2MenuSequence("v2","v2")
-    elStep2v22 = elStep2MenuSequence("v2","v22")
+    elStep2v3 = elStep2MenuSequence("v2","v3")
     # gamma
     gammStep1 = gammStep1MenuSequence("v1")
     
     ElChains  = [
-        Chain(name='HLT_e5'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
-        Chain(name='HLT_e5v2' , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
-        Chain(name='HLT_e5v22', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v22_em",  [elStep2v22]) ] ),
-        Chain(name='HLT_e8'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
-        Chain(name='HLT_g5'  , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_gam", [gammStep1]) ] )
+        Chain(name='HLT_e5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
+        Chain(name='HLT_e5_v2', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
+        Chain(name='HLT_e5_v3', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v3_em",  [elStep2v3]) ] ),
+        Chain(name='HLT_e8'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
+        Chain(name='HLT_g5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_gam", [gammStep1]) ] )
         ]
 
     HLTChains += ElChains
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
index db620d1beb0..9e36ab4f49b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
@@ -15,13 +15,13 @@ include("TrigUpgradeTest/testHLT_MT.py")
 # nightly/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/XML/TriggerMenuXML/LVL1config_Physics_pp_v7.xml
 ##########################################
 
-doElectron = False
-doPhoton = False
-doMuon   = False
+doElectron = True
+doPhoton = True
+doMuon   = True
 doJet    = True
 doMET    = True
 doBJet   = False
-doCombo  = False
+doCombo  = True
 
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
index e543b0835e7..f235b86abb8 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
@@ -1,3 +1,4 @@
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -9,6 +10,7 @@ TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -29,6 +31,7 @@ TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -49,6 +52,7 @@ TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     4   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_mu6Comb ID#393364983
 TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -62,6 +66,7 @@ TriggerSummaryStep2                     5   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     5   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     5   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     5   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_mu6Comb ID#393364983
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     6   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -83,6 +88,7 @@ TriggerSummaryStep2                     7   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     7   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     7   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     7   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
@@ -92,6 +98,7 @@ TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     9   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -110,7 +117,9 @@ TriggerSummaryStep1                     11  0     DEBUG  +++ HLT_e3_etcut ID#271
 TriggerSummaryStep2                     11  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     11  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     11  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_xe65_L1XE50 ID#1283272884
 TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     12  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -130,7 +139,9 @@ TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e5_etcut ID#607
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_xe65_L1XE50 ID#1283272884
 TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     14  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
@@ -139,10 +150,13 @@ TriggerSummaryStep2                     14  0     DEBUG  +++ HLT_g5_etcut ID#140
 TriggerSummaryStep2                     14  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     15  0     DEBUG  +++ HLT_mu6Comb ID#393364983
 TriggerSummaryStep1                     15  0     DEBUG  +++ HLT_mu6 ID#1672162766
+TriggerSummaryStep1                     16  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     16  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     16  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep2                     16  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_xe65_L1XE50 ID#1283272884
 TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     17  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -157,6 +171,7 @@ TriggerSummaryStep1                     18  0     DEBUG  +++ HLT_e3_etcut1step I
 TriggerSummaryStep1                     18  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     18  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep2                     18  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
@@ -192,3 +207,7 @@ TrigSignatureMoniMT                                INFO HLT_mu6
 TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         0         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb                   20        20        3         2         2         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb decisions                             3         2         
+TrigSignatureMoniMT                                INFO HLT_xe30_L1XE10               20        20        12        0         12        
+TrigSignatureMoniMT                                INFO HLT_xe30_L1XE10 decisions                         12        0         
+TrigSignatureMoniMT                                INFO HLT_xe65_L1XE50               20        20        3         0         3         
+TrigSignatureMoniMT                                INFO HLT_xe65_L1XE50 decisions                         3         0         
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 4f3e2c3edb3..1637d01b074 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -366,7 +366,7 @@ ElectronChainParts = {
     'caloInfo'       : [],
     'lhInfo'         : [],
     'L2IDAlg'        : [],
-    'addInfo'        : ['etcut', 'etcut1step'],
+    'addInfo'        : ['etcut', 'etcut1step',"v2","v3"],
     'eventBuildType'  : AllowedEventBuildingIdentifiers,
     }
 # ---- Egamma Dictinary of default Values ----
-- 
GitLab


From 8498ed7558c62e8599bd674945770a5639f3b7f7 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 28 Feb 2019 12:31:26 +0100
Subject: [PATCH 101/404] Set warning messages rightfully back to debug

---
 .../src/EFMissingETFromHelper.cxx             | 60 +++++++++----------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index b1bf26ef606..2a4f8d2818b 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -162,7 +162,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
                                         const xAOD::VertexContainer * /*vertexContainer*/,
                                         const xAOD::MuonContainer * /*muonContainer*/ )
 {
-  ATH_MSG_WARNING( "EFMissingETFromHelper::execute() called" );
+  ATH_MSG_DEBUG( "EFMissingETFromHelper::execute() called" );
 
   if (met==0 || metHelper==0) {
     ATH_MSG_ERROR( "ERROR: null pointers as input!" );
@@ -180,7 +180,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   unsigned char elem = metHelper->GetElements(); // no. of transient aux. compon.
   if (elem!=42) {
     ATH_MSG_WARNING( "Found " << elem << " aux components in the transient helper class.  Not supported!" );
-  } else ATH_MSG_WARNING( "Found " << elem << " aux components in the transient helper class" );
+  } else ATH_MSG_DEBUG( "Found " << elem << " aux components in the transient helper class" );
 
   bool skipAuxInfo=false;
   bool save9comp=false;
@@ -214,7 +214,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
       ATH_MSG_WARNING( "Found " << comp << " aux components in TrigMissingET.  Not supported.  NOT SAVING AUX INFO" );
       skipAuxInfo=true;
   }
-      ATH_MSG_WARNING( "Found " << comp << " aux components in TrigMissingET." );
+      ATH_MSG_DEBUG( "Found " << comp << " aux components in TrigMissingET." );
 
   // Initialize EDM by setting all components to zero
   met->setEx(0.); met->setEy(0.); met->setEz(0.);
@@ -225,22 +225,22 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
     // basic info - DK calibration
     if (i<elem-18){  // skip muon or Had Topo granular or EM Topo correction for all quantities
-      ATH_MSG_WARNING( "skip muon or Had Topo granular or EM Topo correction for all quantities" );
+      ATH_MSG_DEBUG( "skip muon or Had Topo granular or EM Topo correction for all quantities" );
       setMET(met, metHelper, i);
     }
 
     if(save9comp && i == 24) { // Save summed HAD MET
-      ATH_MSG_WARNING( "Save summed HAD MET" );
+      ATH_MSG_DEBUG( "Save summed HAD MET" );
       setMET(met, metHelper, i);
     }
 
     if( (save2comp || save6comp) && i == 34) { // Save JET MET
-      ATH_MSG_WARNING( "Save JET MET" );
+      ATH_MSG_DEBUG( "Save JET MET" );
       setMET(met, metHelper, i);
     }
 
     if(save3comp && i == 39) { // Save PUC MET
-      ATH_MSG_WARNING( "Save PUC MET" );
+      ATH_MSG_DEBUG( "Save PUC MET" );
       setMET(met, metHelper, i);
     }
 
@@ -248,90 +248,90 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
     // auxiliary info - uncorrected
     if (comp == unsigned(elem-17) && i < 24) { // finest granularity
-      ATH_MSG_WARNING( "finest granularity");
+      ATH_MSG_DEBUG( "finest granularity");
       setMETComp(met, metHelper, i);
     } else if(comp == unsigned(elem-17) && i == 41) { // save muons
-      ATH_MSG_WARNING( "save muons");
+      ATH_MSG_DEBUG( "save muons");
       setMETComp(met, metHelper, i-17);
     } else if (save6comp) {
       if (i>=34 && i < 39) { // Central and Forward Jets
-        ATH_MSG_WARNING( "Central and Forward Jets");
+        ATH_MSG_DEBUG( "Central and Forward Jets");
         setMETComp(met, metHelper, i-34);
       }
       if (i==41) { // Muons
-        ATH_MSG_WARNING( "Muons");
+        ATH_MSG_DEBUG( "Muons");
         setMETComp(met, metHelper, 5);
       }
 
     } else if (save9comp) {
       if (i > 24 && i < 29 ) { // HAD scale quantities
-        ATH_MSG_WARNING( "HAD scale quantities" );
+        ATH_MSG_DEBUG( "HAD scale quantities" );
         setMETComp(met, metHelper, i-25);
       } else if( i > 29 && i < 34) {     // EM scale quantities
-        ATH_MSG_WARNING( "EM scale quantities" );
+        ATH_MSG_DEBUG( "EM scale quantities" );
         setMETComp(met, metHelper, i-25-1);
       } else if( i == 41) {    // Muon
-        ATH_MSG_WARNING( "Muon" );
+        ATH_MSG_DEBUG( "Muon" );
         setMETComp(met, metHelper, i-25-8);
       }
     } else if (save5comp) {
       switch (i) {
         case 0: case 1: case 2: case 3: // LAr, barrel
-          ATH_MSG_WARNING("LAr, barrel");
+          ATH_MSG_DEBUG("LAr, barrel");
           setMETComp(met, metHelper, 0, 1);
           break;
         case 4: case 5: case 6: case 7: // LAr, end-cap
-          ATH_MSG_WARNING("LAr, end-cap");
+          ATH_MSG_DEBUG("LAr, end-cap");
         case 21:                        // + FCalEM
-          ATH_MSG_WARNING("+ FCalEM");
+          ATH_MSG_DEBUG("+ FCalEM");
           setMETComp(met, metHelper, 1, 2);
           break;
         case 12: case 13: case 14: // Tile, barrel +
-          ATH_MSG_WARNING("Tile, barrel +");
+          ATH_MSG_DEBUG("Tile, barrel +");
         case 18: case 19: case 20: // Tile, extended barrel
-          ATH_MSG_WARNING("Tile, extended barrel");
+          ATH_MSG_DEBUG("Tile, extended barrel");
           setMETComp(met, metHelper, 2, 3);
           break;
         case 24: case 25: case 26: case 27: case 28:
         case 29: case 30: case 31: case 32: case 33:
         case 34: case 35: case 36: case 37: case 38:
         case 39: case 40 :             // Topo. cluster elements or jets - do nothing.
-          ATH_MSG_WARNING("Topo. cluster elements or jets - do nothing.");
+          ATH_MSG_DEBUG("Topo. cluster elements or jets - do nothing.");
           break;
         case 41: // muons
-          ATH_MSG_WARNING("muons");
+          ATH_MSG_DEBUG("muons");
           setMETComp(met, metHelper, 4);
           break;
         default: // Hadr. end-cap + Tile gap + FCalHad
-          ATH_MSG_WARNING("Hadr. end-cap + Tile gap + FCalHad");
+          ATH_MSG_DEBUG("Hadr. end-cap + Tile gap + FCalHad");
           setMETComp(met, metHelper, 3, 4);
       }
     } else if (save3comp) {
       switch (i) {
         case 39: // Corrected MET
-          ATH_MSG_WARNING( "Corrected MET" );
+          ATH_MSG_DEBUG( "Corrected MET" );
           setMETComp(met, metHelper, 0);
           break;
         case 40: // Original MET
-          ATH_MSG_WARNING( "Original MET" );
+          ATH_MSG_DEBUG( "Original MET" );
           setMETComp(met, metHelper, 1);
           break;
         case 41: // Muons
-          ATH_MSG_WARNING( "Muons" );
+          ATH_MSG_DEBUG( "Muons" );
           setMETComp(met, metHelper, 2);
       }
     } else if (save2comp) { // Jets + muons only
       if (i==34) { // Jets
-        ATH_MSG_WARNING( "Jets+Mu only: Jets");
+        ATH_MSG_DEBUG( "Jets+Mu only: Jets");
         setMETComp(met, metHelper, 0);
       }
       if (i==41) { // Muons
-        ATH_MSG_WARNING( "Jets+Mu only: Muons");
+        ATH_MSG_DEBUG( "Jets+Mu only: Muons");
         setMETComp(met, metHelper, 1);
       }
     } else if (save1comp) { // muons only
       if (i==41) { // REPLACE WITH A TEST OVER COMP. NAME
-        ATH_MSG_WARNING("Muons only");
+        ATH_MSG_DEBUG("Muons only");
         setMETComp(met, metHelper, 0);
       }
     }
@@ -375,7 +375,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   //   if(msgLvl(MSG::DEBUG)){
         s="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
 			    s+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
-        ATH_MSG_WARNING( s );
+        ATH_MSG_DEBUG( s );
    //   }
    // }
 
@@ -396,7 +396,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     // if(msgLvl(MSG::DEBUG)){
       message = strformat ("REGTEST   %s   %6d %12d %10d   %6.2f  %6.3f %10.2f %10.2f %10.2f %10.2f %10.2f",
        name, status, usedChan, sumOfSigns, calib1, calib0, ex, ey, ez, sumE, sumEt);
-      ATH_MSG_WARNING( message );
+      ATH_MSG_DEBUG( message );
     // }
 
   }
-- 
GitLab


From 32faad84cee976e07e427ecb594d5e1e1b661400 Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Thu, 28 Feb 2019 12:59:07 +0100
Subject: [PATCH 102/404] updated jetmenu and emustep references

---
 .../share/EmuStepProcessing.ref               |  6 +++--
 .../TrigUpgradeTest/share/jetMenu.ref         | 22 ++++++++++---------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref
index e602c1cc224..eeec7201b7a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessing.ref
@@ -1,9 +1,11 @@
-TrigSignatureMoniMT                                INFO HLT_e20                       3         3         2         2         2         
-TrigSignatureMoniMT                                INFO HLT_e20 decisions                                 4         4         
 TrigSignatureMoniMT                                INFO HLT_e5                        2         2         1         1         1         
 TrigSignatureMoniMT                                INFO HLT_e5 decisions                                  2         2         
 TrigSignatureMoniMT                                INFO HLT_e5_e8                     2         2         1         0         1         
 TrigSignatureMoniMT                                INFO HLT_e5_e8 decisions                               6         0         
+TrigSignatureMoniMT                                INFO HLT_e5_v2                     0         0         0         0         0         
+TrigSignatureMoniMT                                INFO HLT_e5_v2 decisions                               0         0         
+TrigSignatureMoniMT                                INFO HLT_e5_v3                     1         1         1         1         1         
+TrigSignatureMoniMT                                INFO HLT_e5_v3 decisions                               2         2         
 TrigSignatureMoniMT                                INFO HLT_e8                        4         4         3         3         3         
 TrigSignatureMoniMT                                INFO HLT_e8 decisions                                  5         5         
 TrigSignatureMoniMT                                INFO HLT_g5                        2         2         1         0         1         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
index 3fe23bbc27c..ce932a38433 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
@@ -1,14 +1,16 @@
-TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     5   0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     8   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     11  0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     11  0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j85 ID#3478728990
-TrigSignatureMoniMT                                INFO HLT_j100                      15        15        5         5         
-TrigSignatureMoniMT                                INFO HLT_j100 decisions                                5         
-TrigSignatureMoniMT                                INFO HLT_j85                       15        15        5         5         
-TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 5         
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j85 ID#3478728990
+TrigSignatureMoniMT                                INFO HLT_j100                      20        20        6         6         
+TrigSignatureMoniMT                                INFO HLT_j100 decisions                                6         
+TrigSignatureMoniMT                                INFO HLT_j85                       20        20        6         6         
+TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 6         
-- 
GitLab


From 84eaeaf88c4b05e66fd2e20817b861c2f8876b56 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 28 Feb 2019 13:19:38 +0100
Subject: [PATCH 103/404] post review changes

---
 .../RegionSelector/python/RegSelConfig.py              | 10 ----------
 .../TrigUpgradeTest/python/InDetConfig.py              |  6 +++---
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/DetectorDescription/RegionSelector/python/RegSelConfig.py b/DetectorDescription/RegionSelector/python/RegSelConfig.py
index 1f5090299f6..40ffe7ebf52 100644
--- a/DetectorDescription/RegionSelector/python/RegSelConfig.py
+++ b/DetectorDescription/RegionSelector/python/RegSelConfig.py
@@ -41,9 +41,6 @@ def regSelCfg( flags ):
         from TileRawUtils.TileRawUtilsConf import TileRegionSelectorTable
         tileTable =  TileRegionSelectorTable(name="TileRegionSelectorTable")
         acc.addPublicTool( tileTable )
-        # ??? that is puzzle, the RegSelSvc seems not to have such a property
-        # while it is set in:RegSelSvcDefault.py
-        # regSel.TileRegionSelectorTable     = tileTable
 
     if flags.Detector.GeometryPixel:
         regSel.enableID = True
@@ -109,13 +106,6 @@ def regSelCfg( flags ):
         cscTable = CSC_RegionSelectorTable(name = "CSC_RegionSelectorTable")
         acc.addPublicTool( cscTable )
 
-    # ??? that is same puzzle of Calo, the RegSelSvc seems not to have such a property
-    # while it is set in:RegSelSvcDefault.py 
-    # regSel.RPC_RegionLUT_CreatorTool   = rpcTable
-    # regSel.MDT_RegionLUT_CreatorTool   = mdtTable
-    # regSel.TGC_RegionLUT_CreatorTool   = tgcTable
-    # regSel.CSC_RegionLUT_CreatorTool   = cscTable
-
 
     if flags.Detector.GeometryMM:
         regSel.enableMM  = True   
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index 3311aff346e..9a875ebd505 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
@@ -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
 #
 
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
@@ -482,8 +482,8 @@ if __name__ == "__main__":
     acc.merge(TrigBSReadCfg(ConfigFlags))
 
     acc.merge( TrigInDetConfig( ConfigFlags ) )
-    from RegionSelector.RegSelConfig import RegSelConfig
-    rsc, regSel = RegSelConfig( ConfigFlags )
+    from RegionSelector.RegSelConfig import regSelCfg
+    rsc, regSel = regSelCfg( ConfigFlags )
     regSel.enableCalo = False # turn off calo, certainly a better way to do this...
     acc.merge( rsc )
     acc.addService(regSel)
-- 
GitLab


From 2257acb6abfa654b4d6b606bfe8016431e304001 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Thu, 28 Feb 2019 03:03:11 +0100
Subject: [PATCH 104/404] Add check removing disabled ROBs/SubDets from
 StreamTags

Re-implemented from HltEventLoopMgr in release 21.1
---
 .../TrigSteeringEvent/HLTResultMT.h           |   5 +-
 .../TrigSteeringEvent/src/HLTResultMT.cxx     |   7 +-
 .../TrigOutputHandling/HLTResultMTMaker.h     |  54 +++++++--
 .../python/TrigOutputHandlingConfig.py        |  28 +++++
 .../src/HLTResultMTMaker.cxx                  | 112 +++++++++++++++++-
 5 files changed, 193 insertions(+), 13 deletions(-)

diff --git a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h
index 16457d822ee..64208fd5d22 100644
--- a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.h
+++ b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/HLTResultMT.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 TRIGSTEERINGEVENT_HLTResultMT_H
@@ -44,6 +44,9 @@ namespace HLT {
     /// Const-getter for stream tags
     const std::vector<eformat::helper::StreamTag>& getStreamTags() const;
 
+    /// Non-const-getter for stream tags needed by the result maker to remove disabled ROBs/SubDets
+    std::vector<eformat::helper::StreamTag>& getStreamTagsNonConst();
+
     /** @brief Replace the stored list of stream tags with the given one
      *
      *  Removes duplicates from the input list by merging robs and dets lists of stream tags with equal name and type.
diff --git a/Trigger/TrigEvent/TrigSteeringEvent/src/HLTResultMT.cxx b/Trigger/TrigEvent/TrigSteeringEvent/src/HLTResultMT.cxx
index 417adb41f23..f1ad2d38c24 100644
--- a/Trigger/TrigEvent/TrigSteeringEvent/src/HLTResultMT.cxx
+++ b/Trigger/TrigEvent/TrigSteeringEvent/src/HLTResultMT.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 "TrigSteeringEvent/HLTResultMT.h"
@@ -27,6 +27,11 @@ const std::vector<eformat::helper::StreamTag>& HLT::HLTResultMT::getStreamTags()
   return m_streamTags;
 }
 
+// -----------------------------------------------------------------------------
+std::vector<eformat::helper::StreamTag>& HLT::HLTResultMT::getStreamTagsNonConst() {
+  return m_streamTags;
+}
+
 // -----------------------------------------------------------------------------
 StatusCode HLT::HLTResultMT::setStreamTags(const std::vector<eformat::helper::StreamTag>& streamTags) {
   m_streamTags.clear();
diff --git a/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/HLTResultMTMaker.h b/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/HLTResultMTMaker.h
index 8aba37ac695..5253b40d6c9 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/HLTResultMTMaker.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/HLTResultMTMaker.h
@@ -1,17 +1,22 @@
 /*
-  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 TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
 #define TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
 
+// Trigger includes
 #include "TrigSteeringEvent/HLTResultMT.h"
 #include "TrigOutputHandling/HLTResultMTMakerTool.h"
 
+// Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "AthenaMonitoring/GenericMonitoringTool.h"
 #include "StoreGate/WriteHandle.h"
 
+// Forward declarations
+class IJobOptionsSvc;
+
 /** @class HLTResultMTMaker
  *  @brief Tool to create the HLTResultMT at the end of each event
  **/
@@ -22,26 +27,57 @@ public:
   /// Standard destructor
   virtual ~HLTResultMTMaker();
 
-  // ------------------------- IStateful methods -----------------------------
+  // ------------------------- IStateful methods -------------------------------
   virtual StatusCode initialize() override;
   virtual StatusCode finalize() override;
 
-  // ------------------------- Specific methods of this tool -----------------
+  // ------------------------- Specific methods of this tool -------------------
   /// Builds the HLTResultMT and records it in the event store
   StatusCode makeResult(const EventContext& eventContext) const;
   /// Return name of the HLTResultMT
   const std::string& resultName() const {return m_hltResultWHKey.key();}
 
 private:
+  // ------------------------- Methods -----------------------------------------
+  /// Check ROB and SubDet lists in StreamTags and remove those which are disabled
+  void validatePEBInfo(HLT::HLTResultMT& hltResult) const;
+
+  // ------------------------- Properties --------------------------------------
   /// StoreGate key for the HLTResultMT
-  SG::WriteHandleKey<HLT::HLTResultMT> m_hltResultWHKey {this, "HLTResultWHKey", "HLTResultMT",
-                                                         "Key of the output HLTResultMT object"};
+  SG::WriteHandleKey<HLT::HLTResultMT> m_hltResultWHKey {
+    this, "HLTResultWHKey", "HLTResultMT",
+    "Key of the output HLTResultMT object"
+  };
   /// Tools filling the HLTResultMT object
-  ToolHandleArray<HLTResultMTMakerTool> m_makerTools {this, "MakerTools", {},
-                                                      "Set of tools that fill content of the HLTResultMT"};
+  ToolHandleArray<HLTResultMTMakerTool> m_makerTools {
+    this, "MakerTools", {},
+    "Set of tools that fill content of the HLTResultMT"
+  };
   /// Monitoring tool
-  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "",
-                                               "Monitoring tool"};
+  ToolHandle<GenericMonitoringTool> m_monTool {
+    this, "MonTool", "",
+    "Monitoring tool"
+  };
+  /// Extra enabled ROBs
+  Gaudi::Property<std::vector<uint32_t>> m_extraEnabledROBs {
+    this, "ExtraEnabledROBs", {},
+    "Extra ROBs which can be requested in a stream tag, but are not part of the ROS-ROB map"
+  };
+  /// Extra enabled SubDets
+  Gaudi::Property<std::vector<uint32_t>> m_extraEnabledSubDets {
+    this, "ExtraEnabledSubDets", {},
+    "Extra SubDets which can be requested in a stream tag, but are not part of the ROS-ROB map"
+  };
+
+  // ------------------------- Other private members ---------------------------
+  /// Handle to JobOptionsSvc used to retrieve the DataFlowConfig property
+  ServiceHandle<IJobOptionsSvc> m_jobOptionsSvc;
+  /// List of enabled ROBs retrieved during initialisation
+  std::set<uint32_t> m_enabledROBs;
+  /// List of enabled SubDets retrieved during initialisation
+  std::set<eformat::SubDetector> m_enabledSubDets;
+  /// If true, don't call validatePEBInfo
+  bool m_skipValidatePEBInfo {false};
 };
 
 #endif // TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
index a2f152d0a9f..614176a0628 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
+++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
@@ -5,6 +5,34 @@ def HLTResultMTMakerCfg():
    from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
 
    m = HLTResultMTMaker()
+
+   # ROBs/SubDets which are enabled but not necessarily part of the ROS-ROB map
+   from libpyeformat_helper import SourceIdentifier,SubDetector
+   subdets = [
+      SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI,
+      SubDetector.TDAQ_CALO_JET_PROC_ROI,
+      SubDetector.TDAQ_HLT,
+      SubDetector.TDAQ_FTK,
+      SubDetector.TDAQ_CALO_TOPO_PROC,
+      SubDetector.TDAQ_CALO_DIGITAL_PROC,
+      SubDetector.TDAQ_CALO_FEAT_EXTRACT_ROI,
+   ]
+   m.ExtraEnabledSubDets = []
+   for subdetId in subdets:
+      m.ExtraEnabledSubDets.append( int(subdetId) )
+
+   def addROBs(dest,subdet,modules):
+      for moduleId in modules:
+         dest.append(SourceIdentifier(subdet,moduleId).code())
+
+   m.ExtraEnabledROBs = []
+   addROBs(m.ExtraEnabledROBs, SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, [0xa8, 0xa9, 0xaa, 0xab])
+   addROBs(m.ExtraEnabledROBs, SubDetector.TDAQ_CALO_JET_PROC_ROI,     [0xac, 0xad])
+   addROBs(m.ExtraEnabledROBs, SubDetector.TDAQ_MUON_CTP_INTERFACE,    [0x01])
+   addROBs(m.ExtraEnabledROBs, SubDetector.TDAQ_CTP,                   [0x01])
+   addROBs(m.ExtraEnabledROBs, SubDetector.TDAQ_CALO_TOPO_PROC,        [0x81, 0x91, 0x82, 0x92])
+
+   # Configure HLT result monitoring histograms
    m.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTResultMTMaker')
    m.MonTool.Histograms = [ defineHistogram( 'TIME_build', path='EXPERT', type='TH1F', title='Time of result construction in;[micro seccond]',
                                              xbins=100, xmin=0, xmax=1000 ),
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultMTMaker.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultMTMaker.cxx
index 8392266ef78..870b0f171ba 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultMTMaker.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/HLTResultMTMaker.cxx
@@ -1,15 +1,55 @@
 /*
-  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 "TrigOutputHandling/HLTResultMTMaker.h"
 #include "AthenaMonitoring/Monitored.h"
+#include "GaudiKernel/IJobOptionsSvc.h"
+
+// Local helpers
+namespace {
+  /// Replaced with std::set::contains in C++20
+  template<typename T> bool contains(const std::set<T>& set, const T& value) {
+    return set.find(value) != set.cend();
+  }
+  bool isHLT(const uint32_t robid) {
+    return eformat::helper::SourceIdentifier(robid).subdetector_id() == eformat::TDAQ_HLT;
+  }
+  bool isHLT(const eformat::SubDetector subdet) {
+    return subdet == eformat::TDAQ_HLT;
+  }
+  /// Remove disabled IDs from @c requestedIDs and return the set of removed IDs
+  template<typename T> std::set<T> removeDisabled(std::set<T>& requestedIds, const std::set<T>& enabledIds) {
+    std::set<T> removedIds;
+    for (auto it=requestedIds.begin(); it!=requestedIds.end(); ) {
+      // Check if ROB/SubDet is disabled (skip HLT result ID)
+      if (!isHLT(*it) && !contains(enabledIds, *it)) {
+        removedIds.insert(*it);
+        it = requestedIds.erase(it);
+      }
+      else ++it;
+    }
+    return removedIds;
+  }
+  /// Print helper for set<uint32_t>
+  std::ostream& operator<<(std::ostream& str, const std::set<uint32_t>& set) {
+    for (const uint32_t id : set)
+      str << "0x" << std::hex << std::setfill('0') << std::setw(8) << id << std::dec << " ";
+    return str;
+  }
+  /// Print helper for set<eformat::SubDetector>
+  std::ostream& operator<<(std::ostream& str, const std::set<eformat::SubDetector>& set) {
+    for (const eformat::SubDetector id : set) str << eformat::helper::SubDetectorDictionary.string(id) << " ";
+    return str;
+  }
+}
 
 // =============================================================================
 // Standard constructor
 // =============================================================================
 HLTResultMTMaker::HLTResultMTMaker(const std::string& type, const std::string& name, const IInterface* parent)
-  : AthAlgTool(type, name, parent) {}
+  : AthAlgTool(type, name, parent),
+  m_jobOptionsSvc("JobOptionsSvc", name) {}
 
 // =============================================================================
 // Standard destructor
@@ -23,6 +63,51 @@ StatusCode HLTResultMTMaker::initialize() {
   ATH_CHECK(m_hltResultWHKey.initialize());
   ATH_CHECK(m_makerTools.retrieve());
   ATH_CHECK(m_monTool.retrieve());
+  ATH_CHECK(m_jobOptionsSvc.retrieve());
+
+  // Initialise the enabled ROBs/SubDets list from DataFlowConfig config and extra properties.
+  // DataFlowConfig is a special object used online to hold DF properties passed from TDAQ to HLT as run parameters.
+  const Gaudi::Details::PropertyBase* prop = m_jobOptionsSvc->getClientProperty("DataFlowConfig", "DF_Enabled_ROB_IDs");
+  Gaudi::Property<std::vector<uint32_t>> enabledROBsProp("EnabledROBs",{});
+  if (prop && enabledROBsProp.assign(*prop)) {
+    m_enabledROBs.insert(enabledROBsProp.value().begin(), enabledROBsProp.value().end());
+    ATH_MSG_DEBUG("Retrieved a list of " << m_enabledROBs.size()
+                  << " ROBs from DataFlowConfig.DF_Enabled_ROB_IDs");
+  }
+  else {
+    ATH_MSG_DEBUG("Could not retrieve DataFlowConfig.DF_Enabled_ROB_IDs from JobOptionsSvc. This is fine if running "
+                  << "offline, but should not happen online");
+  }
+
+  prop = m_jobOptionsSvc->getClientProperty("DataFlowConfig", "DF_Enabled_SubDet_IDs");
+  Gaudi::Property<std::vector<uint32_t>> enabledSubDetsProp("EnabledSubDets",{});
+  if (prop && enabledSubDetsProp.assign(*prop)) {
+    // Need to convert from uint32_t to eformat::SubDetector representable by uint8_t
+    for (const uint32_t id : enabledSubDetsProp.value()) {
+      m_enabledSubDets.insert( static_cast<eformat::SubDetector>(id & 0xFF) );
+    }
+    ATH_MSG_DEBUG("Retrieved a list of " << m_enabledSubDets.size()
+                  << " SubDets from DataFlowConfig.DF_Enabled_SubDet_IDs");
+  }
+  else {
+    ATH_MSG_DEBUG("Could not retrieve DataFlowConfig.DF_Enabled_SubDet_IDs from JobOptionsSvc. This is fine if running "
+                  << "offline, but should not happen online");
+  }
+
+  if (m_enabledROBs.empty() && m_enabledSubDets.empty()) {
+    m_skipValidatePEBInfo = true;
+    ATH_MSG_INFO("The list of enabled ROBs and SubDets was not provided by DataFlowConfig or is empty. "
+                 << "StreamTag PEBInfo validation will be skipped.");
+  }
+  else {
+    m_enabledROBs.insert(m_extraEnabledROBs.value().begin(), m_extraEnabledROBs.value().end());
+    // Need to convert from uint32_t to eformat::SubDetector representable by uint8_t
+    for (const uint32_t id : m_extraEnabledSubDets.value()) {
+      m_enabledSubDets.insert( static_cast<eformat::SubDetector>(id & 0xFF) );
+    }
+    ATH_MSG_INFO("StreamTag PEBInfo will be validated against " << m_enabledROBs.size() << " enabled ROBs and "
+                 << m_enabledSubDets.size() << " enabled SubDets");
+  }
   return StatusCode::SUCCESS;
 }
 
@@ -51,6 +136,8 @@ StatusCode HLTResultMTMaker::makeResult(const EventContext& eventContext) const
   }
   time.stop();
 
+  if (!m_skipValidatePEBInfo) validatePEBInfo(*hltResult);
+
   ATH_MSG_DEBUG(*hltResult);
 
   // Fill monitoring histograms
@@ -66,3 +153,24 @@ StatusCode HLTResultMTMaker::makeResult(const EventContext& eventContext) const
 
   return StatusCode::SUCCESS;
 }
+
+// =============================================================================
+// Private method removing disabled ROBs/SubDets from StreamTags
+// =============================================================================
+void HLTResultMTMaker::validatePEBInfo(HLT::HLTResultMT& hltResult) const {
+  for (eformat::helper::StreamTag& st : hltResult.getStreamTagsNonConst()) {
+    std::set<uint32_t> removedROBs = removeDisabled(st.robs,m_enabledROBs);
+    if (!removedROBs.empty())
+      ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled ROBs: " << removedROBs
+                      << " - these ROBs were removed from the StreamTag by " << name());
+    else
+      ATH_MSG_VERBOSE("No disabled ROBs were requested by StreamTag " << st.type << "_" << st.name);
+
+    std::set<eformat::SubDetector> removedSubDets = removeDisabled(st.dets,m_enabledSubDets);
+    if (!removedSubDets.empty())
+      ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled SubDets: " << removedSubDets
+                      << " - these SubDets were removed from the StreamTag by " << name());
+    else
+      ATH_MSG_VERBOSE("No disabled SubDets were requested by StreamTag " << st.type << "_" << st.name);
+  }
+}
-- 
GitLab


From 2b5bd9b513f696644d7933daeba04dc155aa6730 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Thu, 28 Feb 2019 15:51:31 +0100
Subject: [PATCH 105/404] improve commented lines in MdtCalibDbAlg

---
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h     | 24 +++++++------------
 .../src/MdtCalibDbAlg.cxx                     | 10 +++-----
 .../src/MdtCalibDbCoolStrTool.cxx             | 16 ++-----------
 3 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
index f3632e446ca..c0c585154b6 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
@@ -1,24 +1,22 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**
    MdtCalibDbAlg reads raw condition data and writes derived condition data to the condition store
 */
 
-#ifndef MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
-#define MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
+#ifndef MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
+#define MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 #include "GaudiKernel/ICondSvc.h"
-//#include "GaudiKernel/Property.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 
-//new code to replace dummy 
-//members from MdtCalibDbCoolStrTool.h
-//removing obsolete ones for me 
+//from MdtCalibDbCoolStrTool.h
+//removing obsolete ones
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "MdtCalibInterfaces/IMdtCalibDBTool.h"
@@ -50,8 +48,6 @@ namespace coral	{
   class Blob;
 }
 
-//namespace MuonCalib {
-
 //class RtResolutionLookUp;
 //class SamplePoint;
 
@@ -99,10 +95,10 @@ class MdtCalibDbAlg: public AthAlgorithm {
   void initializeSagCorrection(MuonCalib::MdtCorFuncSet *funcSet);
 
   //if m_TimeSlewingCorrection is set to true then it is assumed that the
-  //time slewing correction is applied. If false not. If this flag does 
-  //not match the bit in the creation parameters, the rt-relation and t0 
-  //will be corrected.  
-  //NOTE: This is a preliminary solution for 17.2. In principle each
+  //time slewing correction is applied. If false not. If this flag does
+  //not match the bit in the creation parameters, the rt-relation and t0
+  //will be corrected.
+  //NOTE: This was a preliminary solution for 17.2. In principle each
   //MdtDriftCircleOnTrackCreator could decide individually if it wants to
   //have TS-correction. In the default reco-jobs however, this is
   //configured by one muonRecFlag, that will be used to set this job-option.
@@ -140,6 +136,4 @@ class MdtCalibDbAlg: public AthAlgorithm {
    
 };
 
-//}  //namespace MuonCalib 
-
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index 6b2ccbc604e..67cc6e1ac3f 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "MdtCalibDbCoolStrTool/MdtCalibDbAlg.h"
 
-//includes from MdtCalibDbCoolStrTool.cxx
+//from MdtCalibDbCoolStrTool.cxx
 
 #include "StoreGate/StoreGateSvc.h"
 #include "SGTools/TransientAddress.h"
@@ -40,8 +40,6 @@
 #include "MdtCalibData/RtFromPoints.h"
 #include "MdtCalibData/RtResolutionFromPoints.h"
 
-//#include "MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool.h"
-
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonReadoutGeometry/MdtReadoutElement.h"
 
@@ -54,6 +52,7 @@
 
 //like MdtCalibrationDbSvc
 //for corData in loadRt
+
 #include "MdtCalibData/MdtCorFuncSetCollection.h"
 #include "MdtCalibData/MdtFullCalibData.h"
 #include "MdtCalibData/BFieldCorFunc.h"
@@ -88,8 +87,6 @@ MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator)
   m_writeKeyCor("MdtCorFuncSetCollection")
 {
 
-  //declareInterface< IMdtCalibDBTool >(this);
-
   //Db Folders
   declareProperty("TubeFolder",m_tubeFolder,"DB folder containing the tube constants");
   declareProperty("RtFolder",m_rtFolder,"DB folder containing the RT calibrations");
@@ -379,7 +376,6 @@ StatusCode MdtCalibDbAlg::loadRt(){
   //atrc is readCdoRt here
 
   //tr-relation creators
-  //MuonCalib::RtResolutionFromPoints res_from_points;//never used
   MuonCalib::RtFromPoints rt_fromPoints;
 
   if ( defaultRt(writeCdoRt).isFailure() ){
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
index 6ebcd03bdb2..65afa3249e1 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
@@ -162,22 +162,10 @@ StatusCode MdtCalibDbCoolStrTool::initialize() {
   ATH_CHECK( m_idToFixedIdTool.retrieve() );
 
   //In 2019 for the AthenaMT migration,
-  //old callback functions and member data cache were removed from MdtCalibrationDbSvc
+  //Callback functions and member data cache were removed from MdtCalibrationDbSvc
+  //Registration of the callback functions was also removed here
   //Please use MdtCalibDbAlg to provide derived data via the condition store
-  /*
-  ServiceHandle<MdtCalibrationDbSvc> dbSvc("MdtCalibrationDbSvc", name());
-  ATH_CHECK( dbSvc.retrieve() );
-  ATH_MSG_DEBUG( "Retrieved MdtCalibrationDbSvc" );
 
-  ATH_CHECK( detStore()->regFcn(&IMdtCalibDBTool::loadTube,
-				dynamic_cast<IMdtCalibDBTool*>(this),
-				&MdtCalibrationDbSvc::loadTube,
-				dynamic_cast<MdtCalibrationDbSvc*>(&*dbSvc)) );
-  ATH_CHECK( detStore()->regFcn(&IMdtCalibDBTool::loadRt,
-				dynamic_cast<IMdtCalibDBTool*>(this),
-				&MdtCalibrationDbSvc::loadRt,
-				dynamic_cast<MdtCalibrationDbSvc*>(&*dbSvc)) );
-  */
   // initialize MdtTubeCalibContainers 
   ATH_CHECK( defaultT0s() );
   ATH_CHECK( detStore()->record( m_tubeData, m_tubeDataLocation, true ) );
-- 
GitLab


From ea689830b75d51b8385d13fad6018f363d551981 Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Thu, 28 Feb 2019 15:55:35 +0100
Subject: [PATCH 106/404] fix typo

---
 Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
index afca67d3bf2..2139670e35d 100644
--- a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
@@ -101,7 +101,7 @@ StatusCode CaloLCWeightTool::initialize()
  
   m_sampnames.reserve(CaloSampling::Unknown);
   for (int iSamp=0;iSamp<CaloSampling::Unknown;iSamp++) {
-     m_sampnames[iSamp] = CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp);
+     m_sampnames.push_back(CaloSamplingHelper::getSamplingName((CaloSampling::CaloSample)iSamp));
   }
 
   return StatusCode::SUCCESS;
-- 
GitLab


From fcef23c20b7dcbf06b71eb6ba9964e53b2515590 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 28 Feb 2019 16:09:56 +0100
Subject: [PATCH 107/404] Move ComponentToName definition to cxx from  h

---
 .../TrigEFMissingET/EFMissingETHelper.h       | 90 ++-----------------
 .../TrigEFMissingET/src/EFMissingETHelper.cxx | 85 ++++++++++++++++++
 2 files changed, 90 insertions(+), 85 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
index 219415974df..3d0d3d0c1c2 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
@@ -52,92 +52,12 @@ class TrigEFMissingEtComponent {
     };
 
 
-    static std::string ComponentToName(const Component c)
+    static std::string ComponentToName(const Component c);
+
+    static std::string ComponentToName(const int c)
     {
-        std::string name;
-        switch(c)
-        {
-            // LAr barrel
-            case PreSamplB:  name="PreSamplB";    break;
-            case EMB1:       name="EMB1";         break;
-            case EMB2:       name="EMB2";         break;
-            case EMB3:       name="EMB3";         break;
-      
-            // LAr EM endcap 
-            case PreSamplE:  name="PreSamplE";    break;
-            case EME1:       name="EME1";         break;
-            case EME2:       name="EME2";         break;
-            case EME3:       name="EME3";         break;
-      
-            // Hadronic end cap cal.
-            case HEC0:       name="HEC0";         break;
-            case HEC1:       name="HEC1";         break;
-            case HEC2:       name="HEC2";         break;
-            case HEC3:       name="HEC3";         break;
-
-            // Tile barrel
-            case TileBar0:   name="TileBar0";     break;
-            case TileBar1:   name="TileBar1";     break;
-            case TileBar2:   name="TileBar2";     break;
-
-            // Tile gap (ITC & scint)  
-            case TileGap1:   name="TileGap1";     break;
-            case TileGap2:   name="TileGap2";     break;
-            case TileGap3:   name="TileGap3";     break;
-
-            // Tile extended barrel 
-            case TileExt0:   name="TileExt0";     break;
-            case TileExt1:   name="TileExt1";     break;
-            case TileExt2:   name="TileExt2";     break;
-
-            // Forward cal endcap  
-            case FCalEM:     name="FCalEM";       break;
-            case FCalHad1:   name="FCalHad1";     break;
-            case FCalHad2:   name="FCalHad2";     break;
-
-            // Topo. clusters Had  
-            case TCLCW:      name="TCLCW";        break;
-
-            // pos. and neg. eta barrel                         
-            case TCLCWB1:    name="TCLCWB1";      break;
-            case TCLCWB2:    name="TCLCWB2";      break;
-
-            // pos. and neg. eta endcap             
-            case TCLCWE1:    name="TCLCWE1";      break;
-            case TCLCWE2:    name="TCLCWE2";      break;
-
-            // Topo. clusters EM             
-            case TCEM:       name="TCEM";         break;
-
-            // pos. and neg. eta barrel                         
-            case TCEMB1:     name="TCEMB1";       break;
-            case TCEMB2:     name="TCEMB2";       break;
-
-            // pos. and neg. eta endcap              
-            case TCEME1:     name="TCEME1";       break;
-            case TCEME2:     name="TCEME2";       break;
-
-            // Jet              
-            case JET:        name="JET";          break;
-            case JETB1:      name="JETB1";        break;
-            case JETB2:      name="JETB2";        break;
-            case JETE1:      name="JETE1";        break;
-            case JETE2:      name="JETE2";        break;
-
-            // Topo. cluster Fit              
-            case TCPUC:      name="TCPUC";        break;
-
-            // Topo. cluster Fit -- uncorrected                         
-            case TCPUCUnc:   name="TCPUCUnc";     break;
-
-            // Muons                         
-            case Muons:      name="Muons";        break;
-
-            default:         name="Unknown";
-        }
-        return name;
-                                         
-    }
+        return ComponentToName((Component) c);
+    };
 
 
     unsigned short m_usedChannels; //<! counter for channels
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
index d0c35b0ab11..f9a0621578a 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
@@ -66,6 +66,91 @@ std::string TrigEFMissingEtComponent::getFormattedValues(){
   return std::string(buff);
 }
 
+std::string TrigEFMissingEtComponent::ComponentToName(const Component c)
+{
+  std::string name;
+  switch(c)
+  {
+      // LAr barrel
+    case PreSamplB:  name="PreSamplB";    break;
+    case EMB1:       name="EMB1";         break;
+    case EMB2:       name="EMB2";         break;
+    case EMB3:       name="EMB3";         break;
+
+    // LAr EM endcap 
+    case PreSamplE:  name="PreSamplE";    break;
+    case EME1:       name="EME1";         break;
+    case EME2:       name="EME2";         break;
+    case EME3:       name="EME3";         break;
+
+    // Hadronic end cap cal.
+    case HEC0:       name="HEC0";         break;
+    case HEC1:       name="HEC1";         break;
+    case HEC2:       name="HEC2";         break;
+    case HEC3:       name="HEC3";         break;
+
+    // Tile barrel
+    case TileBar0:   name="TileBar0";     break;
+    case TileBar1:   name="TileBar1";     break;
+    case TileBar2:   name="TileBar2";     break;
+
+    // Tile gap (ITC & scint)  
+    case TileGap1:   name="TileGap1";     break;
+    case TileGap2:   name="TileGap2";     break;
+    case TileGap3:   name="TileGap3";     break;
+
+    // Tile extended barrel 
+    case TileExt0:   name="TileExt0";     break;
+    case TileExt1:   name="TileExt1";     break;
+    case TileExt2:   name="TileExt2";     break;
+
+    // Forward cal endcap  
+    case FCalEM:     name="FCalEM";       break;
+    case FCalHad1:   name="FCalHad1";     break;
+    case FCalHad2:   name="FCalHad2";     break;
+
+    // Topo. clusters Had  
+    case TCLCW:      name="TCLCW";        break;
+
+    // pos. and neg. eta barrel                         
+    case TCLCWB1:    name="TCLCWB1";      break;
+    case TCLCWB2:    name="TCLCWB2";      break;
+
+    // pos. and neg. eta endcap             
+    case TCLCWE1:    name="TCLCWE1";      break;
+    case TCLCWE2:    name="TCLCWE2";      break;
+
+    // Topo. clusters EM             
+    case TCEM:       name="TCEM";         break;
+
+    // pos. and neg. eta barrel                         
+    case TCEMB1:     name="TCEMB1";       break;
+    case TCEMB2:     name="TCEMB2";       break;
+
+    // pos. and neg. eta endcap              
+    case TCEME1:     name="TCEME1";       break;
+    case TCEME2:     name="TCEME2";       break;
+
+    // Jet              
+    case JET:        name="JET";          break;
+    case JETB1:      name="JETB1";        break;
+    case JETB2:      name="JETB2";        break;
+    case JETE1:      name="JETE1";        break;
+    case JETE2:      name="JETE2";        break;
+
+    // Topo. cluster Fit              
+    case TCPUC:      name="TCPUC";        break;
+
+    // Topo. cluster Fit -- uncorrected                         
+    case TCPUCUnc:   name="TCPUCUnc";     break;
+
+    // Muons                         
+    case Muons:      name="Muons";        break;
+
+    default:         name="Unknown";
+  }
+  return name;                                    
+}
 
 /////////////////////////////////////////////////////////////////////
 
-- 
GitLab


From ccb3dc0e03f5e09628cf7866363499b9193850a9 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 28 Feb 2019 16:11:54 +0100
Subject: [PATCH 108/404] Add more debug messages

---
 .../TrigMissingETMuon/src/TrigMissingETMuon.cxx      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 993a3ee3bd3..993068ca234 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
@@ -204,7 +204,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
     unsigned int kk=0;
     for(auto muon : *muonContainer) 
     {
-      ATH_MSG_DEBUG("Looking at muon " << ++kk << "pt = " << muon->pt() << "eta= " << muon->eta() << "phi= " << muon->phi());
+      ATH_MSG_DEBUG("Looking at muon " << kk++ << ": (pt, eta, phi) = (" << muon->pt() << ", " << muon->eta() << ", " << muon->phi() << ")");
 
       // combined or segment tagged muon
       if(muon->muonType() == xAOD::Muon::MuonType::Combined 
@@ -247,7 +247,7 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
         muon_sum_e  += E;
         ++nMuons;
 
-        ATH_MSG_DEBUG("REGTEST: Adding muon with pT = " << Et << " MeV, phi = " << phi << " rad, eta = " << eta );
+        ATH_MSG_DEBUG("Adding muon with (pt, eta, phi) = (" << muon->pt() << ", " << muon->eta() << ", " << muon->phi() << ")");
       } // end if muonType
     } // end for(muon : muonContainer)
   } // end for(te : muonTE's)
@@ -260,7 +260,13 @@ HLT::ErrorCode TrigMissingETMuon::hltExecute(std::vector<std::vector<HLT::Trigge
 
   ATH_MSG_DEBUG("Setting energies and flag");
 
-  unsigned int muonComp = m_met->getNumberOfComponents() - 1; // Muons are always the last component \_( )_/
+  unsigned int muonComp = m_met->getNumberOfComponents() - 1; // Muons are always the last component \_(y)_/
+  ATH_MSG_VERBOSE("Outputting met component names:");
+  ATH_MSG_VERBOSE("ii \t m_met->nameOfComponent(ii)");
+  for(uint ii=0; ii<m_met->getNumberOfComponents(); ii++){
+    ATH_MSG_VERBOSE(ii << '\t' << m_met->nameOfComponent(ii));
+  }
+
   // Suggested by Diego: Checking the component name of the input
   // Turns out to be a good test 
   if( (m_met->nameOfComponent(muonComp)).substr(0,4)!="Muon") 
-- 
GitLab


From 5adffb73bf5c7b3aab3a0eb02b1147d8dbe6085c Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Thu, 28 Feb 2019 16:15:12 +0100
Subject: [PATCH 109/404] Refactorize from helper code

Identified a bug in how the code was factorized previously.

Replaced wrong methods with a new ComponentCopier nested class and associated methods.
---
 .../TrigEFMissingET/EFMissingETFromHelper.h   |  26 +-
 .../src/EFMissingETFromHelper.cxx             | 276 +++++++++---------
 2 files changed, 160 insertions(+), 142 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
index 372f967c004..ce7e81e7475 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromHelper.h
@@ -58,11 +58,27 @@ class EFMissingETFromHelper : public EFMissingETBaseTool
 
     StatusCode executeMT(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper);
 
-  private:
-    void setMET(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
-                unsigned char comp_i);
-    void setMETComp(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper, 
-                    unsigned char comp_i, signed char add_i=-1);
+    class ComponentCopier
+    {
+    public:
+      ComponentCopier(xAOD::TrigMissingET *met, TrigEFMissingEtHelper *metHelper)
+      {
+        m_met = met;
+        m_helper = metHelper;
+      }
+
+      void addHelperCompToMET(unsigned char helper_i);
+      void setMETCompFromHelper(unsigned char met_i, unsigned char helper_i);
+      void addMETCompWithHelper(unsigned char met_i, unsigned char met_add_i, unsigned char helper_i);
+      void setHelperFromMET();
+
+      xAOD::TrigMissingET* getMET() {return m_met; }
+      TrigEFMissingEtHelper* getMETHelper() {return m_helper; }
+      
+    private:
+      xAOD::TrigMissingET *m_met;
+      TrigEFMissingEtHelper *m_helper;
+    };
 
 };
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 2a4f8d2818b..ef03dbc11a5 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -32,6 +32,75 @@ TrigMissingET as auxiliary information.
 
 using CxxUtils::strformat;
 
+void EFMissingETFromHelper::ComponentCopier::addHelperCompToMET(unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  float ex =            metComp->m_ex;
+  float ey =            metComp->m_ey;
+  float ez =            metComp->m_ez;
+  float sumE =          metComp->m_sumE;
+  float sumEt =         metComp->m_sumEt;
+  float c0 =            metComp->m_calib0;
+  float c1 =            metComp->m_calib1;
+  // short status =        metComp->m_status;
+  short sumOfSigns =    metComp->m_sumOfSigns;
+  // unsigned short Ntot = metComp->m_usedChannels;
+
+  m_met->setEx(       m_met->ex() + sumOfSigns * c0 + c1 * ex );
+  m_met->setEy(       m_met->ey() + sumOfSigns * c0 + c1 * ey );
+  m_met->setEz(       m_met->ez() + sumOfSigns * c0 + c1 * ez );
+  m_met->setSumE(   m_met->sumE() + sumOfSigns * c0 + c1 * sumE );
+  m_met->setSumEt( m_met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
+  return;
+}
+
+void EFMissingETFromHelper::ComponentCopier::setMETCompFromHelper(unsigned char met_i, unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  m_met->setNameOfComponent(       met_i, metComp->m_name           );
+  m_met->setExComponent(           met_i, metComp->m_ex             );
+  m_met->setEyComponent(           met_i, metComp->m_ey             );
+  m_met->setEzComponent(           met_i, metComp->m_ez             );
+  m_met->setSumEtComponent(        met_i, metComp->m_sumEt          );
+  m_met->setSumEComponent(         met_i, metComp->m_sumE           );
+  m_met->setCalib0Component(       met_i, metComp->m_calib0         );
+  m_met->setCalib1Component(       met_i, metComp->m_calib1         );
+  m_met->setStatusComponent(       met_i, metComp->m_status         );
+  m_met->setSumOfSignsComponent(   met_i, metComp->m_sumOfSigns     );
+  m_met->setUsedChannelsComponent( met_i, metComp->m_usedChannels   );
+  return;
+}
+
+void EFMissingETFromHelper::ComponentCopier::addMETCompWithHelper(unsigned char met_i, unsigned char met_add_i, unsigned char helper_i)
+{
+  TrigEFMissingEtComponent* metComp = m_helper->GetComponent(helper_i);
+
+  m_met->setExComponent(              met_i, metComp->m_ex           + m_met->exComponent(           met_add_i ) );
+  m_met->setEyComponent(              met_i, metComp->m_ey           + m_met->eyComponent(           met_add_i ) );
+  m_met->setEzComponent(              met_i, metComp->m_ez           + m_met->ezComponent(           met_add_i ) );
+  m_met->setSumEtComponent(           met_i, metComp->m_sumEt        + m_met->sumEtComponent(        met_add_i ) );
+  m_met->setSumEComponent(            met_i, metComp->m_sumE         + m_met->sumEComponent(         met_add_i ) );
+  m_met->setSumOfSignsComponent(      met_i, metComp->m_sumOfSigns   + m_met->sumOfSignsComponent(   met_add_i ) );
+  m_met->setUsedChannelsComponent(    met_i, metComp->m_usedChannels + m_met->usedChannelsComponent( met_add_i ) );
+  m_met->setStatusComponent(          met_i, metComp->m_status       | m_met->statusComponent(       met_add_i ) );
+  m_met->setCalib0Component(          met_i, metComp->m_calib0 );
+  m_met->setCalib1Component(          met_i, metComp->m_calib1 );
+  return;
+}
+
+void EFMissingETFromHelper::ComponentCopier::setHelperFromMET()
+{
+  m_helper->SetEx(     m_met->ex()     );
+  m_helper->SetEy(     m_met->ey()     );
+  m_helper->SetEz(     m_met->ez()     );
+  m_helper->SetSumEt(  m_met->sumEt( ) );
+  m_helper->SetSumE(   m_met->sumE()   );
+  return;
+}
+// ----------------------- //
+
 EFMissingETFromHelper::EFMissingETFromHelper(const std::string& type,
     const std::string& name,
     const IInterface* parent):
@@ -72,79 +141,6 @@ StatusCode EFMissingETFromHelper::finalize()
   return StatusCode::SUCCESS;
 }
 
-void EFMissingETFromHelper::setMET(xAOD::TrigMissingET *const met, TrigEFMissingEtHelper *metHelper, 
-                                  const unsigned char comp_i)
-{
-  TrigEFMissingEtComponent* metComp = metHelper->GetComponent(comp_i);
-
-  float ex =            metComp->m_ex;
-  float ey =            metComp->m_ey;
-  float ez =            metComp->m_ez;
-  float sumE =          metComp->m_sumE;
-  float sumEt =         metComp->m_sumEt;
-  float c0 =            metComp->m_calib0;
-  float c1 =            metComp->m_calib1;
-  // short status =        metComp->m_status;
-  short sumOfSigns =    metComp->m_sumOfSigns;
-  // unsigned short Ntot = metComp->m_usedChannels;
-
-  met->setEx( met->ex() + sumOfSigns * c0 + c1 * ex );
-  met->setEy( met->ey() + sumOfSigns * c0 + c1 * ey );
-  met->setEz( met->ez() + sumOfSigns * c0 + c1 * ez );
-  met->setSumE( met->sumE() + sumOfSigns * c0 + c1 * sumE );
-  met->setSumEt( met->sumEt() + sumOfSigns * c0 + c1 * sumEt );
-  return;
-}
-
-
-void EFMissingETFromHelper::setMETComp(xAOD::TrigMissingET *const met, TrigEFMissingEtHelper *metHelper, 
-                                        const unsigned char comp_i, const signed char add_i)
-{
-  TrigEFMissingEtComponent* metComp = metHelper->GetComponent(comp_i);
-
-  float ex =            metComp->m_ex;
-  float ey =            metComp->m_ey;
-  float ez =            metComp->m_ez;
-  float sumE =          metComp->m_sumE;
-  float sumEt =         metComp->m_sumEt;
-  float c0 =            metComp->m_calib0;
-  float c1 =            metComp->m_calib1;
-  short status =        metComp->m_status;
-  short sumOfSigns =    metComp->m_sumOfSigns;
-  unsigned short Ntot = metComp->m_usedChannels;
-  char comp_name[10]="";
-  strcpy(comp_name, metComp->m_name);
-
-  bool addComponent = (add_i>=0);
-  if (addComponent)
-  {
-    ex         += met->exComponent(add_i);
-    ey         += met->eyComponent(add_i);
-    ez         += met->ezComponent(add_i);
-    sumE       += met->sumEComponent(add_i);
-    sumEt      += met->sumEtComponent(add_i);
-    sumOfSigns += met->sumOfSignsComponent(add_i);
-    status     |= met->statusComponent(add_i);
-    Ntot       += met->usedChannelsComponent(add_i);
-  }
-
-  if (strcmp(comp_name, "") // If the new component name is not ""
-      && !addComponent)     // and if we are not adding a component
-    met->setNameOfComponent(        comp_i, comp_name );
-  met->setExComponent(              comp_i, ex );
-  met->setEyComponent(              comp_i, ey );
-  met->setEzComponent(              comp_i, ez );
-  met->setSumEtComponent(           comp_i, sumEt );
-  met->setSumEComponent(            comp_i, sumE );
-  met->setCalib0Component(          comp_i, c0 );
-  met->setCalib1Component(          comp_i, c1 );
-  met->setStatusComponent(          comp_i, status );
-  met->setSumOfSignsComponent(      comp_i, sumOfSigns );
-  met->setUsedChannelsComponent(    comp_i, Ntot );
-  return;
-}
-
-
 StatusCode EFMissingETFromHelper::execute()
 {
   return StatusCode::SUCCESS;
@@ -169,6 +165,8 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     return StatusCode::FAILURE;
   }
 
+  ComponentCopier copier = ComponentCopier(met, metHelper);
+
   ATH_MSG_DEBUG( "Found this info in the helper class: " << metHelper->getFormattedValues() );
 
   if(m_timersvc)
@@ -177,10 +175,10 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   met->setFlag( metHelper->GetStatus() );
 
   unsigned int comp = met->getNumberOfComponents(); // final no. of aux. compon.
-  unsigned char elem = metHelper->GetElements(); // no. of transient aux. compon.
-  if (elem!=42) {
-    ATH_MSG_WARNING( "Found " << elem << " aux components in the transient helper class.  Not supported!" );
-  } else ATH_MSG_DEBUG( "Found " << elem << " aux components in the transient helper class" );
+  unsigned char nHelperComp = metHelper->GetElements(); // no. of transient aux. compon.
+  if (nHelperComp!=42) {
+    ATH_MSG_WARNING( "Found " << nHelperComp << " aux components in the transient helper class.  Not supported!" );
+  } else ATH_MSG_DEBUG( "Found " << nHelperComp << " aux components in the transient helper class" );
 
   bool skipAuxInfo=false;
   bool save9comp=false;
@@ -221,129 +219,133 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   met->setSumE(0.); met->setSumEt(0.);
 
   // take info from *metHelper and update *met
-  for (unsigned char  i=0; i<elem; ++i) { // loop over transient components
+  for (unsigned char  helper_i=0; helper_i<nHelperComp; ++helper_i) { // loop over transient components
 
     // basic info - DK calibration
-    if (i<elem-18){  // skip muon or Had Topo granular or EM Topo correction for all quantities
+    if (helper_i<nHelperComp-18){  
       ATH_MSG_DEBUG( "skip muon or Had Topo granular or EM Topo correction for all quantities" );
-      setMET(met, metHelper, i);
+      copier.addHelperCompToMET(helper_i);
     }
 
-    if(save9comp && i == 24) { // Save summed HAD MET
+    if(save9comp && helper_i == 24) { 
       ATH_MSG_DEBUG( "Save summed HAD MET" );
-      setMET(met, metHelper, i);
+      copier.addHelperCompToMET(helper_i);
     }
 
-    if( (save2comp || save6comp) && i == 34) { // Save JET MET
+    if( (save2comp || save6comp) && helper_i == 34) { 
       ATH_MSG_DEBUG( "Save JET MET" );
-      setMET(met, metHelper, i);
+      copier.addHelperCompToMET(helper_i);
     }
 
-    if(save3comp && i == 39) { // Save PUC MET
+    if(save3comp && helper_i == 39) { 
       ATH_MSG_DEBUG( "Save PUC MET" );
-      setMET(met, metHelper, i);
+      copier.addHelperCompToMET(helper_i);
     }
 
     if (skipAuxInfo) continue;
 
     // auxiliary info - uncorrected
-    if (comp == unsigned(elem-17) && i < 24) { // finest granularity
+    if (comp == unsigned(nHelperComp-17) && helper_i < 24) { 
       ATH_MSG_DEBUG( "finest granularity");
-      setMETComp(met, metHelper, i);
-    } else if(comp == unsigned(elem-17) && i == 41) { // save muons
+      copier.setMETCompFromHelper(helper_i, helper_i);
+    } else if(comp == unsigned(nHelperComp-17) && helper_i == 41) { 
       ATH_MSG_DEBUG( "save muons");
-      setMETComp(met, metHelper, i-17);
+      copier.setMETCompFromHelper(helper_i-17, helper_i);
     } else if (save6comp) {
-      if (i>=34 && i < 39) { // Central and Forward Jets
+      if (helper_i>=34 && helper_i < 39) { 
         ATH_MSG_DEBUG( "Central and Forward Jets");
-        setMETComp(met, metHelper, i-34);
+        copier.setMETCompFromHelper(helper_i-34, helper_i);
       }
-      if (i==41) { // Muons
+      if (helper_i==41) { 
         ATH_MSG_DEBUG( "Muons");
-        setMETComp(met, metHelper, 5);
+        copier.setMETCompFromHelper(5, helper_i);
       }
 
     } else if (save9comp) {
-      if (i > 24 && i < 29 ) { // HAD scale quantities
+      if (helper_i > 24 && helper_i < 29 ) { 
         ATH_MSG_DEBUG( "HAD scale quantities" );
-        setMETComp(met, metHelper, i-25);
-      } else if( i > 29 && i < 34) {     // EM scale quantities
+        copier.setMETCompFromHelper(helper_i-25, helper_i);
+      } else if( helper_i > 29 && helper_i < 34) {     
         ATH_MSG_DEBUG( "EM scale quantities" );
-        setMETComp(met, metHelper, i-25-1);
-      } else if( i == 41) {    // Muon
+        copier.setMETCompFromHelper(helper_i-25-1, helper_i);
+      } else if( helper_i == 41) {    
         ATH_MSG_DEBUG( "Muon" );
-        setMETComp(met, metHelper, i-25-8);
+        copier.setMETCompFromHelper(helper_i-25-8, helper_i);
       }
     } else if (save5comp) {
-      switch (i) {
-        case 0: case 1: case 2: case 3: // LAr, barrel
+      switch (helper_i) {
+        case 0: case 1: case 2: case 3: 
           ATH_MSG_DEBUG("LAr, barrel");
-          setMETComp(met, metHelper, 0, 1);
+          copier.addMETCompWithHelper(0, 1, helper_i);
           break;
-        case 4: case 5: case 6: case 7: // LAr, end-cap
+        case 4: case 5: case 6: case 7: 
           ATH_MSG_DEBUG("LAr, end-cap");
-        case 21:                        // + FCalEM
+          /* FALLTHROUGH */
+        case 21:                        
           ATH_MSG_DEBUG("+ FCalEM");
-          setMETComp(met, metHelper, 1, 2);
+          copier.addMETCompWithHelper(1, 2, helper_i);
           break;
-        case 12: case 13: case 14: // Tile, barrel +
+        case 12: case 13: case 14: 
           ATH_MSG_DEBUG("Tile, barrel +");
-        case 18: case 19: case 20: // Tile, extended barrel
+          /* FALLTHROUGH */
+        case 18: case 19: case 20: 
           ATH_MSG_DEBUG("Tile, extended barrel");
-          setMETComp(met, metHelper, 2, 3);
+          copier.addMETCompWithHelper(2, 3, helper_i);
           break;
         case 24: case 25: case 26: case 27: case 28:
         case 29: case 30: case 31: case 32: case 33:
         case 34: case 35: case 36: case 37: case 38:
-        case 39: case 40 :             // Topo. cluster elements or jets - do nothing.
+        case 39: case 40 :             
           ATH_MSG_DEBUG("Topo. cluster elements or jets - do nothing.");
           break;
-        case 41: // muons
+        case 41: 
           ATH_MSG_DEBUG("muons");
-          setMETComp(met, metHelper, 4);
+          copier.setMETCompFromHelper(4, helper_i);
           break;
-        default: // Hadr. end-cap + Tile gap + FCalHad
+        default: 
           ATH_MSG_DEBUG("Hadr. end-cap + Tile gap + FCalHad");
-          setMETComp(met, metHelper, 3, 4);
+          copier.addMETCompWithHelper(3, 4, helper_i);
       }
     } else if (save3comp) {
-      switch (i) {
-        case 39: // Corrected MET
+      switch (helper_i) {
+        case 39: 
           ATH_MSG_DEBUG( "Corrected MET" );
-          setMETComp(met, metHelper, 0);
+          copier.setMETCompFromHelper(0, helper_i);
           break;
-        case 40: // Original MET
+        case 40: 
           ATH_MSG_DEBUG( "Original MET" );
-          setMETComp(met, metHelper, 1);
+          copier.setMETCompFromHelper(1, helper_i);
           break;
-        case 41: // Muons
+        case 41: 
           ATH_MSG_DEBUG( "Muons" );
-          setMETComp(met, metHelper, 2);
-      }
-    } else if (save2comp) { // Jets + muons only
-      if (i==34) { // Jets
-        ATH_MSG_DEBUG( "Jets+Mu only: Jets");
-        setMETComp(met, metHelper, 0);
+          copier.setMETCompFromHelper(2, helper_i);
+        default:
+        ;
       }
-      if (i==41) { // Muons
-        ATH_MSG_DEBUG( "Jets+Mu only: Muons");
-        setMETComp(met, metHelper, 1);
+    } else if (save2comp) { 
+      switch(helper_i){
+        case 34:
+          ATH_MSG_DEBUG( "Jets+Mu only: Jets");
+          copier.setMETCompFromHelper(0, helper_i);
+          break;
+        case 41:
+          ATH_MSG_DEBUG( "Jets+Mu only: Muons");
+          copier.setMETCompFromHelper(1, helper_i);
+          break;
+        default:
+        ;
       }
-    } else if (save1comp) { // muons only
-      if (i==41) { // REPLACE WITH A TEST OVER COMP. NAME
+    } else if (save1comp) { 
+      if (helper_i==41) { // REPLACE WITH A TEST OVER COMP. NAME
         ATH_MSG_DEBUG("Muons only");
-        setMETComp(met, metHelper, 0);
+        copier.setMETCompFromHelper(0, helper_i);
       }
     }
 
   } // loop over transient components
 
   // also update transient helper class, for monitoring
-  metHelper->SetEx(     met->ex()     );
-  metHelper->SetEy(     met->ey()     );
-  metHelper->SetEz(     met->ez()     );
-  metHelper->SetSumEt(  met->sumEt( ) );
-  metHelper->SetSumE(   met->sumE()   );
+  copier.setHelperFromMET();
 
   if(m_timersvc)
     m_glob_timer->stop(); // total time
-- 
GitLab


From e8ba91b5854e8da9e2d2aca694a4b23eb3c92820 Mon Sep 17 00:00:00 2001
From: MihaMuskinja <miha.muskinja@gmail.com>
Date: Thu, 28 Feb 2019 16:33:18 +0100
Subject: [PATCH 110/404] fixed clash with trying to include StreamEVGEN twice

---
 Generators/GeneratorUtils/share/postJO.PoolOutput.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Generators/GeneratorUtils/share/postJO.PoolOutput.py b/Generators/GeneratorUtils/share/postJO.PoolOutput.py
index 9495f2c538b..3e572d528fb 100644
--- a/Generators/GeneratorUtils/share/postJO.PoolOutput.py
+++ b/Generators/GeneratorUtils/share/postJO.PoolOutput.py
@@ -1,6 +1,9 @@
 ## Pool persistency for evgen
-from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
-stream = AthenaPoolOutputStream("StreamEVGEN")
+from AthenaCommon.AppMgr import theApp
+stream = theApp.getOutputStream( "StreamEVGEN" )
+if stream is None:
+    from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
+    stream = AthenaPoolOutputStream("StreamEVGEN")
 stream.OutputFile = "evgen.pool.root"
 if "OUTFILE" in dir():
     stream.OutputFile = OUTFILE
-- 
GitLab


From 4139af9315dc5fcf58cbfc4c4b2bc7ca0ac74126 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Thu, 28 Feb 2019 17:30:39 +0100
Subject: [PATCH 111/404] m_speed_of_light in MdtCalibDbAlg

---
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h                    | 1 +
 .../MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx     | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
index c0c585154b6..c07fa1b57e9 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
@@ -113,6 +113,7 @@ class MdtCalibDbAlg: public AthAlgorithm {
   double m_rtShift;
   double m_rtScale;
   double m_prop_beta;
+  const double m_speed_of_light;
   ServiceHandle<IAtRndmGenSvc> m_AtRndmGenSvc;
   CLHEP::HepRandomEngine *p_engine;
 
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index 67cc6e1ac3f..8b17a6fd734 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -77,6 +77,7 @@ MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator)
   m_rtShift(0.),
   m_rtScale(1.),
   m_prop_beta(1.0),
+  m_speed_of_light(299.792458),
   m_AtRndmGenSvc ("AtRndmGenSvc", name),
   m_buffer_length(0),
   m_decompression_buffer(NULL),
@@ -661,7 +662,7 @@ StatusCode MdtCalibDbAlg::defaultT0s(std::unique_ptr<MdtTubeCalibContainerCollec
   ATH_MSG_DEBUG( " Created new MdtTubeCalibContainerCollection size " << writeCdoTube->size() );
 
   // Inverse of wire propagation speed
-  float inversePropSpeed = 1./(299.792458*m_prop_beta);
+  float inversePropSpeed = 1./(m_speed_of_light*m_prop_beta);
 
   //loop over modules (MDT chambers) and create an MdtTubeContainer for each
   MdtIdHelper::const_id_iterator it     = m_mdtIdHelper->module_begin();
@@ -756,7 +757,7 @@ StatusCode MdtCalibDbAlg::loadTube(){
   ATH_MSG_INFO("Range of input is " << rangeTube);
   
   // Inverse of wire propagation speed
-  float inversePropSpeed = 1./(299.792458*m_prop_beta);
+  float inversePropSpeed = 1./(m_speed_of_light*m_prop_beta);
 
   // unpack the strings in the collection and update the 
   // MdtTubeCalibContainers in TDS
-- 
GitLab


From eb1d08410fb73c56ca4f2a2860490a619586c9fe Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Thu, 28 Feb 2019 17:51:37 +0100
Subject: [PATCH 112/404] implement followups

---
 .../src/TriggerEDMDeserialiserAlg.cxx                 |  7 ++++---
 .../src/TriggerEDMSerialiserTool.cxx                  | 11 ++++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
index 78c9817891a..f412edf284c 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMDeserialiserAlg.cxx
@@ -137,7 +137,7 @@ StatusCode TriggerEDMDeserialiserAlg::deserialise(   const Payload* dataptr  ) c
 
     ATH_MSG_DEBUG( "Deserialised object of ptr: " << obj << " which used: " << usedBytes << " bytes from available: " << bsize );
     if ( obj == nullptr ) {
-      ATH_MSG_ERROR( "Deserialisation of object of CLID " << clid << " and transientTypeName " << transientTypeName << " # " << key << " failed, moving one to the next fragment" );
+      ATH_MSG_ERROR( "Deserialisation of object of CLID " << clid << " and transientTypeName " << transientTypeName << " # " << key << " failed" );
       ATH_CHECK(false);
     }
     const bool isxAODInterfaceContainer = transientTypeName.find("xAOD")   != std::string::npos and transientTypeName.find("Aux") == std::string::npos;
@@ -165,6 +165,8 @@ StatusCode TriggerEDMDeserialiserAlg::deserialise(   const Payload* dataptr  ) c
       }
       
       if ( isxAODAuxContainer )  {
+	ATH_CHECK( key.back() == '.' );
+	ATH_CHECK( std::count( key.begin(), key.end(), '.')  == 1 );
 	xAOD::AuxContainerBase* auxHolder = reinterpret_cast<xAOD::AuxContainerBase*>(dataBucket->object());
 	ATH_CHECK( auxHolder != nullptr );	
 	currentAuxStore = new WritableAuxStore();
@@ -228,8 +230,7 @@ StatusCode TriggerEDMDeserialiserAlg::checkSanity( const std::string& transientT
 		   << (isxAODAuxContainer ?" xAOD Aux Container ":"" ) 
 		   << ( isDecoration ? " xAOD Decoration" : "") 
 		   << ( isTPContainer ? " T/P Contianer " : "") );
-    return StatusCode::FAILURE;
-    
+    return StatusCode::FAILURE;    
   }
   return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
index b9c9f0fae3b..e4aeb20ef81 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
@@ -68,9 +68,9 @@ StatusCode TriggerEDMSerialiserTool::initialize() {
 	  }
 	  sel.selectAux( variableNames );
 	}
-	m_toSerialise.emplace_back(transientType, persistentType, clid, key, moduleIdVec, Address::xAODAux, sel );      
+	m_toSerialise.emplace_back( transientType, persistentType, clid, key, moduleIdVec, Address::xAODAux, sel );      
       } else {
-    	m_toSerialise.emplace_back(transientType, persistentType, clid, key, moduleIdVec, Address::xAODInterface, xAOD::AuxSelection() );      
+    	m_toSerialise.emplace_back( transientType, persistentType, clid, key, moduleIdVec, Address::xAODInterface, xAOD::AuxSelection() );      
       }
     } else { // an old T/P type
       m_toSerialise.emplace_back( transientType, persistentType, clid, key, moduleIdVec, Address::OldTP, xAOD::AuxSelection() );      
@@ -237,8 +237,13 @@ StatusCode TriggerEDMSerialiserTool::serialiseTPContainer( void* data, const Add
 }
 
 StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) const {
-  
 
+  // Leave this check until there is a justified case for appending data to an existing result
+  if (not resultToFill.getSerialisedData().empty()) {
+    ATH_MSG_ERROR("Trying to fill a result which is not empty! Likely misconfiguration, returning a FAILURE");
+    return StatusCode::FAILURE;
+  }
+  
   for ( const Address& address: m_toSerialise ) {
     ATH_MSG_DEBUG( "Streaming " << address.persType );
     // obtain object
-- 
GitLab


From ab52174fcff6dd42fa4d592d05038c1644d9ab90 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Thu, 28 Feb 2019 18:00:04 +0100
Subject: [PATCH 113/404] p_engine = m_AtRndmGenSvc->GetEngine(MDTCALIBDBALG)
 in MdtCalibDbAlg

---
 .../MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index 8b17a6fd734..568838a5be4 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -162,7 +162,9 @@ StatusCode MdtCalibDbAlg::initialize(){
                     << m_t0Shift << " spread " << m_t0Spread << " rt shift " << m_rtShift );
       
     // getting our random numbers stream
-    p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBASCIITOOL");
+    p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBALG");
+    //p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBASCIITOOL");
+    //if we need to reproduce something
   }
 
   if ( m_rtShift != 0. || m_rtScale != 1. || m_t0Shift != 0. || m_t0Spread != 0.) {
-- 
GitLab


From 3df9ef5b04e0d5b4d9eae6c9d1a441ffaf8d94f8 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 26 Feb 2019 21:31:02 +0100
Subject: [PATCH 114/404] Add simple unit test for MdtOverlay

---
 .../MuonOverlay/MdtOverlay/CMakeLists.txt     |  10 +
 .../MdtOverlay/MdtOverlay/MdtOverlay.h        |   5 +-
 .../MuonOverlay/MdtOverlay/src/MdtOverlay.cxx |   4 -
 .../MdtOverlay/test/MdtOverlay_test.cxx       | 446 ++++++++++++++++++
 4 files changed, 457 insertions(+), 8 deletions(-)
 create mode 100644 MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx

diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/MdtOverlay/CMakeLists.txt
index a41637f1934..214994f7d26 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/CMakeLists.txt
@@ -11,10 +11,20 @@ atlas_depends_on_subdirs( PUBLIC
                           MuonSpectrometer/MuonDigitContainer
                           MuonSpectrometer/MuonOverlay/MuonOverlayBase
                           PRIVATE
+                          AtlasTest/TestTools
                           Control/StoreGate
                           MuonSpectrometer/MuonDigitization/MuonDigToolInterfaces
                           MuonSpectrometer/MuonIdHelpers )
 
+#External dependencies:
+find_package( GTest )
+
+atlas_add_test( MdtOverlay_test
+                SOURCES src/*.cxx test/MdtOverlay_test.cxx
+                INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+                LINK_LIBRARIES GaudiKernel TestTools MuonDigitContainer MuonOverlayBase StoreGateLib SGtests MuonIdHelpersLib ${GTEST_LIBRARIES}
+                EXTRA_PATTERNS "[0-9]+ ms")
+
 # Component(s) in the package:
 atlas_add_component( MdtOverlay
                      src/*.cxx
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h b/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
index a0bf16beed4..5c9753beec3 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
@@ -20,10 +20,8 @@
 #include "MuonOverlayBase/MuonOverlayBase.h"
 #include "MuonDigitContainer/MdtDigitContainer.h"
 
-class MdtIdHelper;
-
-
 class MdtOverlay : public MuonOverlayBase  {
+
 public:
 
   MdtOverlay(const std::string &name,ISvcLocator *pSvcLocator);
@@ -46,7 +44,6 @@ private:
   SG::WriteHandleKey<MdtDigitContainer> m_outputDigitKey{this,"OutputDigitKey","StoreGateSvc+MDT_DIGITS","WriteHandleKey for Output MdtDigitContainer"};
 
   float m_adcIntegrationWindow{20.0}; // in ns
-  const MdtIdHelper   * m_mdtHelper{nullptr};
   bool m_clean_overlay_data{false};
   bool m_clean_overlay_signal{false};
 };
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx b/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
index 7138030a272..68d1317bac2 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
@@ -15,7 +15,6 @@
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
-#include "MuonIdHelpers/MdtIdHelper.h"
 #include "MuonDigitContainer/MdtDigitContainer.h"
 
 #include <iostream>
@@ -91,9 +90,6 @@ StatusCode MdtOverlay::overlayInitialize()
 {
   ATH_MSG_INFO("MdtOverlay initialized");
 
-  ATH_CHECK(detStore()->retrieve(m_mdtHelper, "MDTIDHELPER"));
-  ATH_MSG_DEBUG(" Found the MdtIdHelper. ");
-
   ATH_CHECK(m_mainInputDigitKey.initialize());
   ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_mainInputDigitKey );
   ATH_CHECK(m_overlayInputDigitKey.initialize());
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx b/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx
new file mode 100644
index 00000000000..8f26e331ad5
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx
@@ -0,0 +1,446 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for MdtOverlay.
+ */
+
+#undef NDEBUG
+
+// Framework
+#include "TestTools/initGaudi.h"
+
+// Google Test
+#include "gtest/gtest.h"
+
+// Tested AthAlgorithm
+#include "../MdtOverlay/MdtOverlay.h"
+
+namespace OverlayTesting {
+
+  // needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated
+  ISvcLocator* g_svcLoc = nullptr;
+
+  // global test environment takes care of setting up Gaudi
+  class GaudiEnvironment : public ::testing::Environment {
+  protected:
+    virtual void SetUp() override {
+      Athena_test::initGaudi(OverlayTesting::g_svcLoc);
+    }
+  };
+
+  class MdtOverlay_test : public ::testing::Test {
+
+  protected:
+    virtual void SetUp() override {
+      m_alg = new MdtOverlay{"MdtOverlay", g_svcLoc};
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    MdtOverlay* m_alg;
+  };   // MdtOverlay_test fixture
+
+
+  TEST_F(MdtOverlay_test, set_properties) {
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(MdtOverlay_test, empty_containers_alg_execute) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG"};
+    const unsigned int containerSize(1188);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_matching_empty_collections) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG1"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(1);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG1"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG1'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG1'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS1'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS1"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_different_empty_collections) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG2"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(2);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG2"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG2'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG2'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS2'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS2"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const MdtDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_matching_collections_one_with_a_digit) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG3"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTDC(12);
+    const int sigADC(13);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG3"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG3'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG3'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS3'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS3"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const MdtDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->tdc()==sigTDC );
+    ASSERT_TRUE( outputDigit1->adc()==sigADC );
+    ASSERT_TRUE( outputDigit1->is_masked()==false );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_different_collections_one_digit_each) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG4"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(2);
+    const int sigTDC(12);
+    const int bkgTDC(13);
+    const int sigADC(13);
+    const int bkgADC(14);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG4"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> bkgDigit = std::make_unique<MdtDigit>(Identifier(12),bkgTDC,bkgADC,false);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG4'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG4'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS4'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS4"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const MdtDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->tdc()==sigTDC );
+    ASSERT_TRUE( outputDigit1->adc()==sigADC );
+    ASSERT_TRUE( outputDigit1->is_masked()==false );
+    const MdtDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->size()==1 );
+    const MdtDigit* outputDigit2 = outputCollection2->at(0);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->tdc()==bkgTDC );
+    ASSERT_TRUE( outputDigit2->adc()==bkgADC );
+    ASSERT_TRUE( outputDigit2->is_masked()==false );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_matching_collections_one_different_digit_each) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG5"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTDC(12);
+    const int bkgTDC(12);
+    const int sigADC(13);
+    const int bkgADC(13);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG5"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> bkgDigit = std::make_unique<MdtDigit>(Identifier(13),bkgTDC,bkgADC,false);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG5'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG5'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS5'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS5"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const MdtDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->tdc()==sigTDC );
+    ASSERT_TRUE( outputDigit1->adc()==sigADC );
+    ASSERT_TRUE( outputDigit1->is_masked()==false );
+    const MdtDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->tdc()==sigTDC );
+    ASSERT_TRUE( outputDigit2->adc()==sigADC );
+    ASSERT_TRUE( outputDigit2->is_masked()==false );
+  }
+
+  TEST_F(MdtOverlay_test, containers_with_matching_collections_one_matching_digit_each) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG6"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTDC(12);
+    const int bkgTDC(12);
+    const int sigADC(13);
+    const int bkgADC(13);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG6"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> bkgDigit = std::make_unique<MdtDigit>(Identifier(12),bkgTDC,bkgADC,false);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG6'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG6'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS6'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS6"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const MdtDigit* outputDigit = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit!=nullptr );
+    ASSERT_TRUE( outputDigit->tdc()==sigTDC ); // TDC values were the same for both digits
+    ASSERT_TRUE( outputDigit->adc()==sigADC+bkgADC ); // Adds up the ADC values on matching digits
+    ASSERT_TRUE( outputDigit->is_masked()==false );
+  }
+
+  TEST_F(MdtOverlay_test, two_digits_with_matching_id_signal_first) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG7"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTDC(11);
+    const int bkgTDC(12);
+    const int sigADC(13);
+    const int bkgADC(13);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG7"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> bkgDigit = std::make_unique<MdtDigit>(Identifier(12),bkgTDC,bkgADC,false);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG7'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG7'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS7'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS7"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const MdtDigit* outputDigit = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit!=nullptr );
+    ASSERT_TRUE( outputDigit->tdc()==sigTDC ); // Use lowest TDC value
+    ASSERT_TRUE( outputDigit->adc()==sigADC+bkgADC ); // Adds up the ADC values on matching digits
+    ASSERT_TRUE( outputDigit->is_masked()==false );
+  }
+
+  TEST_F(MdtOverlay_test, two_digits_with_matching_id_bkg_first) {
+    SG::WriteHandle<MdtDigitContainer> inputSigDataHandle{"StoreGateSvc+MDT_DIGITS_SIG8"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTDC(12);
+    const int bkgTDC(11);
+    const int sigADC(13);
+    const int bkgADC(13);
+    inputSigDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> sigCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> sigDigit = std::make_unique<MdtDigit>(Identifier(12),sigTDC,sigADC,false);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<MdtDigitContainer> inputBkgDataHandle{"StoreGateSvc+MDT_DIGITS_BKG8"};
+    inputBkgDataHandle = std::make_unique<MdtDigitContainer>(containerSize);
+    std::unique_ptr<MdtDigitCollection> bkgCollection = std::make_unique<MdtDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an MdtDigit
+    std::unique_ptr<MdtDigit> bkgDigit = std::make_unique<MdtDigit>(Identifier(12),bkgTDC,bkgADC,false);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG8'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG8'";
+    std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS8'";
+    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
+    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS8"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const MdtDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const MdtDigit* outputDigit = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit!=nullptr );
+    ASSERT_TRUE( outputDigit->tdc()==bkgTDC ); // Use lowest TDC value
+    ASSERT_TRUE( outputDigit->adc()==sigADC+bkgADC ); // Adds up the ADC values on matching digits
+    ASSERT_TRUE( outputDigit->is_masked()==false );
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+  ::testing::AddGlobalTestEnvironment( new OverlayTesting::GaudiEnvironment );
+  return RUN_ALL_TESTS();
+}
-- 
GitLab


From 38ab921f28636b126d19da2dc584b9a13e9acf8c Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 28 Feb 2019 17:05:50 +0100
Subject: [PATCH 115/404] Initial unit test for RpcOverlay

---
 .../MuonOverlay/RpcOverlay/CMakeLists.txt     |  10 +
 .../RpcOverlay/test/RpcOverlay_test.cxx       | 428 ++++++++++++++++++
 2 files changed, 438 insertions(+)
 create mode 100644 MuonSpectrometer/MuonOverlay/RpcOverlay/test/RpcOverlay_test.cxx

diff --git a/MuonSpectrometer/MuonOverlay/RpcOverlay/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/RpcOverlay/CMakeLists.txt
index b67846b51e2..7981783a5ab 100644
--- a/MuonSpectrometer/MuonOverlay/RpcOverlay/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/RpcOverlay/CMakeLists.txt
@@ -11,10 +11,20 @@ atlas_depends_on_subdirs( PUBLIC
                           MuonSpectrometer/MuonDigitContainer
                           MuonSpectrometer/MuonOverlay/MuonOverlayBase
                           PRIVATE
+                          AtlasTest/TestTools
                           Control/StoreGate
                           MuonSpectrometer/MuonDigitization/MuonDigToolInterfaces
                           MuonSpectrometer/MuonIdHelpers )
 
+#External dependencies:
+find_package( GTest )
+
+atlas_add_test( RpcOverlay_test
+                SOURCES src/*.cxx test/RpcOverlay_test.cxx
+                INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+                LINK_LIBRARIES GaudiKernel TestTools MuonDigitContainer MuonOverlayBase StoreGateLib SGtests MuonIdHelpersLib ${GTEST_LIBRARIES}
+                EXTRA_PATTERNS "[0-9]+ ms")
+
 # Component(s) in the package:
 atlas_add_component( RpcOverlay
                      src/*.cxx
diff --git a/MuonSpectrometer/MuonOverlay/RpcOverlay/test/RpcOverlay_test.cxx b/MuonSpectrometer/MuonOverlay/RpcOverlay/test/RpcOverlay_test.cxx
new file mode 100644
index 00000000000..3e8a50e7133
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/RpcOverlay/test/RpcOverlay_test.cxx
@@ -0,0 +1,428 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for RpcOverlay.
+ */
+
+#undef NDEBUG
+
+// Framework
+#include "TestTools/initGaudi.h"
+
+// Google Test
+#include "gtest/gtest.h"
+
+// Tested AthAlgorithm
+#include "../RpcOverlay/RpcOverlay.h"
+
+namespace OverlayTesting {
+
+  // needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated
+  ISvcLocator* g_svcLoc = nullptr;
+
+  // global test environment takes care of setting up Gaudi
+  class GaudiEnvironment : public ::testing::Environment {
+  protected:
+    virtual void SetUp() override {
+      Athena_test::initGaudi(OverlayTesting::g_svcLoc);
+    }
+  };
+
+  class RpcOverlay_test : public ::testing::Test {
+
+  protected:
+    virtual void SetUp() override {
+      m_alg = new RpcOverlay{"RpcOverlay", g_svcLoc};
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    RpcOverlay* m_alg;
+  };   // RpcOverlay_test fixture
+
+
+  TEST_F(RpcOverlay_test, set_properties) {
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(RpcOverlay_test, empty_containers_alg_execute) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG"};
+    const unsigned int containerSize(1188);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_matching_empty_collections) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG1"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(1);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG1"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG1'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG1'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS1'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS1"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_different_empty_collections) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG2"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(2);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG2"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG2'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG2'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS2'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS2"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const RpcDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_matching_collections_one_with_a_digit) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG3"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTime(12);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG3"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG3'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG3'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS3'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS3"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const RpcDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==sigTime );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_different_collections_one_digit_each) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG4"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(2);
+    const int sigTime(12);
+    const int bkgTime(13);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG4"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> bkgDigit = std::make_unique<RpcDigit>(Identifier(12),bkgTime);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG4'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG4'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS4'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS4"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const RpcDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==sigTime );
+    const RpcDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->size()==1 );
+    const RpcDigit* outputDigit2 = outputCollection2->at(0);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->time()==bkgTime );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_matching_collections_one_different_digit_each) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG5"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTime(12);
+    const int bkgTime(12);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG5"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> bkgDigit = std::make_unique<RpcDigit>(Identifier(13),bkgTime);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG5'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG5'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS5'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS5"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const RpcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==sigTime );
+    const RpcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->time()==sigTime );
+  }
+
+  TEST_F(RpcOverlay_test, containers_with_matching_collections_one_matching_digit_each) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG6"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTime(12);
+    const int bkgTime(12);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG6"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> bkgDigit = std::make_unique<RpcDigit>(Identifier(12),bkgTime);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG6'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG6'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS6'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS6"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); //FIXME Is this the correct behaviour?
+    const RpcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==sigTime ); // Time values were the same for both digits
+    const RpcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->time()==bkgTime ); // Time values were the same for both digits
+  }
+
+  TEST_F(RpcOverlay_test, two_digits_with_matching_id_signal_first) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG7"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTime(11);
+    const int bkgTime(12);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG7"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> bkgDigit = std::make_unique<RpcDigit>(Identifier(12),bkgTime);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG7'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG7'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS7'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS7"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); //FIXME Is this the correct behaviour?
+    const RpcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==bkgTime );
+    const RpcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->time()==sigTime ); //FIXME?? Digits are not time ordered?
+  }
+
+  TEST_F(RpcOverlay_test, two_digits_with_matching_id_bkg_first) {
+    SG::WriteHandle<RpcDigitContainer> inputSigDataHandle{"StoreGateSvc+RPC_DIGITS_SIG8"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigTime(12);
+    const int bkgTime(11);
+    inputSigDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> sigCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> sigDigit = std::make_unique<RpcDigit>(Identifier(12),sigTime);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<RpcDigitContainer> inputBkgDataHandle{"StoreGateSvc+RPC_DIGITS_BKG8"};
+    inputBkgDataHandle = std::make_unique<RpcDigitContainer>(containerSize);
+    std::unique_ptr<RpcDigitCollection> bkgCollection = std::make_unique<RpcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an RpcDigit
+    std::unique_ptr<RpcDigit> bkgDigit = std::make_unique<RpcDigit>(Identifier(12),bkgTime);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+RPC_DIGITS_SIG8'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+RPC_DIGITS_BKG8'";
+    std::string    outputPropertyValue = "'StoreGateSvc+RPC_DIGITS8'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<RpcDigitContainer> outputDataHandle{"StoreGateSvc+RPC_DIGITS8"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const RpcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); //FIXME Is this the correct behaviour?
+    const RpcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->time()==bkgTime );
+    const RpcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->time()==sigTime );
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+  ::testing::AddGlobalTestEnvironment( new OverlayTesting::GaudiEnvironment );
+  return RUN_ALL_TESTS();
+}
-- 
GitLab


From 80cc29de7566ffeefec2e6e245da58beca03311e Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 28 Feb 2019 17:20:52 +0100
Subject: [PATCH 116/404] Initial unit tests for TgcOverlay

---
 .../MuonOverlay/TgcOverlay/CMakeLists.txt     |  10 +
 .../TgcOverlay/test/TgcOverlay_test.cxx       | 428 ++++++++++++++++++
 2 files changed, 438 insertions(+)
 create mode 100644 MuonSpectrometer/MuonOverlay/TgcOverlay/test/TgcOverlay_test.cxx

diff --git a/MuonSpectrometer/MuonOverlay/TgcOverlay/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/TgcOverlay/CMakeLists.txt
index c69910fe4bf..37a45e0064f 100644
--- a/MuonSpectrometer/MuonOverlay/TgcOverlay/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/TgcOverlay/CMakeLists.txt
@@ -11,11 +11,21 @@ atlas_depends_on_subdirs( PUBLIC
                           MuonSpectrometer/MuonDigitContainer
                           MuonSpectrometer/MuonOverlay/MuonOverlayBase
                           PRIVATE
+                          AtlasTest/TestTools
                           Control/AthenaKernel
                           Control/StoreGate
                           MuonSpectrometer/MuonDigitization/MuonDigToolInterfaces
                           MuonSpectrometer/MuonIdHelpers )
 
+#External dependencies:
+find_package( GTest )
+
+atlas_add_test( TgcOverlay_test
+                SOURCES src/*.cxx test/TgcOverlay_test.cxx
+                INCLUDE_DIRS ${GTEST_INCLUDE_DIRS}
+                LINK_LIBRARIES GaudiKernel TestTools MuonDigitContainer MuonOverlayBase AthenaKernel StoreGateLib SGtests MuonIdHelpersLib ${GTEST_LIBRARIES}
+                EXTRA_PATTERNS "[0-9]+ ms")
+
 # Component(s) in the package:
 atlas_add_component( TgcOverlay
                      src/*.cxx
diff --git a/MuonSpectrometer/MuonOverlay/TgcOverlay/test/TgcOverlay_test.cxx b/MuonSpectrometer/MuonOverlay/TgcOverlay/test/TgcOverlay_test.cxx
new file mode 100644
index 00000000000..a3f335719e8
--- /dev/null
+++ b/MuonSpectrometer/MuonOverlay/TgcOverlay/test/TgcOverlay_test.cxx
@@ -0,0 +1,428 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for TgcOverlay.
+ */
+
+#undef NDEBUG
+
+// Framework
+#include "TestTools/initGaudi.h"
+
+// Google Test
+#include "gtest/gtest.h"
+
+// Tested AthAlgorithm
+#include "../TgcOverlay/TgcOverlay.h"
+
+namespace OverlayTesting {
+
+  // needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated
+  ISvcLocator* g_svcLoc = nullptr;
+
+  // global test environment takes care of setting up Gaudi
+  class GaudiEnvironment : public ::testing::Environment {
+  protected:
+    virtual void SetUp() override {
+      Athena_test::initGaudi(OverlayTesting::g_svcLoc);
+    }
+  };
+
+  class TgcOverlay_test : public ::testing::Test {
+
+  protected:
+    virtual void SetUp() override {
+      m_alg = new TgcOverlay{"TgcOverlay", g_svcLoc};
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    TgcOverlay* m_alg;
+  };   // TgcOverlay_test fixture
+
+
+  TEST_F(TgcOverlay_test, set_properties) {
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(TgcOverlay_test, empty_containers_alg_execute) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG"};
+    const unsigned int containerSize(1188);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_matching_empty_collections) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG1"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(1);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG1"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG1'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG1'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS1'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS1"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_different_empty_collections) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG2"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(2);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG2"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG2'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG2'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS2'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS2"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const TgcDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_matching_collections_one_with_a_digit) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG3"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigBCTAG(12);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG3"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG3'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG3'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS3'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS3"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const TgcDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==sigBCTAG );
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_different_collections_one_digit_each) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG4"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(2);
+    const int sigBCTAG(12);
+    const int bkgBCTAG(13);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG4"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> bkgDigit = std::make_unique<TgcDigit>(Identifier(12),bkgBCTAG);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG4'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG4'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS4'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS4"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const TgcDigit* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==sigBCTAG );
+    const TgcDigitCollection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->size()==1 );
+    const TgcDigit* outputDigit2 = outputCollection2->at(0);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->bcTag()==bkgBCTAG );
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_matching_collections_one_different_digit_each) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG5"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigBCTAG(12);
+    const int bkgBCTAG(12);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG5"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> bkgDigit = std::make_unique<TgcDigit>(Identifier(13),bkgBCTAG);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG5'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG5'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS5'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS5"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const TgcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==bkgBCTAG ); // bkg digit first in collection
+    const TgcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->bcTag()==sigBCTAG ); // sig digits added to end of collection
+  }
+
+  TEST_F(TgcOverlay_test, containers_with_matching_collections_one_matching_digit_each) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG6"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigBCTAG(12);
+    const int bkgBCTAG(12);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG6"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> bkgDigit = std::make_unique<TgcDigit>(Identifier(12),bkgBCTAG);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG6'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG6'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS6'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS6"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); // FIXME Is this the correct behaviour?
+    const TgcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==bkgBCTAG ); // bkg digit first in collection
+    const TgcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->bcTag()==sigBCTAG ); // sig digits added to end of collection
+  }
+
+  TEST_F(TgcOverlay_test, two_digits_with_matching_id_signal_first) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG7"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigBCTAG(11);
+    const int bkgBCTAG(12);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG7"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> bkgDigit = std::make_unique<TgcDigit>(Identifier(12),bkgBCTAG);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG7'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG7'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS7'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS7"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); // FIXME Is this the correct behaviour?
+    const TgcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==bkgBCTAG ); // bkg digit first in collection
+    const TgcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->bcTag()==sigBCTAG ); // sig digits added to end of collection
+  }
+
+  TEST_F(TgcOverlay_test, two_digits_with_matching_id_bkg_first) {
+    SG::WriteHandle<TgcDigitContainer> inputSigDataHandle{"StoreGateSvc+TGC_DIGITS_SIG8"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigBCTAG(12);
+    const int bkgBCTAG(11);
+    inputSigDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> sigCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),sigElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> sigDigit = std::make_unique<TgcDigit>(Identifier(12),sigBCTAG);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<TgcDigitContainer> inputBkgDataHandle{"StoreGateSvc+TGC_DIGITS_BKG8"};
+    inputBkgDataHandle = std::make_unique<TgcDigitContainer>(containerSize);
+    std::unique_ptr<TgcDigitCollection> bkgCollection = std::make_unique<TgcDigitCollection>(Identifier(1234),bkgElementHash);
+    //Add an TgcDigit
+    std::unique_ptr<TgcDigit> bkgDigit = std::make_unique<TgcDigit>(Identifier(12),bkgBCTAG);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+TGC_DIGITS_SIG8'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+TGC_DIGITS_BKG8'";
+    std::string    outputPropertyValue = "'StoreGateSvc+TGC_DIGITS8'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<TgcDigitContainer> outputDataHandle{"StoreGateSvc+TGC_DIGITS8"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const TgcDigitCollection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 ); // FIXME Is this the correct behaviour?
+    const TgcDigit* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->bcTag()==bkgBCTAG ); // bkg digit first in collection
+    const TgcDigit* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->bcTag()==sigBCTAG ); // sig digits added to end of collection
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+  ::testing::AddGlobalTestEnvironment( new OverlayTesting::GaudiEnvironment );
+  return RUN_ALL_TESTS();
+}
-- 
GitLab


From ad3de0330a385cd471073c1b12794b1dfb992c62 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 28 Feb 2019 19:09:43 +0100
Subject: [PATCH 117/404] Add simple unit test for PixelOverlay

---
 .../InDetRawAlgs/InDetOverlay/CMakeLists.txt  |  16 +-
 .../InDetOverlay/test/PixelOverlay_test.cxx   | 489 ++++++++++++++++++
 2 files changed, 501 insertions(+), 4 deletions(-)
 create mode 100644 InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
index 7282308268c..60235ef57bd 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
@@ -13,22 +13,30 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetRawEvent/InDetRawData
                           PRIVATE
                           Control/StoreGate
- 			                    Control/CxxUtils	  
                           Generators/GeneratorObjects
                           InnerDetector/InDetDetDescr/InDetIdentifier
-                          InnerDetector/InDetRawEvent/InDetSimData 
+                          InnerDetector/InDetRawEvent/InDetSimData
                           InnerDetector/InDetRecTools/TRT_ElectronPidTools
                           Tracking/TrkEvent/TrkTrack
                           )
 
+#External dependencies:
 find_package( CLHEP )
+find_package( GTest )
+
+atlas_add_test( PixelOverlay_test
+                SOURCES src/PixelOverlay.cxx test/PixelOverlay_test.cxx
+                INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
+                LINK_LIBRARIES  ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack ${GTEST_LIBRARIES}
+                EXTRA_PATTERNS "[0-9]+ ms")
+
 
 # Component(s) in the package:
 atlas_add_component( InDetOverlay
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} 
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests CxxUtils GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib)
+                     INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib)
 
 # Install files from the package:
 atlas_install_headers( InDetOverlay )
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx
new file mode 100644
index 00000000000..91161d7edb1
--- /dev/null
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx
@@ -0,0 +1,489 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for PixelOverlay.
+ */
+
+#undef NDEBUG
+
+// Framework
+#include "TestTools/initGaudi.h"
+
+// Google Test
+#include "gtest/gtest.h"
+
+// Tested AthAlgorithm
+#include "../InDetOverlay/PixelOverlay.h"
+
+namespace OverlayTesting {
+
+  // needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated
+  ISvcLocator* g_svcLoc = nullptr;
+
+  // global test environment takes care of setting up Gaudi
+  class GaudiEnvironment : public ::testing::Environment {
+  protected:
+    virtual void SetUp() override {
+      Athena_test::initGaudi(OverlayTesting::g_svcLoc);
+    }
+  };
+
+  class PixelOverlay_test : public ::testing::Test {
+
+  protected:
+    virtual void SetUp() override {
+      m_alg = new PixelOverlay{"PixelOverlay", g_svcLoc};
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+    }
+
+    virtual void TearDown() override {
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    PixelOverlay* m_alg;
+  };   // PixelOverlay_test fixture
+
+
+  TEST_F(PixelOverlay_test, set_properties) {
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(PixelOverlay_test, empty_containers_alg_execute) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG"};
+    const unsigned int containerSize(1188);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_matching_empty_collections) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG1"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(1);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG1"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG1'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG1'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs1'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs1"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_different_empty_collections) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG2"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG2"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG2'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG2'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs2'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs2"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const PixelRDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_matching_collections_one_with_an_RDO) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG3"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(10);
+    const unsigned int sigBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG3"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG3'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG3'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs3'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs3"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const PixelRDORawData* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==sigToT );
+    ASSERT_TRUE( outputDigit1->getBCID()==sigBCID-1 );
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_different_collections_one_RDO_each) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG4"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(2);
+    const unsigned int sigToT(10);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(2);
+    const unsigned int bkgBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG4"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(12),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG4'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG4'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs4'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs4"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const PixelRDORawData* outputDigit1 = outputCollection1->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==sigToT );
+    ASSERT_TRUE( outputDigit1->getBCID()==sigBCID-1 );
+    const PixelRDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->size()==1 );
+    const PixelRDORawData* outputDigit2 = outputCollection2->at(0);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getToT()==bkgToT );
+    ASSERT_TRUE( outputDigit2->getBCID()==bkgBCID-1 );
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_matching_collections_one_different_RDO_each) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG5"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(11);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(1);
+    const unsigned int bkgBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG5"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(13),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG5'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG5'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs5'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs5"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const PixelRDORawData* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==sigToT ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit1->getBCID()==sigBCID-1 ); // RDOs in same collection sorted according to Identifier
+    const PixelRDORawData* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getToT()==bkgToT ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit2->getBCID()==bkgBCID-1 ); // RDOs in same collection sorted according to Identifier
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_matching_collections_one_matching_RDO_each) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG6"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(10);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(2);
+    const unsigned int bkgBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG6"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(12),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG6'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG6'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs6'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs6"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const PixelRDORawData* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // Bkg RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // Bkg RDO taken in case of matching Identifiers
+  }
+
+  TEST_F(PixelOverlay_test, two_RDOs_with_matching_id_signal_first) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG7"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(11);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(1);
+    const unsigned int bkgBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG7"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(12),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG7'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG7'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs7'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs7"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const PixelRDORawData* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // Bkg RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // Bkg RDO taken in case of matching Identifiers
+  }
+
+  TEST_F(PixelOverlay_test, two_RDOs_with_matching_id_bkg_first) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG8"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(11);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(2);
+    const unsigned int bkgBCID(1);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(12),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG8"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(12),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG8'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG8'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs8'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs8"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const PixelRDORawData* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // Bkg RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // Bkg RDO taken in case of matching Identifiers
+  }
+
+  TEST_F(PixelOverlay_test, containers_with_matching_collections_one_different_RDO_each_v2) {
+    SG::WriteHandle<PixelRDO_Container> inputSigDataHandle{"StoreGateSvc+PixelRDOs_SIG9"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const unsigned int sigToT(11);
+    const unsigned int bkgToT(10);
+    const unsigned int sigBCID(1);
+    const unsigned int bkgBCID(2);
+    inputSigDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> sigCollection = std::make_unique<PixelRDO_Collection>(sigElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> sigDigit = std::make_unique<Pixel1RawData>(Identifier(13),sigToT,sigBCID-1,0,sigBCID-1);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<PixelRDO_Container> inputBkgDataHandle{"StoreGateSvc+PixelRDOs_BKG9"};
+    inputBkgDataHandle = std::make_unique<PixelRDO_Container>(containerSize);
+    std::unique_ptr<PixelRDO_Collection> bkgCollection = std::make_unique<PixelRDO_Collection>(bkgElementHash);
+    //Add a Pixel1RawData object
+    std::unique_ptr<Pixel1RawData> bkgDigit = std::make_unique<Pixel1RawData>(Identifier(12),bkgToT,bkgBCID-1,0,bkgBCID-1);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    // ordering A, C, B is on purpose to test for unintended alphabetic ordering
+    std::string  inputSigPropertyValue = "'StoreGateSvc+PixelRDOs_SIG9'";
+    std::string  inputBkgPropertyValue = "'StoreGateSvc+PixelRDOs_BKG9'";
+    std::string    outputPropertyValue = "'StoreGateSvc+PixelRDOs9'";
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<PixelRDO_Container> outputDataHandle{"StoreGateSvc+PixelRDOs9"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const PixelRDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const PixelRDORawData* outputDigit1 = outputCollection->at(0);
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // RDOs in same collection sorted according to Identifier
+    const PixelRDORawData* outputDigit2 = outputCollection->at(1);
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getToT()==sigToT ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit2->getBCID()==sigBCID-1 ); // RDOs in same collection sorted according to Identifier
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+  ::testing::AddGlobalTestEnvironment( new OverlayTesting::GaudiEnvironment );
+  return RUN_ALL_TESTS();
+}
-- 
GitLab


From 3dd5159f0f64462bdfb6c50954572ae34011ab71 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 28 Feb 2019 16:28:04 +0100
Subject: [PATCH 118/404] LArRawConditions: const interfaces for
 LArFEBTimeOffset.

As an alternative to LArFEBTimeOffset::setDefaultReturnValue(), allow
passing the default return value as an additional argument to TimeOffset().
Needed for cases where the object is const.
---
 .../LArRawConditions/LArFEBTimeOffset.h          | 16 ++++++++++++++--
 .../LArRawConditions/src/LArFEBTimeOffset.cxx    |  4 ++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/LArCalorimeter/LArRawConditions/LArRawConditions/LArFEBTimeOffset.h b/LArCalorimeter/LArRawConditions/LArRawConditions/LArFEBTimeOffset.h
index e6e22ec84cb..b319967bcfc 100755
--- a/LArCalorimeter/LArRawConditions/LArRawConditions/LArFEBTimeOffset.h
+++ b/LArCalorimeter/LArRawConditions/LArRawConditions/LArFEBTimeOffset.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 LARFEBTIMEOFFSET_H
@@ -17,6 +17,7 @@ class LArFEBTimeOffset: public ILArFEBTimeOffset{
   inline void setTimeOffset(const HWIdentifier fId, const float offset) //Setter
     {m_febTimeMap[fId]=offset;}    
   inline float TimeOffset(const HWIdentifier fId) const;                  //Getter
+  inline float TimeOffset(const HWIdentifier fId, float defVal) const;
 
   inline unsigned size() const
     { return m_febTimeMap.size();}
@@ -29,7 +30,8 @@ class LArFEBTimeOffset: public ILArFEBTimeOffset{
   float m_defaultReturnValue;
 };
 
-inline float LArFEBTimeOffset::TimeOffset(const HWIdentifier fId) const {
+inline float LArFEBTimeOffset::TimeOffset(const HWIdentifier fId) const
+{
   const std::map <HWIdentifier,float>::const_iterator it=m_febTimeMap.find(fId);
   if (it==m_febTimeMap.end())
     return m_defaultReturnValue;
@@ -37,6 +39,16 @@ inline float LArFEBTimeOffset::TimeOffset(const HWIdentifier fId) const {
     return it->second;
 }
 
+inline float LArFEBTimeOffset::TimeOffset(const HWIdentifier fId,
+                                          float defVal) const
+{
+  const std::map <HWIdentifier,float>::const_iterator it=m_febTimeMap.find(fId);
+  if (it==m_febTimeMap.end())
+    return defVal;
+  else
+    return it->second;
+}
+
 CLASS_DEF( LArFEBTimeOffset, 83217154, 1) 
 #endif 
 
diff --git a/LArCalorimeter/LArRawConditions/src/LArFEBTimeOffset.cxx b/LArCalorimeter/LArRawConditions/src/LArFEBTimeOffset.cxx
index 2cd8f0d2744..2f743d3796f 100755
--- a/LArCalorimeter/LArRawConditions/src/LArFEBTimeOffset.cxx
+++ b/LArCalorimeter/LArRawConditions/src/LArFEBTimeOffset.cxx
@@ -1,7 +1,7 @@
 /*
-  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 "LArRawConditions/LArFEBTimeOffset.h"
 
-LArFEBTimeOffset::LArFEBTimeOffset() : m_defaultReturnValue(0.0) {}
+LArFEBTimeOffset::LArFEBTimeOffset() {}
-- 
GitLab


From c91abb87af05c7cd8b3c7ac3063adaa22440a175 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Thu, 28 Feb 2019 22:42:03 +0100
Subject: [PATCH 119/404] unique_ptr rt in MdtCalibDbAlg::defaultRt()

---
 .../MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx        | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index 568838a5be4..49300ee6895 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -262,7 +262,7 @@ StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& wr
   // Loop over all RTs in the file (but the default file only has 1 RT)
   // Use the first valid RT found in the file as the default for all chambers.
   for(unsigned int n=0;n<rts.nRts();++n) {
-    MuonCalib::RtDataFromFile::RtRelation *rt = rts.getRt( n );
+    std::unique_ptr<MuonCalib::RtDataFromFile::RtRelation> rt(rts.getRt(n));
 
     const MuonCalib::RtDataFromFile::RtRelation::DataVec &times = rt->times();
     const MuonCalib::RtDataFromFile::RtRelation::DataVec &radii = rt->radii();
@@ -273,13 +273,11 @@ StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& wr
       ATH_MSG_ERROR( " defaultRt rt table has too few entries" );
       continue;
     }
-
     // check if all tables have same size
     if( times.size() != radii.size() || times.size() != reso.size() ) {
       ATH_MSG_ERROR( "defaultRt rt table size mismatch " );
       continue;
     }
-
     // check for negative time bins, i.e. decreasing time value with radius
     double t_min    = times[0];
     double bin_size = times[1]-t_min;
@@ -321,7 +319,6 @@ StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& wr
     if( !resoRel || !rtRel ) {
       if(resoRel) delete resoRel;
       if(rtRel) delete rtRel;
-      delete rt;
       continue;
     }
 
@@ -349,9 +346,8 @@ StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& wr
 	ATH_MSG_VERBOSE(" "<<ipt<<" "<<t<<" "<< rtRel->radius(t)<<" "<< resoRel->resolution(t));
       }
     }
-    delete rt;
-    break;            //only need the first good RT from the text file
-  }  //end loop over RTs in file
+    break; //only need the first good RT from the text file
+  } //end loop over RTs in file
 
   return StatusCode::SUCCESS;
 }
-- 
GitLab


From e703f469f2d51366840e97f69414d425fd044764 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 28 Feb 2019 16:29:37 +0100
Subject: [PATCH 120/404] TestTools: Ignore a few more differences that come up
 frequently.

Ignore a few more differences that come up frequently.
---
 AtlasTest/TestTools/share/post.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/AtlasTest/TestTools/share/post.sh b/AtlasTest/TestTools/share/post.sh
index 66f8ff73048..426541c251f 100755
--- a/AtlasTest/TestTools/share/post.sh
+++ b/AtlasTest/TestTools/share/post.sh
@@ -117,6 +117,7 @@ PP="$PP"'|Service factory for type [^ ]+ already declared'
 PP="$PP"'|Converter for class:[^ ]+ already exists'
 # Number of configurables read can vary from build to build.
 PP="$PP"'|INFO Read module info for|confDb modules in'
+PP="$PP"'|INFO Read module info for|configurables from'
 # ignore ApplicationMgr header.
 PP="$PP"'|^ApplicationMgr *SUCCESS *$'
 PP="$PP"'|^=+$'
@@ -161,6 +162,8 @@ PP="$PP"'|^EventInfoMgtInit: Got release version'
 PP="$PP"'|^Py:Athena +INFO using release'
 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='
 
 # 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'
-- 
GitLab


From 484331a53e4d8bbd5689573f78b27369e3a7bfce Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 28 Feb 2019 16:43:25 +0100
Subject: [PATCH 121/404] LArEventTest: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../LArTest/LArEventTest/src/DumpLArDigits.cxx       | 11 ++++-------
 .../LArTest/LArEventTest/src/DumpLArRawChannels.cxx  | 11 ++++-------
 .../LArEventTest/src/FindDuplicatedLArDigits.cxx     | 12 ++++++------
 .../LArTest/LArEventTest/src/LArDigitsToNtuple.cxx   | 12 ++++++------
 .../LArTest/LArEventTest/src/TriggerPatternCount.cxx |  3 +--
 5 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/LArCalorimeter/LArTest/LArEventTest/src/DumpLArDigits.cxx b/LArCalorimeter/LArTest/LArEventTest/src/DumpLArDigits.cxx
index 8b180c1c305..bcb61b34c50 100644
--- a/LArCalorimeter/LArTest/LArEventTest/src/DumpLArDigits.cxx
+++ b/LArCalorimeter/LArTest/LArEventTest/src/DumpLArDigits.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "LArEventTest/DumpLArDigits.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArRawEvent/LArDigitContainer.h"
 #include "xAODEventInfo/EventInfo.h"
 //#include "testpack/compdigit.h"
@@ -31,12 +31,9 @@ StatusCode DumpLArDigits::initialize()
   ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
   ATH_MSG_DEBUG ( " Found the LArOnlineID helper. " );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  if (!caloIdMgr) {
-    ATH_MSG_ERROR ( "Unable to get instance of CaloIdManager" );
-    return StatusCode::FAILURE;
-  }
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
   if (!m_emId)  {
     ATH_MSG_ERROR ( "Unable to get EM_ID" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArTest/LArEventTest/src/DumpLArRawChannels.cxx b/LArCalorimeter/LArTest/LArEventTest/src/DumpLArRawChannels.cxx
index 5f24d41fab9..819ed17fae8 100644
--- a/LArCalorimeter/LArTest/LArEventTest/src/DumpLArRawChannels.cxx
+++ b/LArCalorimeter/LArTest/LArEventTest/src/DumpLArRawChannels.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "LArEventTest/DumpLArRawChannels.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "xAODEventInfo/EventInfo.h"
 //#include "testpack/compdigit.h"
 #include <stdlib.h>
@@ -33,12 +33,9 @@ StatusCode DumpLArRawChannels::initialize()
   ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
   ATH_MSG_DEBUG ( " Found the LArOnlineID helper. " );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  if (!caloIdMgr) {
-    ATH_MSG_ERROR ( "Unable to get instance of CaloIdManager" );
-    return StatusCode::FAILURE;
-  }
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
   if (!m_emId) {
     ATH_MSG_ERROR ( "Unable to get EM_ID" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArTest/LArEventTest/src/FindDuplicatedLArDigits.cxx b/LArCalorimeter/LArTest/LArEventTest/src/FindDuplicatedLArDigits.cxx
index 7ff71f7f3ee..a7d96677a69 100644
--- a/LArCalorimeter/LArTest/LArEventTest/src/FindDuplicatedLArDigits.cxx
+++ b/LArCalorimeter/LArTest/LArEventTest/src/FindDuplicatedLArDigits.cxx
@@ -7,7 +7,7 @@
 #include "xAODEventInfo/EventInfo.h"
 
 #include "GaudiKernel/SmartDataPtr.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArRawEvent/LArDigitContainer.h"
 #include "LArRawEvent/LArFebHeaderContainer.h"
 #include "TBEvent/TBPhase.h"
@@ -36,11 +36,11 @@ FindDuplicatedLArDigits::~FindDuplicatedLArDigits()
 
 StatusCode FindDuplicatedLArDigits::initialize()
 {
-  //Use CaloIdManager to access detector info
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
diff --git a/LArCalorimeter/LArTest/LArEventTest/src/LArDigitsToNtuple.cxx b/LArCalorimeter/LArTest/LArEventTest/src/LArDigitsToNtuple.cxx
index af466f6886a..bf0823a29dc 100644
--- a/LArCalorimeter/LArTest/LArEventTest/src/LArDigitsToNtuple.cxx
+++ b/LArCalorimeter/LArTest/LArEventTest/src/LArDigitsToNtuple.cxx
@@ -7,7 +7,7 @@
 #include "xAODEventInfo/EventInfo.h"
 
 #include "GaudiKernel/SmartDataPtr.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArRawEvent/LArDigitContainer.h"
 #include "LArRawEvent/LArFebHeaderContainer.h"
 #include "TBEvent/TBPhase.h"
@@ -53,11 +53,11 @@ LArDigitsToNtuple::~LArDigitsToNtuple()
 
 StatusCode LArDigitsToNtuple::initialize()
 {
-  //Use CaloIdManager to access detector info
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
diff --git a/LArCalorimeter/LArTest/LArEventTest/src/TriggerPatternCount.cxx b/LArCalorimeter/LArTest/LArEventTest/src/TriggerPatternCount.cxx
index 6cb303ce923..e287ebd8cb8 100755
--- a/LArCalorimeter/LArTest/LArEventTest/src/TriggerPatternCount.cxx
+++ b/LArCalorimeter/LArTest/LArEventTest/src/TriggerPatternCount.cxx
@@ -1,12 +1,11 @@
 /*
-  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 "LArEventTest/TriggerPatternCount.h"
 #include "CaloIdentifier/CaloGain.h"
 
 #include "GaudiKernel/SmartDataPtr.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "TBEvent/TBTriggerPatternUnit.h"
 #include <fstream>
 #include <stdlib.h>
-- 
GitLab


From 7d1545fd5f6160ffc10ddc6fcb8e21578dcb8f2b Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 1 Mar 2019 01:46:40 +0100
Subject: [PATCH 122/404] Move SCT_ID retrieval from execute to initialize as a
 possible fix of a rare crash.

---
 .../src/SCT_CablingCondAlgFromCoraCool.cxx      | 13 +++++++------
 .../src/SCT_CablingCondAlgFromCoraCool.h        |  4 ++++
 .../src/SCT_CablingCondAlgFromText.cxx          | 17 +++++++++--------
 .../src/SCT_CablingCondAlgFromText.h            |  4 ++++
 4 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx
index 14f536d62b6..95987730032 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.cxx
@@ -171,7 +171,8 @@ namespace {
 // Constructor
 SCT_CablingCondAlgFromCoraCool::SCT_CablingCondAlgFromCoraCool(const std::string& name, ISvcLocator* pSvcLocator):
   AthReentrantAlgorithm(name, pSvcLocator),
-  m_condSvc{"CondSvc", name}
+  m_condSvc{"CondSvc", name},
+  m_idHelper{nullptr}
 {
 }
 
@@ -196,6 +197,9 @@ SCT_CablingCondAlgFromCoraCool::initialize() {
     return StatusCode::FAILURE;
   }
 
+  // SCT_ID
+  ATH_CHECK(detStore()->retrieve(m_idHelper, "SCT_ID"));
+
   // Read Cond Handle
   ATH_CHECK(m_readKeyRod.initialize());
   ATH_CHECK(m_readKeyRodMur.initialize());
@@ -234,9 +238,6 @@ SCT_CablingCondAlgFromCoraCool::execute(const EventContext& ctx) const {
     return StatusCode::SUCCESS;
   }
 
-  const SCT_ID* idHelper{nullptr};
-  ATH_CHECK(detStore()->retrieve(idHelper, "SCT_ID"));
-
   // Determine the folders are Run2 or Run1
   bool isRun2{m_readKeyRod.key()==rodFolderName2};
 
@@ -481,7 +482,7 @@ SCT_CablingCondAlgFromCoraCool::execute(const EventContext& ctx) const {
         ATH_MSG_WARNING("Invalid eta, phi..skipping insertion to map for module " << snString << " (may be already present in map)");
         continue;
       }
-      Identifier offlineId{idHelper->wafer_id(bec,layer,phi,eta,side)};
+      Identifier offlineId{m_idHelper->wafer_id(bec,layer,phi,eta,side)};
       int link{rxLink[side]};
       if (defaultLink==link) {
         link = (fibreOffset % fibresPerRod) + fibreInMur*2 + side;
@@ -503,7 +504,7 @@ SCT_CablingCondAlgFromCoraCool::execute(const EventContext& ctx) const {
         ATH_MSG_WARNING(bec << " " << layer << " " << phi << " " << eta << " " << side);
         ATH_MSG_INFO("MUR, position " << mur << ", " << harnessPosition);
       } 
-      IdentifierHash offlineIdHash{idHelper->wafer_hash(offlineId)};
+      IdentifierHash offlineIdHash{m_idHelper->wafer_hash(offlineId)};
       insert(offlineIdHash, onlineId, SCT_SerialNumber(sn), writeCdo.get());
       numEntries++;
     }
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.h b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.h
index bf2ff175ce7..c28e7de3ab1 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.h
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromCoraCool.h
@@ -27,6 +27,9 @@
 //STL includes
 #include <string>
 
+//Forward declarations
+class SCT_ID;
+
 /**
  *    @class SCT_CablingCondAlgFromCoraCool
  *    @brief Service which fill the SCT Cabling from the database, using CoraCool.
@@ -53,6 +56,7 @@ private:
   SG::WriteCondHandleKey<SCT_CablingData> m_writeKey{this, "WriteKey", "SCT_CablingData", "Key of output (derived) conditions folder"};
   ServiceHandle<ICondSvc> m_condSvc;
 
+  const SCT_ID* m_idHelper;
 };//end of class
 
 #endif // SCT_CablingCondAlgFromCoraCool_H
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx
index ecba6f9bb07..702cfc93adb 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.cxx
@@ -59,7 +59,8 @@ namespace {
 // Constructor
 SCT_CablingCondAlgFromText::SCT_CablingCondAlgFromText(const std::string& name, ISvcLocator* pSvcLocator):
   AthReentrantAlgorithm(name, pSvcLocator),
-  m_condSvc{"CondSvc", name}
+  m_condSvc{"CondSvc", name},
+  m_idHelper{nullptr}
 {
 }
 
@@ -74,6 +75,9 @@ SCT_CablingCondAlgFromText::initialize() {
   }
   ATH_MSG_INFO("Reading cabling from " << m_source.value());
 
+  // SCT_ID
+  ATH_CHECK(detStore()->retrieve(m_idHelper, "SCT_ID"));
+
   // CondSvc
   ATH_CHECK(m_condSvc.retrieve());
 
@@ -106,9 +110,6 @@ SCT_CablingCondAlgFromText::execute(const EventContext& ctx) const {
     return StatusCode::SUCCESS;
   }
 
-  const SCT_ID* idHelper{nullptr};
-  ATH_CHECK(detStore()->retrieve(idHelper, "SCT_ID"));
-
   // Construct the output Cond Object and fill it in
   std::unique_ptr<SCT_CablingData> writeCdo{std::make_unique<SCT_CablingData>()};
 
@@ -144,8 +145,8 @@ SCT_CablingCondAlgFromText::execute(const EventContext& ctx) const {
       dataLine.exceptions(std::ios_base::badbit|std::ios_base::failbit);
       try {
         dataLine>>rod>>Link>>barrelOrEndcap>>layer>>eta>>phi>>side>>std::hex>>robidFromfile>>std::dec>>sn;
-        offlineId = idHelper->wafer_id(barrelOrEndcap,layer,phi,eta,side);
-        offlineIdHash = idHelper->wafer_hash(offlineId);
+        offlineId = m_idHelper->wafer_id(barrelOrEndcap,layer,phi,eta,side);
+        offlineIdHash = m_idHelper->wafer_hash(offlineId);
       } catch (const std::ios_base::failure&) {
         ATH_MSG_ERROR("An error occurred while reading the cabling file " << m_source.value()
                       << ", it may be badly formatted in the following line: \n" << inString);
@@ -166,8 +167,8 @@ SCT_CablingCondAlgFromText::execute(const EventContext& ctx) const {
       }
       if (link==disabledFibre) {
         ATH_MSG_DEBUG(sn << ": Disabled fibre encountered in text file. Will attempt to place identifier using the other fibre.");
-        offlineId = idHelper->wafer_id(barrelOrEndcap,layer,phi,eta,side);
-        offlineIdHash = idHelper->wafer_hash(offlineId);
+        offlineId = m_idHelper->wafer_id(barrelOrEndcap,layer,phi,eta,side);
+        offlineIdHash = m_idHelper->wafer_hash(offlineId);
         disabledFibres.push_back(offlineIdHash);
         continue;
       }
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.h b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.h
index d01a858f29b..c090ff163b8 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.h
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingCondAlgFromText.h
@@ -25,6 +25,9 @@
 //STL includes
 #include <string>
 
+//Forward declarations
+class SCT_ID;
+
 /**
  *    @class SCT_CablingCondAlgFromText
  *    @brief Service which fill the SCT Cabling from plain text (a file).
@@ -47,6 +50,7 @@ private:
   SG::WriteCondHandleKey<SCT_CablingData> m_writeKey{this, "WriteKey", "SCT_CablingData", "Key of output (derived) conditions folder"};
   ServiceHandle<ICondSvc> m_condSvc;
 
+  const SCT_ID* m_idHelper;
 };//end of class
 
 #endif // SCT_CablingCondAlgFromText_H
-- 
GitLab


From f8873f0aaeb7a22acf496a26293e048b80f35fed Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Thu, 28 Feb 2019 19:40:06 -0600
Subject: [PATCH 123/404] Update copyright

---
 Control/AthenaServices/src/DecisionAlg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Control/AthenaServices/src/DecisionAlg.h b/Control/AthenaServices/src/DecisionAlg.h
index 9bb6f38c75e..d320e5d5ba7 100644
--- a/Control/AthenaServices/src/DecisionAlg.h
+++ b/Control/AthenaServices/src/DecisionAlg.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- C++ -*-
 
 /*
-  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 ATHENASERVICES_DECISIONALG_H
-- 
GitLab


From 5e612cc52def4322bedf2b5c7d0b6f0b612b4252 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Thu, 28 Feb 2019 16:31:03 +0000
Subject: [PATCH 124/404] Merge branch 'test-addFTK' into '21.3'

Update datasets used by Trigger ART tests

See merge request atlas/athena!21529

(cherry picked from commit b6cdf240fdcded2fb3f2f48617adbde80c06d5fe)

dfbec7af Update datasets used by Trigger ART tests
---
 .../test/exec_athena_art_trigger_validation.sh         | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh b/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh
index 457f96fc52c..71a0b86b6e2 100755
--- a/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh
+++ b/Trigger/TrigValidation/TriggerTest/test/exec_athena_art_trigger_validation.sh
@@ -41,20 +41,20 @@ elif [[ $INPUT == "ftk" ]]; then
   export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.digit.RDO_FTK.e6337_e5984_s3126_d1480_d1471_tid15265974_00/RDO_FTK.15265974._004440.pool.root.1"]'
 
 elif [[ $INPUT == "bphysics" ]]; then
-  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc15_RTT_1000_Bphysics_toAOD_r6889/Bphysics_RDO_r6889_mixed.pool.root"]'
+  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/RDO_FTK.Bphysics_1000.pool.root.1"]'
 
 elif [[ $INPUT == "mubphysics" ]]; then
-  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc15_13TeV.180593.Pythia8_AUMSTW2008LO_Wtaunu_3mu_noPhotos.recon.RDO.e3802_s2608_s2183_r6790/RDO.05594910._000008.pool.root.1"]'
+  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc16_13TeV.180593.Pythia8_AUMSTW2008LO_Wtaunu_3mu_noPhotos.digit.RDO_FTK.e3802_s3126_r11234_d1505/RDO_FTK.17121384._000012.pool.root.1","/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc16_13TeV.180593.Pythia8_AUMSTW2008LO_Wtaunu_3mu_noPhotos.digit.RDO_FTK.e3802_s3126_r11234_d1505/RDO_FTK.17121384._000028.pool.root.1"]'
 
 elif [[ $INPUT == "minbias" ]]; then
-  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00/RDO.07858100._000087.pool.root.1"]'
+  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/RDO_FTK.minbias_1000.pool.root.1"]'
 
 elif [[ $INPUT == 'data' ]]; then
-  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]'
+  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00360026.physics_EnhancedBias.recon.RAW.r10978/RAW.15789997._002546.pool.root.1"]'
 
 else 
   # Default - ttbar
-  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1","/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000002.pool.root.1"]'
+  export DS='["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.digit.RDO_FTK.e4993_s3214_r11234_d1505/RDO_FTK.17071950._000065.pool.root.1","/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.digit.RDO_FTK.e4993_s3214_r11234_d1505/RDO_FTK.17071950._000235.pool.root.1"]'
 fi
 
 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
-- 
GitLab


From 382a66483435e8afe61d293b9a24d94c3ebeafb2 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Thu, 28 Feb 2019 09:30:17 +0000
Subject: [PATCH 125/404] Merge branch 'test-21.3' into '21.3'

Test 21.3

See merge request atlas/athena!21487

(cherry picked from commit 6e813848e4c9eafc78273b7b5a8e7959c62f1147)

5ec528ed Changes to physval trigger ART test
d1d72125 Fix NEVT
---
 .../test/test_mc_ntup_physval_grid.sh         | 32 ++++++++++---------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_ntup_physval_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_ntup_physval_grid.sh
index a4c017b69e8..57fb1491330 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_ntup_physval_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_ntup_physval_grid.sh
@@ -16,31 +16,33 @@
 export NAME="mc_ntup_physval_grid"
 export JOB_LOG="athena.log"
 export TEST="TrigAnalysisTest"
-export NEVT=10
+export NEVT=100
 export DS='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigAnalysisTest/AthenaTrigAOD_TrigEDMandTDTCheck_MC_pp_v7_chain/AOD.pool.root'
 
 Reco_tf.py --inputAODFile=${DS}  --preExec "all:from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);" --skipEvents="0" --maxEvents=${NEVT} --valid="True"  --jobNumber="1" --validationFlags doExample,doMET,doPFlow,doEgamma,doInDet,doTau,doJet,doBtag,doZee,doMuon,doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet --outputNTUP_PHYSVALFile="NTUP_PHYSVAL.pool.root" > output.log 
 
 echo "art-result: $? PhysVal"
 
+ArtPackage=$1
+ArtJobName=$2
+#
+echo " ArtPackage = ${ArtPackage}"
+echo " ArtJobName = ${ArtJobName}"
+#
+art.py download ${ArtPackage} ${ArtJobName}
+echo "art-result: $? ref-download"
 
+CMD="find . -maxdepth 1 -name "ref-*""
+refdir=$(eval "${CMD}")
+echo "Reference directory"
+echo ${refdir}
 
-# We need to place a reference file on cvmfs
-#physval_make_web_display.py --ratio  --reffile Ref:PHYSVAL_all.root --title Test PHYSVAL_all.root --outdir PHYSVAL_WEB
+
+# make webdisplay 
 mkdir PHYSVAL_WEB
-#domains="BTag Ele Gam IDTrk Jets Muons MET PFlow TopoClusters"
-###domains="BTag Electron IDPerformanceMon Jets MET Muons PFlow Photon Summary Tau TopoClusters"
-###doTrigEgamma,doTrigBphys,doTrigMET,doTrigJet,doTrigMuon,doTrigHLTResult,doTrigCalo,doTrigMinBias,doTrigTau,doTrigIDtrk,doTrigBjet
-#for slice in ${domains}
-#do 
-#      physval_make_web_display.py --ratio --reffile Ref:/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/DerivationFrameworkPhysicsValidation/PHYSVAL_all_reference.root --title Test PHYSVAL_all.root --outdir PHYSVAL_WEB/${slice} --startpath ${slice}
-      physval_make_web_display.py --ratio --drawopt HISTPE --refdrawopt HIST --reffile Ref:NTUP_PHYSVAL.pool.root --title Test  --outdir PHYSVAL_WEB --startpath run_1/HLT NTUP_PHYSVAL.pool.root
-#done
+physval_make_web_display.py --ratio --drawopt HISTPE --refdrawopt HIST --reffile Ref:${refdir}/NTUP_PHYSVAL.pool.root --title Test  --outdir PHYSVAL_WEB --startpath run_1/HLT NTUP_PHYSVAL.pool.root
+
 echo  "art-result: $? web"
 
 
 
-#ArtPackage=$1
-#ArtJobName=$2
-#art.py compare grid --entries 10 ${ArtPackage} ${ArtJobName}
-#echo "art-result: $? Diff"
-- 
GitLab


From daf6fc5e44f313145b6d3b061a6c1a8c28977563 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 28 Feb 2019 16:52:45 +0100
Subject: [PATCH 126/404] LArCalibTest: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../LArCalibTest/LArCalibTest/LArHVTest.h     |  7 +--
 .../LArCalibTest/src/LArCablingChecker.cxx    | 11 ++---
 .../LArTest/LArCalibTest/src/LArHVTest.cxx    | 43 +++++--------------
 3 files changed, 19 insertions(+), 42 deletions(-)

diff --git a/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArHVTest.h b/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArHVTest.h
index 4c0e793f9d1..fc54eaa4cbb 100644
--- a/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArHVTest.h
+++ b/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArHVTest.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 LARHVTEST_H
@@ -13,9 +13,8 @@
 
 #include "StoreGate/DataHandle.h"
 #include "LArIdentifier/LArOnlineID.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 
 #include "StoreGate/ReadCondHandleKey.h"
 #include "LArCabling/LArOnOffIdMapping.h"
@@ -49,8 +48,6 @@ class LArHVTest: 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;
 
   ToolHandle<ILArHVTool> m_hvtool;
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "CablingKey", "LArOnOffIdMap","Mapping key"};
diff --git a/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx b/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx
index 3a279f3691b..90dafd43614 100755
--- a/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx
+++ b/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "LArCalibTest/LArCablingChecker.h"
 #include "LArRawEvent/LArDigit.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArRawConditions/LArCalibParams.h"
 #include "xAODEventInfo/EventInfo.h"
 #include <algorithm>
@@ -55,9 +55,10 @@ StatusCode LArCablingChecker::initialize() {
     ATH_MSG_ERROR ( "Unable to open output file with name " << m_outFileName );
     return StatusCode::FAILURE;
   }
-  
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
+
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
 
   m_channelHashMax = m_onlineHelper->channelHashMax();
 
diff --git a/LArCalorimeter/LArTest/LArCalibTest/src/LArHVTest.cxx b/LArCalorimeter/LArTest/LArCalibTest/src/LArHVTest.cxx
index 5107de16298..a38405bf995 100644
--- a/LArCalorimeter/LArTest/LArCalibTest/src/LArHVTest.cxx
+++ b/LArCalorimeter/LArTest/LArCalibTest/src/LArHVTest.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 "LArCalibTest/LArHVTest.h"
@@ -49,40 +49,19 @@ StatusCode LArHVTest::initialize() {
     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();
-
-  sc = detStore()->retrieve(m_calodetdescrmgr);                
-  if (sc.isFailure()) {
-    msg(MSG::ERROR) << "Unable to get CaloDetDescrManager" << endmsg;
-    return StatusCode::FAILURE;                              
-  } 
-
-
-  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;
-  }
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
 
+  m_larem_id   = idHelper->em_idHelper();
+  m_larhec_id   = idHelper->hec_idHelper();
+  m_larfcal_id   = idHelper->fcal_idHelper();
 
-  ATH_CHECK(m_cablingKey.initialize());
-  ATH_CHECK(m_hvmapKey.initialize());
-  ATH_CHECK(m_hvdataKey.initialize());
+  ATH_CHECK( detStore()->retrieve(m_electrodeID) );
+  ATH_CHECK( m_hvtool.retrieve() );
+  ATH_CHECK( m_cablingKey.initialize() );
+  ATH_CHECK( m_hvmapKey.initialize()) ;
+  ATH_CHECK( m_hvdataKey.initialize() );
 
   ATH_MSG_DEBUG("LArHVTest initialize() end");
   return StatusCode::SUCCESS;
-- 
GitLab


From 921f7fe347b2ad62ac7142bdff24542ec09ed074 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 1 Mar 2019 11:25:40 +0100
Subject: [PATCH 127/404] make serialier configuration respecting the order of
 EDM

---
 .../python/TrigOutputHandlingConfig.py        |   7 +-
 .../TrigOutputHandling/share/test.txt         |   8 +-
 .../src/TriggerEDMSerialiserTool.cxx          |  15 ++-
 .../src/TriggerEDMSerialiserTool.h            |   5 +-
 .../TrigUpgradeTest/share/egamma.withViews.py |   1 +
 .../TrigUpgradeTest/share/egammaRunData.ref   | 120 +++++++++---------
 6 files changed, 86 insertions(+), 70 deletions(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
index c7e5ddb682c..26394936c88 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
+++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
@@ -46,8 +46,13 @@ def TriggerEDMSerialiserToolCfg(name):
    serialiser = TriggerEDMSerialiserTool(name)
    from collections import OrderedDict
    class OD(OrderedDict):
+      """Purpose of this class is to present map (ordered by insertion order) interface on python side, 
+      whereas the property to look like vector of such strings
+      "type#key;id0,id1"
+      when it gets to setting the serialiser property
+      """
       def __repr__(self):
-         return '{' + ','.join( ['"'+str(k)+'":'+str(v) for k,v in self.iteritems()] ) + '}'
+         return '[' +','.join( ['"'+str(typekey)+';'+','.join(map( lambda _:str(_), ids) )+'"'  for typekey,ids in self.iteritems()] ) + ']'
       def __str__(self):
          return self.__repr__()
 
diff --git a/Trigger/TrigSteer/TrigOutputHandling/share/test.txt b/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
index a90258b525a..ce727319b51 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
+++ b/Trigger/TrigSteer/TrigOutputHandling/share/test.txt
@@ -6,7 +6,7 @@ deserialiser2.OutputLevel=1;
 deserialiser2.Prefix="DESERIALISED2_";
 deserialised2.ModuleID=1;
 ToolSvc.serialiser.OutputLevel=1;
-ToolSvc.serialiser.CollectionsToSerialize = {"xAOD::TrigEMClusterContainer_v1#EMClusters":[0], 
-                                        "xAOD::TrigEMClusterAuxContainer_v2#EMClustersAux.viewIndex.testFloat.rawEt.testSmallFloat":[0],
-					"xAOD::TrigCompositeContainer_v1#EMClustersDecisions":[0,1],
-					"xAOD::TrigCompositeAuxContainer_v2#EMClustersDecisionsAux.detail1.detail2":[0,1]};
+ToolSvc.serialiser.CollectionsToSerialize = ["xAOD::TrigEMClusterContainer_v1#EMClusters;0", 
+                                        "xAOD::TrigEMClusterAuxContainer_v2#EMClustersAux.viewIndex.testFloat.rawEt.testSmallFloat;0",
+					"xAOD::TrigCompositeContainer_v1#EMClustersDecisions;0,1",
+					"xAOD::TrigCompositeAuxContainer_v2#EMClustersDecisionsAux.detail1.detail2;0,1"];
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
index e4aeb20ef81..8d35af4e68e 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.cxx
@@ -25,9 +25,12 @@ TriggerEDMSerialiserTool::~TriggerEDMSerialiserTool() {}
 StatusCode TriggerEDMSerialiserTool::initialize() {
 
   ATH_CHECK( m_serializerSvc.retrieve() );
-  ATH_CHECK( m_clidSvc.retrieve() );
-  for ( const auto& [typeKeyAux, moduleIdVec] : m_collectionsToSerialize ) {
+  ATH_CHECK( m_clidSvc.retrieve() );  
+  for ( const auto& typeKeyAuxIDs : m_collectionsToSerialize ) {    
+    ATH_MSG_DEBUG("Parsing " << typeKeyAuxIDs);
+    const std::string typeKeyAux = typeKeyAuxIDs.substr( 0, typeKeyAuxIDs.find(';') );
     const std::string persistentType = typeKeyAux.substr( 0, typeKeyAux.find('#') );
+    ATH_MSG_DEBUG("Type " << typeKeyAux);
     if ( persistentType.find('_') == std::string::npos ) {
       ATH_MSG_ERROR( "Unversioned object to be recorded " << typeKeyAux );
       return StatusCode::FAILURE;
@@ -46,6 +49,14 @@ StatusCode TriggerEDMSerialiserTool::initialize() {
       ATH_MSG_ERROR( "The type " << persistentType <<  " is not known to ROOT serialiser" );
       return StatusCode::FAILURE;
     }
+    
+
+    const std::string moduleIDs  = typeKeyAuxIDs.substr( typeKeyAuxIDs.find(';')+1 );
+    std::vector<std::string> splitModuleIDs;
+    boost::split( splitModuleIDs, moduleIDs, [](const char c){ return c == ','; } );
+    std::vector<uint16_t> moduleIdVec;
+    for ( const auto& module: splitModuleIDs ) moduleIdVec.push_back( std::stoi( module ) );
+
     if (moduleIdVec.empty()) {
       ATH_MSG_ERROR( "No HLT result module IDs given for " << typeKeyAux );
       return StatusCode::FAILURE;
diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
index deace3b35d8..9303d13438b 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
@@ -37,14 +37,13 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
   virtual StatusCode  initialize() override;
 
  private: 
-  Gaudi::Property<std::map< std::string,std::vector<uint16_t> > > m_collectionsToSerialize {
+  Gaudi::Property< std::vector< std::string > > m_collectionsToSerialize {
     this, "CollectionsToSerialize", {},
-    "EDM streaming map {collectionKey, moduleIdVec} where collectionKey is a string formatted like for "
+    "EDM streaming configuration \'collectionKeyType, module1,module2,module3\' where collectionKeyType is a string formatted like for "
     "AthenaOutputStream, e.g. TYPE#SG.aux1.aux2..etc. The type has to be an exact type, i.e. with _vN not the alias "
     "type. moduleIdVec is the vector of HLTResult ROB module IDs to which the collection should be written. ID=0 is "
     "the main result, other IDs are used for data scouting."
   };
-  
   /// @class Address
   /// Internal structure to keep configuration organised conveniently
   ///
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
index 8d77c08931e..474e1c36b3f 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egamma.withViews.py
@@ -359,6 +359,7 @@ serialiser.addCollectionListToMainResult([
 print serialiser
 
 
+
 streamPhysicsMain = ['Main', 'physics', "True", "True"]
 streamPhotonPerf = ['PhotonPerf', 'calibration', "True", "True"] # just made up the name
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
index 1cf0f1c5d49..1c772ff2c5e 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
@@ -1,176 +1,176 @@
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
+HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
 HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
-HLTRMakerAlg.MKTool.Serialiser          9   0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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
-HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+HLTRMakerAlg.MKTool.Serialiser          14  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 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          14  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterAuxContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClustersAux. Fragment size :484 bytes
+HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigCompositeAuxContainer#remap_EgammaCaloDecisionsAux. Fragment size :284 bytes
 HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
-HLTRMakerAlg.MKTool.Serialiser          15  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
-HLTRMakerAlg.MKTool.Serialiser          16  0     DEBUG xAOD::TrigElectronAuxContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFexAux. Fragment size :472 bytes
 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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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
-HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+HLTRMakerAlg.MKTool.Serialiser          18  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 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          18  0     DEBUG xAOD::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
+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::TrigCompositeContainer#remap_EgammaCaloDecisions Fragment size :180 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
+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::TrigElectronContainer#HLT_xAOD__TrigElectronContainer_L2ElectronFex Fragment size :196 bytes
 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        
-- 
GitLab


From 648fce2ff61cab37deae482c3295f29031d35e22 Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Fri, 1 Mar 2019 12:06:31 +0100
Subject: [PATCH 128/404] Fix for ATLASRECTS-4869

Due to a mistake on my part, the MuonPatternCombinationCollection was no longer being written to SG, leading to a leak: that is now fixed.
The fact that this was only noticed by the leak suggests that there is no longer any need for the MuonPatternCombinationCollection to be in SG at all.
If this is confirmed, it will be removed in a subsequent MR.
---
 .../src/MooSegmentFinderAlg.cxx               | 23 +++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MooSegmentFinderAlg.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MooSegmentFinderAlg.cxx
index a8b32b99515..65cf2b00cba 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MooSegmentFinderAlg.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentCombiners/MuonSegmentCombinerTools/MooSegmentCombinationFinder/src/MooSegmentFinderAlg.cxx
@@ -108,15 +108,24 @@ StatusCode MooSegmentFinderAlg::execute()
 
   SG::WriteHandle<MuonPatternCombinationCollection> patHandle(m_patternCombiLocation); 
   
-  if( patHandle.record(std::make_unique<MuonPatternCombinationCollection>()).isSuccess() ){
-    ATH_MSG_VERBOSE("stored MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
-  }else{
-    ATH_MSG_ERROR("Failed to store MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
-  }
-  output.patternCombinations=patHandle.ptr();
-
   m_segmentFinder->findSegments( mdtCols, cscCols, tgcCols, rpcCols, output );
 
+  if(output.patternCombinations){
+    if( patHandle.record(std::make_unique<MuonPatternCombinationCollection>(std::move(*(output.patternCombinations)))).isSuccess() ){
+      ATH_MSG_VERBOSE("stored MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
+    }else{
+      ATH_MSG_ERROR("Failed to store MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
+    }
+    delete output.patternCombinations;
+  }
+  else{
+    if( patHandle.record(std::make_unique<MuonPatternCombinationCollection>()).isSuccess() ){
+      ATH_MSG_VERBOSE("stored MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
+    }else{
+      ATH_MSG_ERROR("Failed to store MuonPatternCombinationCollection at " << m_patternCombiLocation.key());
+    }
+  }
+
   //do cluster based segment finding
   if (m_doTGCClust || m_doRPCClust){
     const PRD_MultiTruthCollection* tgcTruthColl=0;
-- 
GitLab


From 47a1268baf17824f07f0df885c3f5fc0b119c284 Mon Sep 17 00:00:00 2001
From: Hass AbouZeid <hass.abouzeid@cern.ch>
Date: Fri, 1 Mar 2019 12:51:37 +0100
Subject: [PATCH 129/404] Changing the method in which random numbers are
 retrieved for the Tile Digitization code in order for reproducible output
 when running in AthenaMT.

---
 .../TileSimAlgs/TileDigitsFromPulse.h         |  7 ++-
 .../TileSimAlgs/TileSimAlgs/TileDigitsMaker.h |  8 ++-
 .../TileSimAlgs/TileHitToRawChannel.h         |  7 ++-
 .../TileSimAlgs/TileSimAlgs/TileHitToTTL1.h   | 10 ++--
 .../TileSimAlgs/TileHitVecToCntTool.h         | 10 ++--
 .../TilePulseForTileMuonReceiver.h            |  9 ++--
 .../TileSimAlgs/python/TileDigitsGetter.py    |  6 +--
 .../python/TileRawChannelFromHitsGetter.py    |  7 +--
 .../TileSimAlgs/python/TileSimAlgsConfig.py   |  6 +--
 .../share/TileFitDigitization_jobOptions.py   |  5 --
 .../share/TileMuonReceiver_jobOptions.py      |  5 +-
 .../TileSimAlgs/share/TileTTL1_jobOptions.py  |  5 --
 .../TileSimAlgs/src/TileDigitsFromPulse.cxx   | 20 +++----
 .../TileSimAlgs/src/TileDigitsMaker.cxx       | 29 +++++-----
 .../TileSimAlgs/src/TileHitToRawChannel.cxx   | 14 ++---
 .../TileSimAlgs/src/TileHitToTTL1.cxx         | 23 ++++----
 .../TileSimAlgs/src/TileHitVecToCntTool.cxx   | 54 +++++++++++--------
 .../src/TileMuonReceiverDecision.cxx          |  4 +-
 .../src/TilePulseForTileMuonReceiver.cxx      | 19 ++++---
 19 files changed, 114 insertions(+), 134 deletions(-)

diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileDigitsFromPulse.h
index a9fa8ce47c3..d2371cf227c 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 870dfbe8050..fb7fb3ef826 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 f8dda86c180..a628d57fb73 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 d40163eb4a7..faae77d0af7 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 fa3f0d05253..a8a7ed378da 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 9d0b66c21b1..ddfa17f2d89 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 40dd0f6f39e..f83c2a867be 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 3994a819cf7..64e2e6748cf 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 8ffb0575f19..6a5cf4fe333 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 e482a3694fc..a022e619461 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 01464381ac2..32f162bbe77 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 4e40fd9f75e..41f01c71eac 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 d26dac72a08..378bdee6eb5 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 00da31feb79..0f2e466ac38 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 8a2a5626150..f42a18023d5 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 6d4dd7210bd..a4946a1d371 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 b78f6245c41..3ec21273efb 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 ac75cea888b..8c9fcd54db9 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 c7c9dfec82d..d532b76cb6b 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) {
-- 
GitLab


From a1b49b9886eea45f5ce99ad8beaf518dd55b9c88 Mon Sep 17 00:00:00 2001
From: Hass AbouZeid <hass.abouzeid@cern.ch>
Date: Fri, 1 Mar 2019 12:52:30 +0100
Subject: [PATCH 130/404] Update overlay reference for digitization

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index 43ba199944d..3cd71dc09aa 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -24,5 +24,5 @@ ciRefFileMap = {
                 's3126-22.0'           : 'v2',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
-                'overlay-d1498-22.0'   : 'v6',
+                'overlay-d1498-22.0'   : 'v10',
                }
-- 
GitLab


From 74e3528125ee79a4819326fc7d0cbdac744e518a Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Fri, 1 Mar 2019 13:11:03 +0100
Subject: [PATCH 131/404] Remove defunct call to LumiBlockMuWriter from trigger
 modifiers. see \!21458

---
 .../TrigUpgradeTest/test/test_egamma_run_data.sh          | 1 +
 Trigger/TriggerRelease/python/Modifiers.py                | 8 --------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
index 78bc7cbc808..e39bd0db0c5 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
@@ -7,3 +7,4 @@ 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 &&
 athena TrigUpgradeTest/checkESD.py 
+
diff --git a/Trigger/TriggerRelease/python/Modifiers.py b/Trigger/TriggerRelease/python/Modifiers.py
index 6ad2de7fa67..c7377cfe4fa 100644
--- a/Trigger/TriggerRelease/python/Modifiers.py
+++ b/Trigger/TriggerRelease/python/Modifiers.py
@@ -441,14 +441,6 @@ class useOnlineLumi(_modifier):
         from LumiBlockComps.LuminosityToolDefault import LuminosityToolOnline
         ToolSvc += LuminosityToolOnline()
 
-        # This is needed for the correct functioning of LumiBlockMuTool
-        from LumiBlockComps.LumiBlockCompsConf import LumiBlockMuWriter        
-        from AthenaCommon.AlgSequence import AlgSequence
-        topSequence = AlgSequence()
-        topSequence += LumiBlockMuWriter("LumiBlockMuWriter",
-                                         LuminosityTool = ToolSvc.LuminosityTool)
-        
-        
 ###############################################################
 # Algorithm modifiers 
 ###############################################################
-- 
GitLab


From 4a08782289b3bec8015207877cc0da7c39fbd0a7 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 1 Mar 2019 15:34:59 +0100
Subject: [PATCH 132/404] Make TrigEFMissingETComponent::Component more safe

---
 .../TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
index 3d0d3d0c1c2..472b1185887 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
@@ -30,7 +30,8 @@ class TrigEFMissingEtComponent {
   public: // all attributes are public: like a struct
     enum Component 
     { 
-        PreSamplB, EMB1     , EMB2     , EMB3     ,     // LAr barrel
+        PreSamplB = 0 , 
+                   EMB1     , EMB2     , EMB3     ,     // LAr barrel
         PreSamplE, EME1     , EME2     , EME3     ,     // LAr EM endcap 
         HEC0     , HEC1     , HEC2     , HEC3     ,     // Hadronic end cap cal.
         TileBar0 , TileBar1 , TileBar2 ,                // Tile barrel
@@ -48,7 +49,8 @@ class TrigEFMissingEtComponent {
         JETE1    , JETE2    ,                           // 
         TCPUC    ,                                      // Topo. cluster Fit 
         TCPUCUnc ,                                      // Topo. cluster Fit -- uncorrected
-        Muons                                           // Muons 
+        Muons,                                          // Muons 
+        ComponentSize
     };
 
 
-- 
GitLab


From 61b70942b84a83908b4d91659354655253d07d84 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 1 Mar 2019 15:39:47 +0100
Subject: [PATCH 133/404] Add indicies so it's easier to count

---
 .../TrigEFMissingET/src/EFMissingETHelper.cxx | 34 +++++++++----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
index f9a0621578a..2545065ee93 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
@@ -71,80 +71,80 @@ std::string TrigEFMissingEtComponent::ComponentToName(const Component c)
   std::string name;
   switch(c)
   {
-      // LAr barrel
+    // 00-03 LAr barrel 
     case PreSamplB:  name="PreSamplB";    break;
     case EMB1:       name="EMB1";         break;
     case EMB2:       name="EMB2";         break;
     case EMB3:       name="EMB3";         break;
 
-    // LAr EM endcap 
+    // 04-07 LAr EM endcap 
     case PreSamplE:  name="PreSamplE";    break;
     case EME1:       name="EME1";         break;
     case EME2:       name="EME2";         break;
     case EME3:       name="EME3";         break;
 
-    // Hadronic end cap cal.
+    // 08-11 Hadronic end cap cal.
     case HEC0:       name="HEC0";         break;
     case HEC1:       name="HEC1";         break;
     case HEC2:       name="HEC2";         break;
     case HEC3:       name="HEC3";         break;
 
-    // Tile barrel
+    // 12-14 Tile barrel
     case TileBar0:   name="TileBar0";     break;
     case TileBar1:   name="TileBar1";     break;
     case TileBar2:   name="TileBar2";     break;
 
-    // Tile gap (ITC & scint)  
+    // 15-17 Tile gap (ITC & scint)  
     case TileGap1:   name="TileGap1";     break;
     case TileGap2:   name="TileGap2";     break;
     case TileGap3:   name="TileGap3";     break;
 
-    // Tile extended barrel 
+    // 18-20 Tile extended barrel 
     case TileExt0:   name="TileExt0";     break;
     case TileExt1:   name="TileExt1";     break;
     case TileExt2:   name="TileExt2";     break;
 
-    // Forward cal endcap  
+    // 21-23 Forward cal endcap  
     case FCalEM:     name="FCalEM";       break;
     case FCalHad1:   name="FCalHad1";     break;
     case FCalHad2:   name="FCalHad2";     break;
 
-    // Topo. clusters Had  
+    // 24    Topo. clusters Had  
     case TCLCW:      name="TCLCW";        break;
 
-    // pos. and neg. eta barrel                         
+    // 25-26 pos. and neg. eta barrel                         
     case TCLCWB1:    name="TCLCWB1";      break;
     case TCLCWB2:    name="TCLCWB2";      break;
 
-    // pos. and neg. eta endcap             
+    // 27-28 pos. and neg. eta endcap             
     case TCLCWE1:    name="TCLCWE1";      break;
     case TCLCWE2:    name="TCLCWE2";      break;
 
-    // Topo. clusters EM             
+    // 29    Topo. clusters EM             
     case TCEM:       name="TCEM";         break;
 
-    // pos. and neg. eta barrel                         
+    // 30-31 pos. and neg. eta barrel                         
     case TCEMB1:     name="TCEMB1";       break;
     case TCEMB2:     name="TCEMB2";       break;
 
-    // pos. and neg. eta endcap              
+    // 32-33 pos. and neg. eta endcap              
     case TCEME1:     name="TCEME1";       break;
     case TCEME2:     name="TCEME2";       break;
 
-    // Jet              
+    // 34-38 Jet              
     case JET:        name="JET";          break;
     case JETB1:      name="JETB1";        break;
     case JETB2:      name="JETB2";        break;
     case JETE1:      name="JETE1";        break;
     case JETE2:      name="JETE2";        break;
 
-    // Topo. cluster Fit              
+    // 39    Topo. cluster Fit              
     case TCPUC:      name="TCPUC";        break;
 
-    // Topo. cluster Fit -- uncorrected                         
+    // 40    Topo. cluster Fit -- uncorrected                         
     case TCPUCUnc:   name="TCPUCUnc";     break;
 
-    // Muons                         
+    // 41    Muons                         
     case Muons:      name="Muons";        break;
 
     default:         name="Unknown";
-- 
GitLab


From dde0dfff6f3db22995208fe0863c1adcfb09a0ca Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Fri, 1 Mar 2019 14:48:49 +0000
Subject: [PATCH 134/404] Classes to hold a transient trigger menu
 configuration and corresponding I/O

---
 .../TrigConfData/CMakeLists.txt               |  18 +
 .../TrigConfData/TrigConfData/ConstIter.h     | 121 +++
 .../TrigConfData/TrigConfData/DataStructure.h | 125 +++
 .../TrigConfData/TrigConfData/HLTChain.h      |  53 ++
 .../TrigConfData/TrigConfData/HLTMenu.h       |  57 ++
 .../TrigConfData/TrigConfData/L1Item.h        |  67 ++
 .../TrigConfData/TrigConfData/L1Menu.h        |  70 ++
 .../TrigConfData/TrigConfData/L1Threshold.h   |  64 ++
 .../TrigConfData/L1TopoAlgorithm.h            |  58 ++
 .../TrigConfData/TrigConfData/L1TopoMenu.h    |  70 ++
 .../TrigConfData/TrigConfData/L1TopoOutput.h  |  72 ++
 .../TrigConfData/src/DataStructure.cxx        | 142 +++
 .../TrigConfData/src/HLTChain.cxx             |  59 ++
 .../TrigConfData/src/HLTMenu.cxx              |  44 +
 .../TrigConfData/src/L1Item.cxx               |  63 ++
 .../TrigConfData/src/L1Menu.cxx               |  69 ++
 .../TrigConfData/src/L1Threshold.cxx          |  68 ++
 .../TrigConfData/src/L1TopoAlgorithm.cxx      |  59 ++
 .../TrigConfData/src/L1TopoMenu.cxx           |  77 ++
 .../TrigConfData/src/L1TopoOutput.cxx         |  58 ++
 .../TrigConfIO/CMakeLists.txt                 |  40 +
 .../TrigConfIO/TrigConfIO/JsonFileLoader.h    |  76 ++
 .../python/MenuXML2JSONConverter.py           | 228 +++++
 .../TrigConfIO/python/__init__.py             |   1 +
 .../scripts/TriggerMenuDB2JSONConverter.py    | 145 +++
 .../scripts/TriggerMenuXML2JSONConverter.py   |  25 +
 .../TrigConfIO/src/JsonFileLoader.cxx         | 106 +++
 .../test/data/HLTconfig_Physics_pp_v7.json    |  59 ++
 .../test/data/L1Topoconfig_Physics_pp_v7.json | 609 +++++++++++++
 .../test/data/LVL1config_Physics_pp_v7.json   | 839 ++++++++++++++++++
 .../TrigConfIO/test/read_config_info.cxx      | 130 +++
 .../test/testTriggerConfigAccess.sh           |   7 +
 .../utils/TestTriggerMenuAccess.cxx           | 179 ++++
 33 files changed, 3858 insertions(+)
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTMenu.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Item.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Menu.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoMenu.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoOutput.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/HLTMenu.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1TopoMenu.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/JsonFileLoader.h
 create mode 100755 Trigger/TrigConfiguration/TrigConfIO/python/MenuXML2JSONConverter.py
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/python/__init__.py
 create mode 100755 Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuDB2JSONConverter.py
 create mode 100755 Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuXML2JSONConverter.py
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/src/JsonFileLoader.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/test/data/HLTconfig_Physics_pp_v7.json
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/test/data/L1Topoconfig_Physics_pp_v7.json
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/test/data/LVL1config_Physics_pp_v7.json
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/test/read_config_info.cxx
 create mode 100755 Trigger/TrigConfiguration/TrigConfIO/test/testTriggerConfigAccess.sh
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx

diff --git a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
new file mode 100644
index 00000000000..083e0420bd2
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
@@ -0,0 +1,18 @@
+################################################################################
+# Package: TrigConfData
+################################################################################
+
+# Declare the package name:
+atlas_subdir( TrigConfData )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( )
+
+# External dependencies:
+find_package( Boost REQUIRED )
+
+# Component(s) in the package:
+atlas_add_library ( TrigConfData TrigConfData/*.h src/*.cxx
+                    PUBLIC_HEADERS TrigConfData
+                    INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                    LINK_LIBRARIES ${Boost_LIBRARIES} )
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
new file mode 100644
index 00000000000..a0938698d93
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/ConstIter.h
@@ -0,0 +1,121 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_CONSTITER_H
+#define TRIGCONFDATA_CONSTITER_H
+
+/**
+ * @file TrigConfData/ConstIter.h
+ * @author J. Stelzer
+ * @date Feb 2019
+ * @brief Forward iterator to traverse the main components of the trigger configuration
+ */
+
+#include <functional>
+
+namespace TrigConf {
+
+   /**
+    * @brief Forward iterator over an iterable of type @c V returning an object of type @c T
+    *
+    * By its nature this is a generator, returning values of type @c T, computed on the fly
+    *     <https://en.wikipedia.org/wiki/Generator_(computer_programming)>
+    *
+    * Objects of type @c T must be creatable from @c V::value_type, either by having 
+    * a constuctor T(V::valuetype) or by supplying an explicit conversion function to
+    * the constructor of the iterator
+    *
+    * This is being used by HLTMenu, @c L1Menu, and L1TopoMenu
+    */
+   template<typename V, typename T>
+   class ConstIter final {
+   public:
+      /**
+       * @brief Constructor
+       * @param buf Reference to the underlying iterable data container
+       * @param offset Position of the current element at construction time
+       * @param f Function to create an object of type @c T from type @c V::value_type, the default calls a contstructor T(V::value_type)
+       *
+       * Iterators pointing to the front and back of the container, assuming that T can be created from the elements of V are created like this
+       *@code
+       ConstIter<V, T> begin( v );
+       ConstIter<V, T> end( v, v.size() );       
+       @endcode
+       *
+       * An example for iterating over chains of an HLTMenu
+       *@code
+       ptree & chains = hltmenu.data().get_child("chains");
+       ConstIter<ptree, TrigConf::HLTChain> begin( v, 0,  [](auto x){return HLTChain(x.second));
+       ConstIter<ptree, TrigConf::HLTChain> end( chains, chains.size(), [](auto x){return HLTChain(x.second) );   
+       *@endcode
+       */
+      ConstIter( const V & buf, size_t offset = 0, 
+                 std::function<T(const typename V::value_type &)> f = [](auto x)->T{return {x};}) :
+         m_buf(buf),
+         m_offset(offset),
+         m_data(),
+         m_f(f),
+         m_bufIt(buf.begin())
+      {}
+
+      /** Destructor */
+      ~ConstIter()
+      {}
+
+      /** @brief Comparison operator */
+      bool operator==(const ConstIter &i) {
+         return &i.m_buf == &m_buf && i.m_offset == m_offset;
+      }
+
+      /** Not-equal operator */
+      bool operator!=(const ConstIter &i) {
+         return !(*this == i);
+      }
+
+      /** Pre-increment operator */
+      ConstIter & operator++() {
+         ++m_offset;
+         ++m_bufIt;
+         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);
+         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
+      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
+
+   };
+
+}
+
+/**
+ * @brief Iterator traits for the above iterator
+ * 
+ * note that the @c std::iterator will be deprecated in C++17
+ */
+namespace std {
+    template<typename V, typename T>
+    class iterator_traits<TrigConf::ConstIter<V,T> >
+    {
+    public:
+        using difference_type = std::ptrdiff_t;
+        using size_type = std::size_t;
+        using value_type = const T;
+        using pointer = const T*;
+        using reference = const T&;
+        using iterator_category = std::random_access_iterator_tag;
+    };
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
new file mode 100644
index 00000000000..3e5c1c35775
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
@@ -0,0 +1,125 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_DATASTRUCTURE
+#define TRIGCONFDATA_DATASTRUCTURE
+
+/**
+ * @file TrigConfData/DataStructure.h
+ * @author J. Stelzer
+ * @date Feb 2019
+ * @brief Base class for Trigger configuration data and wrapper around underlying representation
+ */
+
+#include <iostream>
+#include <vector>
+#include "boost/property_tree/ptree.hpp"
+
+namespace TrigConf {
+
+   /**
+    * @brief Base class for Trigger configuration data and wrapper around underlying representation
+    *
+    * Triggger configuration description data uses json format which can be represented 
+    * as boost::ptree (or other formats if ATLAS decides to support those)
+    * 
+    * The class acts as layer to shield the clients of the trigger configuration from the concrete
+    * representation of the transient configuration data
+    * 
+    * Configuration data is typically recursive, meaning that sub-configurations can also be expressed
+    * as DataStructure objects. Therefore this class also is base class to all other classes describing
+    * parts of the trigger configuration in this package
+    *
+    * Detailed information can be found under
+    *     <https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerConfigurationAccess>
+    */
+   class DataStructure {
+   public:
+
+      using ptree = boost::property_tree::ptree;
+
+      /** Default constructor, leading to an uninitialized configuration object */
+      DataStructure();
+
+      /** Constructor initialized with configuration data 
+       * @param data Reference to the data container 
+       */
+      DataStructure(const ptree &);
+
+      /** Destructor */
+      virtual ~DataStructure();
+
+      /** @brief Setting the configuration data */
+      void setData(const ptree & data);
+
+      /** Clearing the configuration data
+       * 
+       * leads to an uninitialized object
+       */
+      void clear();
+
+      /** Access to the underlying data, if needed */ 
+      const ptree & data() const { return m_data; }
+
+      /** Access to simple attribute */ 
+      std::string operator[](const std::string & key) const;
+
+      /** Access to array structure
+       * @param pathToChild The path to the configuration child, relative to the current one in form "path.to.child"
+       * @param ignoreIfMissing Controls the behavior in case of missing configuration child
+       *
+       * In case the child is missing and @c ignoreIfMissing is set to @c true, and empty vector 
+       * will be returned. Otherwise a runtime exception will be thrown. 
+       */
+      std::vector<DataStructure> getList(const std::string & pathToChild, bool ignoreIfMissing = false) const;
+
+      /** Access to configuration object 
+       * @param pathToChild The path to the configuration child, relative to the current one
+       * @param ignoreIfMissing Controls the behavior in case of missing configuration child
+       *
+       * In case the child is missing and @c ignoreIfMissing is set to @c true, an uninitialized 
+       * @c DataStructure will be returned. Otherwise a runtime exception will be thrown. 
+       *@code
+       *bool ignoreIfMissing = true;
+       *if( const DataStructure & child = ds.getObject("path.to.child", ignoreIfMissing) ) {
+       *   cout << child["key"] << endl;
+       *}
+       *@endcode
+       **/
+      DataStructure getObject(const std::string & pathToChild, bool ignoreIfMissing = false) const;
+
+      /** Access to initialized state */
+      explicit operator bool() const { return m_initialized; }
+
+      /** Check if children exist */
+      bool empty() const { return m_data.empty(); }
+
+      /* Print this object including children
+       * @param os The output stream
+       */
+      void print(std::ostream & os = std::cout) const;
+
+      /** Static function to print a @c ptree object
+       * @param key The key of this data as found in the parent structure
+       * @param data The ptree to print
+       * @param level The substruture level used to indent the output
+       * @param os The output stream
+       */
+      static void printElement(const std::string& key, 
+                               const ptree & data,
+                               uint level = 0,
+                               std::ostream & os = std::cout);
+
+   protected:
+
+      bool m_initialized { false }; //!< if initialized, the underlying ptree is valid (can be empty)
+
+      ptree m_data; //!< object holding the configuration data
+   
+   };
+
+}
+
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h
new file mode 100644
index 00000000000..1ffd558c305
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_HLTCHAIN_H
+#define TRIGCONFDATA_HLTCHAIN_H
+
+#include "TrigConfData/DataStructure.h"
+
+namespace TrigConf {
+
+   /** 
+    * @brief HLT chain configuration
+    *
+    * Provides access to the name and counter of the HLT chain, to 
+    * the seeding L1 item and to the connected output streams and chain groups.
+    */
+   class HLTChain final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      HLTChain();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the HLT chain configuration 
+       */      
+      HLTChain(const boost::property_tree::ptree & data);
+
+      /** Destructor */
+      ~HLTChain();
+
+      /** Accessor to the chain name */      
+      const std::string & name() const;
+
+      /** Accessor to the chain counter
+       *
+       * The chain counter is unique with the menu
+       */
+      unsigned int counter() const;
+
+      /** Accessor to the seeding L1 item */
+      const std::string & l1item() const;
+
+      /** Accessor to the connected output streams */
+      std::vector<DataStructure> streams() const;
+
+      /** Accessor to the groups this chain belongs to */
+      std::vector<std::string> groups() const;
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTMenu.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTMenu.h
new file mode 100644
index 00000000000..98433f4c0eb
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTMenu.h
@@ -0,0 +1,57 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_HLTMENU_H
+#define TRIGCONFDATA_HLTMENU_H
+
+#include "TrigConfData/ConstIter.h"
+#include "TrigConfData/DataStructure.h"
+#include "TrigConfData/HLTChain.h"
+
+namespace TrigConf {
+
+   /** 
+    * @brief HLT menu configuration
+    *
+    * Provides access to menu attributes like its name and to the trigger chains
+    */
+   class HLTMenu final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      HLTMenu();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the HLT menu 
+       */
+      HLTMenu(const ptree & data);
+
+      /** Destructor */
+      ~HLTMenu();
+
+      /** Accessor to the menu name */
+      std::string name() const;
+
+      /** Accessor to the number of HLT chains */
+      std::size_t size() const;
+
+      /** Iterator over the HLT chains */
+      using const_iterator = ConstIter<ptree, HLTChain>;
+
+      /** Begin of the HLT chains list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator begin() const;
+
+      /** End of the HLT chains list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator end() const;
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Item.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Item.h
new file mode 100644
index 00000000000..003ef0a0458
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Item.h
@@ -0,0 +1,67 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1ITEM_H
+#define TRIGCONFDATA_L1ITEM_H
+
+#include "TrigConfData/DataStructure.h"
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1 threshold configuration
+    *
+    * Provides access to the L1 item name and ID and the deadtime settings, 
+    * trigger type, logic, and partition.
+    */
+   class L1Item final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      L1Item();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1 item configuration 
+       */
+      L1Item(const ptree & data);
+
+      /** Destrutor */
+      ~L1Item();
+
+      /** Accessor to the item name */
+      const std::string & name() const;
+
+      /** Accessor to the CTP ID */
+      unsigned int ctpId() const;
+
+      /** Accessor to the item definition */
+      const std::string & definition() const;
+
+      /** Accessor to the complex deadtime
+       *
+       * This can be 0 or 1, but 1 has never been used so far
+       */
+      unsigned int complexDeadtime() const;
+
+      /** Accessor to the item monitoring definition */
+      const std::string & monitor() const;
+
+      /** Accessor to the item partition */
+      unsigned int partition() const;
+
+      /** Accessor to the item triggerType */
+      const std::string & triggerType() const;
+
+      /** Accessor to the item logic
+       *
+       * The current description of the logic is rather complex and
+       * difficult to parse and should be redesigned.
+       */
+      DataStructure logic() const;
+      
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Menu.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Menu.h
new file mode 100644
index 00000000000..b90cf64372d
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Menu.h
@@ -0,0 +1,70 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1MENU_H
+#define TRIGCONFDATA_L1MENU_H
+
+#include "TrigConfData/ConstIter.h"
+#include "TrigConfData/DataStructure.h"
+#include "TrigConfData/L1Item.h"
+#include "TrigConfData/L1Threshold.h"
+
+#include <vector>
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1 menu configuration
+    *
+    * Provides access to menu name and ctpVersion and to the L1 items and thresholds
+    */
+   class L1Menu final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      L1Menu();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1 menu 
+       */
+      L1Menu(const ptree & data);
+
+      /** Destructor */
+      ~L1Menu();
+
+      /** Accessor to the menu name */
+      std::string name() const;
+
+      /** Accessor to the menu version */
+      unsigned int version() const;
+
+      /** Accessor to the version of the CTP format */
+      unsigned int ctpVersion() const;
+
+      /** Accessor to the number of L1 items */
+      std::size_t size() const;
+
+      /** Iterator over the L1 items */
+      using const_iterator = ConstIter<ptree, L1Item>;
+
+      /** Begin of the L1 items list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator begin() const;
+
+      /** End of the L1 items list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator end() const;
+
+      /** List of L1 thresholds */
+      std::vector<TrigConf::L1Threshold> thresholds() const;
+
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
new file mode 100644
index 00000000000..16c9ab023be
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
@@ -0,0 +1,64 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1THRESHOLD_H
+#define TRIGCONFDATA_L1THRESHOLD_H
+
+#include "TrigConfData/DataStructure.h"
+#include <vector>
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1 threshold configuration
+    *
+    * Provides access to the L1Topo algorithm name and type and the selection parameters,
+    * input and output collections. Can hold sorting and decision algorithms
+    */
+   class L1Threshold final : public DataStructure {
+   public:
+
+      /** Constructor */
+      L1Threshold();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1 threshold 
+       */
+      L1Threshold(const ptree & data);
+
+      /** Destructor */
+      ~L1Threshold();
+
+      /** Accessor to the threshold name */
+      const std::string & name() const;
+
+      /** Accessor to the threshold type */
+      const std::string & type() const;
+
+      /** Accessor to the input board type */
+      const std::string & input() const;
+
+      /** Accessor to the mapping number
+       *
+       * The mapping is unique within a type
+       */
+      unsigned int mapping() const;
+
+      /** Accessor to the threshold ID */
+      unsigned int id() const;
+
+      /** Accessor to the list of threshold values */
+      std::vector<DataStructure> thresholdValues() const;
+      
+      /** Accessor to the cabling information
+       *
+       * If no cabling information is available then bool(cable()) is false
+       */
+      DataStructure cable() const;
+      
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
new file mode 100644
index 00000000000..c2313c8b4e0
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
@@ -0,0 +1,58 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1TOPOALGORITHM_H
+#define TRIGCONFDATA_L1TOPOALGORITHM_H
+
+#include "TrigConfData/DataStructure.h"
+#include <vector>
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1Topo algorithm configuration
+    *
+    * Provides access to the L1Topo algorithm name and type and the selection parameters,
+    * input and output collections. Can hold sorting and decision algorithms
+    */
+   class L1TopoAlgorithm final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      L1TopoAlgorithm();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1Topo menu 
+       */
+      L1TopoAlgorithm(const ptree & data);
+
+      /** Destructor */
+      ~L1TopoAlgorithm();
+
+      /** Accessor to algorithm index */
+      unsigned int algId() const;
+
+      /** Accessor to algorithm name */
+      const std::string & name() const;
+
+      /** Accessor to algorithm class type */
+      const std::string & type() const;
+
+      /** Accessor to list of input data collections */
+      std::vector<DataStructure> inputs() const;
+
+      /** Accessor to output collection */
+      DataStructure outputs() const;
+
+      /** Accessor to generic parameters */
+      std::vector<DataStructure> generics() const;
+
+      /** Accessor to register parameters which can change for each algorithm instance */
+      std::vector<DataStructure> parameters() const;
+
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoMenu.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoMenu.h
new file mode 100644
index 00000000000..191f6878dc9
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoMenu.h
@@ -0,0 +1,70 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1TOPOMENU_H
+#define TRIGCONFDATA_L1TOPOMENU_H
+
+#include "TrigConfData/ConstIter.h"
+#include "TrigConfData/DataStructure.h"
+#include "TrigConfData/L1TopoOutput.h"
+#include "TrigConfData/L1TopoAlgorithm.h"
+
+#include <vector>
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1Topo menu configuration
+    *
+    * Provides access to menu name and to the L1Topo putput lines
+    */
+   class L1TopoMenu final : virtual public DataStructure {
+   public:
+
+      /** Constructor */
+      L1TopoMenu();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1Topo menu 
+       */
+      L1TopoMenu(const ptree & data);
+
+      /** Destructor */
+      ~L1TopoMenu();
+
+      /** Accessor to the menu name */
+      std::string name() const;
+
+      /** Accessor to the menu version */
+      unsigned int version() const;
+
+      /** Access to the number of L1TopoOutput lines */
+      std::size_t size() const;
+
+      /** Iterator over the L1Topo output lines */
+      using const_iterator = ConstIter<ptree, L1TopoOutput>;
+
+      /** Begin of the L1Topo output lines list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator begin() const;
+
+      /** End of the L1Topo output lines list
+       *
+       * Needed for range-based loops
+       */
+      const_iterator end() const;
+
+      /** List of sorting algorithms */
+      std::vector<TrigConf::L1TopoAlgorithm> sortingAlgorithms() const;
+
+      /** List of decision algorithms */
+      std::vector<TrigConf::L1TopoAlgorithm> decisionAlgorithms() const;
+
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoOutput.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoOutput.h
new file mode 100644
index 00000000000..cd7eed36326
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoOutput.h
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1TOPOOUTPUT_H
+#define TRIGCONFDATA_L1TOPOOUTPUT_H
+
+#include "TrigConfData/DataStructure.h"
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1Topo output line configuration
+    *
+    * Provides access to the name of the trigger line, to the connected algorithm
+    *  and the lines the signals are being sent on.
+    */
+   class L1TopoOutput final : virtual public DataStructure {
+   public:
+      /** Constructor */
+      L1TopoOutput();
+
+      /** Constructor initialized with configuration data 
+       * @param data The data containing the L1Topo output line 
+       */      
+      L1TopoOutput(const boost::property_tree::ptree & data);
+
+      /** Destructor */
+      ~L1TopoOutput();
+
+      /** Accessor to the algorithm name */
+      const std::string & algName() const;
+
+      /** Accessor to the algorithm name */
+      unsigned int algId() const;
+
+      /** Accessor to the clock the signals are sent on
+       *
+       * The clock is 0 or 1. In case of multiple output signals from 
+       * the same algorithm, they are all on the same clock
+       */
+      unsigned int clock() const;
+
+      /** Accessor to the cable bit of the first signal
+       *
+       * In case of multiple signals, they are consecutive, starting at this bit. 
+       */
+      unsigned int firstBit() const;
+
+      /** Accessor to the FPGA number 
+       *
+       * The FPGA number can be 0 or 1
+       */
+      unsigned int fpga() const;
+
+      /** Accessor to the board number
+       *
+       * The board number can be 0 or 1
+       */
+      unsigned int board() const;
+
+      /** Accessor to the algorithm trigger lines
+       *
+       * Comma-separated list of line names
+       */
+      const std::string & triggerLines() const;
+
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
new file mode 100644
index 00000000000..433f9827ab1
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
@@ -0,0 +1,142 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include <iostream>
+#include "TrigConfData/DataStructure.h"
+#include <boost/property_tree/json_parser.hpp>
+
+using TV = boost::property_tree::ptree::value_type;  // tree-value type
+using namespace std;
+
+TrigConf::DataStructure::DataStructure()
+{}
+
+TrigConf::DataStructure::DataStructure(const ptree & data) :
+   m_initialized(true),
+   m_data(data)
+{}
+
+TrigConf::DataStructure::~DataStructure()
+{}
+
+void
+TrigConf::DataStructure::setData(const ptree & data)
+{
+   m_initialized = true;
+   m_data = data;
+}
+
+
+void
+TrigConf::DataStructure::clear()
+{
+   m_initialized = false;
+   m_data.clear();
+}
+
+std::string 
+TrigConf::DataStructure::operator[](const std::string & key) const
+{
+   const auto & obj = m_data.get_child(key);
+   // check if the key points to a plain string value
+   if ( !obj.empty() ) {
+      if ( obj.front().first.empty() ) {
+         throw runtime_error(string("Structure \"") + key + "\" is not a simple attribute but a list [], it needs to be accessed via getList(\"" + key + "\") -> vector<DataStructure>");
+      } else { 
+         throw runtime_error(string("Structure \"") + key + "\" is not a simple attribute but an object {}, it needs to be accessed via getObject(\"" + key + "\") -> DataStructure");
+      }
+   }
+
+   return obj.data();
+}
+
+std::vector<TrigConf::DataStructure> 
+TrigConf::DataStructure::getList(const std::string & pathToChild, bool ignoreIfMissing) const
+{
+   std::vector<TrigConf::DataStructure> childList;
+   const auto & list = m_data.get_child_optional(pathToChild);
+   if( ! list ) {
+      if ( ignoreIfMissing ) {
+         return childList;
+      } else {
+         throw runtime_error(string("Structure \"") + pathToChild + "\" does not exist.");          
+      }
+   }
+
+   // check if the pathToChild points to a list
+   if ( list.get().empty() ) {
+      throw runtime_error(string("Structure \"") + pathToChild + "\" is not a list [] but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
+   } else if ( ! list.get().front().first.empty() ) {
+      throw runtime_error(string("Structure \"") + pathToChild + "\" is not a list [] but an object {}, it needs to be accessed via getObject(\"" + pathToChild + "\") -> DataStructure");
+   }
+
+   childList.reserve(list.get().size());
+
+   for( auto & childData : list.get() )
+      childList.emplace_back( childData.second );
+
+   return childList;
+}
+
+
+TrigConf::DataStructure
+TrigConf::DataStructure::getObject(const std::string & pathToChild, bool ignoreIfMissing) const
+{
+   const auto & obj = m_data.get_child_optional(pathToChild);
+   if( ! obj ) {
+      if ( ignoreIfMissing ) {
+         return DataStructure();
+      } else {
+         throw runtime_error(string("Structure \"") + pathToChild + "\" does not exist.");          
+      }
+   }
+   // check if the pathToChild points to an object
+   if ( obj.get().empty() ) {
+      throw runtime_error(string("Structure \"") + pathToChild + "\" is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
+   } else if ( obj.get().front().first.empty() ) {
+      throw runtime_error(string("Structure \"") + pathToChild + "\" is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
+   }
+   return { obj.get() };
+}
+
+
+void
+TrigConf::DataStructure::print(ostream & os) const
+{
+   printElement("", m_data, 0, os);
+   os << std::endl;
+
+   //boost::property_tree::write_json( o, m_data );
+}
+
+void
+TrigConf::DataStructure::printElement(const std::string& key, const ptree & data, uint level, ostream & os)
+{
+   constexpr char del = '"';
+
+   const string value = data.get_value<std::string>();
+   
+   if( data.empty() ) { // no children, so jsut a key->value pair
+      uint n(4*level); while(n--) os << " ";
+      os << del << key << del << ": " << del << value << del;
+      return;
+   }
+
+
+   bool isArray ( data.begin()->first.empty() ); // dictionaries have keys, arrays don't
+   { uint n(4*level); while(n--) os << " "; }
+   if ( ! key.empty() )
+      os << del << key << del << ": ";
+   os << (isArray ? "[" : "{") << std::endl;
+
+   size_t childCounter = data.size();
+   for( const TV & x : data ) {
+      printElement(x.first, x.second, level + 1, os);
+      if( --childCounter ) os << ",";
+      os << std::endl;
+   }
+   { uint n(4*level); while(n--) os << " "; }
+   os << (isArray ? "]" : "}");
+
+}
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx
new file mode 100644
index 00000000000..3d3b6596281
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx
@@ -0,0 +1,59 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/HLTChain.h"
+TrigConf::HLTChain::HLTChain()
+{}
+
+TrigConf::HLTChain::HLTChain(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::HLTChain::~HLTChain()
+{}
+
+const std::string &
+TrigConf::HLTChain::name() const
+{
+   return data().get_child("name").data();
+}
+
+unsigned int
+TrigConf::HLTChain::counter() const
+{
+   return data().get_child("counter").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::HLTChain::l1item() const
+{
+   return data().get_child("l1item").data();
+}
+
+std::vector<TrigConf::DataStructure>
+TrigConf::HLTChain::streams() const
+{
+   std::vector<DataStructure> strlist;
+   const auto & streams = m_data.get_child("streams");
+   strlist.reserve(streams.size());
+
+   for( auto & strData : streams )
+      strlist.emplace_back( strData.second );
+   
+   return strlist;
+}
+
+std::vector<std::string>
+TrigConf::HLTChain::groups() const
+{
+   std::vector<std::string> grouplist;
+   const auto & groups = m_data.get_child("groups");
+   grouplist.reserve(groups.size());
+
+   for( auto & groupData : groups )
+      grouplist.emplace_back( groupData.second.get_child("name").data() );
+
+   return grouplist;
+}
+
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/HLTMenu.cxx b/Trigger/TrigConfiguration/TrigConfData/src/HLTMenu.cxx
new file mode 100644
index 00000000000..276fec4dc14
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/HLTMenu.cxx
@@ -0,0 +1,44 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/HLTMenu.h"
+#include "TrigConfData/HLTChain.h"
+
+using TV = boost::property_tree::ptree::value_type;  // tree-value type
+using namespace std;
+
+TrigConf::HLTMenu::HLTMenu()
+{}
+
+TrigConf::HLTMenu::HLTMenu(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::HLTMenu::~HLTMenu()
+{}
+
+std::size_t 
+TrigConf::HLTMenu::size() const
+{
+   return m_data.get_child("chains").size();
+}
+
+std::string
+TrigConf::HLTMenu::name() const
+{
+   return m_data.get_child("name").data();
+}
+
+TrigConf::HLTMenu::const_iterator
+TrigConf::HLTMenu::begin() const
+{
+   return {m_data.get_child("chains"), 0,  [](auto x){return HLTChain(x.second);}};
+}
+
+TrigConf::HLTMenu::const_iterator
+TrigConf::HLTMenu::end() const
+{
+   const auto & chains = m_data.get_child("chains");
+   return {chains, chains.size(), [](auto x){return HLTChain(x.second);}};
+}
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx
new file mode 100644
index 00000000000..25bdaf15d35
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx
@@ -0,0 +1,63 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1Item.h"
+
+TrigConf::L1Item::L1Item()
+{}
+
+TrigConf::L1Item::L1Item(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1Item::~L1Item()
+{}
+
+const std::string &
+TrigConf::L1Item::name() const
+{
+   return data().get_child("name").data();
+}
+
+unsigned int
+TrigConf::L1Item::ctpId() const
+{
+   return data().get_child("ctpId").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::L1Item::definition() const
+{
+   return data().get_child("definition").data();
+}
+
+unsigned int
+TrigConf::L1Item::complexDeadtime() const
+{
+   return data().get_child("complexDeadtime").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::L1Item::monitor() const
+{
+   return data().get_child("monitor").data();
+}
+
+unsigned int
+TrigConf::L1Item::partition() const
+{
+   return data().get_child("partition").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::L1Item::triggerType() const
+{
+   return data().get_child("triggerType").data();
+}
+
+TrigConf::DataStructure
+TrigConf::L1Item::logic() const
+{
+   return getObject("AND");
+}
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx
new file mode 100644
index 00000000000..dadff9739ff
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx
@@ -0,0 +1,69 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1Menu.h"
+using namespace std;
+
+
+TrigConf::L1Menu::L1Menu()
+{}
+
+TrigConf::L1Menu::L1Menu(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1Menu::~L1Menu()
+{}
+
+std::string
+TrigConf::L1Menu::name() const
+{
+   return m_data.get_child("name").data();
+}
+
+unsigned int 
+TrigConf::L1Menu::version() const
+{
+   return m_data.get_child("version").get_value<unsigned int>();
+}
+
+unsigned int 
+TrigConf::L1Menu::ctpVersion() const
+{
+   return m_data.get_child("ctpVersion").get_value<unsigned int>();
+}
+
+std::size_t 
+TrigConf::L1Menu::size() const
+{
+   return m_data.get_child("menu.items").size();
+}
+
+TrigConf::L1Menu::const_iterator
+TrigConf::L1Menu::begin() const
+{
+   return {m_data.get_child("menu.items"), 0,  [](auto x){return L1Item(x.second);}};
+}
+
+TrigConf::L1Menu::const_iterator
+TrigConf::L1Menu::end() const
+{
+   const auto & items = m_data.get_child("menu.items");
+   return {items, items.size(), [](auto x){return L1Item(x.second);}};
+}
+
+
+std::vector<TrigConf::L1Threshold> 
+TrigConf::L1Menu::thresholds() const
+{
+   std::vector<TrigConf::L1Threshold> thrlist;
+   const auto & thresholds = m_data.get_child("thresholds");
+   thrlist.reserve(thresholds.size());
+
+   for( auto & thr : thresholds )
+      thrlist.emplace_back( thr.second );
+
+   return thrlist;
+}
+
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
new file mode 100644
index 00000000000..ae82389f35f
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1Threshold.h"
+
+TrigConf::L1Threshold::L1Threshold()
+{}
+
+TrigConf::L1Threshold::L1Threshold(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1Threshold::~L1Threshold()
+{}
+
+const std::string &
+TrigConf::L1Threshold::name() const
+{
+   return data().get_child("name").data();
+}
+
+const std::string &
+TrigConf::L1Threshold::type() const
+{
+   return data().get_child("type").data();
+}
+
+const std::string &
+TrigConf::L1Threshold::input() const
+{
+   return data().get_child("input").data();
+}
+
+unsigned int
+TrigConf::L1Threshold::mapping() const
+{
+   return data().get_child("mapping").get_value<unsigned int>();
+}
+
+unsigned int
+TrigConf::L1Threshold::id() const
+{
+   return data().get_child("id").get_value<unsigned int>();
+}
+
+std::vector<TrigConf::DataStructure>
+TrigConf::L1Threshold::thresholdValues() const
+{
+   std::vector<DataStructure> thrVlist;
+
+   if( const auto & thrVs = m_data.get_child_optional("thresholdValues") ) {
+
+      thrVlist.reserve(thrVs.get().size());
+      
+      for( auto & thrVData : thrVs.get() )
+         thrVlist.emplace_back( thrVData.second );
+   }
+   
+   return thrVlist;
+}
+
+TrigConf::DataStructure
+TrigConf::L1Threshold::cable() const
+{
+   bool ignoreIfMissing = true; 
+   return getObject("cable", ignoreIfMissing);
+}
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
new file mode 100644
index 00000000000..14f21a07677
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
@@ -0,0 +1,59 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1TopoAlgorithm.h"
+
+TrigConf::L1TopoAlgorithm::L1TopoAlgorithm()
+{}
+
+TrigConf::L1TopoAlgorithm::L1TopoAlgorithm(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1TopoAlgorithm::~L1TopoAlgorithm()
+{}
+
+unsigned int
+TrigConf::L1TopoAlgorithm::algId() const
+{
+   return data().get_child("algId").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::L1TopoAlgorithm::name() const
+{
+   return data().get_child("name").data();
+}
+
+const std::string &
+TrigConf::L1TopoAlgorithm::type() const
+{
+   return data().get_child("type").data();
+}
+
+
+std::vector<TrigConf::DataStructure> 
+TrigConf::L1TopoAlgorithm::inputs() const
+{
+   return getList("fixedParameters.inputs");
+}
+
+TrigConf::DataStructure 
+TrigConf::L1TopoAlgorithm::outputs() const
+{
+   return getObject("fixedParameters.outputs");
+}
+
+std::vector<TrigConf::DataStructure> 
+TrigConf::L1TopoAlgorithm::generics() const
+{
+   return getList("fixedParameters.generics");
+}
+
+std::vector<TrigConf::DataStructure> 
+TrigConf::L1TopoAlgorithm::parameters() const
+{
+   return getList("variableParameters.parameters");
+}
+
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoMenu.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoMenu.cxx
new file mode 100644
index 00000000000..dbe9b617f3c
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoMenu.cxx
@@ -0,0 +1,77 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1TopoMenu.h"
+#include "TrigConfData/L1TopoOutput.h"
+using namespace std;
+
+
+TrigConf::L1TopoMenu::L1TopoMenu()
+{}
+
+TrigConf::L1TopoMenu::L1TopoMenu(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1TopoMenu::~L1TopoMenu()
+{}
+
+std::string
+TrigConf::L1TopoMenu::name() const
+{
+   return m_data.get_child("name").data();
+}
+
+unsigned int 
+TrigConf::L1TopoMenu::version() const
+{
+   return m_data.get_child("version").get_value<unsigned int>();
+}
+
+std::size_t 
+TrigConf::L1TopoMenu::size() const
+{
+   return m_data.get_child("outputs").size();
+}
+
+vector<TrigConf::L1TopoAlgorithm>
+TrigConf::L1TopoMenu::sortingAlgorithms() const
+{
+
+   std::vector<TrigConf::L1TopoAlgorithm> algorithmList;
+   const auto & sortingAlgorithms = m_data.get_child("sortingAlgorithms");
+   algorithmList.reserve(sortingAlgorithms.size());
+
+   for( auto & alg : sortingAlgorithms )
+      algorithmList.emplace_back( alg.second );
+
+   return algorithmList;
+}
+
+vector<TrigConf::L1TopoAlgorithm>
+TrigConf::L1TopoMenu::decisionAlgorithms() const
+{
+
+   std::vector<TrigConf::L1TopoAlgorithm> algorithmList;
+   const auto & decisionAlgorithms = m_data.get_child("decisionAlgorithms");
+   algorithmList.reserve(decisionAlgorithms.size());
+
+   for( auto & alg : decisionAlgorithms )
+      algorithmList.emplace_back( alg.second );
+
+   return algorithmList;
+}
+
+TrigConf::L1TopoMenu::const_iterator
+TrigConf::L1TopoMenu::begin() const
+{
+   return {m_data.get_child("outputs"), 0,  [](auto x){return L1TopoOutput(x.second);}};
+}
+
+TrigConf::L1TopoMenu::const_iterator
+TrigConf::L1TopoMenu::end() const
+{
+   const auto & outputs = m_data.get_child("outputs");
+   return {outputs, outputs.size(), [](auto x){return L1TopoOutput(x.second);}};
+}
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx
new file mode 100644
index 00000000000..3698667674b
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx
@@ -0,0 +1,58 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1TopoOutput.h"
+
+TrigConf::L1TopoOutput::L1TopoOutput()
+{}
+
+TrigConf::L1TopoOutput::L1TopoOutput(const boost::property_tree::ptree & data) 
+   : DataStructure(data)
+{}
+
+TrigConf::L1TopoOutput::~L1TopoOutput()
+{}
+
+const std::string &
+TrigConf::L1TopoOutput::algName() const
+{
+   return data().get_child("algName").data();
+}
+
+unsigned int
+TrigConf::L1TopoOutput::algId() const
+{
+   return data().get_child("algId").get_value<unsigned int>();
+}
+
+unsigned int
+TrigConf::L1TopoOutput::clock() const
+{
+   return data().get_child("clock").get_value<unsigned int>();
+}
+
+unsigned int
+TrigConf::L1TopoOutput::firstBit() const
+{
+   return data().get_child("firstBit").get_value<unsigned int>();
+}
+
+unsigned int
+TrigConf::L1TopoOutput::fpga() const
+{
+   return data().get_child("fpga").get_value<unsigned int>();
+}
+
+unsigned int
+TrigConf::L1TopoOutput::board() const
+{
+   return data().get_child("board").get_value<unsigned int>();
+}
+
+const std::string &
+TrigConf::L1TopoOutput::triggerLines() const
+{
+   return data().get_child("triggerLines").data();
+}
+
diff --git a/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt
new file mode 100644
index 00000000000..0198666bf63
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt
@@ -0,0 +1,40 @@
+################################################################################
+# Package: TrigConfIO
+################################################################################
+
+# Declare the package name:
+atlas_subdir( TrigConfIO )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          GaudiKernel
+                          Trigger/TrigConfiguration/TrigConfData
+                          Trigger/TrigConfiguration/TrigConfBase
+                          PRIVATE
+                          Tools/PathResolver
+                          )
+
+# External dependencies:
+find_package( Boost )
+
+# Component(s) in the package:
+atlas_add_library( TrigConfIO
+                   TrigConfIO/*.h src/*.cxx
+                   PUBLIC_HEADERS TrigConfIO
+                   LINK_LIBRARIES PathResolver TrigConfBase TrigConfData GaudiKernel )
+
+atlas_add_executable( TestTriggerMenuAccess utils/TestTriggerMenuAccess.cxx 
+                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                      LINK_LIBRARIES ${Boost_LIBRARIES} TrigConfIO )
+
+atlas_install_python_modules( python/*.py )
+
+atlas_install_scripts( scripts/*.py )
+
+atlas_install_data( data/*.json data/*.xml )
+
+atlas_add_test( ReadTriggerConfig SOURCES test/read_config_info.cxx
+                INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+                LINK_LIBRARIES ${Boost_LIBRARIES} TrigConfData TrigConfIO 
+                ENVIRONMENT "TESTFILEPATH=${CMAKE_CURRENT_SOURCE_DIR}/test/data"
+                POST_EXEC_SCRIPT nopost.sh )
diff --git a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/JsonFileLoader.h b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/JsonFileLoader.h
new file mode 100644
index 00000000000..300943075ed
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/JsonFileLoader.h
@@ -0,0 +1,76 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @file TrigConfIO/JsonFileLoader.h
+ * @author J. Stelzer
+ * @date Feb 2019
+ * @brief Loader class for Trigger configuration from Json
+ */
+
+#ifndef TRIGCONFSTORAGE_JSONFILELOADER_H
+#define TRIGCONFSTORAGE_JSONFILELOADER_H
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "boost/property_tree/ptree.hpp"
+#include "TrigConfBase/TrigConfMessaging.h"
+
+#include "TrigConfData/DataStructure.h"
+
+namespace TrigConf {
+
+   /**
+    * @brief Loader of trigger configurations from Json files
+    */
+   class JsonFileLoader : public TrigConfMessaging {
+   public:
+
+      /** Constructor */
+      JsonFileLoader();
+
+      /** Destructor */
+      virtual ~JsonFileLoader();
+
+      /**
+       * @brief Load content of json file into a ptree
+       * @param filename [in] Name of the json file
+       * @param data [out] 
+       * @param pathToChild [in] Path to a sub structure for partial loading of data
+       *
+       * The file is searched for in the path list defined by the environment variable @c DATAPATH.
+       * If the optional parameter @c pathToChild is specified, one can load parts if the configuration
+       * from the file.
+       *@code
+       *    TrigConf::JsonFileLoader fileLoader;
+       *    const std::string l1_filename = "TriggerMenuXML/LVL1config_Physics_pp_v7.json";
+       *    TrigConf::DataStructure metSignificance;
+       *    fileLoader.loadFile( l1_filename, metSignificance, "CaloInfo.METSignificance");
+       @endcode
+       */
+      StatusCode loadFile( const std::string & filename,
+                           boost::property_tree::ptree & data,
+                           const std::string & pathToChild = "");
+
+      /**
+       * @brief Load content of json file into a ptree
+       * @param filename [in] Name of the json file
+       * @param data [out] 
+       * @param pathToChild [in] Path to a sub structure for partial loading of data
+       */
+      StatusCode loadFile( const std::string & filename,
+                           DataStructure & data,
+                           const std::string & pathToChild = "");
+
+
+      void setLevel(MSGTC::Level lvl) { msg().setLevel(lvl); }
+
+      MSGTC::Level outputLevel() const { return msg().level(); }
+
+   };
+
+}
+
+#endif
+
diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/MenuXML2JSONConverter.py b/Trigger/TrigConfiguration/TrigConfIO/python/MenuXML2JSONConverter.py
new file mode 100755
index 00000000000..843d3e22053
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/python/MenuXML2JSONConverter.py
@@ -0,0 +1,228 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+import sys,os
+
+class XML2JsonConverter(object):
+    def __init__(self, tabsize = 4,  **args):
+        self.tabsize = tabsize
+        
+        self.__doc = None
+        self.__root = None
+        self.__rules = {}
+        self.xmlfilename = None
+        
+
+    def convertFile(self, inputfilename, jsonfilename = None ):
+        if not inputfilename.endswith(".xml"):
+            print "judging by the suffix, %s is not an xml file" % inputfilename
+            return 1
+        self.parseXMLFile( inputfilename )
+        self.writeJsonFile( jsonfilename )
+    
+    def parseXMLFile(self,filename):
+        self.xmlfilename = filename
+        import xml.etree.cElementTree as ET
+        self.doc = ET.parse(filename)
+        self.root = self.doc.getroot()
+        print "Parsed file %s" % filename
+        return self.doc
+        
+    def loadRules(self,docname):
+        self.rules = { 'asInt' : {},
+                       'asArray' : [],
+                       'asMultiArray' : [],
+                       'ignoreElement' : [],
+                       'ignoreAttrib' : [],
+                       'promote' : {},
+                       'rename' : {}   # renaming will be applied last 
+                       }
+        
+        if docname == "LVL1Config":
+            self.rules['asInt'] =  {
+                "TriggerItem" : ["partition", "complex_deadtime", "ctpid"],
+                "TriggerThreshold" : ["bitnum", "mapping", "version", "active", "id"],
+                "TriggerThresholdValue" : [ "thresholdval", "etamin", "etamax", "phimin", "phimax", 
+                                            "em_isolation", "window", "priority", "had_veto", "had_isolation"],
+                "Signal" : [ "range_end", "range_begin" ],
+                "Random" : ["cut0", "cut1", "cut2", "cut3"],
+                "PrescaleSet" : ["menuPartition"],
+                "Prescale" : ["ctpid"],
+                "TriggerCondition" : ["multi"],
+                "METSignificance" : ["xeMax", "teSqrtMax", "xsSigmaOffset", "teSqrtMin", "xsSigmaScale", "xeMin"],
+                "MinimumTOBPt" : [ "priority", "etamin", "ptmin", "etamax", "window" ],
+                "Parametrization" : [ "slope", "isobit", "priority", "etamin", "offset", "mincut", "etamax", "upperlimit"],
+                "CaloInfo" : [ "global_em_scale", "global_jet_scale"],
+                "BunchGroupSet" : [ "menuPartition" ],
+                "BunchGroup" : [ "internalNumber" ],
+                "MuctpiInfo" : [ "high_pt", "max_cand", "low_pt" ],
+                "PrescaledClock" : [ "clock1", "clock2" ],
+                "LVL1Config" : [ "l1Version", "ctpVersion" ]
+                }
+            self.rules['asArray'] = [ 'AND', 'OR' ]
+            self.rules['asMultiArray'] = [ ('PrescaleSet', 'Prescale'),
+                                           ('TriggerThreshold', 'TriggerThresholdValue'),
+                                           ('TriggerCounterList', 'TriggerCounter'),
+                                           ('Isolation', 'Parametrization'),
+                                           ('TriggerMenu', 'TriggerItem'),
+                                           ('CaloInfo', 'MinimumTOBPt'),
+                                           ('CaloInfo', 'Isolation'),
+                                           ('BunchGroupSet', 'BunchGroup'),
+                                           ('OR', 'TriggerCondition'),
+                                           ('TriggerThresholdList', 'TriggerThreshold'),
+                                           ('AND', 'TriggerCondition'),
+                                           ('AND', 'OR'),
+                                           ('AND', 'InternalTrigger')
+                                           ]
+            self.rules['ignoreElement'] = []
+            self.rules['promote'] = {"TriggerThresholdList" : "TriggerThreshold"}
+            self.rules['rename'] = { "TriggerItem" : "items", "TriggerMenu" : "menu", "l1Version" : "version", "ctpid" : "ctpId",
+                                     "complex_deadtime" : "complexDeadtime", "trigger_type" : "triggerType", "TriggerThreshold" : "thresholds",
+                                     "triggerthreshold" : "triggerThreshold", "TriggerCondition" : "triggerCondition", "InternalTrigger" : "internalTrigger",
+                                     "Cable" : "cable", "Signal" : "signal", "range_begin" : "rangeBegin", "range_end" : "rangeEnd",
+                                     "TriggerThresholdValue" : "thresholdValues" }
+            
+        elif docname == "HLT_MENU":
+            
+            self.rules['asInt'] = {
+                "CHAIN": ["EBstep", "chain_counter"],
+                "SIGNATURE": ["signature_counter"]
+                }
+            self.rules['asMultiArray'] = [ ('SEQUENCE_LIST', 'SEQUENCE'),
+                                           ('GROUP_LIST', 'GROUP'),
+                                           ('SIGNATURE_LIST', 'SIGNATURE'),
+                                           ('CHAIN_LIST', 'CHAIN'),
+                                           ('STREAMTAG_LIST', 'STREAMTAG'),
+                                           ('SIGNATURE', 'TRIGGERELEMENT')
+                                           ]
+            self.rules['ignoreElement'] = [ "SEQUENCE_LIST", "SIGNATURE_LIST", "TRIGGERTYPE_LIST" ]
+            self.rules['ignoreAttrib'] = [ ("CHAIN", "level"),
+                                           ("CHAIN", "EBstep"),
+                                           ("CHAIN", "pass_through"),
+                                           ("CHAIN", "prescale"),
+                                           ("CHAIN", "rerun_prescale"),
+                                           ("HLT_MENU", "prescale_set_name")]
+            self.rules['promote'] = {"GROUP_LIST" : "GROUP", "STREAMTAG_LIST" : "STREAMTAG", "CHAIN_LIST" : "CHAIN"}
+            self.rules['rename'] = { "GROUP" : "groups", "STREAMTAG" : "streams", "CHAIN" : "chains",
+                                     "menu_name" : "name",
+                                     "chain_name" : "name", "chain_counter" : "counter", "lower_chain_name" : "l1item",
+                                     "stream" : "name"}
+
+        elif docname == "TOPO_MENU":
+            
+            self.rules['asInt'] = {
+                "Parameter": ["pos", "value"],
+                "Bit": ["selection"],
+                "Input": ["position"],
+                "Output": ["bits", "fpga", "clock", "algoId", "module", "firstbit"],
+                "SortAlgo": ["algoId"],
+                "DecisionAlgo": ["algoId"],
+                }
+            self.rules['asMultiArray'] = [ ('OutputList', 'Output'),
+                                           ('Fixed', 'Generic'),
+                                           ('Fixed', 'Input'),
+                                           ('TOPO_MENU', 'SortAlgo'),
+                                           ('TOPO_MENU', 'DecisionAlgo'),
+                                           ('Variable', 'Parameter'),
+                                           ('Output', 'Bit'),
+                                           ('SIGNATURE', 'TRIGGERELEMENT')
+                                           ]
+            self.rules['promote'] = { "OutputList" : "Output" }
+            self.rules['rename'] = { "menu_name" : "name", "menu_version" : "version",
+                                     "algname" : "algName", "algoId" : "algId", "firstbit" : "firstBit", "module" : "board", "triggerline" : "triggerLines",
+                                     "SortAlgo" : "sortingAlgorithms", "DecisionAlgo" : "decisionAlgorithms",
+                                     "Fixed" : "fixedParameters", "Input" : "inputs", "Output" : "outputs", "Generic" : "generics",
+                                     "Variable" : "variableParameters", "Parameter" : "parameters"}
+        else:
+            print "Unknown document with root element %s" % docname
+            return 1
+        return 0
+
+
+    def renameKey(self,key):
+        return self.rules['rename'][key] if key in self.rules['rename'] else key
+
+    
+    def createJsonStruct(self, node):
+        if node.tag in self.rules['asArray']:
+            return [ {element.tag : self.createJsonStruct(element)} for element in node ]
+
+        else:
+            from collections import OrderedDict
+            d = OrderedDict()
+            # writing attributs of the element to json structure in alphabetical order
+            # turn values into int according to the asInt rule
+            for attr in sorted(node.attrib.keys()):
+                if (node.tag, attr) in self.rules['ignoreAttrib']: # attributes to ignore
+                    continue
+                if node.tag in self.rules['asInt'] and attr in self.rules['asInt'][node.tag]:
+                    d[self.renameKey(attr)] = int(node.attrib[attr])
+                else:
+                    d[self.renameKey(attr)] = node.attrib[attr]
+            # looping over children
+            for element in node:
+                if element.tag in self.rules['ignoreElement']:
+                    continue
+                if (node.tag, element.tag) in self.rules['asMultiArray']:
+                    # list of multiple identical elements (e.g. CHAINs)
+                    key = self.renameKey(element.tag) 
+                    if not key in d: d[key] = list()
+                    d[key] += [ self.createJsonStruct(element) ]
+                else:
+                    # single element (e.g. CHAIN_LIST)
+                    if element.tag in d:
+                        raise RuntimeError("element %s already attached to node %s and not declared as MultiArray" % (element.tag, node.tag))
+
+                    if element.tag in self.rules['promote']:
+                        obj = self.createJsonStruct(element)
+                        promoted = self.renameKey( self.rules['promote'][element.tag]) #e.g. Chains
+                        d[promoted] = obj[promoted]
+                    else:
+                        d[self.renameKey(element.tag)] = self.createJsonStruct(element)
+
+            return d
+
+
+
+    def writeJsonFile(self, filename = None):
+        import json
+        if not filename:
+            # use xml filename base
+            filename = self.xmlfilename.rstrip(".xml")+".json"
+        elif os.path.isdir(filename):
+            filename = filename.rstrip("/") + "/" + self.xmlfilename.split("/")[-1].rstrip(".xml")+".json"
+        self.loadRules(self.root.tag)
+        d = self.createJsonStruct(self.root)
+        FH = open(filename, "w")
+        json.dump(d, FH, indent=self.tabsize, separators=(',', ': '))
+        FH.close()
+        print "Wrote file %s" % filename
+
+
+
+    def checkJsonConformity(self, filename):
+        print "Checking json conformity",
+        import json
+        FH = open(filename, "rb")
+        try:
+            json.load(FH)
+            print " ... OK"
+        except ValueError, e:
+            print " ... FAILED"
+            print e
+        FH.close()
+        
+
+
+def test():
+    if len(sys.argv)<=1:
+        print "please specify xml file for conversion"
+        return 1
+
+    converter = XML2JsonConverter()
+    converter.convertFile( sys.argv[1] )
+    return 0
+
+
+if __name__=="__main__":
+    sys.exit(test())
+
diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/__init__.py b/Trigger/TrigConfiguration/TrigConfIO/python/__init__.py
new file mode 100644
index 00000000000..4e669a90b8b
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/python/__init__.py
@@ -0,0 +1 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuDB2JSONConverter.py b/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuDB2JSONConverter.py
new file mode 100755
index 00000000000..a3bb04b2538
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuDB2JSONConverter.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+import sys, os
+from optparse import OptionParser, OptionGroup
+
+class Silence():
+    def __init__(self, verbose):
+        self.verbose = verbose
+    def __enter__(self):
+        if not self.verbose:
+            self.so = sys.stdout
+            sys.stdout = open(os.devnull, 'w')
+    def __exit__(self, type, value, traceback):
+        if not self.verbose:
+            sys.stdout = self.so
+            
+def main():
+
+
+    parser = OptionParser(usage="usage: %prog [options] smk")
+
+    parser.add_option("-v", "--verbose",
+                      action = "store_true",
+                      dest = "verbose",
+                      default = False,
+                      help="verbose output [default: %default]")
+    
+    actions = OptionGroup(parser, "actions")
+
+    actions.add_option( "",
+                        "--l1",
+                        dest = "l1psk",
+                        metavar = "PSK",
+                        default = 0,
+                        help = "Level 1 prescale key PSK for L1 prescale set to convert" )
+
+    actions.add_option( "",
+                        "--hlt",
+                        type="int",
+                        dest = "hltpsk",
+                        metavar="PSK",
+                        default = 0,
+                        help = "HLT prescale key PSK for HLT prescale set to convert" )
+
+    actions.add_option( "",
+                        "--showpsk",
+                        dest = "showpsk",
+                        action = "store_true",
+                        default = False,
+                        help = "only prints prescale keys attached to SMK [default: %default]" )
+
+    parser.add_option_group(actions)
+
+    parser.add_option( "",
+                       "--db",
+                       dest = "db",
+                       default = "TRIGGERDB",
+                       help = "database alias TRIGGERDB|TRIGGERDBREPR|TRIGGERDBMC  [default: %default]" )
+
+
+    (options, args) = parser.parse_args()
+
+    if len(args) != 1:
+        parser.error("Please specify the SMK")
+
+    try:
+        smk = int(args[0])
+    except ValueError:
+        parser.error("SMK must be an integer")
+
+
+    if not (options.l1psk or options.hltpsk or options.showpsk):
+        parser.print_help()
+        parser.error("Please specify one of the actions")
+
+    if options.showpsk:
+        with Silence(options.verbose):
+            from TrigConfigSvc.TrigConfigSvcUtils import getHLTPrescalesFromSMK
+            hltpsk = getHLTPrescalesFromSMK(options.db,smk)
+        print "Trigger keys connected to SM %i are %r" % (smk, [int(k[0]) for k in hltpsk])
+
+
+    if options.hltpsk:
+        with Silence(options.verbose): # suppress all the output from loading the athena modules
+            from TrigConfigSvc.TrigConfigSvcUtils import queryHLTPrescaleTableRun2
+            res = queryHLTPrescaleTableRun2(options.db,options.hltpsk,smk)        
+
+        from collections import defaultdict, OrderedDict
+        d = defaultdict(lambda : list())
+
+        for e in res:
+            d[(int(e[1]),e[0])] += [ (e[2],e[4]) ]
+
+        # building json structure
+        prescaleSet = []
+        for (chainID, chainName),prescales in sorted(d.items()):
+            entry = OrderedDict()
+            entry['chainId'] = chainID
+            entry['chainName'] =chainName
+            entry.update(prescales)
+            prescaleSet.append( entry )
+
+        # saving to file
+        import json
+        filename = "HLTPrescales_smk%i_psk%i.json" % (smk, options.hltpsk)
+        FH = open(filename, "w")
+        json.dump(prescaleSet, FH, indent=4, separators=(',', ': '))
+        FH.close()
+        print "Wrote file %s" % filename
+
+    if options.l1psk:
+        with Silence(options.verbose): # suppress all the output from loading the athena modules
+            from TrigConfigSvc.TrigConfigSvcUtils import queryHLTPrescaleTableRun2
+            res = queryHLTPrescaleTableRun2(options.db,options.hltpsk,smk)        
+
+        from collections import defaultdict, OrderedDict
+        d = defaultdict(lambda : list())
+
+        for e in res:
+            d[(int(e[1]),e[0])] += [ (e[2],e[4]) ]
+
+        # building json structure
+        prescaleSet = []
+        for (chainID, chainName),prescales in sorted(d.items()):
+            entry = OrderedDict()
+            entry['chainId'] = chainID
+            entry['chainName'] =chainName
+            entry.update(prescales)
+            prescaleSet.append( entry )
+
+        # saving to file
+        import json
+        filename = "HLTPrescales_smk%i_psk%i.json" % (smk, options.hltpsk)
+        FH = open(filename, "w")
+        json.dump(prescaleSet, FH, indent=4, separators=(',', ': '))
+        FH.close()
+        print "Wrote file %s" % filename
+
+
+
+
+if __name__=="__main__":
+    sys.exit(main())
+        
diff --git a/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuXML2JSONConverter.py b/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuXML2JSONConverter.py
new file mode 100755
index 00000000000..3355f1c27db
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/scripts/TriggerMenuXML2JSONConverter.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+import sys
+
+def main():
+    if len(sys.argv)<=1:
+        print "please use this format:"
+        print "%s inputfile.xml [outputfile.json]   ... menu file conversion" % sys.argv[0].rsplit('/')[-1]
+        print "%s inputfile.json                    ... json conformity check of any json file" % sys.argv[0].rsplit('/')[-1]
+        return 1
+
+    inputfile = sys.argv[1]
+    outputfile = sys.argv[2] if len(sys.argv)>2 else None
+    
+    from TrigConfIO.MenuXML2JSONConverter import XML2JsonConverter
+    converter = XML2JsonConverter()
+
+    if inputfile.endswith(".xml"):
+        converter.convertFile( inputfile, outputfile )
+    elif inputfile.endswith(".json"):
+        converter.checkJsonConformity( inputfile )
+
+if __name__=="__main__":
+    sys.exit(main())
diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileLoader.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileLoader.cxx
new file mode 100644
index 00000000000..77383a89e42
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileLoader.cxx
@@ -0,0 +1,106 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfIO/JsonFileLoader.h"
+#include "PathResolver/PathResolver.h"
+
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
+#include <sys/stat.h>
+#include <filesystem>
+
+using ptree = boost::property_tree::ptree;
+
+
+TrigConf::JsonFileLoader::JsonFileLoader() : 
+   TrigConfMessaging( "JsonFileLoader")
+{}
+
+TrigConf::JsonFileLoader::~JsonFileLoader()
+{}
+
+StatusCode
+TrigConf::JsonFileLoader::loadFile( const std::string & filename,
+                                    boost::property_tree::ptree & data,
+                                    const std::string & pathToChild )
+{
+
+   /*
+    * resolution of the file location happens in three steps
+    1) ckeck if file exists under the absolute or relative path location
+    2) if not and the path is not an absolute one, use the DATAPATH
+   */
+
+   std::string file=""; // resolved file name
+   struct stat buffer;   
+   bool existsAsSpecified = (stat (filename.c_str(), &buffer) == 0); 
+
+
+   if( existsAsSpecified ) {
+      file = filename;
+   } else {
+      if (filename.find("/")==0) { // absolute location
+         TRG_MSG_WARNING("Can not find file with absolute location " << filename);
+         return StatusCode::RECOVERABLE;
+      } else {
+         // check if environment DATAPATH exists
+         PathResolver::SearchPathStatus pathStatus = PathResolver::check_search_path ("DATAPATH");
+         if ( pathStatus == PathResolver::EnvironmentVariableUndefined ) {
+            TRG_MSG_WARNING("Path environment $DATAPATH has not been defined");
+            return StatusCode::RECOVERABLE;
+         }
+         
+         // resolve absolute location
+         file = PathResolver::find_file (filename, "DATAPATH");   
+         if ( file == "" ) {
+            TRG_MSG_WARNING("Did not find file " << filename << " in $DATAPATH");
+            return StatusCode::RECOVERABLE;
+         }
+      }
+   }
+
+   TRG_MSG_INFO("Reading information from " << file);
+
+   // Load the json file
+   try {
+      boost::property_tree::read_json(file, data);
+   }
+   catch (const boost::property_tree::json_parser_error& e) {
+      TRG_MSG_WARNING("Could either not locate or parse the file " << file);
+      return StatusCode::RECOVERABLE; 
+   }
+
+   if( ! pathToChild.empty() ) {
+      // the user has specified that s/he wants to access a certain part of the file
+      // the pathToChild is specified like this "a.b.c"
+      boost::optional<ptree&> subtree = data.get_child_optional(pathToChild);
+      if(subtree) {
+         data = *subtree;
+      } else {
+         TRG_MSG_WARNING("Did not find element '" << pathToChild << "' in the file " << file);
+         data.clear();
+      }
+   }
+
+   return StatusCode::SUCCESS;
+}
+
+
+StatusCode
+TrigConf::JsonFileLoader::loadFile( const std::string & filename,
+                                    DataStructure & data,
+                                    const std::string & pathToChild )
+{
+   boost::property_tree::ptree pt;
+
+   StatusCode sc = this -> loadFile( filename, pt, pathToChild);
+
+   if(!sc.isSuccess())
+      return sc;
+
+   data.setData(pt);
+
+   return StatusCode::SUCCESS;
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/test/data/HLTconfig_Physics_pp_v7.json b/Trigger/TrigConfiguration/TrigConfIO/test/data/HLTconfig_Physics_pp_v7.json
new file mode 100644
index 00000000000..6c649e0cf63
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/test/data/HLTconfig_Physics_pp_v7.json
@@ -0,0 +1,59 @@
+{
+    "name": "Physics_pp_v7",
+    "chains": [
+        {
+            "counter": 1,
+            "name": "HLT_e26_lhtight_idperf",
+            "l1item": "L1_EM22VHI",
+            "streams": [
+                {
+                    "obeyLB": "yes",
+                    "prescale": "1",
+                    "name": "Main",
+                    "type": "physics"
+                }
+            ],
+            "groups": [
+                {
+                    "name": "RATE:IDMonitoring"
+                },
+                {
+                    "name": "BW:Egamma"
+                },
+                {
+                    "name": "BW:ID"
+                }
+            ]
+        },
+        {
+            "counter": 2,
+            "name": "HLT_e28_lhtight_idperf",
+            "l1item": "L1_EM24VHI",
+            "streams": [
+                {
+                    "obeyLB": "yes",
+                    "prescale": "1",
+                    "name": "Main",
+                    "type": "physics"
+                },
+                {
+                    "obeyLB": "yes",
+                    "prescale": "1",
+                    "name": "express",
+                    "type": "express"
+                }
+            ],
+            "groups": [
+                {
+                    "name": "RATE:IDMonitoring"
+                },
+                {
+                    "name": "BW:Egamma"
+                },
+                {
+                    "name": "BW:ID"
+                }
+            ]
+        }
+    ]
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/test/data/L1Topoconfig_Physics_pp_v7.json b/Trigger/TrigConfiguration/TrigConfIO/test/data/L1Topoconfig_Physics_pp_v7.json
new file mode 100644
index 00000000000..2e0cc8f240d
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/test/data/L1Topoconfig_Physics_pp_v7.json
@@ -0,0 +1,609 @@
+{
+    "name": "Topo_pp_vX",
+    "version": "1",
+    "outputs": [
+        {
+            "algName": "INVM_AJ_HighMass",
+            "algId": 0,
+            "clock": 0,
+            "firstBit": 0,
+            "fpga": 0,
+            "board": 0,
+            "triggerLines": "900INVM9999-AJ30s6-AJ20s6,800INVM9999-AJ30s6-AJ20s6,700INVM9999-AJ30s6-AJ20s6,500INVM9999-AJ30s6-AJ20s6"
+        },
+        {
+            "algName": "INVM_AJ_LowMass",
+            "algId": 1,
+            "clock": 0,
+            "firstBit": 4,
+            "fpga": 0,
+            "board": 0,
+            "triggerLines": "400INVM9999-AJ30s6-AJ20s6,300INVM9999-AJ30s6-AJ20s6,200INVM9999-AJ30s6-AJ20s6,100INVM9999-AJ30s6-AJ20s6"
+        },
+        {
+            "algName": "INVM_NFF",
+            "algId": 93,
+            "clock": 1,
+            "firstBit": 12,
+            "fpga": 1,
+            "board": 0,
+            "triggerLines": "600INVM9999-J30s6-AJ20s6,500INVM9999-J30s6-AJ20s6,400INVM9999-J30s6-AJ20s6,200INVM9999-J30s6-AJ20s6"
+        }     
+    ],
+    "TopoConfig": {},
+    "sortingAlgorithms": [
+        {
+            "algId": 15,
+            "name": "AJs",
+            "output": "AJs",
+            "type": "JetSort",
+            "fixedParameters": {
+                "inputs": [
+                    {
+                        "name": "JetTobArray",
+                        "value": "JetTobArray"
+                    }
+                ],
+                "outputs": {
+                    "name": "TobArrayOut",
+                    "value": "AJs"
+                },
+                "generics": [
+                    {
+                        "name": "InputWidth",
+                        "value": ":InputWidthJET:"
+                    },
+                    {
+                        "name": "InputWidth1stStage",
+                        "value": ":InputWidth1stStageSortJET:"
+                    },
+                    {
+                        "name": "OutputWidth",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "JetSize",
+                        "value": "2"
+                    },
+                    {
+                        "name": "DoEtaCut",
+                        "value": "0"
+                    }
+                ]
+            },
+            "variableParameters": {
+                "parameters": [
+                    {
+                        "name": "MinEta",
+                        "pos": 0,
+                        "value": 0
+                    },
+                    {
+                        "name": "MaxEta",
+                        "pos": 1,
+                        "value": 49
+                    }
+                ]
+            }
+        },
+        {
+            "algId": 17,
+            "name": "Js",
+            "output": "Js",
+            "type": "JetSort",
+            "fixedParameters": {
+                "inputs": [
+                    {
+                        "name": "JetTobArray",
+                        "value": "JetTobArray"
+                    }
+                ],
+                "outputs": {
+                    "name": "TobArrayOut",
+                    "value": "Js"
+                },
+                "generics": [
+                    {
+                        "name": "InputWidth",
+                        "value": ":InputWidthJET:"
+                    },
+                    {
+                        "name": "InputWidth1stStage",
+                        "value": ":InputWidth1stStageSortJET:"
+                    },
+                    {
+                        "name": "OutputWidth",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "JetSize",
+                        "value": "2"
+                    },
+                    {
+                        "name": "DoEtaCut",
+                        "value": "1"
+                    }
+                ]
+            },
+            "variableParameters": {
+                "parameters": [
+                    {
+                        "name": "MinEta",
+                        "pos": 0,
+                        "value": 0
+                    },
+                    {
+                        "name": "MaxEta",
+                        "pos": 1,
+                        "value": 31
+                    }
+                ]
+            }
+        }
+    ],
+    "decisionAlgorithms": [
+        {
+            "algId": 0,
+            "name": "INVM_AJ_HighMass",
+            "type": "InvariantMassInclusive1",
+            "fixedParameters": {
+                "inputs": [
+                    {
+                        "name": "Tob",
+                        "position": 0,
+                        "value": "AJs"
+                    }
+                ],
+                "outputs": {
+                    "bits": 4,
+                    "name": "Results",
+                    "Bit": [
+                        {
+                            "name": "900INVM9999-AJ30s6-AJ20s6",
+                            "selection": 0
+                        },
+                        {
+                            "name": "800INVM9999-AJ30s6-AJ20s6",
+                            "selection": 1
+                        },
+                        {
+                            "name": "700INVM9999-AJ30s6-AJ20s6",
+                            "selection": 2
+                        },
+                        {
+                            "name": "500INVM9999-AJ30s6-AJ20s6",
+                            "selection": 3
+                        }
+                    ]
+                },
+                "generics": [
+                    {
+                        "name": "InputWidth",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "MaxTob",
+                        "value": "6"
+                    },
+                    {
+                        "name": "NumResultBits",
+                        "value": "4"
+                    }
+                ]
+            },
+            "variableParameters": {
+                "parameters": [
+                    {
+                        "name": "MinET1",
+                        "pos": 0,
+                        "selection": "0",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 1,
+                        "selection": "0",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 2,
+                        "selection": "0",
+                        "value": 810000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 3,
+                        "selection": "0",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 4,
+                        "selection": "1",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 5,
+                        "selection": "1",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 6,
+                        "selection": "1",
+                        "value": 640000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 7,
+                        "selection": "1",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 8,
+                        "selection": "2",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 9,
+                        "selection": "2",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 10,
+                        "selection": "2",
+                        "value": 490000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 11,
+                        "selection": "2",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 12,
+                        "selection": "3",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 13,
+                        "selection": "3",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 14,
+                        "selection": "3",
+                        "value": 250000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 15,
+                        "selection": "3",
+                        "value": 99980001
+                    }
+                ]
+            }
+        },
+        {
+            "algId": 1,
+            "name": "INVM_AJ_LowMass",
+            "type": "InvariantMassInclusive1",
+            "fixedParameters": {
+                "inputs": [
+                    {
+                        "name": "Tob",
+                        "position": 0,
+                        "value": "AJs"
+                    }
+                ],
+                "outputs": {
+                    "bits": 4,
+                    "name": "Results",
+                    "Bit": [
+                        {
+                            "name": "400INVM9999-AJ30s6-AJ20s6",
+                            "selection": 0
+                        },
+                        {
+                            "name": "300INVM9999-AJ30s6-AJ20s6",
+                            "selection": 1
+                        },
+                        {
+                            "name": "200INVM9999-AJ30s6-AJ20s6",
+                            "selection": 2
+                        },
+                        {
+                            "name": "100INVM9999-AJ30s6-AJ20s6",
+                            "selection": 3
+                        }
+                    ]
+                },
+                "generics": [
+                    {
+                        "name": "InputWidth",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "MaxTob",
+                        "value": "6"
+                    },
+                    {
+                        "name": "NumResultBits",
+                        "value": "4"
+                    }
+                ]
+            },
+            "variableParameters": {
+                "parameters": [
+                    {
+                        "name": "MinET1",
+                        "pos": 0,
+                        "selection": "0",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 1,
+                        "selection": "0",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 2,
+                        "selection": "0",
+                        "value": 160000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 3,
+                        "selection": "0",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 4,
+                        "selection": "1",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 5,
+                        "selection": "1",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 6,
+                        "selection": "1",
+                        "value": 90000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 7,
+                        "selection": "1",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 8,
+                        "selection": "2",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 9,
+                        "selection": "2",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 10,
+                        "selection": "2",
+                        "value": 40000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 11,
+                        "selection": "2",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 12,
+                        "selection": "3",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 13,
+                        "selection": "3",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 14,
+                        "selection": "3",
+                        "value": 10000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 15,
+                        "selection": "3",
+                        "value": 99980001
+                    }
+                ]
+            }
+        },
+        {
+            "algId": 93,
+            "name": "INVM_NFF",
+            "type": "InvariantMassInclusive2",
+            "fixedParameters": {
+                "inputs": [
+                    {
+                        "name": "Tob1",
+                        "position": 0,
+                        "value": "Js"
+                    },
+                    {
+                        "name": "Tob2",
+                        "position": 1,
+                        "value": "AJs"
+                    }
+                ],
+                "outputs": {
+                    "bits": 4,
+                    "name": "Results",
+                    "Bit": [
+                        {
+                            "name": "600INVM9999-J30s6-AJ20s6",
+                            "selection": 0
+                        },
+                        {
+                            "name": "500INVM9999-J30s6-AJ20s6",
+                            "selection": 1
+                        },
+                        {
+                            "name": "400INVM9999-J30s6-AJ20s6",
+                            "selection": 2
+                        },
+                        {
+                            "name": "200INVM9999-J30s6-AJ20s6",
+                            "selection": 3
+                        }
+                    ]
+                },
+                "generics": [
+                    {
+                        "name": "InputWidth1",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "InputWidth2",
+                        "value": ":OutputWidthSortJET:"
+                    },
+                    {
+                        "name": "MaxTob1",
+                        "value": "6"
+                    },
+                    {
+                        "name": "MaxTob2",
+                        "value": "6"
+                    },
+                    {
+                        "name": "NumResultBits",
+                        "value": "4"
+                    }
+                ]
+            },
+            "variableParameters": {
+                "parameters": [
+                    {
+                        "name": "MinET1",
+                        "pos": 0,
+                        "selection": "0",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 1,
+                        "selection": "0",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 2,
+                        "selection": "0",
+                        "value": 360000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 3,
+                        "selection": "0",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 4,
+                        "selection": "1",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 5,
+                        "selection": "1",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 6,
+                        "selection": "1",
+                        "value": 250000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 7,
+                        "selection": "1",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 8,
+                        "selection": "2",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 9,
+                        "selection": "2",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 10,
+                        "selection": "2",
+                        "value": 160000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 11,
+                        "selection": "2",
+                        "value": 99980001
+                    },
+                    {
+                        "name": "MinET1",
+                        "pos": 12,
+                        "selection": "3",
+                        "value": 30
+                    },
+                    {
+                        "name": "MinET2",
+                        "pos": 13,
+                        "selection": "3",
+                        "value": 20
+                    },
+                    {
+                        "name": "MinMSqr",
+                        "pos": 14,
+                        "selection": "3",
+                        "value": 40000
+                    },
+                    {
+                        "name": "MaxMSqr",
+                        "pos": 15,
+                        "selection": "3",
+                        "value": 99980001
+                    }
+                ]
+            }
+        }	
+    ]
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/test/data/LVL1config_Physics_pp_v7.json b/Trigger/TrigConfiguration/TrigConfIO/test/data/LVL1config_Physics_pp_v7.json
new file mode 100644
index 00000000000..ea0c1fea94e
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/test/data/LVL1config_Physics_pp_v7.json
@@ -0,0 +1,839 @@
+{
+    "ctpVersion": 4,
+    "version": 1,
+    "name": "Physics_pp_v7",
+    "menu": {
+        "name": "Physics_pp_v7",
+        "phase": "lumi",
+        "items": [
+            {
+                "complexDeadtime": 0,
+                "ctpId": 11,
+                "definition": "(EM22VHI[x1]&BGRP0&BGRP1)",
+                "monitor": "LF:111|HF:000",
+                "name": "L1_EM22VHI",
+                "partition": 1,
+                "triggerType": "10000100",
+                "AND": [
+                    {
+                        "TriggerCondition": {
+                            "multi": 1,
+                            "name": "EM22VHI_x1",
+                            "triggerThreshold": "EM22VHI"
+                        }
+                    },
+                    {
+                        "InternalTrigger": {
+                            "name": "BGRP0"
+                        }
+                    },
+                    {
+                        "InternalTrigger": {
+                            "name": "BGRP1"
+                        }
+                    }
+                ]
+            },
+            {
+                "complexDeadtime": 0,
+                "ctpId": 392,
+                "definition": "(EM24VHI[x1]&BGRP0&BGRP1)",
+                "monitor": "LF:111|HF:000",
+                "name": "L1_EM24VHI",
+                "partition": 1,
+                "triggerType": "10000100",
+                "AND": [
+                    {
+                        "TriggerCondition": {
+                            "multi": 1,
+                            "name": "EM24VHI_x1",
+                            "triggerThreshold": "EM24VHI"
+                        }
+                    },
+                    {
+                        "InternalTrigger": {
+                            "name": "BGRP0"
+                        }
+                    },
+                    {
+                        "InternalTrigger": {
+                            "name": "BGRP1"
+                        }
+                    }
+                ]
+            }
+        ]
+    },
+    "thresholds": [
+        {
+            "active": 1,
+            "bitnum": 3,
+            "id": 63,
+            "input": "ctpin",
+            "mapping": 13,
+            "name": "EM22VHI",
+            "type": "EM",
+            "version": 1,
+            "thresholdValues": [
+                {
+                    "em_isolation": 63,
+                    "etamax": 49,
+                    "etamin": -49,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 1,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -17,
+                    "etamin": -25,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -15,
+                    "etamin": -17,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -14,
+                    "etamin": -15,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 19,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -13,
+                    "etamin": -14,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 20,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -11,
+                    "etamin": -13,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -8,
+                    "etamin": -11,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 22,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -7,
+                    "etamin": -8,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 0,
+                    "etamin": -7,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 7,
+                    "etamin": 0,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 8,
+                    "etamin": 7,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 11,
+                    "etamin": 8,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 22,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 13,
+                    "etamin": 11,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 14,
+                    "etamin": 13,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 20,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 15,
+                    "etamin": 14,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 19,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 17,
+                    "etamin": 15,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 25,
+                    "etamin": 17,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM22VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                }
+            ],
+            "cable": {
+                "connector": "CON1",
+                "input": "SLOT7",
+                "name": "EM2",
+                "signal": {
+                    "rangeBegin": 15,
+                    "rangeEnd": 17
+                }
+            }
+        },
+        {
+            "active": 1,
+            "bitnum": 3,
+            "id": 64,
+            "input": "ctpin",
+            "mapping": 14,
+            "name": "EM24VHI",
+            "type": "EM",
+            "version": 1,
+            "thresholdValues": [
+                {
+                    "em_isolation": 63,
+                    "etamax": 49,
+                    "etamin": -49,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 1,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -17,
+                    "etamin": -25,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 25,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -15,
+                    "etamin": -17,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -14,
+                    "etamin": -15,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -13,
+                    "etamin": -14,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 22,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -11,
+                    "etamin": -13,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -8,
+                    "etamin": -11,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": -7,
+                    "etamin": -8,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 25,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 0,
+                    "etamin": -7,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 26,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 7,
+                    "etamin": 0,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 26,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 8,
+                    "etamin": 7,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 25,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 11,
+                    "etamin": 8,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 24,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 13,
+                    "etamin": 11,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 14,
+                    "etamin": 13,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 22,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 15,
+                    "etamin": 14,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 21,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 17,
+                    "etamin": 15,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 23,
+                    "type": "EM",
+                    "window": 0
+                },
+                {
+                    "em_isolation": 63,
+                    "etamax": 25,
+                    "etamin": 17,
+                    "had_isolation": 63,
+                    "had_veto": 99,
+                    "isobits": "00100",
+                    "name": "EM24VHIfull",
+                    "phimax": 64,
+                    "phimin": 0,
+                    "priority": 2,
+                    "thresholdval": 25,
+                    "type": "EM",
+                    "window": 0
+                }
+            ],
+            "cable": {
+                "connector": "CON1",
+                "input": "SLOT7",
+                "name": "EM2",
+                "signal": {
+                    "rangeBegin": 18,
+                    "rangeEnd": 20
+                }
+            }
+        }
+    ],
+    "CaloInfo": {
+        "global_em_scale": 2,
+        "global_jet_scale": 1,
+        "name": "CaloInfo",
+        "METSignificance": {
+            "teSqrtMax": 63,
+            "teSqrtMin": 4,
+            "xeMax": 63,
+            "xeMin": 11,
+            "xsSigmaOffset": 1640,
+            "xsSigmaScale": 1150
+        },
+        "Isolation": [
+            {
+                "thrtype": "HAIsoForEMthr",
+                "Parametrization": [
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 1,
+                        "mincut": 10,
+                        "offset": -2,
+                        "priority": 0,
+                        "slope": 230,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 2,
+                        "mincut": 0,
+                        "offset": 0,
+                        "priority": 0,
+                        "slope": 0,
+                        "upperlimit": 0
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 3,
+                        "mincut": 10,
+                        "offset": -2,
+                        "priority": 0,
+                        "slope": 230,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 4,
+                        "mincut": 10,
+                        "offset": -2,
+                        "priority": 0,
+                        "slope": 230,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 5,
+                        "mincut": 10,
+                        "offset": -2,
+                        "priority": 0,
+                        "slope": 230,
+                        "upperlimit": 50
+                    }
+                ]
+            },
+            {
+                "thrtype": "EMIsoForEMthr",
+                "Parametrization": [
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 1,
+                        "mincut": 0,
+                        "offset": 0,
+                        "priority": 0,
+                        "slope": 0,
+                        "upperlimit": 0
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 2,
+                        "mincut": 20,
+                        "offset": -18,
+                        "priority": 0,
+                        "slope": 80,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 3,
+                        "mincut": 20,
+                        "offset": -18,
+                        "priority": 0,
+                        "slope": 80,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 4,
+                        "mincut": 10,
+                        "offset": -20,
+                        "priority": 0,
+                        "slope": 80,
+                        "upperlimit": 50
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 5,
+                        "mincut": 15,
+                        "offset": -18,
+                        "priority": 0,
+                        "slope": 80,
+                        "upperlimit": 50
+                    }
+                ]
+            },
+            {
+                "thrtype": "EMIsoForTAUthr",
+                "Parametrization": [
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 1,
+                        "mincut": 0,
+                        "offset": 30,
+                        "priority": 0,
+                        "slope": 100,
+                        "upperlimit": 60
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 2,
+                        "mincut": 0,
+                        "offset": 20,
+                        "priority": 0,
+                        "slope": 100,
+                        "upperlimit": 60
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 3,
+                        "mincut": 0,
+                        "offset": 15,
+                        "priority": 0,
+                        "slope": 100,
+                        "upperlimit": 60
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 4,
+                        "mincut": 0,
+                        "offset": 40,
+                        "priority": 0,
+                        "slope": 0,
+                        "upperlimit": 124
+                    },
+                    {
+                        "etamax": 49,
+                        "etamin": -49,
+                        "isobit": 5,
+                        "mincut": 0,
+                        "offset": 30,
+                        "priority": 0,
+                        "slope": 100,
+                        "upperlimit": 60
+                    }
+                ]
+            }
+        ],
+        "MinimumTOBPt": [
+            {
+                "etamax": 49,
+                "etamin": -49,
+                "priority": 0,
+                "ptmin": 3,
+                "thrtype": "EM"
+            },
+            {
+                "etamax": 49,
+                "etamin": -49,
+                "priority": 0,
+                "ptmin": 8,
+                "thrtype": "TAU"
+            },
+            {
+                "etamax": 49,
+                "etamin": -49,
+                "priority": 0,
+                "ptmin": 12,
+                "thrtype": "JETS",
+                "window": 4
+            },
+            {
+                "etamax": 49,
+                "etamin": -49,
+                "priority": 0,
+                "ptmin": 12,
+                "thrtype": "JETL",
+                "window": 8
+            }
+        ]
+    },
+    "MuctpiInfo": {
+        "high_pt": 1,
+        "low_pt": 1,
+        "max_cand": 13,
+        "name": "muctpi"
+    }
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/test/read_config_info.cxx b/Trigger/TrigConfiguration/TrigConfIO/test/read_config_info.cxx
new file mode 100644
index 00000000000..47ebf4e8114
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/test/read_config_info.cxx
@@ -0,0 +1,130 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfIO/JsonFileLoader.h"
+
+#include "TrigConfData/L1TopoMenu.h"
+#include "TrigConfData/L1Menu.h"
+#include "TrigConfData/HLTMenu.h"
+
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+using namespace std;
+
+bool testSize( const TrigConf::L1TopoMenu & l1topo, uint l1toposize,
+               const TrigConf::L1Menu & l1, uint l1size,
+               const TrigConf::HLTMenu & hlt, uint hltsize )
+{
+   return 
+      ( l1topo.size() == l1toposize ) &&
+      ( l1.size() == l1size ) &&
+      ( hlt.size() == hltsize );
+}
+
+int main() {
+   
+   string testfilepath = string(getenv("TESTFILEPATH")) + "/"; 
+   
+   const string l1topofn = testfilepath + "L1Topoconfig_Physics_pp_v7.json";
+   const string l1fn     = testfilepath + "LVL1config_Physics_pp_v7.json";
+   const string hltfn    = testfilepath + "HLTconfig_Physics_pp_v7.json";
+   TrigConf::JsonFileLoader fileLoader;
+   fileLoader.setLevel(TrigConf::MSGTC::WARNING); 
+   
+   TrigConf::L1TopoMenu l1topomenu;
+   TrigConf::L1Menu l1menu;
+   TrigConf::HLTMenu hltmenu;
+   bool loadTestL1Topo = fileLoader.loadFile( l1topofn, l1topomenu ).isSuccess();
+   cout << "Test loading of L1Topo file      ... " << ( loadTestL1Topo ? "passed" : "failed" ) << endl;
+
+   bool loadTestL1 = fileLoader.loadFile( l1fn, l1menu ).isSuccess();
+   cout << "Test loading of L1 file          ... " << ( loadTestL1 ? "passed" : "failed" ) << endl;
+
+   bool loadTestHLT = fileLoader.loadFile( hltfn, hltmenu ).isSuccess();
+   cout << "Test loading of HLT file         ... " << ( loadTestHLT ? "passed" : "failed" ) << endl;
+   
+   if ( ( loadTestL1Topo && loadTestL1 && loadTestHLT ) == false ) return 1; // can't not continue with the other tests
+
+   bool allSucceeded = true;
+
+   bool sizeTest = testSize( l1topomenu, 3, l1menu, 2, hltmenu, 2);
+   if (l1menu.thresholds().size() != 2)
+      sizeTest = false;
+   if ( ! sizeTest ) allSucceeded = false;
+   cout << "Test size of menus               ... " << ( sizeTest ? "passed" : "failed" ) << endl;
+
+
+   bool itemAccessTest = true;
+   for(const auto & item : l1menu ) {
+      item.name(); item.ctpId(); item.definition(); item.triggerType();
+   }
+   for(const auto & thr : l1menu.thresholds() ) {
+      try {
+         thr.thresholdValues();
+         thr.name(); thr.type(); thr.mapping();
+         if( const auto & cable = thr.cable() ) {
+            cable["input"]; cable["connector"];
+         }
+      }
+      catch(...) {
+         itemAccessTest = false;
+      }
+   }
+   if ( ! itemAccessTest ) allSucceeded = false;
+   cout << "Test access of items             ... " << ( itemAccessTest ? "passed" : "failed" ) << endl;
+
+
+
+   bool chainAccessTest = true;
+   for( auto & ch : hltmenu ) {
+      ch.name();
+      ch.counter();
+      ch.l1item();
+      for( auto & s : ch.streams() ) {
+         try {
+            s["type"];
+            s["name"];
+            s["obeyLB"];
+            s["prescale"];
+         }
+         catch(...) {
+            chainAccessTest = false;
+         }
+      }
+      std::string g1(""),g2("");
+      for( auto & g : ch.groups() ) {
+         g1 += g;
+      }
+      for( auto & g : ch.getList("groups") ) {
+         g2 += g["name"];
+      }
+      if(g1 != g2)
+         chainAccessTest = false;
+   }
+      
+   if ( ! chainAccessTest ) allSucceeded = false;
+   cout << "Test access of chains            ... " << ( chainAccessTest ? "passed" : "failed" ) << endl;
+
+
+
+
+
+   /* this will be implemented later
+   const std::string fn1{"testout_boostWriter.json"};
+   const std::string fn2{"testout_manualWriter.json"};
+
+   boost::property_tree::write_json( fn1, menu.data() );
+   
+   std::ofstream of2;
+   of2.open(fn2);
+   menu.print(of2);
+   of2.close();
+
+   menu.print();
+   */
+
+   return allSucceeded ? 0 : 1;
+
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/test/testTriggerConfigAccess.sh b/Trigger/TrigConfiguration/TrigConfIO/test/testTriggerConfigAccess.sh
new file mode 100755
index 00000000000..2fa7ed3514e
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/test/testTriggerConfigAccess.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/bash
+
+printenv | grep TESTFILE
+
+echo "$1"
+
+exit 1
diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx
new file mode 100644
index 00000000000..9a487a83ccb
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx
@@ -0,0 +1,179 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfIO/JsonFileLoader.h"
+#include "TrigConfData/HLTMenu.h"
+#include "TrigConfData/L1Menu.h"
+#include "TrigConfData/L1TopoMenu.h"
+
+#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/json_parser.hpp>
+
+using namespace std;
+
+int main(int /*argc*/, char** /*argv*/) {
+
+   // HLT menu test file
+   const std::string l1topo_filename = "TrigConfIO/L1Topoconfig_Physics_pp_v7_21.1.40.json";
+   const std::string l1_filename = "TrigConfIO/LVL1config_Physics_pp_v7_21.1.40.json";
+   const std::string hlt_filename = "TrigConfIO/HLTconfig_Physics_pp_v7_21.1.40.json";
+
+   // file loader
+   TrigConf::JsonFileLoader fileLoader;
+
+   cout << "===========================" << endl
+        << "=====                 =====" << endl
+        << "===== Test HLT access =====" << endl
+        << "=====                 =====" << endl
+        << "===========================" << endl << endl;
+
+  
+   // HLT
+   TrigConf::HLTMenu hltmenu;
+   fileLoader.loadFile( hlt_filename, hltmenu);
+      
+   cout << "Loaded the menu " << hltmenu.name() << endl;
+   cout << "Menu has " << hltmenu.size() << " chains, going to print the first 3." << endl;
+   int np = 3;
+   for( auto & ch : hltmenu ) {
+      cout << endl << "Chain '" << ch.name() << "' with counter " << ch["counter"] << " and seeded by " << ch["l1item"] << endl;
+      cout << "has the following streams:" << endl;
+      for( auto & s : ch.streams() ) {
+         cout << "  " << s["type"] << "_" << s["name"] 
+              << (s["obeyLB"]=="yes" ? " (obeys LB" : " (does not obey LB") << " and has prescale " << s["prescale"] << ")" << endl;
+      }
+      cout << "and groups: ";
+      for( auto & g : ch.groups() ) {
+         cout << " " << g;
+      }
+      cout << endl;
+      cout << "for comparison generic access to groups: ";
+      for( auto & g : ch.getList("groups") ) {
+         cout << " " << g["name"];
+      }
+      cout << endl;
+      if(--np==0) break;
+   }
+  
+   // LVL1
+   cout << endl
+        << "==========================" << endl
+        << "=====                =====" << endl
+        << "===== Test L1 access =====" << endl
+        << "=====                =====" << endl
+        << "==========================" << endl << endl;
+
+   TrigConf::L1Menu l1menu;
+   fileLoader.loadFile( l1_filename, l1menu);
+   cout << "Loaded the L1 menu " << l1menu.name() << endl;
+
+   // items
+   cout << endl << "L1 menu has " << l1menu.size() << " items, going to print only the first." << endl;
+   int ni = 1; // print only first 1
+   for(const auto & item : l1menu ) {
+      cout << endl << item.name() << "(ctpId " << item.ctpId() << ") has definition '" << item.definition() << "' and triggerType " << item.triggerType()<< endl;
+      cout << "Full printout:" << endl;
+      item.print();
+      if(--ni==0) break;
+   }
+
+   // thresholds
+   cout << endl << "L1 menu has " << l1menu.thresholds().size() << " thresholds, going to print only the first." << endl;
+   ni = 1; // print only first 1
+   for(const auto & thr : l1menu.thresholds() ) {
+      const auto & thrValues = thr.thresholdValues();
+      cout << endl << thr.name() << " of type " << thr.type() << " (mapping " << thr.mapping() << ") has " << thrValues.size() << " thresholdValues. Cabling info:" << endl;
+      if( const auto & cable = thr.cable() ) {
+         cout << "Cabling info: " << cable["input"] << " " << cable["connector"] << endl;
+      } else {
+         cout << "No cabling info available for this threshold" << endl;
+      }
+      if(--ni==0) break;
+   }
+   
+
+
+   cout << endl
+        << "=====" << endl
+        << "===== Test access to sub config" << endl
+        << "=====" << endl << endl;
+
+   // CaloInfo, etc
+   cout << "Loading CaloInfo.MuctpiInfo" << endl;
+   TrigConf::DataStructure muctpiConf;
+   fileLoader.loadFile( l1_filename, muctpiConf, "MuctpiInfo");
+   muctpiConf.print();
+
+   cout << "Loading CaloInfo.METSignificance" << endl;
+   TrigConf::DataStructure metSignificance;
+   fileLoader.loadFile( l1_filename, metSignificance, "CaloInfo.METSignificance");
+   metSignificance.print();
+
+   cout << "Loading CaloInfo" << endl;
+   TrigConf::DataStructure caloInfo;
+   fileLoader.loadFile( l1_filename, caloInfo, "CaloInfo"); // only works when the data that CaloInfo points to is a well-formed
+   boost::property_tree::write_json( "testOutput_CaloInfo.json", caloInfo.data() );
+   cout << "EM scale : " << caloInfo["global_em_scale"] << endl;
+   for( auto & iso : caloInfo.getList("Isolation") ) {
+      cout << iso["thrtype"] << endl;
+      for( auto & par : iso.getList("Parametrization") ) {
+         cout << par["isobit"] << " with slope " << par["slope"] << " and upperlimit " << par["upperlimit"] << endl;
+      }
+   }
+  
+   // L1Topo
+   cout << endl
+        << "==============================" << endl
+        << "=====                    =====" << endl
+        << "===== Test L1Topo access =====" << endl
+        << "=====                    =====" << endl
+        << "==============================" << endl << endl;
+
+   TrigConf::L1TopoMenu l1topomenu;
+   fileLoader.loadFile( l1topo_filename, l1topomenu);
+   cout << "Loaded the L1Topo menu " << l1topomenu.name() << endl;
+
+   // output lines
+   cout << endl << "L1Topo menu has " << l1topomenu.size() << " outputs, going to print the first 5." << endl;
+   ni = 5;
+   for(auto & output : l1topomenu) {
+      cout << "  " << output.algName() << "[" << output.algId() << "] on board " << output.board() << ", fpga " << output.fpga() << " and clock " << output.clock()
+           << " feeds lines " << output.triggerLines() << ", starting at bit " << output.firstBit() << endl; 
+      if(--ni==0) break;
+   }   
+
+   // sorting algorithms
+   const auto & sortAlgs = l1topomenu.getList("sortingAlgorithms"); 
+   cout << endl << "L1Topo menu has " << sortAlgs.size() << " sorting algorithms. Going to print first 2:" << endl;
+   ni=2;
+   for(auto & alg : sortAlgs ) {
+      cout << endl << "Sorting algorithm " << alg["name"] << "[" << alg["algId"] << "] uses inputs" << endl;
+      for( const auto &x : alg.getList("fixedParameters.inputs") ) {
+         cout << "   " << x["name"] << " " << x["value"] << endl;
+      }
+      cout << "and produces output ";
+      const auto & x = alg.getObject("fixedParameters.outputs");
+      cout << alg["fixedParameters.outputs.name"] << " " << x["value"] << endl; // two ways to access name and value
+      if(--ni==0) break;
+   }
+
+   // decision algorithm
+   const auto & decAlgs = l1topomenu.getList("decisionAlgorithms"); 
+   cout << endl << "L1Topo menu has " << decAlgs.size() << " decision algorithms. Going to print first" << endl;
+   ni=1;
+   for(auto & alg : decAlgs ) {
+      cout << endl << "Decision algorithm " << alg["name"] << "[" << alg["algId"] << "] uses inputs" << endl;
+      for( const auto &x : alg.getList("fixedParameters.inputs") ) {
+         cout << "   " << x["name"] << " at " << x["position"] << ": " << x["value"] << endl;
+      }
+      const auto & o = alg.getObject("fixedParameters.outputs");
+      cout << "and produces " << o["bits"] << " outputs:" << endl;
+      for(const auto & b : o.getList("Bit") ) {
+         cout << "  " << b["selection"] << " " << b["name"] << endl;
+      }
+      if(--ni==0) break;
+   }
+
+   return 0;
+}
-- 
GitLab


From f544cbfac676b67f05b6caf98140cc648bb039a1 Mon Sep 17 00:00:00 2001
From: Jack Cranshaw <cranshaw@anl.gov>
Date: Fri, 1 Mar 2019 14:50:47 +0000
Subject: [PATCH 135/404] Move EventStreamInfo, EventFormat, CutBookkeeper, and
 ByteStreamMetadata to use GenericMetadataTool

---
 .../share/AthenaPoolMultiTestCheckOutput.ref  | 488 +++++++++++++++++-
 .../AthenaKernel/GenericMetadataTool.h        |  95 ++++
 .../AthenaKernel/GenericMetadataTool.icc      | 387 ++++++++++++++
 .../AthenaKernel/GenericMetadataToolNoAux.h   |  95 ++++
 .../AthenaKernel/GenericMetadataToolNoAux.icc | 379 ++++++++++++++
 .../AthenaKernel/AthenaKernel/IMetaDataTool.h |   4 +-
 .../AthenaServices/src/AthenaOutputStream.cxx |  54 --
 Control/AthenaServices/src/MetaDataSvc.cxx    |  11 +-
 .../share/AthenaPoolExample_Concat.ref        |  97 +---
 .../share/AthenaPoolExample_Copy.ref          |  24 +-
 .../share/AthenaPoolExample_Filter.ref        |  30 +-
 .../share/AthenaPoolExample_RCond.ref         |  25 +-
 .../share/AthenaPoolExample_RFilter.ref       |  27 +-
 .../share/AthenaPoolExample_RMeta.ref         |  27 +-
 .../share/AthenaPoolExample_ReWrite.ref       |  34 +-
 .../share/AthenaPoolExample_ReWriteAgain.ref  |  36 +-
 .../share/AthenaPoolExample_ReWriteNext.ref   |  34 +-
 .../share/AthenaPoolExample_Read.ref          | 147 +++---
 .../share/AthenaPoolExample_ReadAgain.ref     | 145 +++---
 .../share/AthenaPoolExample_ReadConcat.ref    | 147 +++---
 .../share/AthenaPoolExample_WCond.ref         |  29 +-
 .../share/AthenaPoolExample_WMeta.ref         |  24 +-
 .../share/AthenaPoolExample_Write.ref         |  26 +-
 .../AthenaPOOL/AthenaPoolTools/CMakeLists.txt |   3 +-
 .../share/MetadataTest_jobOptions.py          |  42 +-
 .../AthenaPoolTools/src/MetadataTest.cxx      |  59 ++-
 .../AthenaPoolTools/src/MetadataTest.h        |   6 +-
 .../src/CopyEventStreamInfo.cxx               | 202 ++------
 .../src/CopyEventStreamInfo.h                 |  40 +-
 .../src/IOVDbMetaDataTool.h                   |   3 -
 .../python/ByteStreamConfig.py                |   2 +
 .../ByteStreamCnvSvc/python/ReadByteStream.py |   2 +
 .../src/ByteStreamEventStorageInputSvc.cxx    |   5 +-
 .../src/ByteStreamMetadataTool.cxx            | 156 ++----
 .../src/ByteStreamMetadataTool.h              |  28 +-
 .../src/EventInfoByteStreamCnv.cxx            |   6 +-
 .../ByteStreamMetadataContainer.h             |   7 +
 .../EventBookkeeperTools/BookkeeperTool.h     |  67 +--
 .../Root/BookkeeperTool.cxx                   | 266 +---------
 .../python/CutFlowHelpers.py                  |   7 +-
 Event/EventBookkeeperTools/src/CutFlowSvc.cxx |   2 +-
 .../xAODEventFormat/EventFormat.h             |   6 +
 .../src/EventFormatMetaDataTool.cxx           | 146 +-----
 .../src/EventFormatMetaDataTool.h             |  51 +-
 .../src/FileMetaDataCreatorTool.h             |   3 -
 .../xAODMetaDataCnv/FileMetaDataTool.h        |   3 -
 46 files changed, 2055 insertions(+), 1422 deletions(-)
 create mode 100644 Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
 create mode 100644 Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
 create mode 100644 Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
 create mode 100644 Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestCheckOutput.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestCheckOutput.ref
index b00c829ec72..ce3a5930082 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestCheckOutput.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestCheckOutput.ref
@@ -1,7 +1,491 @@
 ReadData             INFO in initialize()
 EventSelector        INFO reinitialization...
 EventSelector        INFO EventSelection with query 
-EventSelector        INFO No Events found in any Input Collections
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-EventSelector        INFO No Events found in any Input Collections
+AthenaPoolConve...   INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector 
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 0 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1.2 y = -2.3 z = 226.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 4.4 y = -8.0 z = 94.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 7.6 y = -13.7 z = 70.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 10.8 y = -19.3 z = 59.9 detector = DummyHitDetector
+ReadData             INFO Hit x = 14.0 y = -25.0 z = 54.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 17.2 y = -30.7 z = 50.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 20.4 y = -36.4 z = 48.1 detector = DummyHitDetector
+ReadData             INFO Hit x = 23.7 y = -42.0 z = 46.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 26.9 y = -47.7 z = 44.9 detector = DummyHitDetector
+ReadData             INFO Hit x = 30.1 y = -53.4 z = 43.8 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 6 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 601.2 y = -2.3 z = -373.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 604.4 y = -8.0 z = -505.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 607.6 y = -13.7 z = -529.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 610.8 y = -19.3 z = -540.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 614.0 y = -25.0 z = -545.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 617.2 y = -30.7 z = -549.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 620.4 y = -36.4 z = -551.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 623.7 y = -42.0 z = -553.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 626.9 y = -47.7 z = -555.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 630.1 y = -53.4 z = -556.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 9 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 901.2 y = -2.3 z = -673.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 904.4 y = -8.0 z = -805.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 907.6 y = -13.7 z = -829.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 910.8 y = -19.3 z = -840.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 914.0 y = -25.0 z = -845.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 917.2 y = -30.7 z = -849.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 920.4 y = -36.4 z = -851.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 923.7 y = -42.0 z = -853.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 926.9 y = -47.7 z = -855.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 930.1 y = -53.4 z = -856.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 12 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1201.2 y = -2.3 z = -973.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1204.4 y = -8.0 z = -1105.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1207.6 y = -13.7 z = -1129.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1210.8 y = -19.3 z = -1140.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1214.0 y = -25.0 z = -1145.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1217.2 y = -30.7 z = -1149.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1220.4 y = -36.4 z = -1151.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1223.7 y = -42.0 z = -1153.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1226.9 y = -47.7 z = -1155.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1230.1 y = -53.4 z = -1156.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 15 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1501.2 y = -2.3 z = -1273.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1504.4 y = -8.0 z = -1405.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1507.6 y = -13.7 z = -1429.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1510.8 y = -19.3 z = -1440.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1514.0 y = -25.0 z = -1445.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1517.2 y = -30.7 z = -1449.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1520.4 y = -36.4 z = -1451.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1523.7 y = -42.0 z = -1453.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1526.9 y = -47.7 z = -1455.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1530.1 y = -53.4 z = -1456.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 16 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1601.2 y = -2.3 z = -1373.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1604.4 y = -8.0 z = -1505.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1607.6 y = -13.7 z = -1529.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1610.8 y = -19.3 z = -1540.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1614.0 y = -25.0 z = -1545.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1617.2 y = -30.7 z = -1549.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1620.4 y = -36.4 z = -1551.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1623.7 y = -42.0 z = -1553.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1626.9 y = -47.7 z = -1555.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1630.1 y = -53.4 z = -1556.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream1
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 18 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1801.2 y = -2.3 z = -1573.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1804.4 y = -8.0 z = -1705.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1807.6 y = -13.7 z = -1729.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1810.8 y = -19.3 z = -1740.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1814.0 y = -25.0 z = -1745.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1817.2 y = -30.7 z = -1749.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1820.4 y = -36.4 z = -1751.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1823.7 y = -42.0 z = -1753.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1826.9 y = -47.7 z = -1755.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1830.1 y = -53.4 z = -1756.1 detector = DummyHitDetector
+EventSelector        INFO Disconnecting input sourceID: 64AE69C5-92AE-0947-B00E-80138A37EE89
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 1 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 101.2 y = -2.3 z = 126.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 104.4 y = -8.0 z = -5.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 107.6 y = -13.7 z = -29.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 110.8 y = -19.3 z = -40.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 114.0 y = -25.0 z = -45.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 117.2 y = -30.7 z = -49.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 120.4 y = -36.4 z = -51.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 123.7 y = -42.0 z = -53.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 126.9 y = -47.7 z = -55.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 130.1 y = -53.4 z = -56.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 4 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 401.2 y = -2.3 z = -173.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 404.4 y = -8.0 z = -305.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 407.6 y = -13.7 z = -329.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 410.8 y = -19.3 z = -340.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 414.0 y = -25.0 z = -345.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 417.2 y = -30.7 z = -349.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 420.4 y = -36.4 z = -351.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 423.7 y = -42.0 z = -353.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 426.9 y = -47.7 z = -355.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 430.1 y = -53.4 z = -356.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 7 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 701.2 y = -2.3 z = -473.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 704.4 y = -8.0 z = -605.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 707.6 y = -13.7 z = -629.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 710.8 y = -19.3 z = -640.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 714.0 y = -25.0 z = -645.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 717.2 y = -30.7 z = -649.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 720.4 y = -36.4 z = -651.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 723.7 y = -42.0 z = -653.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 726.9 y = -47.7 z = -655.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 730.1 y = -53.4 z = -656.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 10 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1001.2 y = -2.3 z = -773.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1004.4 y = -8.0 z = -905.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1007.6 y = -13.7 z = -929.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1010.8 y = -19.3 z = -940.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1014.0 y = -25.0 z = -945.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1017.2 y = -30.7 z = -949.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1020.4 y = -36.4 z = -951.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1023.7 y = -42.0 z = -953.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1026.9 y = -47.7 z = -955.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1030.1 y = -53.4 z = -956.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 13 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1301.2 y = -2.3 z = -1073.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1304.4 y = -8.0 z = -1205.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1307.6 y = -13.7 z = -1229.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1310.8 y = -19.3 z = -1240.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1314.0 y = -25.0 z = -1245.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1317.2 y = -30.7 z = -1249.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1320.4 y = -36.4 z = -1251.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1323.7 y = -42.0 z = -1253.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1326.9 y = -47.7 z = -1255.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1330.1 y = -53.4 z = -1256.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 17 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1701.2 y = -2.3 z = -1473.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1704.4 y = -8.0 z = -1605.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1707.6 y = -13.7 z = -1629.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1710.8 y = -19.3 z = -1640.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1714.0 y = -25.0 z = -1645.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1717.2 y = -30.7 z = -1649.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1720.4 y = -36.4 z = -1651.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1723.7 y = -42.0 z = -1653.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1726.9 y = -47.7 z = -1655.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1730.1 y = -53.4 z = -1656.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 7
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream2
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 19 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1901.2 y = -2.3 z = -1673.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1904.4 y = -8.0 z = -1805.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1907.6 y = -13.7 z = -1829.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1910.8 y = -19.3 z = -1840.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1914.0 y = -25.0 z = -1845.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1917.2 y = -30.7 z = -1849.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1920.4 y = -36.4 z = -1851.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1923.7 y = -42.0 z = -1853.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1926.9 y = -47.7 z = -1855.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1930.1 y = -53.4 z = -1856.1 detector = DummyHitDetector
+EventSelector        INFO Disconnecting input sourceID: 2C513419-B861-324B-BA1E-7AC5D0466920
+ReadData             INFO EventStreamInfo: Number of events = 5
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream3
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 2 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 201.2 y = -2.3 z = 26.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 204.4 y = -8.0 z = -105.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 207.6 y = -13.7 z = -129.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 210.8 y = -19.3 z = -140.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 214.0 y = -25.0 z = -145.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 217.2 y = -30.7 z = -149.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 220.4 y = -36.4 z = -151.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 223.7 y = -42.0 z = -153.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 226.9 y = -47.7 z = -155.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 230.1 y = -53.4 z = -156.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 5
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream3
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 5 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 501.2 y = -2.3 z = -273.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 504.4 y = -8.0 z = -405.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 507.6 y = -13.7 z = -429.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 510.8 y = -19.3 z = -440.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 514.0 y = -25.0 z = -445.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 517.2 y = -30.7 z = -449.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 520.4 y = -36.4 z = -451.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 523.7 y = -42.0 z = -453.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 526.9 y = -47.7 z = -455.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 530.1 y = -53.4 z = -456.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 5
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream3
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 8 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 801.2 y = -2.3 z = -573.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 804.4 y = -8.0 z = -705.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 807.6 y = -13.7 z = -729.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 810.8 y = -19.3 z = -740.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 814.0 y = -25.0 z = -745.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 817.2 y = -30.7 z = -749.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 820.4 y = -36.4 z = -751.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 823.7 y = -42.0 z = -753.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 826.9 y = -47.7 z = -755.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 830.1 y = -53.4 z = -756.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 5
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream3
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 11 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1101.2 y = -2.3 z = -873.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1104.4 y = -8.0 z = -1005.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1107.6 y = -13.7 z = -1029.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1110.8 y = -19.3 z = -1040.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1114.0 y = -25.0 z = -1045.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1117.2 y = -30.7 z = -1049.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1120.4 y = -36.4 z = -1051.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1123.7 y = -42.0 z = -1053.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1126.9 y = -47.7 z = -1055.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1130.1 y = -53.4 z = -1056.1 detector = DummyHitDetector
+ReadData             INFO EventStreamInfo: Number of events = 5
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = ExcludeTestTrigMap
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Stream3
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 14 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 1401.2 y = -2.3 z = -1173.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1404.4 y = -8.0 z = -1305.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 1407.6 y = -13.7 z = -1329.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1410.8 y = -19.3 z = -1340.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1414.0 y = -25.0 z = -1345.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 1417.2 y = -30.7 z = -1349.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 1420.4 y = -36.4 z = -1351.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 1423.7 y = -42.0 z = -1353.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 1426.9 y = -47.7 z = -1355.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 1430.1 y = -53.4 z = -1356.1 detector = DummyHitDetector
+EventSelector        INFO Disconnecting input sourceID: 24FE039A-0006-0845-8842-06B43B990690
+ReadData             INFO EventStreamInfo: Number of events = 0
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO EventStreamInfo: Number of events = 1
+ReadData             INFO EventStreamInfo: ItemList:
+ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 1287802, key = MultiTestTrigMap
+ReadData             INFO CLID = 38853911, key = EventInfoAux.
+ReadData             INFO CLID = 45903698, key = EventInfo
+ReadData             INFO CLID = 222376821, key = Others
+ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
+ReadData             INFO TagInfo: 
+ReadData             INFO EventInfo event: 3 run: 0
+ReadData             INFO Get Smart data ptr 1
+ReadData             INFO Could not find ExampleTrackContainer/MyTracks
+ReadData             INFO Hit x = 301.2 y = -2.3 z = -73.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 304.4 y = -8.0 z = -205.2 detector = DummyHitDetector
+ReadData             INFO Hit x = 307.6 y = -13.7 z = -229.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 310.8 y = -19.3 z = -240.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 314.0 y = -25.0 z = -245.7 detector = DummyHitDetector
+ReadData             INFO Hit x = 317.2 y = -30.7 z = -249.3 detector = DummyHitDetector
+ReadData             INFO Hit x = 320.4 y = -36.4 z = -251.8 detector = DummyHitDetector
+ReadData             INFO Hit x = 323.7 y = -42.0 z = -253.6 detector = DummyHitDetector
+ReadData             INFO Hit x = 326.9 y = -47.7 z = -255.0 detector = DummyHitDetector
+ReadData             INFO Hit x = 330.1 y = -53.4 z = -256.1 detector = DummyHitDetector
+EventSelector        INFO Disconnecting input sourceID: A09FEA71-37EF-3646-B018-297E85D568FE
 ReadData             INFO in finalize()
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
new file mode 100644
index 00000000000..a7deac3027f
--- /dev/null
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
@@ -0,0 +1,95 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef GENERICMETADATATOOL_H
+#define GENERICMETADATATOOL_H
+
+/** @file GenericMetadataTool.h
+ *  @brief This file contains the class definition for the GenericMetadataTool class.
+ *  @author Jack Cranshaw <cranshaw@anl.gov>
+ *  $Id: $
+ **/
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "AthenaKernel/IMetaDataTool.h"
+#include "GaudiKernel/IIncidentListener.h"
+#include "GaudiKernel/ServiceHandle.h"
+
+#include <string>
+
+/** @class GenericMetadataTool
+ *  @brief This class provides the basic functionality for processing metadata in the athena framework. The derived class must simply implement merge functionality in the updateContainer method.
+ **/
+
+template <typename T, typename U>
+class GenericMetadataTool : public AthAlgTool, public virtual ::IMetaDataTool
+{
+public: // Constructor and Destructor
+   /// Standard Service Constructor
+   GenericMetadataTool(const std::string& type, 
+                  const std::string& name,
+                  const IInterface*  parent);
+   /// Destructor
+   virtual ~GenericMetadataTool();
+
+public:
+   virtual StatusCode metaDataStop() override;
+   virtual StatusCode beginInputFile(const SG::SourceID& sid = "Serial") override;
+   virtual StatusCode endInputFile(const SG::SourceID& sid = "Serial") override;
+   virtual StatusCode initialize() override;
+   virtual StatusCode finalize() override;
+
+protected:
+   ServiceHandle<StoreGateSvc> inputMetaStore() const;
+   ServiceHandle<StoreGateSvc> outputMetaStore() const;
+
+   /// Helper class to update a container with information from another one
+   virtual StatusCode updateContainer( T* contToUpdate,
+                                 const T* otherCont ) = 0;
+
+   StatusCode initOutputContainer(const std::string& sgkey);
+
+   StatusCode buildAthenaInterface(const std::string& inputName,
+                                   const std::string& outputName,
+                                   const SG::SourceID& sid);
+
+   /// Fill Cutflow information
+   StatusCode addProcessMetadata();
+ 
+   /// Pointer to cut flow svc 
+   ServiceHandle<StoreGateSvc> m_inputMetaStore;
+   ServiceHandle<StoreGateSvc> m_outputMetaStore;
+
+   /// The name of the output Container
+   std::string m_outputCollName;
+   /// The name of the input Container
+   std::string  m_inputCollName;
+   /// The name of the process Container
+   std::string m_procMetaName;
+
+   bool m_processMetadataTaken;
+   bool m_markIncomplete;
+
+   /// List of source ids which have reached end file
+   std::set<SG::SourceID> m_fullreads;
+   std::set<SG::SourceID> m_read;
+   std::set<SG::SourceID> m_written;
+
+};
+
+template <typename T, typename U>
+inline ServiceHandle<StoreGateSvc> GenericMetadataTool<T,U>::inputMetaStore() const
+{
+   return m_inputMetaStore;
+}
+
+template <typename T, typename U>
+inline ServiceHandle<StoreGateSvc> GenericMetadataTool<T,U>::outputMetaStore() const
+{
+   return m_outputMetaStore;
+}
+
+#include "GenericMetadataTool.icc"
+#endif
+
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
new file mode 100644
index 00000000000..090d157df0e
--- /dev/null
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
@@ -0,0 +1,387 @@
+///////////////////////// -*- C++ -*- /////////////////////////////
+
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Implementation file for class GenericMetadataTool
+// Authors: Joao Firmino da Costa <joao.costa@cern.ch> and David Cote <david.cote@cern.ch>
+///////////////////////////////////////////////////////////////////
+
+// STL include
+#include <algorithm>
+
+#include "GaudiKernel/Incident.h"
+#include "GaudiKernel/FileIncident.h"
+#include "GaudiKernel/IIncidentSvc.h"
+#include "AthenaKernel/MetaCont.h"
+#include "AthenaKernel/ClassID_traits.h"
+#include "AthenaKernel/errorcheck.h"
+#include "StoreGate/WriteMetaHandle.h"
+#include "AthenaBaseComps/AthCheckMacros.h"
+#include "AthContainersInterfaces/IConstAuxStoreMeta.h"
+
+template <typename T, typename U>
+GenericMetadataTool<T,U>::GenericMetadataTool(const std::string& type, 
+                               const std::string& name,
+                               const IInterface*  parent)
+  : AthAlgTool(type,name,parent),
+    m_inputMetaStore( "StoreGateSvc/InputMetaDataStore", name ),
+    m_outputMetaStore( "StoreGateSvc/MetaDataStore", name ),
+    m_processMetadataTaken(false),
+    m_markIncomplete(true)
+{
+  declareProperty("OutputCollName", m_outputCollName="GenericMetadataOutput",  
+    "The default name of the container for output files");
+  declareProperty("InputCollName", m_inputCollName = "GenericMetadataInput",
+    "The default name of the container for input files");
+  declareProperty("ProcessMetadataCollName", m_procMetaName = "ProcessMetadata",
+    "The default name of the container for process meta");
+  declareProperty("MarkIncomplete", m_markIncomplete = true, 
+    "Defaults to filling both complete and incomplete bookkeepers");
+  declareInterface< ::IMetaDataTool >( this );
+}
+
+
+
+template <typename T, typename U>
+GenericMetadataTool<T,U>::~GenericMetadataTool()
+{
+}
+
+
+
+template <typename T, typename U>
+StatusCode
+GenericMetadataTool<T,U>::initialize()
+{
+  ATH_MSG_DEBUG( "Initializing " << name() << " - package version " << PACKAGE_VERSION );
+
+  ATH_MSG_DEBUG("InputCollName = " << m_inputCollName);
+  ATH_MSG_DEBUG("OutputCollName = " << m_outputCollName);
+  ATH_MSG_DEBUG("ProcessMetadataCollName = " << m_procMetaName);
+
+  return StatusCode::SUCCESS;
+}
+
+
+
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::beginInputFile(const SG::SourceID& sid)
+{
+  ATH_MSG_DEBUG("beginInputFile " << this->name() << "\n" << outputMetaStore()->dump());
+  //OPENING NEW INPUT FILE
+  //Things to do:
+  // 1) note that a file is currently opened
+  // 2) Load metadata T from input file
+  //    2a) if incomplete from input, directly propagate to output
+  //    2b) if complete from input, wait for EndInputFile to decide what to do in output
+
+  const std::string storename("MetaDataStore+");
+  if (m_inputCollName != "") {  // are there inputs
+    //  IF NO METACONT IN OUTPUT STORE YET
+    //     Initialize MetaCont for incomplete and tmp containers in output store
+    //
+    std::string tmp_name = storename+m_outputCollName+"tmp";
+    ATH_CHECK(buildAthenaInterface(m_inputCollName,tmp_name,sid));
+
+    // Do the following if we want incomplete processings marked
+    if (m_markIncomplete) {
+      std::string inc_name = storename+"Incomplete"+m_outputCollName; 
+      std::string input_inc_name = "Incomplete"+m_inputCollName;
+      ATH_CHECK(buildAthenaInterface(input_inc_name,inc_name,sid));
+    }
+  } // inputCollName if
+  else {
+    ATH_MSG_INFO("No input name");
+  }
+
+  // reset cutflow taken marker
+  m_processMetadataTaken = false;
+
+  m_read.insert(sid);
+  
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::endInputFile(const SG::SourceID& sid)
+{
+  // Add the sid to the list of complete sids
+  if (m_inputCollName != "") {  // are there inputs
+    m_fullreads.insert(sid);
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::metaDataStop()
+{
+  const std::string storename("MetaDataStore+");
+  if (m_inputCollName != "") {  // are there inputs
+    //TERMINATING THE JOB (EndRun)
+    //Things to do:
+    // 1) Create new incomplete metadata T if relevant
+    // 2) Print cut flow summary
+    // 3) Write root file if requested
+    // Now retrieve pointers for the MetaConts
+    std::string tmp_name = storename+m_outputCollName+"tmpCont";
+    const MetaCont<T>* tmp;
+    ATH_CHECK(outputMetaStore()->retrieve(tmp,tmp_name));
+    T* outcom = new T();
+    U* outcom_aux = new U();
+    outcom->setStore(outcom_aux);
+
+    if (m_markIncomplete) {
+      std::string inc_name = storename+"Incomplete"+m_outputCollName+"Cont"; 
+      // Build incomplete container to fill
+      T* outinc = new T();
+      U* outinc_aux = new U();
+      outinc->setStore(outinc_aux);
+      // Check if there were any incomplete inputs
+      const MetaCont<T>* inc;
+      if(outputMetaStore()->retrieve(inc,inc_name).isSuccess()) {
+
+        // Incomplete inputs can just be merged
+        auto sids_inc = inc->sources();
+        T* contptr(nullptr);
+        for (auto it = sids_inc.begin(); it != sids_inc.end(); ++it) {
+          if (!inc->find(*it,contptr)) {
+            ATH_MSG_ERROR("Container sid list did not match contents");
+          } else {
+            ATH_CHECK(updateContainer(outinc,contptr));
+          }
+          contptr = nullptr; 
+        }
+      } else {
+        ATH_MSG_INFO("Did not find MetaCont for " << inc_name << ", assuming input had no incomplete bookkeepers");
+      }
+
+      // Loop over containers and mark based on end files seen
+      auto sids_tmp = tmp->sources();
+      T* contptr(nullptr);
+      for (auto it = sids_tmp.begin(); it != sids_tmp.end(); ++it) {
+        if (!tmp->find(*it,contptr)) {
+          ATH_MSG_ERROR("Container sid list did not match contents");
+        } else {
+          bool complete = std::find(m_fullreads.begin(),
+                       m_fullreads.end(),
+                       *it) != m_fullreads.end();
+          bool not_written = std::find(m_written.begin(),
+                          m_written.end(),
+                          *it) == m_written.end();
+          if (complete && not_written) {
+            ATH_CHECK(updateContainer(outcom,contptr));
+          } else {
+            ATH_CHECK(updateContainer(outinc,contptr));
+          }
+        }
+      }
+
+      std::string incout_name = "Incomplete"+m_outputCollName;
+      // Do any cleanup
+      if (outputMetaStore()->contains(ClassID_traits<T>::ID(),incout_name) ) {
+        ATH_MSG_INFO("Cleaning up class for " << incout_name);
+        const T* tmpBook(nullptr);
+        if ( outputMetaStore()->retrieve(tmpBook,incout_name).isSuccess() ) {
+          const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+          ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
+          ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+        }
+        else ATH_MSG_INFO("StoreGate failed retrieve");
+      }
+      ATH_CHECK(outputMetaStore()->record(outinc,incout_name));
+      ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux."));
+    }  // markIncomplete
+    else {
+      auto sids_tmp = tmp->sources();
+      T* contptr(nullptr);
+      // just merge complete inputs into complete/output container
+      for (auto it = sids_tmp.begin(); it != sids_tmp.end(); ++it) {
+        if (!tmp->find(*it,contptr)) {
+          ATH_MSG_ERROR("Container sid list did not match contents");
+        } else {
+          // default to not worrying about marking
+          ATH_CHECK(updateContainer(outcom,contptr));
+        }
+      }
+    }
+
+    // Record container objects directly in store for output
+    if (outputMetaStore()->contains(ClassID_traits<T>::ID(),m_outputCollName)) {
+      ATH_MSG_INFO("Cleaning up class for " << m_outputCollName);
+      const T* tmpBook(nullptr);
+      if ( outputMetaStore()->retrieve(tmpBook,m_outputCollName).isSuccess() ) {
+        const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+        ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
+        ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+      }
+      else ATH_MSG_ERROR("StoreGate failed retrieve");
+    }
+    ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName));
+    ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux."));
+  } // inputCollName if
+
+  if (!m_processMetadataTaken) {
+    if (addProcessMetadata().isFailure()) {
+      ATH_MSG_ERROR("Could not add process metadata");
+    }
+  }
+  else {
+    ATH_MSG_DEBUG("Process metadata written into container before metaDataStop");
+  }
+
+  // Reset after metadata stop
+  m_processMetadataTaken = false;
+
+  if (m_inputCollName != "") {  // are there inputs
+    // Copy read files into written files
+    //std::copy(m_read.begin(),m_read.end(),back_inserter(m_written));
+    for (auto it = m_read.begin(); it != m_read.end(); ++it) {
+      m_written.insert(*it);
+    }
+    // Remove completes from read
+    for (auto it = m_fullreads.begin(); it != m_fullreads.end(); ++it) {
+      m_read.erase(*it);
+      //std::remove(m_read.begin(); m_read.end(), *it);
+    }
+    m_fullreads.clear();
+  } // inputCollName if
+  
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T, typename U>
+StatusCode
+GenericMetadataTool<T,U>::finalize()
+{
+  ATH_MSG_DEBUG( "Finalizing " << name() << " - package version " << PACKAGE_VERSION );
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::initOutputContainer( const std::string& sgkey)
+{
+  std::string key = sgkey;
+  // Create the primary container
+  // Put it in a MetaCont
+  MetaCont<T>* mcont = new MetaCont<T>(DataObjID(ClassID_traits<T>::ID(),key));
+  // Do the same for the auxiliary container
+  std::string auxkey(key+"Aux.");
+  //MetaCont<U>* acont = new MetaCont<U>(DataObjID(ClassID_traits<U>::ID(),auxkey)); // fails on symlink, Failure
+  //MetaCont<SG::IConstAuxStore>* acont = new MetaCont<SG::IConstAuxStore>(DataObjID(ClassID_traits<SG::IConstAuxStore>::ID(),auxkey)); // fails on symlink, exception
+  DataObjID obj(ClassID_traits<SG::IConstAuxStore>::ID(),auxkey);
+  MetaCont<SG::IConstAuxStore>* acont = new MetaCont<SG::IConstAuxStore>(obj); 
+  ATH_CHECK(outputMetaStore()->record(std::move(mcont),key));
+  ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey));
+  // Create a symlink
+  // so that proxy references to <Aux>#auxkey find it in MetaCont<Aux>#auxkey
+  try {
+  StatusCode sc = outputMetaStore()->symLink
+          (
+            ClassID_traits<MetaCont<SG::IConstAuxStore> >::ID(),
+            auxkey,
+            ClassID_traits<SG::IConstAuxStore>::ID()
+          );
+    if (sc.isFailure()) {
+      ATH_MSG_ERROR("Unable to symlink " << auxkey);
+    }
+  }
+  catch (std::exception& e) {
+    ATH_MSG_INFO("SYMLINK EXCEPTION " << e.what());
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+//--------------------------------------------------------//
+//  MetaConts are only needed when reading in Athena
+//  This builds them and populates them with bookeepers from the input store
+//--------------------------------------------------------//
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::buildAthenaInterface(const std::string& inputName,
+                                                const std::string& outputName,
+                                                const SG::SourceID& sid)
+{
+  ATH_MSG_DEBUG("buildAthenaInterface " << inputName << " " << outputName);
+  // Make sure the MetaCont is ready in the output store for outputName
+  //   If not, then create it
+  std::string name = outputName+"Cont"; 
+  if( !(outputMetaStore()->contains(ClassID_traits<MetaCont<T> >::ID(),name)) ) {
+    ATH_CHECK(this->initOutputContainer(name));
+  }
+  else {
+    ATH_MSG_WARNING("incomplete collection already exists");
+  }
+
+  // Retrieve pointer for the MetaCont
+  MetaCont<T>* mc;
+  ATH_CHECK(outputMetaStore()->retrieve(mc,name));
+
+  // Make sure sid does not already exist in the MetaCont
+  for (auto it = mc->sources().begin(); it != mc->sources().end(); ++it) {
+    if (*it==sid) {
+      ATH_MSG_ERROR("Metadata already exists for sid " << sid);
+      return StatusCode::FAILURE;   // Fail if sid already exists
+    }
+  }
+
+  // Get the input bookkeeper of the input metadata store
+  const T* cbc;
+  if (inputMetaStore()->contains(ClassID_traits<T>::ID(),inputName) ) {
+    StatusCode ssc = inputMetaStore()->retrieve( cbc, inputName );
+    if (ssc.isSuccess()) {
+      // Insert input bookkeeper into MetaCont for this sid
+      T* tostore = new T(*cbc);
+      if ( !mc->insert(sid,tostore) ) {
+        ATH_MSG_ERROR("Unable to insert " << inputName << " for " << sid << " with key " << name);
+        return StatusCode::FAILURE;   // Fail if insert to mc fails
+      }
+    }
+    else {
+      ATH_MSG_ERROR("Could not retrieve class with name " << inputName << " in input store");
+      return StatusCode::FAILURE;   // Fail if store contains, but not retrieves
+    }
+  }
+  else {
+    ATH_MSG_WARNING("No " << inputName << " data in this file ");
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+template <typename T, typename U>
+StatusCode GenericMetadataTool<T,U>::addProcessMetadata()
+{
+  // Add the information from the current processing to the complete output
+  // --> same paradigm as original CutFlowSvc
+  // Get the complete bookkeeper collection of the output meta-data store
+  T* completeBook(nullptr); 
+  if( !(outputMetaStore()->retrieve( completeBook, m_outputCollName) ).isSuccess() ) {
+    ATH_MSG_ERROR( "Could not get output container from output MetaDataStore" );
+    return StatusCode::FAILURE;
+  }
+
+  // Get the bookkeeper from the current processing
+  T* fileCompleteBook(nullptr);
+  if( outputMetaStore()->contains(ClassID_traits<T>::ID(),m_procMetaName) ) {
+    if( !(outputMetaStore()->retrieve( fileCompleteBook, m_procMetaName) ).isSuccess() ) {
+      ATH_MSG_WARNING( "Could not get process metadata from output MetaDataStore" );
+    }
+    else {
+      // update the complete output with the complete input
+      ATH_CHECK(this->updateContainer(completeBook,fileCompleteBook));
+    }
+  }
+  else {
+    ATH_MSG_INFO("No process container " << m_procMetaName);
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
new file mode 100644
index 00000000000..a64cc062ac2
--- /dev/null
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
@@ -0,0 +1,95 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef GENERICMETADATATOOLNOAUX_H
+#define GENERICMETADATATOOLNOAUX_H
+
+/** @file GenericMetadataToolNoAux.h
+ *  @brief This file contains the class definition for the GenericMetadataToolNoAux class.
+ *  @author Jack Cranshaw <cranshaw@anl.gov>
+ *  $Id: $
+ **/
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "AthenaKernel/IMetaDataTool.h"
+#include "GaudiKernel/IIncidentListener.h"
+#include "GaudiKernel/ServiceHandle.h"
+
+#include <string>
+
+/** @class GenericMetadataToolNoAux
+ *  @brief This class provides the basic functionality for processing metadata in the athena framework. The derived class must simply implement merge functionality in the updateContainer method.
+ **/
+
+template <typename T>
+class GenericMetadataToolNoAux : public AthAlgTool, public virtual ::IMetaDataTool
+{
+public: // Constructor and Destructor
+   /// Standard Service Constructor
+   GenericMetadataToolNoAux(const std::string& type, 
+                  const std::string& name,
+                  const IInterface*  parent);
+   /// Destructor
+   virtual ~GenericMetadataToolNoAux();
+
+public:
+   virtual StatusCode metaDataStop() override;
+   virtual StatusCode beginInputFile(const SG::SourceID& sid = "Serial") override;
+   virtual StatusCode endInputFile(const SG::SourceID& sid = "Serial") override;
+   virtual StatusCode initialize() override;
+   virtual StatusCode finalize() override;
+
+protected:
+   ServiceHandle<StoreGateSvc> inputMetaStore() const;
+   ServiceHandle<StoreGateSvc> outputMetaStore() const;
+
+   /// Helper class to update a container with information from another one
+   virtual StatusCode updateContainer( T* contToUpdate,
+                                 const T* otherCont ) = 0;
+
+   StatusCode initOutputContainer(const std::string& sgkey);
+
+   StatusCode buildAthenaInterface(const std::string& inputName,
+                                   const std::string& outputName,
+                                   const SG::SourceID& sid);
+
+   /// Fill Cutflow information
+   StatusCode addProcessMetadata();
+ 
+   /// Pointer to cut flow svc 
+   ServiceHandle<StoreGateSvc> m_inputMetaStore;
+   ServiceHandle<StoreGateSvc> m_outputMetaStore;
+
+   /// The name of the output Container
+   std::string m_outputCollName;
+   /// The name of the input Container
+   std::string  m_inputCollName;
+   /// The name of the process Container
+   std::string m_procMetaName;
+
+   bool m_processMetadataTaken;
+   bool m_markIncomplete;
+
+   /// List of source ids which have reached end file
+   std::set<SG::SourceID> m_fullreads;
+   std::set<SG::SourceID> m_read;
+   std::set<SG::SourceID> m_written;
+
+};
+
+template <typename T>
+inline ServiceHandle<StoreGateSvc> GenericMetadataToolNoAux<T>::inputMetaStore() const
+{
+   return m_inputMetaStore;
+}
+
+template <typename T>
+inline ServiceHandle<StoreGateSvc> GenericMetadataToolNoAux<T>::outputMetaStore() const
+{
+   return m_outputMetaStore;
+}
+
+#include "GenericMetadataToolNoAux.icc"
+#endif
+
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
new file mode 100644
index 00000000000..e5bc970b222
--- /dev/null
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
@@ -0,0 +1,379 @@
+///////////////////////// -*- C++ -*- /////////////////////////////
+
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Implementation file for class GenericMetadataToolNoAux
+// Authors: Joao Firmino da Costa <joao.costa@cern.ch> and David Cote <david.cote@cern.ch>
+///////////////////////////////////////////////////////////////////
+
+// STL include
+#include <algorithm>
+
+#include "GaudiKernel/Incident.h"
+#include "GaudiKernel/FileIncident.h"
+#include "GaudiKernel/IIncidentSvc.h"
+#include "AthenaKernel/MetaCont.h"
+#include "AthenaKernel/ClassID_traits.h"
+#include "AthenaKernel/errorcheck.h"
+#include "StoreGate/WriteMetaHandle.h"
+#include "AthenaBaseComps/AthCheckMacros.h"
+#include "AthContainersInterfaces/IConstAuxStoreMeta.h"
+
+template <typename T>
+GenericMetadataToolNoAux<T>::GenericMetadataToolNoAux(const std::string& type, 
+                               const std::string& name,
+                               const IInterface*  parent)
+  : AthAlgTool(type,name,parent),
+    m_inputMetaStore( "StoreGateSvc/InputMetaDataStore", name ),
+    m_outputMetaStore( "StoreGateSvc/MetaDataStore", name ),
+    m_processMetadataTaken(false),
+    m_markIncomplete(true)
+{
+  declareProperty("OutputCollName", m_outputCollName="GenericMetadataOutput",  
+    "The default name of the container for output files");
+  declareProperty("InputCollName", m_inputCollName = "GenericMetadataInput",
+    "The default name of the container for input files");
+  declareProperty("ProcessMetadataCollName", m_procMetaName = "ProcessMetadata",
+    "The default name of the container for process meta");
+  declareProperty("MarkIncomplete", m_markIncomplete = true, 
+    "Defaults to filling both complete and incomplete bookkeepers");
+  declareInterface< ::IMetaDataTool >( this );
+}
+
+
+
+template <typename T>
+GenericMetadataToolNoAux<T>::~GenericMetadataToolNoAux()
+{
+}
+
+
+
+template <typename T>
+StatusCode
+GenericMetadataToolNoAux<T>::initialize()
+{
+  ATH_MSG_DEBUG( "Initializing " << name() << " - package version " << PACKAGE_VERSION );
+
+  ATH_MSG_DEBUG("InputCollName = " << m_inputCollName);
+  ATH_MSG_DEBUG("OutputCollName = " << m_outputCollName);
+  ATH_MSG_DEBUG("ProcessMetadataCollName = " << m_procMetaName);
+
+  return StatusCode::SUCCESS;
+}
+
+
+
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::beginInputFile(const SG::SourceID& sid)
+{
+  ATH_MSG_DEBUG("beginInputFile " << this->name() << "\n" << outputMetaStore()->dump());
+  //OPENING NEW INPUT FILE
+  //Things to do:
+  // 1) note that a file is currently opened
+  // 2) Load metadata T from input file
+  //    2a) if incomplete from input, directly propagate to output
+  //    2b) if complete from input, wait for EndInputFile to decide what to do in output
+
+  const std::string storename("MetaDataStore+");
+  if (m_inputCollName != "") {  // are there inputs
+    //  IF NO METACONT IN OUTPUT STORE YET
+    //     Initialize MetaCont for incomplete and tmp containers in output store
+    //
+    std::string tmp_name = storename+m_outputCollName+"tmp";
+    ATH_CHECK(buildAthenaInterface(m_inputCollName,tmp_name,sid));
+
+    // Do the following if we want incomplete processings marked
+    if (m_markIncomplete) {
+      std::string inc_name = storename+"Incomplete"+m_outputCollName; 
+      std::string input_inc_name = "Incomplete"+m_inputCollName;
+      ATH_CHECK(buildAthenaInterface(input_inc_name,inc_name,sid));
+    }
+  } // inputCollName if
+  else {
+    ATH_MSG_INFO("No input name");
+  }
+
+  // reset cutflow taken marker
+  m_processMetadataTaken = false;
+
+  m_read.insert(sid);
+  
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::endInputFile(const SG::SourceID& sid)
+{
+  // Add the sid to the list of complete sids
+  if (m_inputCollName != "") {  // are there inputs
+    m_fullreads.insert(sid);
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::metaDataStop()
+{
+  const std::string storename("MetaDataStore+");
+  if (m_inputCollName != "") {  // are there inputs
+    //TERMINATING THE JOB (EndRun)
+    //Things to do:
+    // 1) Create new incomplete metadata T if relevant
+    // 2) Print cut flow summary
+    // 3) Write root file if requested
+    // Now retrieve pointers for the MetaConts
+    std::string tmp_name = storename+m_outputCollName+"tmpCont";
+    const MetaCont<T>* tmp;
+    ATH_CHECK(outputMetaStore()->retrieve(tmp,tmp_name));
+    T* outcom = new T();
+    //U* outcom_aux = new U();
+    //outcom->setStore(outcom_aux);
+
+    if (m_markIncomplete) {
+      std::string inc_name = storename+"Incomplete"+m_outputCollName+"Cont"; 
+      // Build incomplete container to fill
+      T* outinc = new T();
+      //U* outinc_aux = new U();
+      //outinc->setStore(outinc_aux);
+      // Check if there were any incomplete inputs
+      const MetaCont<T>* inc;
+      if(outputMetaStore()->retrieve(inc,inc_name).isSuccess()) {
+
+        // Incomplete inputs can just be merged
+        auto sids_inc = inc->sources();
+        T* contptr(nullptr);
+        for (auto it = sids_inc.begin(); it != sids_inc.end(); ++it) {
+          if (!inc->find(*it,contptr)) {
+            ATH_MSG_ERROR("Container sid list did not match contents");
+          } else {
+            ATH_CHECK(updateContainer(outinc,contptr));
+          }
+          contptr = nullptr; 
+        }
+      } else {
+        ATH_MSG_INFO("Did not find MetaCont for " << inc_name << ", assuming input had no incomplete bookkeepers");
+      }
+
+      // Loop over containers and mark based on end files seen
+      auto sids_tmp = tmp->sources();
+      T* contptr(nullptr);
+      for (auto it = sids_tmp.begin(); it != sids_tmp.end(); ++it) {
+        if (!tmp->find(*it,contptr)) {
+          ATH_MSG_ERROR("Container sid list did not match contents");
+        } else {
+          bool complete = std::find(m_fullreads.begin(),
+                       m_fullreads.end(),
+                       *it) != m_fullreads.end();
+          bool not_written = std::find(m_written.begin(),
+                          m_written.end(),
+                          *it) == m_written.end();
+          if (complete && not_written) {
+            ATH_CHECK(updateContainer(outcom,contptr));
+          } else {
+            ATH_CHECK(updateContainer(outinc,contptr));
+          }
+        }
+      }
+
+      std::string incout_name = "Incomplete"+m_outputCollName;
+      // Do any cleanup
+      if (outputMetaStore()->contains(ClassID_traits<T>::ID(),incout_name) ) {
+        ATH_MSG_INFO("Cleaning up class for " << incout_name);
+        const T* tmpBook(nullptr);
+        if ( outputMetaStore()->retrieve(tmpBook,incout_name).isSuccess() ) {
+          //const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+          ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
+          //ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+        }
+        else ATH_MSG_INFO("StoreGate failed retrieve");
+      }
+      ATH_CHECK(outputMetaStore()->record(outinc,incout_name));
+      //ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux."));
+    }  // markIncomplete
+    else {
+      auto sids_tmp = tmp->sources();
+      T* contptr(nullptr);
+      // just merge complete inputs into complete/output container
+      for (auto it = sids_tmp.begin(); it != sids_tmp.end(); ++it) {
+        if (!tmp->find(*it,contptr)) {
+          ATH_MSG_ERROR("Container sid list did not match contents");
+        } else {
+          // default to not worrying about marking
+          ATH_CHECK(updateContainer(outcom,contptr));
+        }
+      }
+    }
+
+    // Record container objects directly in store for output
+    if (outputMetaStore()->contains(ClassID_traits<T>::ID(),m_outputCollName)) {
+      ATH_MSG_INFO("Cleaning up class for " << m_outputCollName);
+      const T* tmpBook(nullptr);
+      if ( outputMetaStore()->retrieve(tmpBook,m_outputCollName).isSuccess() ) {
+        //const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+        ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
+        //ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+      }
+      else ATH_MSG_ERROR("StoreGate failed retrieve");
+    }
+    ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName));
+    //ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux."));
+  } // inputCollName if
+
+  if (!m_processMetadataTaken) {
+    if (addProcessMetadata().isFailure()) {
+      ATH_MSG_ERROR("Could not add CutFlow information");
+    }
+  }
+  else {
+    ATH_MSG_DEBUG("Process metadata written into container before metaDataStop");
+  }
+
+  // Reset after metadata stop
+  m_processMetadataTaken = false;
+
+  if (m_inputCollName != "") {  // are there inputs
+    // Copy read files into written files
+    //std::copy(m_read.begin(),m_read.end(),back_inserter(m_written));
+    for (auto it = m_read.begin(); it != m_read.end(); ++it) {
+      m_written.insert(*it);
+    }
+    // Remove completes from read
+    for (auto it = m_fullreads.begin(); it != m_fullreads.end(); ++it) {
+      m_read.erase(*it);
+      //std::remove(m_read.begin(); m_read.end(), *it);
+    }
+    m_fullreads.clear();
+  } // inputCollName if
+  
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T>
+StatusCode
+GenericMetadataToolNoAux<T>::finalize()
+{
+  ATH_MSG_DEBUG( "Finalizing " << name() << " - package version " << PACKAGE_VERSION );
+  return StatusCode::SUCCESS;
+}
+
+
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::initOutputContainer( const std::string& sgkey)
+{
+  std::string key = sgkey;
+  // Create the primary container
+  // Put it in a MetaCont
+  MetaCont<T>* mcont = new MetaCont<T>(DataObjID(ClassID_traits<T>::ID(),key));
+  // Do the same for the auxiliary container
+  //std::string auxkey(key+"Aux.");
+  //MetaCont<U>* acont = new MetaCont<U>(DataObjID(ClassID_traits<U>::ID(),auxkey));
+  ATH_CHECK(outputMetaStore()->record(std::move(mcont),key));
+  //ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey));
+  //StatusCode sc(StatusCode::SUCCESS);
+/*
+  StatusCode sc = outputMetaStore()->symLink
+          (
+            ClassID_traits<MetaCont<SG::IConstAuxStore> >::ID(),
+            auxkey,
+            ClassID_traits<SG::IConstAuxStore>::ID()
+          );
+  if (sc.isFailure()) {
+    ATH_MSG_ERROR("Unable to symlink " << auxkey);
+  }
+*/
+
+  return StatusCode::SUCCESS;
+}
+
+//--------------------------------------------------------//
+//  MetaConts are only needed when reading in Athena
+//  This builds them and populates them with bookeepers from the input store
+//--------------------------------------------------------//
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::buildAthenaInterface(const std::string& inputName,
+                                                const std::string& outputName,
+                                                const SG::SourceID& sid)
+{
+  // Make sure the MetaCont is ready in the output store for outputName
+  //   If not, then create it
+  std::string name = outputName+"Cont"; 
+  if( !(outputMetaStore()->contains(ClassID_traits<MetaCont<T> >::ID(),name)) ) {
+    ATH_CHECK(this->initOutputContainer(name));
+  }
+  else {
+    ATH_MSG_WARNING("incomplete collection already exists");
+  }
+
+  // Retrieve pointer for the MetaCont
+  MetaCont<T>* mc;
+  ATH_CHECK(outputMetaStore()->retrieve(mc,name));
+
+  // Make sure sid does not already exist in the MetaCont
+  for (auto it = mc->sources().begin(); it != mc->sources().end(); ++it) {
+    if (*it==sid) {
+      ATH_MSG_ERROR("Metadata already exists for sid " << sid);
+      return StatusCode::FAILURE;   // Fail if sid already exists
+    }
+  }
+
+  // Get the input bookkeeper of the input metadata store
+  const T* cbc;
+  if (inputMetaStore()->contains(ClassID_traits<T>::ID(),inputName) ) {
+    StatusCode ssc = inputMetaStore()->retrieve( cbc, inputName );
+    if (ssc.isSuccess()) {
+      // Insert input bookkeeper into MetaCont for this sid
+      T* tostore = new T(*cbc);
+      if ( !mc->insert(sid,tostore) ) {
+        ATH_MSG_ERROR("Unable to insert " << inputName << " for " << sid << " with key " << name);
+        return StatusCode::FAILURE;   // Fail if insert to mc fails
+      }
+    }
+    else {
+      ATH_MSG_ERROR("Could not retrieve class with name " << inputName << " in input store");
+      return StatusCode::FAILURE;   // Fail if store contains, but not retrieves
+    }
+  }
+  else {
+    ATH_MSG_WARNING("No " << inputName << " data in this file ");
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+template <typename T>
+StatusCode GenericMetadataToolNoAux<T>::addProcessMetadata()
+{
+  // Add the information from the current processing to the complete output
+  // --> same paradigm as original CutFlowSvc
+  // Get the complete bookkeeper collection of the output meta-data store
+  T* completeBook(nullptr); 
+  if( !(outputMetaStore()->retrieve( completeBook, m_outputCollName) ).isSuccess() ) {
+    ATH_MSG_ERROR( "Could not get output container from output MetaDataStore" );
+    return StatusCode::FAILURE;
+  }
+
+  // Get the bookkeeper from the current processing
+  T* fileCompleteBook(nullptr);
+  if( outputMetaStore()->contains(ClassID_traits<T>::ID(),m_procMetaName) ) {
+    if( !(outputMetaStore()->retrieve( fileCompleteBook, m_procMetaName) ).isSuccess() ) {
+      ATH_MSG_WARNING( "Could not get process metadata from output MetaDataStore" );
+    }
+    else {
+      // update the complete output with the complete input
+      ATH_CHECK(this->updateContainer(completeBook,fileCompleteBook));
+    }
+  }
+  else {
+    ATH_MSG_INFO("No process container " << m_procMetaName);
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
index d119cbeb652..2558e16bda4 100755
--- a/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
+++ b/Control/AthenaKernel/AthenaKernel/IMetaDataTool.h
@@ -28,8 +28,8 @@ public: // Non-static members
   /// processed
   virtual StatusCode endInputFile(const SG::SourceID& sid = "Serial") = 0;
 
-  /// Function called when the tool should write out its metadata
-  virtual StatusCode metaDataStop(const SG::SourceID& sid = "Serial") = 0;
+  /// Function called when the tool should prepare to write its metadata
+  virtual StatusCode metaDataStop() = 0;
 
   /// Gaudi boilerplate
    static const InterfaceID& interfaceID();
diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 5e5ecb04329..f0667db1e09 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -319,59 +319,6 @@ StatusCode AthenaOutputStream::initialize() {
 StatusCode AthenaOutputStream::stop()
 {
    ATH_MSG_DEBUG("AthenaOutputStream " << this->name() << " ::stop()");
-/*
-   for (std::vector<ToolHandle<IAthenaOutputTool> >::iterator iter = m_helperTools.begin();
-        iter != m_helperTools.end(); iter++) {
-      if (!(*iter)->preFinalize().isSuccess()) {
-          ATH_MSG_ERROR("Cannot finalize helper tool");
-      }
-   }
-   ServiceHandle<MetaDataSvc> mdsvc("MetaDataSvc", name());
-   if (mdsvc.retrieve().isFailure()) {
-      ATH_MSG_ERROR("Could not retrieve MetaDataSvc for stop actions");
-   }
-   else {
-      ATH_CHECK(mdsvc->prepareOutput());
-   }
-   // Always force a final commit in stop - mainly applies to AthenaPool
-   if (m_writeOnFinalize) {
-      if (write().isFailure()) {  // true mean write AND commit
-         ATH_MSG_ERROR("Cannot write on finalize");
-      }
-      ATH_MSG_INFO("Records written: " << m_events);
-   }
-
-   if (!m_metadataItemList.value().empty()) {
-      m_currentStore = &m_metadataStore;
-      StatusCode status = m_streamer->connectServices(m_metadataStore.type(), m_persName, false);
-      if (status.isFailure()) {
-         throw GaudiException("Unable to connect metadata services", name(), StatusCode::FAILURE);
-      }
-      m_checkNumberOfWrites = false;
-      m_outputAttributes = "[OutputCollection=MetaDataHdr][PoolContainerPrefix=MetaData][AttributeListKey=][DataHeaderSatellites=]";
-      m_p2BWritten->clear();
-      IProperty *pAsIProp(nullptr);
-      if ((m_p2BWritten.retrieve()).isFailure() ||
-                     nullptr == (pAsIProp = dynamic_cast<IProperty*>(&*m_p2BWritten)) ||
-                     (pAsIProp->setProperty("ItemList", m_metadataItemList.toString())).isFailure()) {
-         throw GaudiException("Folder property [metadataItemList] not found", name(), StatusCode::FAILURE);
-      }
-      if (write().isFailure()) {  // true mean write AND commit
-         ATH_MSG_ERROR("Cannot write metadata");
-      }
-      m_outputAttributes.clear();
-      m_currentStore = &m_dataStore;
-      status = m_streamer->connectServices(m_dataStore.type(), m_persName, m_extendProvenanceRecord);
-      if (status.isFailure()) {
-         throw GaudiException("Unable to re-connect services", name(), StatusCode::FAILURE);
-      }
-      m_p2BWritten->clear();
-      if ((pAsIProp->setProperty(m_itemList)).isFailure()) {
-         throw GaudiException("Folder property [itemList] not found", name(), StatusCode::FAILURE);
-      }
-      ATH_MSG_INFO("Records written: " << m_events);
-   }
-*/
    return StatusCode::SUCCESS;
 }
 
@@ -658,7 +605,6 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item)
       ATH_MSG_VERBOSE("Calling tokenizeAtStep( " << keyTokens << ", " << item_key << ", " << wildCard << ")" );
       this->tokenizeAtSep( keyTokens, item_key, wildCard );
       ATH_MSG_VERBOSE("Done calling tokenizeAtStep( " << keyTokens << ", " << item_key << ", " << wildCard << ")" );
-      //std::pair<std::string, std::string> key = breakAtSep(item_key, wildCard);
       // Now loop over any found proxies
       for (; iter != end; ++iter) {
          SG::DataProxy* itemProxy(iter->second);
diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx
index 90767e2bc18..4f8034ec30d 100644
--- a/Control/AthenaServices/src/MetaDataSvc.cxx
+++ b/Control/AthenaServices/src/MetaDataSvc.cxx
@@ -123,8 +123,8 @@ StatusCode MetaDataSvc::initialize() {
    }
    ATH_MSG_INFO("Found " << m_metaDataTools);
 
-   m_incSvc->addListener(this, "FirstInputFile", 90);
-   m_incSvc->addListener(this, "BeginInputFile", 90);
+   m_incSvc->addListener(this, "FirstInputFile", 80);
+   m_incSvc->addListener(this, "BeginInputFile", 80);
    m_incSvc->addListener(this, "EndInputFile", 10);
    m_incSvc->addListener(this, "LastInputFile", 10);
    m_incSvc->addListener(this, "ShmProxy", 90);
@@ -323,7 +323,6 @@ StatusCode MetaDataSvc::retireMetadataSource(const Incident& inc)
 
 StatusCode MetaDataSvc::prepareOutput()
 {
-   ATH_MSG_DEBUG("prepareOutput");
    StatusCode rc(StatusCode::SUCCESS);
    for (auto it = m_metaDataTools.begin(); it != m_metaDataTools.end(); ++it) {
       ATH_MSG_DEBUG(" calling metaDataStop for " << (*it)->name());
@@ -403,12 +402,12 @@ StatusCode MetaDataSvc::transitionMetaDataFile(bool ignoreInputFile) {
       return(StatusCode::FAILURE);
    }
 
-   Incident metaDataStopIncident(name(), "MetaDataStop");
-   m_incSvc->fireIncident(metaDataStopIncident);
-
    // Set to be listener for end of event
    ATH_CHECK(this->prepareOutput());
 
+   Incident metaDataStopIncident(name(), "MetaDataStop");
+   m_incSvc->fireIncident(metaDataStopIncident);
+
    AthCnvSvc* cnvSvc = dynamic_cast<AthCnvSvc*>(m_addrCrtr.operator->());
    if (cnvSvc) {
       if (!cnvSvc->disconnectOutput().isSuccess()) {
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
index 2c8a05fd7e1..a6f08dfaccf 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
@@ -1,74 +1,21 @@
-Warning in <TInterpreter::ReadRootmapFile>: class  InDet::IInDetTrackSelectionTool found in libInDetTrackSelectionToolDict.so  is already in libInDetSecVtxTrackSelectionToolDict.so 
-Mon Feb 18 13:00:57 CST 2019
-Preloading tcmalloc_minimal.so
-Athena               INFO including file "AthenaCommon/Preparation.py"
-Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
-Athena               INFO including file "AthenaCommon/Execution.py"
-Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ConcatJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5458 configurables from 155 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-Athena               INFO including file "AthenaCommon/runbatch.py"
-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 v31r0)
-                                          running on hepd-0004 on Mon Feb 18 13:01:03 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 3045 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
-AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 571 CLIDRegistry entries for module ALL
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
-MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
-AthenaPoolCnvSvc    DEBUG Property update for OutputLevel : new value = 2
-AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
-PoolSvc             DEBUG Property update for OutputLevel : new value = 2
-PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok]
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /home/gemmeren/workarea/build/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host hepd-0004.lcrc.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:Catalog1.xml
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
-xAODMaker::Even...WARNING Beam conditions service not available
-xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
-xAODMaker::Even...   INFO Luminosity information not available
-xAODMaker::Even...   INFO Will take information from the EventInfo object
-ClassIDSvc           INFO  getRegistryEntries: read 1537 CLIDRegistry entries for module ALL
-WriteData           DEBUG Property update for OutputLevel : new value = 2
 WriteData            INFO in initialize()
-WriteData           DEBUG input handles: 0
-WriteData           DEBUG output handles: 2
-WriteData           DEBUG Data Deps for WriteData
   + OUTPUT  ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
   + OUTPUT  ( 'ExampleHitContainer' , 'StoreGateSvc+PetersHits' ) 
-ReWriteData         DEBUG Property update for OutputLevel : new value = 2
 ReWriteData          INFO in initialize()
-ReWriteData         DEBUG input handles: 1
-ReWriteData         DEBUG output handles: 1
-ReWriteData         DEBUG Data Deps for ReWriteData
   + INPUT   ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
   + OUTPUT  ( 'ExampleTrackContainer' , 'StoreGateSvc+MyTracks' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 396 CLIDRegistry entries for module ALL
-Stream1             DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG In initialize 
 Stream1             DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
@@ -76,27 +23,15 @@ Stream1             DEBUG End initialize
 Stream1             DEBUG In initialize
 Stream1             DEBUG Found StoreGateSvc store.
 Stream1             DEBUG Found MetaDataStore store.
-OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...   INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...   INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
 Stream1              INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo'])
 Stream1              INFO Data output: SimplePoolFile1.root
-Stream1              INFO I/O reinitialization...
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
+Stream1              INFO ../O reinitialization...
 Stream1             DEBUG End initialize
-Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 0
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
-Stream1             DEBUG Data Deps for Stream1
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
-MakeInputDataHe...   INFO Initializing MakeInputDataHeader - package version OutputStreamAthenaPool-00-00-00
 MakeInputDataHe...   INFO Name of Stream to be made Input: Stream1
-Stream2             DEBUG Property update for OutputLevel : new value = 2
-Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG In initialize 
 Stream2             DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: Stream2 with no Algs
@@ -104,21 +39,13 @@ Stream2             DEBUG End initialize
 Stream2             DEBUG In initialize
 Stream2             DEBUG Found StoreGateSvc store.
 Stream2             DEBUG Found MetaDataStore store.
-Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
-Stream2.Stream2...   INFO Initializing Stream2.Stream2Tool - package version AthenaServices-00-00-00
-Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
-Stream2.Stream2...   INFO Initializing Stream2.Stream2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
 Stream2              INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo'])
 Stream2              INFO Data output: SimplePoolFile3.root
-Stream2              INFO I/O reinitialization...
-Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
+Stream2              INFO ../O reinitialization...
 Stream2             DEBUG End initialize
-Stream2             DEBUG input handles: 0
-Stream2             DEBUG output handles: 0
 Stream2             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool)
-Stream2             DEBUG Data Deps for Stream2
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
 HistogramPersis...WARNING Histograms saving not required.
 EventSelector        INFO  Enter McEventSelector Initialization 
@@ -157,14 +84,10 @@ ReWriteData          INFO Element = 0x???? : 17.2845
 ReWriteData          INFO Element = 0x???? : 10.8645
 ReWriteData          INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector = Track made in: DummyHitDetector
 ReWriteData          INFO registered all data
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
 AthenaPoolCnvSvc    DEBUG setAttribute DEFAULT_SPLITLEVEL to 0
 AthenaPoolCnvSvc    DEBUG setAttribute STREAM_MEMBER_WISE to 1
 AthenaPoolCnvSvc    DEBUG setAttribute DEFAULT_BUFFERSIZE to 32000
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile1.root
 SimplePoolFile1...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Shapes
 ##Shapes            DEBUG Opening
@@ -184,7 +107,6 @@ SimplePoolFile1...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile1.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 108 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
@@ -244,8 +166,6 @@ SimplePoolFile1...  DEBUG ---->Class:DataHeader_p5
 SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile1.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile1.root and cont: POOLContainerForm(DataHeaderForm)
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile3.root returned FID: '????' tech=ROOT_All
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile3.root
 SimplePoolFile3...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Shapes
 ##Shapes            DEBUG Opening
@@ -265,7 +185,6 @@ SimplePoolFile3...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile3.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 75 CLIDRegistry entries for module ALL
 Stream2             DEBUG addItemObjects(2101,"*") called
 Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
@@ -1286,7 +1205,6 @@ MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
 SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-ClassIDSvc           INFO  getRegistryEntries: read 7 CLIDRegistry entries for module ALL
 Stream1              INFO Records written: 21
 Stream1             DEBUG Leaving handle
 Stream2             DEBUG handle() incident type: MetaDataStop
@@ -1322,16 +1240,10 @@ SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream2              INFO Records written: 21
 Stream2             DEBUG Leaving handle
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
-IncidentProcAlg1     INFO Finalize
 WriteData            INFO in finalize()
 ReWriteData          INFO in finalize()
-WriteData           DEBUG Calling destructor
-ReWriteData         DEBUG Calling destructor
-IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
 Stream2             DEBUG finalize: Optimize output
@@ -1344,11 +1256,6 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 42
-cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #=124
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.242(+- 1.54)/    0/   10 [ms] #=124
-cRepR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.181(+- 1.33)/    0/   10 [ms] #=166
-ChronoStatSvc        INFO Time User   : Tot=  390 [ms]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
index 68520454e9d..e336f0cad70 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
@@ -1,12 +1,11 @@
-Warning in <TInterpreter::ReadRootmapFile>: class  InDet::IInDetTrackSelectionTool found in libInDetTrackSelectionToolDict.so  is already in libInDetSecVtxTrackSelectionToolDict.so 
-Mon Feb 18 13:00:12 CST 2019
+Tue Feb 26 09:21:49 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_CopyJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5458 configurables from 155 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -14,15 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on hepd-0004 on Mon Feb 18 13:00:17 2019
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:58 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 3045 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 Stream1             DEBUG Property update for OutputLevel : new value = 2
@@ -38,8 +36,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /home/gemmeren/workarea/build/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host hepd-0004.lcrc.anl.gov [ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -117,7 +115,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1653 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1706 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -161,7 +159,7 @@ RootDatabase.se...  DEBUG File name SimplePoolFile1.root
 RootDatabase.se...  DEBUG Got tree CollectionTree read entry -1
 RootDatabase.se...  DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolFile1.root and cont: CollectionTree
-ClassIDSvc           INFO  getRegistryEntries: read 396 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
@@ -692,11 +690,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
-fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
 cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 83
+fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
 cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 65
-cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  390 [ms]                                             #=  1
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.484(+- 2.15)/    0/   10 [ms] #= 62
+ChronoStatSvc        INFO Time User   : Tot=  0.7  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
index dbf879abcb4..3b4d975e73f 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
@@ -1,27 +1,26 @@
-Tue Feb 12 15:15:37 CST 2019
+Tue Feb 26 09:22:30 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_FilterJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5451 configurables from 155 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 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 hepd-0004 on Tue Feb 12 15:15:46 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:38 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 3045 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -36,8 +35,8 @@ PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /home/gemmeren/workarea/build/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host hepd-0004.lcrc.anl.gov [ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -50,7 +49,7 @@ EventSelector       DEBUG Property update for OutputLevel : new value = 2
 EventSelector        INFO Initializing EventSelector - package version EventSelectorAthenaPool-00-00-00
 EventSelector       DEBUG Service base class initialized successfully
 EventSelector.Q...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 1967 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 20?0 CLIDRegistry entries for module ALL
 EventSelector.Q...   INFO in initialize()
 EventSelector        INFO reinitialization...
 EventSelector        INFO EventSelection with query EventNumber > 5
@@ -168,7 +167,7 @@ Stream1             DEBUG Data Deps for Stream1
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
 RegStream1          DEBUG Property update for OutputLevel : new value = 2
 RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 665 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 RegStream1          DEBUG In initialize 
 RegStream1          DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
@@ -771,7 +770,6 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 RegStream1.TagTool   INFO Collection Events output: 10
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
-MetaDataSvc         DEBUG prepareOutput
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -825,11 +823,11 @@ EventSelector.Q...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 11
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 32
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 35
-fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.625(+- 2.42)/    0/   10 [ms] #= 32
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.606(+- 2.39)/    0/   10 [ms] #= 33
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.465(+- 2.11)/    0/   10 [ms] #= 43
-ChronoStatSvc        INFO Time User   : Tot= 0.66  [s]                                             #=  1
+fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 32
+cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 43
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.286(+- 1.67)/    0/   10 [ms] #= 35
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.909(+- 2.87)/    0/   10 [ms] #= 33
+ChronoStatSvc        INFO Time User   : Tot= 0.65  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
index 30f640c092f..f5821ba46cf 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 19:11:44 CET 2019
+Tue Feb 26 09:23:48 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RCondJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 19:12:06 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:56 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -40,9 +39,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -118,7 +117,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1798 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -966,9 +965,9 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.217(+- 1.46)/    0/   10 [ms] #= 46
 cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.204(+- 1.41)/    0/   10 [ms] #= 49
-cObj_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max= 0.87(+- 3.51)/    0/   20 [ms] #= 46
-ChronoStatSvc        INFO Time User   : Tot= 0.95  [s]                                             #=  1
+ChronoStatSvc        INFO Time User   : Tot= 0.56  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
index ef70f13f8c9..03bac03aed5 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 19:07:43 CET 2019
+Tue Feb 26 09:22:42 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RFilterJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 19:08:23 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:51 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -35,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -143,7 +142,7 @@ AthenaPoolConve...   INFO massageEventInfo: unable to get OverrideRunNumberFromI
 AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 0 events processed so far  <<<===
 ReadData            DEBUG in execute()
-ClassIDSvc           INFO  getRegistryEntries: read 1815 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2092 CLIDRegistry entries for module ALL
 ReadData          WARNING Could not find EventStreamInfo
 ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
@@ -333,9 +332,9 @@ 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=   90 [ms] Ave/Min/Max= 4.09(+- 18.7)/    0/   90 [ms] #= 22
-cObj_ALL             INFO Time User   : Tot=  130 [ms] Ave/Min/Max= 6.19(+- 21.5)/    0/  100 [ms] #= 21
-ChronoStatSvc        INFO Time User   : Tot= 1.04  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   70 [ms] Ave/Min/Max= 3.18(+- 12.6)/    0/   60 [ms] #= 22
+cObj_ALL             INFO Time User   : Tot=   80 [ms] Ave/Min/Max= 3.81(+-   15)/    0/   70 [ms] #= 21
+ChronoStatSvc        INFO Time User   : Tot= 0.54  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
index 27cca5d130f..4c58119aee4 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 18:44:02 CET 2019
+Tue Feb 26 09:24:13 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RMetaJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 18:44:16 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:24:22 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -37,9 +36,9 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.xml) [ok
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -117,7 +116,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1798 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -877,9 +876,9 @@ ToolSvc.AthPool...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 47
-cObj_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.889(+- 4.12)/    0/   20 [ms] #= 45
-ChronoStatSvc        INFO Time User   : Tot= 0.94  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.213(+- 1.44)/    0/   10 [ms] #= 47
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.444(+- 2.06)/    0/   10 [ms] #= 45
+ChronoStatSvc        INFO Time User   : Tot= 0.56  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index a109d3d6499..176d63aa24d 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 18:40:02 CET 2019
+Tue Feb 26 09:21:23 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 18:40:15 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:32 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -36,9 +35,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -119,7 +118,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2129 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -173,7 +172,7 @@ Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
 RegStream1          DEBUG Property update for OutputLevel : new value = 2
 RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 337 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 RegStream1          DEBUG In initialize 
 RegStream1          DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
@@ -1930,7 +1929,6 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 RegStream1.TagTool   INFO Collection Events output: 20
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
-MetaDataSvc         DEBUG prepareOutput
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1973,10 +1971,10 @@ ReadData             INFO in finalize()
 ReWriteData          INFO in finalize()
 WriteTag             INFO in finalize()
 MagicWriteTag        INFO in finalize()
+IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
 RegStream1          DEBUG In finalize
-IncidentProcAlg2     INFO Finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
@@ -1984,13 +1982,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
 cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 66
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.476(+- 2.13)/    0/   10 [ms] #= 21
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0613(+-0.781)/    0/   10 [ms] #=163
 fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.323(+- 2.52)/    0/   20 [ms] #= 62
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.123(+- 1.56)/    0/   20 [ms] #=163
-cObj_ALL             INFO Time User   : Tot=   50 [ms] Ave/Min/Max=0.794(+- 3.24)/    0/   20 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot= 0.94  [s]                                             #=  1
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot= 0.73  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
index a66e5c8af98..dbfcfb71701 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 18:52:15 CET 2019
+Tue Feb 26 09:22:02 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 18:52:52 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:11 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -36,9 +35,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -113,7 +112,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2126 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolRepli...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -167,7 +166,7 @@ Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
 RegStream1          DEBUG Property update for OutputLevel : new value = 2
 RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 337 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 RegStream1          DEBUG In initialize 
 RegStream1          DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
@@ -1986,7 +1985,6 @@ RegStream1.TagTool   INFO Collection Events output: 20
 RegStream1.TagTool   INFO Unable to register collection: PFN 'RootCollection||PFN:SimplePoolCollection3.root' already registered ( POOL : "registerPFN" from "FileCatalog" )
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
-MetaDataSvc         DEBUG prepareOutput
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -2029,10 +2027,10 @@ ReadData             INFO in finalize()
 ReWriteData          INFO in finalize()
 WriteTag             INFO in finalize()
 MagicWriteTag        INFO in finalize()
+IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
 RegStream1          DEBUG In finalize
-IncidentProcAlg2     INFO Finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
@@ -2042,11 +2040,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 65
-cObj_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.635(+- 3.02)/    0/   20 [ms] #= 63
-cRepR_ALL            INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.245(+-  1.9)/    0/   20 [ms] #=163
-fRep_ALL             INFO Time User   : Tot=   50 [ms] Ave/Min/Max=0.806(+- 3.26)/    0/   20 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  1.2  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.154(+- 1.23)/    0/   10 [ms] #= 65
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
+cRepR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.184(+- 1.74)/    0/   20 [ms] #=163
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.645(+- 3.04)/    0/   20 [ms] #= 62
+ChronoStatSvc        INFO Time User   : Tot= 0.67  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index ef8f7480f75..aaf9bcd318b 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 18:53:02 CET 2019
+Tue Feb 26 09:22:15 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 18:53:55 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:25 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -36,9 +35,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -119,7 +118,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2129 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -173,7 +172,7 @@ Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
 RegStream1          DEBUG Property update for OutputLevel : new value = 2
 RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 337 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 RegStream1          DEBUG In initialize 
 RegStream1          DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
@@ -1328,7 +1327,6 @@ Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
 RegStream1.TagTool   INFO Collection Events output: 20
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
-MetaDataSvc         DEBUG prepareOutput
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
 Stream1             DEBUG addItemObjects(167728019,"Stream1") called
 Stream1             DEBUG            Key:Stream1
@@ -1371,10 +1369,10 @@ ReadData             INFO in finalize()
 ReWriteData          INFO in finalize()
 WriteTag             INFO in finalize()
 MagicWriteTag        INFO in finalize()
+IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
 RegStream1          DEBUG In finalize
-IncidentProcAlg2     INFO Finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
@@ -1384,11 +1382,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 65
-fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.154(+- 1.23)/    0/   10 [ms] #= 65
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0613(+-0.781)/    0/   10 [ms] #=163
-cObj_ALL             INFO Time User   : Tot=   50 [ms] Ave/Min/Max=0.794(+-  3.7)/    0/   20 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot= 1.28  [s]                                             #=  1
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.323(+- 1.77)/    0/   10 [ms] #= 62
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot= 0.76  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
index fc047d6e275..ccd005b6b21 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 18:40:19 CET 2019
+Tue Feb 26 09:21:37 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 18:40:32 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:45 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -35,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -162,7 +161,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1801 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -322,8 +321,8 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -355,8 +354,8 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -388,8 +387,8 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -421,8 +420,8 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -454,8 +453,8 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -487,8 +486,8 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -520,8 +519,8 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -553,8 +552,8 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -586,8 +585,8 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -619,8 +618,8 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20094
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
@@ -809,7 +808,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -831,7 +830,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -853,7 +852,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -875,7 +874,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -897,7 +896,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -919,7 +918,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -941,7 +940,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -963,7 +962,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -985,7 +984,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1007,7 +1006,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1029,7 +1028,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1051,7 +1050,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1073,7 +1072,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1095,7 +1094,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1117,7 +1116,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1139,7 +1138,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1161,7 +1160,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1183,7 +1182,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1205,7 +1204,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1227,7 +1226,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16734
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1370,7 +1369,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1396,7 +1395,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1422,7 +1421,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1448,7 +1447,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1474,7 +1473,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1500,7 +1499,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1526,7 +1525,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1552,7 +1551,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1578,7 +1577,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1604,7 +1603,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1630,7 +1629,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1656,7 +1655,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1682,7 +1681,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1708,7 +1707,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1734,7 +1733,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1760,7 +1759,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1786,7 +1785,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1812,7 +1811,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1838,7 +1837,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1864,7 +1863,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18966
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1883,9 +1882,9 @@ 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=   10 [ms] Ave/Min/Max=0.099(+- 0.99)/    0/   10 [ms] #=101
-cObj_ALL             INFO Time User   : Tot=   50 [ms] Ave/Min/Max=0.543(+-  2.7)/    0/   20 [ms] #= 92
-ChronoStatSvc        INFO Time User   : Tot= 0.92  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=101
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 1.78)/    0/   10 [ms] #= 92
+ChronoStatSvc        INFO Time User   : Tot= 0.64  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
index 07a000d002e..cf738fb8201 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 19:29:52 CET 2019
+Tue Feb 26 09:22:55 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 19:30:14 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:03 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -35,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -156,7 +155,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1798 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolRepli...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -381,8 +380,8 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -414,8 +413,8 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -447,8 +446,8 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -480,8 +479,8 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -513,8 +512,8 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -546,8 +545,8 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -579,8 +578,8 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -612,8 +611,8 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -645,8 +644,8 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -678,8 +677,8 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19644
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
@@ -869,7 +868,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -891,7 +890,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -913,7 +912,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -935,7 +934,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -957,7 +956,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -979,7 +978,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1001,7 +1000,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1023,7 +1022,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1045,7 +1044,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1067,7 +1066,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1089,7 +1088,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1111,7 +1110,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1133,7 +1132,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1155,7 +1154,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1177,7 +1176,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1199,7 +1198,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1221,7 +1220,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1243,7 +1242,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1265,7 +1264,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1287,7 +1286,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1430,7 +1429,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1456,7 +1455,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1482,7 +1481,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1508,7 +1507,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1534,7 +1533,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1560,7 +1559,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1586,7 +1585,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1612,7 +1611,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1638,7 +1637,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1664,7 +1663,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1690,7 +1689,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1716,7 +1715,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1742,7 +1741,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1768,7 +1767,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1794,7 +1793,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1820,7 +1819,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1846,7 +1845,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1872,7 +1871,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1898,7 +1897,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1924,7 +1923,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19068
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1943,9 +1942,9 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
+cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 92
 cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=101
-cObj_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.435(+- 2.52)/    0/   20 [ms] #= 92
-ChronoStatSvc        INFO Time User   : Tot= 0.95  [s]                                             #=  1
+ChronoStatSvc        INFO Time User   : Tot= 0.68  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
index 673cabcad57..c8a17acb6f1 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
@@ -1,27 +1,26 @@
-Tue Feb  5 19:30:58 CET 2019
+Tue Feb 26 09:23:20 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 19:31:22 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:30 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -35,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -156,7 +155,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1798 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -381,8 +380,8 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -414,8 +413,8 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -447,8 +446,8 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -480,8 +479,8 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -513,8 +512,8 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -546,8 +545,8 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -579,8 +578,8 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -612,8 +611,8 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -645,8 +644,8 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -678,8 +677,8 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19693
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 23
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
@@ -869,7 +868,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -891,7 +890,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -913,7 +912,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -935,7 +934,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -957,7 +956,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -979,7 +978,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1001,7 +1000,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1023,7 +1022,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1045,7 +1044,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1067,7 +1066,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1089,7 +1088,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1111,7 +1110,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1133,7 +1132,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1155,7 +1154,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1177,7 +1176,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1199,7 +1198,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1221,7 +1220,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1243,7 +1242,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1265,7 +1264,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1287,7 +1286,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16738
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1418,7 +1417,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1444,7 +1443,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1470,7 +1469,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1496,7 +1495,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1522,7 +1521,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1548,7 +1547,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1574,7 +1573,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1600,7 +1599,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1626,7 +1625,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1652,7 +1651,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1678,7 +1677,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1704,7 +1703,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1730,7 +1729,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1756,7 +1755,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1782,7 +1781,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1808,7 +1807,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1834,7 +1833,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1860,7 +1859,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1886,7 +1885,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1912,7 +1911,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18601
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
@@ -1931,9 +1930,9 @@ 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=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=101
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 2.31)/    0/   20 [ms] #= 92
-ChronoStatSvc        INFO Time User   : Tot=    1  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.099(+- 0.99)/    0/   10 [ms] #=101
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 1.78)/    0/   10 [ms] #= 92
+ChronoStatSvc        INFO Time User   : Tot= 0.66  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
index ff796037dfe..5fa7ff4b8fa 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
@@ -1,30 +1,29 @@
-Tue Feb  5 19:31:29 CET 2019
+Tue Feb 26 09:23:35 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WCondJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5456 configurables from 56 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 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 lxplus115.cern.ch on Tue Feb  5 19:31:58 2019
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:43 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 7037 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 1164 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 1169 CLIDRegistry entries for module ALL
 Stream1             DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG in initialize()
 ToolSvc.Stream1...   INFO Initializing ToolSvc.Stream1Tool - package version AthenaServices-00-00-00
@@ -33,9 +32,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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/2019-02-04T2257/Athena/22.0.1/InstallArea/x86_64-slc6-gcc62-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus115.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -117,7 +116,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1798 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2070 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -1186,9 +1185,9 @@ commitOutput         INFO Time User   : Tot=    0 [us]
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  2
 fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  2
 cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  3
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.217(+- 1.46)/    0/   10 [ms] #= 46
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.682(+-  3.3)/    0/   20 [ms] #= 44
-ChronoStatSvc        INFO Time User   : Tot= 0.98  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 46
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.455(+- 2.08)/    0/   10 [ms] #= 44
+ChronoStatSvc        INFO Time User   : Tot= 0.62  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
index 0a0ce4be884..1d3be638da1 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
@@ -1,12 +1,11 @@
-Warning in <TInterpreter::ReadRootmapFile>: class  InDet::IInDetTrackSelectionTool found in libInDetTrackSelectionToolDict.so  is already in libInDetSecVtxTrackSelectionToolDict.so 
-Mon Feb 18 13:01:26 CST 2019
+Tue Feb 26 09:24:00 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WMetaJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5458 configurables from 155 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -14,15 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on hepd-0004 on Mon Feb 18 13:01:31 2019
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:24:09 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 3045 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
@@ -38,8 +36,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.xml) [ok
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /home/gemmeren/workarea/build/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host hepd-0004.lcrc.anl.gov [ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -136,7 +134,7 @@ SimplePoolFile5...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile5.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 504 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 453 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
@@ -741,11 +739,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
-cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.476(+- 2.13)/    0/   10 [ms] #= 21
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.119(+- 1.08)/    0/   10 [ms] #= 84
 fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.238(+- 1.52)/    0/   10 [ms] #= 84
-ChronoStatSvc        INFO Time User   : Tot=  370 [ms]                                             #=  1
+cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.476(+- 2.78)/    0/   20 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot= 0.66  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
index 6ebb3d3d917..2d920194bb0 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
@@ -1,12 +1,11 @@
-Warning in <TInterpreter::ReadRootmapFile>: class  InDet::IInDetTrackSelectionTool found in libInDetTrackSelectionToolDict.so  is already in libInDetSecVtxTrackSelectionToolDict.so 
-Mon Feb 18 12:59:38 CST 2019
+Tue Feb 26 09:21:07 CST 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WriteJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5458 configurables from 155 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -14,15 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on hepd-0004 on Mon Feb 18 12:59:51 2019
+                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:19 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 3045 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3110 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
@@ -38,8 +36,8 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data
-DBReplicaSvc         INFO Read replica configuration from /home/gemmeren/workarea/build/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host hepd-0004.lcrc.anl.gov [ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
 PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -87,7 +85,7 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 396 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 Stream2             DEBUG Property update for OutputLevel : new value = 2
 Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG In initialize 
@@ -162,7 +160,7 @@ SimplePoolFile1...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile1.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 542 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 540 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
@@ -1040,10 +1038,10 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 43
-cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.189(+- 1.36)/    0/   10 [ms] #=106
-cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.0647(+-0.802)/    0/   10 [ms] #=309
-fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.377(+- 1.91)/    0/   10 [ms] #=106
-ChronoStatSvc        INFO Time User   : Tot=  450 [ms]                                             #=  1
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0324(+-0.568)/    0/   10 [ms] #=309
+fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.283(+- 1.66)/    0/   10 [ms] #=106
+cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.283(+- 2.15)/    0/   20 [ms] #=106
+ChronoStatSvc        INFO Time User   : Tot=  0.7  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt
index 1a7ac3f5f2f..f60e79006f0 100644
--- a/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt
+++ b/Database/AthenaPOOL/AthenaPoolTools/CMakeLists.txt
@@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PRIVATE
                           Control/StoreGate
                           Database/PersistentDataModel
                           Event/EventInfo
+                          Event/ByteStreamData
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODCutFlow
                           GaudiKernel
@@ -24,7 +25,7 @@ atlas_add_component( AthenaPoolTools
                      src/BookkeeperDumper.cxx
                      src/RequireUniqueEvent.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo GaudiKernel xAODCutFlow)
+                     LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo GaudiKernel xAODCutFlow ByteStreamData)
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
diff --git a/Database/AthenaPOOL/AthenaPoolTools/share/MetadataTest_jobOptions.py b/Database/AthenaPOOL/AthenaPoolTools/share/MetadataTest_jobOptions.py
index f795f05fbea..d1c4938c3dd 100755
--- a/Database/AthenaPOOL/AthenaPoolTools/share/MetadataTest_jobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolTools/share/MetadataTest_jobOptions.py
@@ -15,7 +15,10 @@ svcMgr += ClassIDSvc()
 from AthenaCommon.Constants   import INFO
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
+from AthenaCommon.AlgSequence import AthSequencer
+athOutSeq = AthSequencer("AthOutSeq")
 
+# include MetaDataSvc and initialize properties
 include("EventSelectorAthenaPool/MetaDataSvc_jobOptions.py")
 from AthenaServices.AthenaServicesConf import MetaDataSvc
 svcMgr += MetaDataSvc()
@@ -23,15 +26,48 @@ svcMgr.MetaDataSvc.OutputLevel = 2
 svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr"
 svcMgr.ProxyProviderSvc.ProviderNames += [ "MetaDataSvc" ]
 
+# include some tools
+from EventBookkeeperTools.CutFlowHelpers import CreateBookkeeperTool
+CreateBookkeeperTool()
+
+from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamMetadataTool
+svcMgr.MetaDataSvc.MetaDataTools += [ "ByteStreamMetadataTool" ]
+
+#print "SGInputLoader init"
+#from SGComps.SGCompsConf import SGInputLoader
+#sgin = SGInputLoader()
+#sgin.Load = [('EventInfo','ByteStreamEventInfo')]
+
+# Tell it that there is data in the input file
 from IOVSvc.IOVSvcConf import MetaInputLoader
 metain = MetaInputLoader()
 metain.Dump = True
-metain.OutputLevel = DEBUG
-metain.Load = [('EventStreamInfo','StreamAOD'),('xAOD::CutBookkeeperContainer','CutBookkeepers'),('xAOD::CutBookkeeperAuxContainer','CutBookkeepersAux.')]
+metain.OutputLevel = INFO
+metain.Load = [('EventStreamInfo','StreamAOD'),('xAOD::CutBookkeeperContainer','CutBookkeepers'),('xAOD::CutBookkeeperAuxContainer','CutBookkeepersAux.'),('ByteStreamMetadataContainer','ByteStreamMetadata'),('xAOD::CutBookkeeperContainer','IncompleteCutBookkeepers'),('xAOD::CutBookkeeperAuxContainer','IncompleteCutBookkeepersAux.')]
 topSequence += metain
 
+include ("AthenaPoolTools/EventCount_jobOptions.py")
+
 from AthenaPoolTools.AthenaPoolToolsConf import MetadataTest
-topSequence += MetadataTest( OutputLevel = INFO )
+topSequence += MetadataTest( OutputLevel = INFO, InputStream="StreamAOD" )
+
+import PyUtils.AthFile as af
+from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
+CreateCutFlowSvc( svcName="CutFlowSvc", athFile=af, seq=topSequence, addMetaDataToAllOutputFiles=False )
+
+import AthenaPoolCnvSvc.WriteAthenaPool
+
+from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
+DataStream = AthenaPoolOutputStream( "StreamTest" , "MetadataTest.root", True, noTag=True )
+DataStream.TakeItemsFromInput = True
+DataStream.ItemList   += ["EventInfo#ByteStreamEventInfo"]
+DataStream.MetadataItemList   += ["xAOD::CutBookkeeperContainer#CutBookkeepers"]
+DataStream.MetadataItemList   += ["xAOD::CutBookkeeperAuxContainer#CutBookkeepersAux."]
+DataStream.MetadataItemList   += ["xAOD::CutBookkeeperContainer#IncompleteCutBookkeepers"]
+DataStream.MetadataItemList   += ["xAOD::CutBookkeeperAuxContainer#IncompleteCutBookkeepersAux."]
+DataStream.MetadataItemList   += ["ByteStreamMetadataContainer#ByteStreamMetadata"]
+DataStream.OutputLevel = DEBUG
+
 #==============================================================
 #
 # End of job options file
diff --git a/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.cxx b/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.cxx
index 45f6b6c7712..61f356ea1cf 100755
--- a/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.cxx
+++ b/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.cxx
@@ -13,6 +13,7 @@
 #include "StoreGate/ReadMetaHandle.h"
 
 #include "xAODCutFlow/CutBookkeeperContainer.h"
+#include "ByteStreamData/ByteStreamMetadata.h"
 
 #include "StoreGate/StoreGateSvc.h"
 
@@ -21,10 +22,15 @@
 MetadataTest::MetadataTest(const std::string& name, ISvcLocator* pSvcLocator) : 
    AthAlgorithm(name, pSvcLocator),
    m_hkey("CutBookkeepers","MetaDataStore"),
+   m_hinckey("IncompleteCutBookkeepers","MetaDataStore"),
    m_eihkey("StreamAOD","MetaDataStore"),
-   //m_eihkey2("DataStream","MetaDataStore"),
-   m_esidone(false)
+   m_bshkey("ByteStreamMetadata","MetaDataStore"),
+   m_esidone(false),
+   m_inputstream("StreamAOD")
 {
+   declareProperty("InputStream",
+                   m_inputstream = "StreamAOD",
+                   "Key to read EventStreamInfo.");
 }
 
 MetadataTest::~MetadataTest()
@@ -33,9 +39,11 @@ MetadataTest::~MetadataTest()
 StatusCode MetadataTest::start() 
 {
   // Get proper dbkey.
+   m_eihkey = SG::ReadMetaHandleKey<EventStreamInfo>(m_inputstream,"MetaDataStore");
    ATH_CHECK( m_hkey.initialize() );  
+   ATH_CHECK( m_hinckey.initialize() );  
    ATH_CHECK( m_eihkey.initialize() );
-   //ATH_CHECK( m_eihkey2.initialize() );
+   ATH_CHECK( m_bshkey.initialize() );
    m_esidone = false;
    return StatusCode::SUCCESS;
 }
@@ -43,15 +51,10 @@ StatusCode MetadataTest::start()
 StatusCode MetadataTest::execute() 
 {
    ATH_MSG_DEBUG ( "in execute()" );
-
-   const DataHeader* thisDH = nullptr;
-   ATH_CHECK( evtStore()->retrieve(thisDH, "EventSelector") );
-   std::string sid = thisDH->begin()->getToken()->dbID().toString();
    if (!m_esidone) {
-     //m_hkey.setDbKey(sid);
-     SG::ReadMetaHandleKey<xAOD::CutBookkeeperContainer> readkey(m_hkey.key(),sid);
-     ATH_CHECK(readkey.initialize());
-     SG::ReadMetaHandle<xAOD::CutBookkeeperContainer> readhand(readkey,this->getContext());
+     ATH_MSG_INFO("== CUTBOOKKEEPERCONTAINER CHECKS ==");
+     // create handle, get pointer to object
+     SG::ReadMetaHandle<xAOD::CutBookkeeperContainer> readhand(m_hkey,this->getContext());
      const xAOD::CutBookkeeperContainer* cbkCont(*readhand);
      if (cbkCont != nullptr) {
        ATH_MSG_INFO("Found cbk size " << cbkCont->size());
@@ -61,8 +64,20 @@ StatusCode MetadataTest::execute()
      } else {
        ATH_MSG_ERROR("Did not retrieve CutBookkeeperContainer from store");
      }
+     // create handle, get pointer to object
+     SG::ReadMetaHandle<xAOD::CutBookkeeperContainer> increadhand(m_hinckey,this->getContext());
+     const xAOD::CutBookkeeperContainer* inccbkCont(*increadhand);
+     if (inccbkCont != nullptr) {
+       ATH_MSG_INFO("Found inc cbk size " << inccbkCont->size());
+       for (auto it = inccbkCont->begin(); it != inccbkCont->end(); ++it) {
+         ATH_MSG_INFO("Name: " <<(*it)->name() << ", N=" << (*it)->nAcceptedEvents());
+       }
+     } else {
+       ATH_MSG_ERROR("Did not retrieve inc CutBookkeeperContainer from store");
+     }
 
-     m_eihkey.setDbKey(sid);
+     ATH_MSG_INFO("== EVENTSTREAMINFO CHECKS ==");
+     // create handle, get pointer to object
      SG::ReadMetaHandle<EventStreamInfo> eikey(m_eihkey,this->getContext());
      const EventStreamInfo* esi(*eikey);
      if (esi!=nullptr) {
@@ -70,16 +85,20 @@ StatusCode MetadataTest::execute()
      } else {
        ATH_MSG_ERROR("Did not retrieve EventStreamInfo " << m_eihkey.objKey());
      }
-/*
-     m_eihkey2.setDbKey(sid);
-     SG::ReadMetaHandle<EventStreamInfo> eikey2(m_eihkey2,this->getContext());
-     const EventStreamInfo* esi2(*eikey2);
-     if (esi2!=nullptr) {
-       ATH_MSG_INFO(" esi has n events = " << esi2->getNumberOfEvents());
+
+     ATH_MSG_INFO("== BYTESTREAMMETADATACONTAINER CHECKS ==");
+     // create handle, get pointer to object
+     SG::ReadMetaHandle<ByteStreamMetadataContainer> bskey(m_bshkey,this->getContext());
+     const ByteStreamMetadataContainer* bsmc(*bskey);
+     if (bsmc!=nullptr) {
+       ATH_MSG_INFO("ByteStreamMetadataContainer size " << bsmc->size());
+       for (auto it = bsmc->begin(); it != bsmc->end(); ++it) {
+         ATH_MSG_INFO("Run="<<(*it)->getRunNumber()<<" E="<<(*it)->getBeamEnergy()<<" s="<<(*it)->getStream());
+       } 
      } else {
-       ATH_MSG_ERROR("Did not retrieve EventStreamInfo " << m_eihkey2.objKey());
+       ATH_MSG_ERROR("Did not find ByteStreamMetadataContainer");
      }
-*/
+
      m_esidone=true;
    }
 
diff --git a/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.h b/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.h
index e609a14f020..536ce36a6bf 100755
--- a/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.h
+++ b/Database/AthenaPOOL/AthenaPoolTools/src/MetadataTest.h
@@ -26,6 +26,7 @@
 #include "StoreGate/ReadMetaHandleKey.h"
 #include "xAODCutFlow/CutBookkeeperContainer.h"
 #include "EventInfo/EventStreamInfo.h"
+#include "ByteStreamData/ByteStreamMetadataContainer.h"
 
 class MetadataTest : public AthAlgorithm {
 public:
@@ -40,11 +41,12 @@ public:
 
 private:
   SG::ReadMetaHandleKey<xAOD::CutBookkeeperContainer> m_hkey;
+  SG::ReadMetaHandleKey<xAOD::CutBookkeeperContainer> m_hinckey;
   SG::ReadMetaHandleKey<EventStreamInfo> m_eihkey;
-  //SG::ReadMetaHandleKey<EventStreamInfo> m_eihkey2;
+  SG::ReadMetaHandleKey<ByteStreamMetadataContainer> m_bshkey;
 
   bool m_esidone;
-
+  std::string m_inputstream;
 
 };
 #endif
diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.cxx b/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.cxx
index c4ff3c32725..a966b65e169 100644
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.cxx
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.cxx
@@ -10,188 +10,48 @@
 
 #include "CopyEventStreamInfo.h"
 
-#include "GaudiKernel/FileIncident.h"
-
-#include "EventInfo/EventStreamInfo.h"
-#include "StoreGate/StoreGateSvc.h"
 
 //___________________________________________________________________________
 CopyEventStreamInfo::CopyEventStreamInfo(const std::string& type,
-	const std::string& name,
-	const IInterface* parent) : ::AthAlgTool(type, name, parent),
-		m_metaDataStore("StoreGateSvc/MetaDataStore", name),
-		m_inputMetaDataStore("StoreGateSvc/InputMetaDataStore", name) {
-   // Declare IMetaDataTool interface
-   declareInterface<IMetaDataTool>(this);
-
-   // Declare the properties
-   declareProperty("Key", m_key = std::string());
+              	                         const std::string& name,
+	                                 const IInterface* parent) 
+       : GenericMetadataToolNoAux <EventStreamInfo>(type, name, parent)
+{
 }
 //___________________________________________________________________________
 CopyEventStreamInfo::~CopyEventStreamInfo() {
 }
-//___________________________________________________________________________
-StatusCode CopyEventStreamInfo::initialize() {
-   ATH_MSG_INFO("Initializing " << name() << " - package version " << PACKAGE_VERSION);
-   // Locate the MetaDataStore and InputMetaDataStore
-   if (!m_metaDataStore.retrieve().isSuccess()) {
-      ATH_MSG_FATAL("Could not find MetaDataStore");
-      return(StatusCode::FAILURE);
+
+
+StatusCode CopyEventStreamInfo::updateContainer(
+                 EventStreamInfo* evtStrInfo_out,
+           const EventStreamInfo* evtStrInfo_in ) 
+{
+   evtStrInfo_out->addEvent(evtStrInfo_in->getNumberOfEvents());
+   for (auto elem = evtStrInfo_in->getRunNumbers().begin(),
+         lastElem = evtStrInfo_in->getRunNumbers().end(); 
+            elem != lastElem; elem++) {
+      evtStrInfo_out->insertRunNumber(*elem);
    }
-   if (!m_inputMetaDataStore.retrieve().isSuccess()) {
-      ATH_MSG_FATAL("Could not find InputMetaDataStore");
-      return(StatusCode::FAILURE);
+   for (auto elem = evtStrInfo_in->getLumiBlockNumbers().begin(),
+         lastElem = evtStrInfo_in->getLumiBlockNumbers().end(); 
+            elem != lastElem; elem++) {
+      evtStrInfo_out->insertLumiBlockNumber(*elem);
    }
-   // Set to be listener for end of event
-   /*
-   ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", this->name());
-   if (incSvc.retrieve().isFailure()) {
-      ATH_MSG_FATAL("Unable to get the IncidentSvc");
-      return(StatusCode::FAILURE);
+   for (auto elem = evtStrInfo_in->getProcessingTags().begin(),
+         lastElem = evtStrInfo_in->getProcessingTags().end(); 
+            elem != lastElem; elem++) {
+      evtStrInfo_out->insertProcessingTag(*elem);
    }
-   incSvc->addListener(this, "BeginInputFile", 60); // pri has to be < 100 to be after MetaDataSvc.
-   */
-   return(StatusCode::SUCCESS);
-}
-//___________________________________________________________________________
-StatusCode CopyEventStreamInfo::finalize() {
-   ATH_MSG_DEBUG("in finalize()");
-   // release the MetaDataStore and InputMetaDataStore
-   if (!m_metaDataStore.release().isSuccess()) {
-      ATH_MSG_WARNING("Could not release MetaDataStore");
+   for (auto elem = evtStrInfo_in->getItemList().begin(),
+         lastElem = evtStrInfo_in->getItemList().end(); 
+            elem != lastElem; elem++) {
+      evtStrInfo_out->insertItemList((*elem).first, (*elem).second);
    }
-   if (!m_inputMetaDataStore.release().isSuccess()) {
-      ATH_MSG_WARNING("Could not release InputMetaDataStore");
+   for (auto elem = evtStrInfo_in->getEventTypes().begin(),
+         lastElem = evtStrInfo_in->getEventTypes().end(); 
+            elem != lastElem; elem++) {
+      evtStrInfo_out->insertEventType(*elem);
    }
    return(StatusCode::SUCCESS);
 }
-
-
-StatusCode CopyEventStreamInfo::beginInputFile(const SG::SourceID&)
-{
-   if (m_inputMetaDataStore->contains<EventStreamInfo>(m_key)) {
-      std::list<SG::ObjectWithVersion<EventStreamInfo> > allVersions;
-      if (!m_inputMetaDataStore->retrieveAllVersions(allVersions, m_key).isSuccess()) {
-         ATH_MSG_ERROR("Could not retrieve all versions for EventStreamInfo");
-         return StatusCode::FAILURE;
-      }
-      EventStreamInfo* evtStrInfo_out = 0;
-      for (SG::ObjectWithVersion<EventStreamInfo>& obj : allVersions) {
-         const EventStreamInfo* evtStrInfo_in = obj.dataObject.cptr();
-         if (!m_metaDataStore->contains<EventStreamInfo>(m_key)) {
-            evtStrInfo_out = new EventStreamInfo(*evtStrInfo_in);
-            if (!m_metaDataStore->record(evtStrInfo_out, m_key).isSuccess()) {
-               ATH_MSG_ERROR("Could not record DataObject: " << m_key);
-               return StatusCode::FAILURE;
-            }
-         } else {
-            if (!m_metaDataStore->retrieve(evtStrInfo_out, m_key).isSuccess()) {
-               ATH_MSG_ERROR("Could not find DataObject in output: " << m_key);
-               return StatusCode::FAILURE;
-            }
-            evtStrInfo_out->addEvent(evtStrInfo_in->getNumberOfEvents());
-            for (auto elem = evtStrInfo_in->getRunNumbers().begin(),
-	              lastElem = evtStrInfo_in->getRunNumbers().end(); 
-                      elem != lastElem; elem++) {
-               evtStrInfo_out->insertRunNumber(*elem);
-            }
-            for (auto elem = evtStrInfo_in->getLumiBlockNumbers().begin(),
-	              lastElem = evtStrInfo_in->getLumiBlockNumbers().end(); 
-                      elem != lastElem; elem++) {
-               evtStrInfo_out->insertLumiBlockNumber(*elem);
-            }
-            for (auto elem = evtStrInfo_in->getProcessingTags().begin(),
-	              lastElem = evtStrInfo_in->getProcessingTags().end(); 
-                      elem != lastElem; elem++) {
-               evtStrInfo_out->insertProcessingTag(*elem);
-            }
-            for (auto elem = evtStrInfo_in->getItemList().begin(),
-	              lastElem = evtStrInfo_in->getItemList().end(); 
-                      elem != lastElem; elem++) {
-               evtStrInfo_out->insertItemList((*elem).first, (*elem).second);
-            }
-            for (auto elem = evtStrInfo_in->getEventTypes().begin(),
-	              lastElem = evtStrInfo_in->getEventTypes().end(); 
-                      elem != lastElem; elem++) {
-               evtStrInfo_out->insertEventType(*elem);
-            }
-         }
-      }
-   }
-   return(StatusCode::SUCCESS);
-}
-StatusCode CopyEventStreamInfo::endInputFile(const SG::SourceID&)
-{
-   return(StatusCode::SUCCESS);
-}
-StatusCode CopyEventStreamInfo::metaDataStop(const SG::SourceID&)
-{
-   return(StatusCode::SUCCESS);
-}
-//___________________________________________________________________________
-/*
-void CopyEventStreamInfo::handle(const Incident& inc) {
-   ATH_MSG_DEBUG("handle() " << inc.type());
-   if (inc.type() == "BeginInputFile") {
-      std::vector<std::string> keys;
-      if (m_key.value().empty()) {
-         m_inputMetaDataStore->keys<EventStreamInfo>(keys);
-      } else {
-         keys.push_back(m_key);
-      }
-      for (const auto &key : keys) {
-         // Ignore versioned container
-         if (key.substr(0, 1) == ";" && key.substr(3, 1) == ";") {
-            ATH_MSG_VERBOSE( "Ignore versioned containe: " << key );
-            continue;
-         }
-         ATH_MSG_VERBOSE("Attempting to copy " << key);
-         if (m_inputMetaDataStore->contains<EventStreamInfo>(key)) {
-            std::list<SG::ObjectWithVersion<EventStreamInfo> > allVersions;
-            if (!m_inputMetaDataStore->retrieveAllVersions(allVersions, key).isSuccess()) {
-               ATH_MSG_ERROR("Could not retrieve all versions for EventStreamInfo");
-               return;
-            }
-            EventStreamInfo* evtStrInfo_out = 0;
-            for (std::list<SG::ObjectWithVersion<EventStreamInfo> >::const_iterator iter = allVersions.begin(),
-		            iterEnd = allVersions.end(); iter != iterEnd; iter++) {
-               const EventStreamInfo* evtStrInfo_in = iter->dataObject;
-               if (!m_metaDataStore->contains<EventStreamInfo>(key)) {
-                  evtStrInfo_out = new EventStreamInfo(*evtStrInfo_in);
-                  if (!m_metaDataStore->record(evtStrInfo_out, key).isSuccess()) {
-                     ATH_MSG_ERROR("Could not record DataObject: " << key);
-                     return;
-                  }
-               } else {
-                  if (!m_metaDataStore->retrieve(evtStrInfo_out, key).isSuccess()) {
-                     ATH_MSG_ERROR("Could not find DataObject in output: " << key);
-                     return;
-                  }
-                  evtStrInfo_out->addEvent(evtStrInfo_in->getNumberOfEvents());
-                  for (std::set<unsigned int>::const_iterator elem = evtStrInfo_in->getRunNumbers().begin(),
-		                  lastElem = evtStrInfo_in->getRunNumbers().end(); elem != lastElem; elem++) {
-                     evtStrInfo_out->insertRunNumber(*elem);
-                  }
-                  for (std::set<unsigned int>::const_iterator elem = evtStrInfo_in->getLumiBlockNumbers().begin(),
-		                  lastElem = evtStrInfo_in->getLumiBlockNumbers().end(); elem != lastElem; elem++) {
-                     evtStrInfo_out->insertLumiBlockNumber(*elem);
-                  }
-                  for (std::set<std::string>::const_iterator elem = evtStrInfo_in->getProcessingTags().begin(),
-		                  lastElem = evtStrInfo_in->getProcessingTags().end(); elem != lastElem; elem++) {
-                     evtStrInfo_out->insertProcessingTag(*elem);
-                  }
-                  for (std::set<std::pair<CLID, std::string> >::const_iterator elem = evtStrInfo_in->getItemList().begin(),
-		                  lastElem = evtStrInfo_in->getItemList().end(); elem != lastElem; elem++) {
-                     evtStrInfo_out->insertItemList((*elem).first, (*elem).second);
-                  }
-                  for (std::set<EventType>::const_iterator elem = evtStrInfo_in->getEventTypes().begin(),
-		                  lastElem = evtStrInfo_in->getEventTypes().end(); elem != lastElem; elem++) {
-                     evtStrInfo_out->insertEventType(*elem);
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-*/
diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.h b/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.h
index 62bdee0caee..c47114f86e6 100644
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.h
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/src/CopyEventStreamInfo.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 COPYEVENTSTREAMINFO_H
@@ -9,9 +9,8 @@
  *  @author Peter van Gemmeren <gemmeren@anl.gov>
  **/
 
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "AthenaKernel/IMetaDataTool.h"
+#include "AthenaKernel/GenericMetadataToolNoAux.h"
+#include "EventInfo/EventStreamInfo.h"
 
 #include <string>
 
@@ -20,36 +19,21 @@ class StoreGateSvc;
 /** @class CopyEventStreamInfo 
  *  @brief This class provides an algorithm to make the EventStreamInfo object and update it.
  **/
-class CopyEventStreamInfo : public ::AthAlgTool, virtual public IMetaDataTool {
+class CopyEventStreamInfo : public GenericMetadataToolNoAux <EventStreamInfo> {
 public:
    /// Standard AlgTool Constructor
-   CopyEventStreamInfo(const std::string& type, const std::string& name, const IInterface* parent);
+   CopyEventStreamInfo(const std::string& type, 
+                       const std::string& name, 
+                       const IInterface* parent);
    /// Destructor
    virtual ~CopyEventStreamInfo();
 
    /// AthAlgTool Interface method implementations:
-   StatusCode initialize();
-   StatusCode finalize();
+   //StatusCode initialize();
+   //StatusCode finalize();
+   /// Helper class to update a container with information from another one
+   virtual StatusCode updateContainer(EventStreamInfo* evtStrInfo_out,
+                                const EventStreamInfo* evtStrInfo_in );
 
-   /// Function called when a new input file is opened
-   virtual StatusCode beginInputFile(const SG::SourceID& = "Serial");
- 
-   /// Function called when the currently open input file got completely
-   /// processed
-   virtual StatusCode endInputFile(const SG::SourceID& = "Serial");
-
-   /// Function called when the tool should write out its metadata
-   virtual StatusCode metaDataStop(const SG::SourceID& = "Serial");
-
-   /// Incident service handle listening for BeginInputFile and EndInputFile.
-   //void handle(const Incident& incident);
-
-private:
-   /// Key, the StoreGate key for the EventStreamInfo object.
-   StringProperty m_key;
-
-   /// Pointer to the metadata stores
-   ServiceHandle<StoreGateSvc> m_metaDataStore;
-   ServiceHandle<StoreGateSvc> m_inputMetaDataStore;
 };
 #endif
diff --git a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
index e6a9b928c27..77052951f83 100755
--- a/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
+++ b/Database/IOVDbMetaDataTools/src/IOVDbMetaDataTool.h
@@ -87,9 +87,6 @@ public:
     /// processed
     StatusCode endInputFile(const SG::SourceID&) {return this->endInputFile();}
 
-    /// Function called when the tool should write out its metadata
-    StatusCode metaDataStop(const SG::SourceID&) {return this->metaDataStop();}
-
     /// Incident service handle listening for BeginInputFile and EndInputFile.
     void handle(const Incident& incident);
 
diff --git a/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py b/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py
index d9e1c6676f0..36bb8fab6cd 100644
--- a/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py
+++ b/Event/ByteStreamCnvSvc/python/ByteStreamConfig.py
@@ -50,6 +50,8 @@ def TrigBSReadCfg( inputFlags ):
     
     from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamMetadataTool
     bsMetaDataTool = ByteStreamMetadataTool()
+    bsMetaDataTool.InputCollName  = "ByteStreamMetadata"
+    bsMetaDataTool.OutputCollName = "ByteStreamMetadata"
     acc.addPublicTool( bsMetaDataTool )
     
     from StoreGate.StoreGateConf import ProxyProviderSvc, StoreGateSvc
diff --git a/Event/ByteStreamCnvSvc/python/ReadByteStream.py b/Event/ByteStreamCnvSvc/python/ReadByteStream.py
index 301a7b47fad..f6fab4ce108 100644
--- a/Event/ByteStreamCnvSvc/python/ReadByteStream.py
+++ b/Event/ByteStreamCnvSvc/python/ReadByteStream.py
@@ -67,6 +67,8 @@ if not hasattr (svcMgr.ToolSvc, 'IOVDbMetaDataTool'):
 svcMgr.MetaDataSvc.MetaDataTools += [ "ByteStreamMetadataTool" ]
 if not hasattr (svcMgr.ToolSvc, 'ByteStreamMetadataTool'):
     svcMgr.ToolSvc += CfgMgr.ByteStreamMetadataTool()
+    svcMgr.ToolSvc.ByteStreamMetadataTool.InputCollName = "ByteStreamMetadata"
+    svcMgr.ToolSvc.ByteStreamMetadataTool.OutputCollName = "ByteStreamMetadata"
 
 # User metadata in FMD
 if not hasattr (svcMgr, 'ByteStreamAttListMetadataSvc'):
diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamEventStorageInputSvc.cxx b/Event/ByteStreamCnvSvc/src/ByteStreamEventStorageInputSvc.cxx
index ac1e5b12a96..4a7511a92fc 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamEventStorageInputSvc.cxx
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamEventStorageInputSvc.cxx
@@ -6,6 +6,7 @@
 
 #include "DumpFrags.h"
 #include "ByteStreamData/ByteStreamMetadata.h"
+#include "ByteStreamData/ByteStreamMetadataContainer.h"
 #include "ByteStreamData/ByteStreamUserMetadata.h"
 #include "ByteStreamCnvSvcBase/ByteStreamAddress.h"
 #include "EventStorage/pickDataReader.h"
@@ -168,7 +169,9 @@ bool ByteStreamEventStorageInputSvc::loadMetadata()
 	  m_reader->maxEvents(), m_reader->recEnable(), m_reader->triggerType(), word1.to_ulong(), word2.to_ulong(),
 	  m_reader->beamType(), m_reader->beamEnergy(), m_reader->GUID(), m_reader->stream(),
 	  m_reader->projectTag(), m_reader->lumiblockNumber(), nonuser);
-  StatusCode status = m_mdSvc->record(metadata, "ByteStreamMetadata");
+  ByteStreamMetadataContainer* bsmdc = new ByteStreamMetadataContainer;
+  bsmdc->push_back(metadata);
+  StatusCode status = m_mdSvc->record(bsmdc, "ByteStreamMetadata");
   if (!status.isSuccess()) {
      delete metadata; metadata = 0;
      ATH_MSG_WARNING("Unable to record Input MetaData for ByteStream");
diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.cxx b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.cxx
index 3f58c4f1680..d9dc41baaa8 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.cxx
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.cxx
@@ -10,19 +10,15 @@
 
 #include "ByteStreamMetadataTool.h"
 
-//#include "GaudiKernel/IIncidentSvc.h"
-//#include "GaudiKernel/FileIncident.h"
-
-#include "ByteStreamData/ByteStreamMetadataContainer.h"
-#include "StoreGate/StoreGateSvc.h"
-
 //___________________________________________________________________________
 ByteStreamMetadataTool::ByteStreamMetadataTool(const std::string& type,
-	const std::string& name,
-	const IInterface* parent) : AthAlgTool(type, name, parent), 
-		m_pMetaDataStore("StoreGateSvc/MetaDataStore", name), 
-		m_pInputStore("StoreGateSvc/InputMetaDataStore", name) {
-   declareInterface<IMetaDataTool>(this);
+     	                                       const std::string& name,
+	                                       const IInterface* parent)
+    : GenericMetadataToolNoAux <ByteStreamMetadataContainer>(type, name, parent)
+{
+  m_inputCollName="ByteStreamMetadata";
+  m_outputCollName="ByteStreamMetadata";
+  m_markIncomplete=false;
 }
 
 //___________________________________________________________________________
@@ -32,138 +28,46 @@ ByteStreamMetadataTool::~ByteStreamMetadataTool() {
 //___________________________________________________________________________
 StatusCode ByteStreamMetadataTool::initialize() {
    ATH_MSG_INFO("Initializing " << name() << " - package version " << PACKAGE_VERSION);
-   if (!::AthAlgTool::initialize().isSuccess()) {
-      ATH_MSG_FATAL("Cannot initialize AthService base class.");
-      return(StatusCode::FAILURE);
-   }
-
-   // locate the DetectorStore and initialize our local ptr
-   StatusCode status = m_pMetaDataStore.retrieve();
-   if (!status.isSuccess() || 0 == m_pMetaDataStore) {
-      ATH_MSG_ERROR("Could not find MetaDataStore");
-      return(status);
-   }
-   status = m_pInputStore.retrieve();
-   if (!status.isSuccess() || 0 == m_pInputStore) {
-      ATH_MSG_ERROR("Could not find InputMetaDataStore");
-      return(status);
-   }
    return(StatusCode::SUCCESS);
 }
 
 //___________________________________________________________________________
 StatusCode ByteStreamMetadataTool::finalize() {
    ATH_MSG_INFO("in finalize()");
-   return(::AthAlgTool::finalize());
+   return(StatusCode::SUCCESS);
 }
 
 
-StatusCode ByteStreamMetadataTool::beginInputFile(const SG::SourceID&)
-{
-   return this->beginInputFile();
-}
-
-StatusCode ByteStreamMetadataTool::beginInputFile()
+StatusCode ByteStreamMetadataTool::updateContainer(
+                      ByteStreamMetadataContainer* bsmdc_out,
+                const ByteStreamMetadataContainer* bsmdc_in )
 {
-   std::vector<std::string> vKeys;
-   std::set<std::string> keys;
-   m_pInputStore->keys<ByteStreamMetadata>(vKeys);
-   keys.insert(vKeys.begin(), vKeys.end());
-   m_pInputStore->keys<ByteStreamMetadataContainer>(vKeys);
-   keys.insert(vKeys.begin(), vKeys.end());
-
    std::vector<ByteStreamMetadata*> copy;
    std::set<std::string> transGuids;
-   for (std::set<std::string>::const_iterator keyIter = keys.begin(), keyEnd = keys.end();
-	      keyIter != keyEnd; keyIter++) {
-      ATH_MSG_DEBUG("Processing Input ByteStreamMetadata, key = " << *keyIter);
-      copy.clear();
-      if (m_pInputStore->contains<ByteStreamMetadata>(*keyIter)) {
-         std::list<SG::ObjectWithVersion<ByteStreamMetadata> > allVersions;
-         StatusCode status = m_pInputStore->retrieveAllVersions(allVersions, *keyIter);
-         if (!status.isSuccess()) {
-            ATH_MSG_ERROR("Could not find Input ByteStreamMetadata");
-            return StatusCode::FAILURE;
-         } else {
-            ATH_MSG_DEBUG("Found Input ByteStreamMetadata");
-         }
-         for (SG::ObjectWithVersion<ByteStreamMetadata>& obj : allVersions) {
-            copy.push_back(new ByteStreamMetadata(*obj.dataObject));
-         }
-      }
-      if (m_pInputStore->contains<ByteStreamMetadataContainer>(*keyIter)) {
-         std::list<SG::ObjectWithVersion<ByteStreamMetadataContainer> > allVersions;
-         StatusCode status = m_pInputStore->retrieveAllVersions(allVersions, *keyIter);
-         if (!status.isSuccess()) {
-            ATH_MSG_ERROR("Could not find Input ByteStreamMetadataContainer");
-            return StatusCode::FAILURE;
-         } else {
-            ATH_MSG_DEBUG("Found Input ByteStreamMetadataContainer");
-         }
-         for (SG::ObjectWithVersion<ByteStreamMetadataContainer>& obj : allVersions) {
-            const ByteStreamMetadataContainer& bsmdc = *obj.dataObject;
-            for (const ByteStreamMetadata* md : bsmdc) {
-              copy.push_back(new ByteStreamMetadata(*md));
-            }
-         }
-      }
-      if (!copy.empty()) {
-         transGuids.clear();
-         // Check for existing container
-         ByteStreamMetadataContainer* bsmdc = 0;
-         if (m_pMetaDataStore->contains<ByteStreamMetadataContainer>(*keyIter)) {
-            ATH_MSG_DEBUG("Pre-existing ByteStreamMetadataContainer found");
-            StatusCode status = m_pMetaDataStore->retrieve(bsmdc, *keyIter);
-            if (!status.isSuccess()) {
-               ATH_MSG_ERROR("Could not retrieve " << *keyIter << " ByteStreamMetadataContainer");
-               return StatusCode::FAILURE;
-            }
-            for (ByteStreamMetadataContainer::const_iterator iter = bsmdc->begin(), iterEnd = bsmdc->end();
+
+   // Put input into vector of components
+   for (const ByteStreamMetadata* md : *bsmdc_in) {
+     copy.push_back(new ByteStreamMetadata(*md));
+   }
+   // If anything was in the input, copy to output
+   if (!copy.empty()) {
+      transGuids.clear();
+      // Check for existing guid in output container
+      for (auto iter = bsmdc_out->begin(), iterEnd = bsmdc_out->end();
 	               iter != iterEnd; iter++) {
-               transGuids.insert((*iter)->getGuid());
-            }
-         } else {
-            bsmdc = new ByteStreamMetadataContainer;
-            StatusCode status = m_pMetaDataStore->record(bsmdc, *keyIter);
-            if (!status.isSuccess()) {
-               ATH_MSG_ERROR("Could not store ByteStreamMetadata in Metadata store");
-               return StatusCode::FAILURE;
-            } else {
-               ATH_MSG_DEBUG("ByteStreamMetadata copied to MetaDataStore");
-            }
-         }
-         for (std::vector<ByteStreamMetadata*>::iterator iter = copy.begin(), iterEnd = copy.end();
+         transGuids.insert((*iter)->getGuid());
+      }
+      for (auto iter = copy.begin(), iterEnd = copy.end();
 	            iter != iterEnd; iter++) {
-            // Only insert new metadata records (with GUID not yet in container)
-            if (transGuids.insert((*iter)->getGuid()).second) {
-               bsmdc->push_back(*iter);
-               *iter = 0;
-            } else {
-               delete *iter; *iter = 0;
-            }
+         // Only insert new metadata records (with GUID not yet in container)
+         if (transGuids.insert((*iter)->getGuid()).second) {
+            bsmdc_out->push_back(*iter);
+            *iter = 0;
+         } else {
+            delete *iter; *iter = 0;
          }
       }
    }
    return StatusCode::SUCCESS;
 }
 
-
-StatusCode ByteStreamMetadataTool::endInputFile(const SG::SourceID&)
-{
-   return StatusCode::SUCCESS;
-}
-
-StatusCode ByteStreamMetadataTool::endInputFile()
-{
-   return StatusCode::SUCCESS;
-}
-
-StatusCode ByteStreamMetadataTool::metaDataStop(const SG::SourceID&)
-{
-   return StatusCode::SUCCESS;
-}
-
-StatusCode ByteStreamMetadataTool::metaDataStop()
-{
-   return StatusCode::SUCCESS;
-}
diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
index a9c579681ff..5a1026d5068 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
@@ -12,9 +12,9 @@
  **/
 
 #include "GaudiKernel/ServiceHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
 #include "AthenaKernel/SourceID.h"
-#include "AthenaKernel/IMetaDataTool.h"
+#include "AthenaKernel/GenericMetadataToolNoAux.h"
+#include "ByteStreamData/ByteStreamMetadataContainer.h"
 
 #include <string>
 
@@ -23,8 +23,8 @@ class StoreGateSvc;
 /** @class ByteStreamMetadataTool
  *  @brief This class provides the MetaDataTool for ByteStreamMetadata objects
  **/
-class ByteStreamMetadataTool : public ::AthAlgTool,
-	virtual public IMetaDataTool {
+class ByteStreamMetadataTool : public GenericMetadataToolNoAux <ByteStreamMetadataContainer> 
+{
 public: 
    /// Standard Service Constructor
    ByteStreamMetadataTool(const std::string& type, const std::string& name, const IInterface* parent);
@@ -32,21 +32,11 @@ public:
    virtual ~ByteStreamMetadataTool();
 
    /// Gaudi Service Interface method implementations:
-   StatusCode initialize();
-   StatusCode finalize();
-
-   /// Incident service handle listening for BeginInputFile and EndInputFile.
-   virtual StatusCode beginInputFile();
-   virtual StatusCode endInputFile();
-   virtual StatusCode metaDataStop(const SG::SourceID&);
-   virtual StatusCode beginInputFile(const SG::SourceID&);
-   virtual StatusCode endInputFile(const SG::SourceID&);
-   virtual StatusCode metaDataStop();
-
-private:
-   typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-   StoreGateSvc_t m_pMetaDataStore;
-   StoreGateSvc_t m_pInputStore;
+   StatusCode initialize() override;
+   StatusCode finalize() override;
+   /// Helper class to update a container with information from another one
+   virtual StatusCode updateContainer(ByteStreamMetadataContainer* bsmdc_out,
+                                const ByteStreamMetadataContainer* bsmdc_in );
 };
 
 #endif
diff --git a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx
index 61cc2e641a7..fe6f552c2f4 100644
--- a/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx
+++ b/Event/ByteStreamCnvSvc/src/EventInfoByteStreamCnv.cxx
@@ -10,6 +10,7 @@
 
 #include "ByteStreamData/RawEvent.h"
 #include "ByteStreamData/ByteStreamMetadata.h"
+#include "ByteStreamData/ByteStreamMetadataContainer.h"
 
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/StatusCode.h"
@@ -203,11 +204,12 @@ StatusCode EventInfoByteStreamCnv::createObj(IOpaqueAddress* pAddr, DataObject*&
 
   unsigned int detMask0 = 0xFFFFFFFF, detMask1 = 0xFFFFFFFF, detMask2 = 0xFFFFFFFF, detMask3 = 0xFFFFFFFF;
   // Get ByteStream Metadata from Input MetaData Store
-  const ByteStreamMetadata* metadata = 0;
-  StatusCode status = m_mdSvc->retrieve(metadata, "ByteStreamMetadata");
+  const ByteStreamMetadataContainer* metadatacont = 0;
+  StatusCode status = m_mdSvc->retrieve(metadatacont, "ByteStreamMetadata");
   if (!status.isSuccess()) {
     log << MSG::WARNING << "Unable to retrieve Input MetaData for ByteStream" << endmsg;
   } else {
+    const ByteStreamMetadata* metadata = *(metadatacont->begin());
     uint64_t detectorMask = metadata->getDetectorMask();
     detMask0 = (unsigned int)(detectorMask & 0x00000000FFFFFFFF);
     detMask1 = (unsigned int)(detectorMask >> 32);
diff --git a/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h b/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
index 2f6b5f2cbc1..56c3307f128 100644
--- a/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
+++ b/Event/ByteStreamData/ByteStreamData/ByteStreamMetadataContainer.h
@@ -22,4 +22,11 @@ class ByteStreamMetadataContainer : public DataVector<ByteStreamMetadata> {
 
 #include "AthenaKernel/CLASS_DEF.h"
 CLASS_DEF(ByteStreamMetadataContainer, 1076128893, 1)
+#ifndef XAOD_STANDALONE
+#include "AthenaKernel/MetaCont.h"
+CLASS_DEF( MetaCont<ByteStreamMetadataContainer> , 1174128703 , 1 )
+#include "SGTools/BaseInfo.h"
+SG_BASE( MetaCont<ByteStreamMetadataContainer>, MetaContBase );
+#endif // not XAOD_STANDALONE
+
 #endif
diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
index ff3f8368960..6bf4a4ba6c0 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.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 BOOKKEEPERTOOL_H
@@ -7,19 +7,11 @@
 
 /** @file BookkeeperTool.h
  *  @brief This file contains the class definition for the BookkeeperTool class.
- *  @author Peter van Gemmeren <gemmeren@anl.gov>
- *  $Id: BookkeeperTool.h 663679 2015-04-29 08:31:54Z krasznaa $
+ *  @author Jack Cranshaw <cranshaw@anl.gov>
+ *  $Id: $
  **/
 
-//#include "GaudiKernel/AlgTool.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "AsgTools/AsgMetadataTool.h"
-#ifdef ASGTOOL_ATHENA
-#include "AthenaKernel/IMetaDataTool.h"
-#endif // ASGTOOL_ATHENA
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "AthenaKernel/ICutFlowSvc.h"
+#include "AthenaKernel/GenericMetadataTool.h"
 
 #include "xAODCutFlow/CutBookkeeper.h"
 #include "xAODCutFlow/CutBookkeeperContainer.h"
@@ -32,57 +24,22 @@
  **/
 
 
-class BookkeeperTool : public asg::AsgMetadataTool
-#ifdef ASGTOOL_ATHENA
-                     , public virtual ::IMetaDataTool
-#endif // ASGTOOL_ATHENA
+class BookkeeperTool : public GenericMetadataTool <xAOD::CutBookkeeperContainer, xAOD::CutBookkeeperAuxContainer> 
 {
-   ASG_TOOL_CLASS0(BookkeeperTool)
-public: // Constructor and Destructor
+public: 
+   // Constructor and Destructor
    /// Standard Service Constructor
-   BookkeeperTool(const std::string& name = "BookkeeperTool");
+   BookkeeperTool(const std::string& type, 
+                  const std::string& name,
+                  const IInterface*  parent);
    /// Destructor
    virtual ~BookkeeperTool();
 
-public:
-   //void handle(const Incident& incident);
-   virtual StatusCode metaDataStop();
-   virtual StatusCode beginInputFile();
-   virtual StatusCode endInputFile();
-   /// Function collecting the metadata from a new input file
-   virtual StatusCode beginInputFile(const SG::SourceID&) {return this->beginInputFile();}
-   /// Function collecting the metadata from a new input file
-   virtual StatusCode endInputFile(const SG::SourceID&) {return this->endInputFile();}
-   /// Function writing the collected metadata to the output
-   virtual StatusCode metaDataStop(const SG::SourceID&) {return this->metaDataStop();}
-   //
-   virtual StatusCode initialize();
-   virtual StatusCode finalize();
-
 private:
   
   /// Helper class to update a container with information from another one
-  StatusCode updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
-                              const xAOD::CutBookkeeperContainer* otherCont );
-
-  StatusCode copyContainerToOutput(const std::string& outname);
-
-  /// Fill Cutflow information
-  StatusCode addCutFlow();
- 
-  /// Pointer to cut flow svc 
-  //ServiceHandle<ICutFlowSvc> m_cutflowsvc;
-
-  /// The name of the output CutBookkeeperContainer
-  std::string m_outputCollName;
-  
-  /// The name of the input CutBookkeeperContainer
-  std::string  m_inputCollName;
-
-  /// The name of the CutFlowSvc CutBookkeeperContainer
-  std::string m_cutflowCollName;
-
-  bool m_cutflowTaken;
+  virtual StatusCode updateContainer(xAOD::CutBookkeeperContainer* contToUpdate,
+                               const xAOD::CutBookkeeperContainer* otherCont );
 
 };
 
diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
index f7de4648787..7da02c01aaf 100644
--- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
+++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.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
 */
 
 // Implementation file for class BookkeeperTool
@@ -13,241 +13,28 @@
 // STL include
 #include <algorithm>
 
-// #include "FillEBCFromFlat.h"
-
-#include "GaudiKernel/Incident.h"
-#include "GaudiKernel/FileIncident.h"
-#include "GaudiKernel/IIncidentSvc.h"
+#include "AthenaKernel/MetaCont.h"
+#include "AthenaKernel/ClassID_traits.h"
 #include "AthenaKernel/errorcheck.h"
+#include "AthenaKernel/GenericMetadataTool.h"
+#include "AthenaKernel/ICutFlowSvc.h"
 #include "AthenaBaseComps/AthCheckMacros.h"
+#include "AthContainersInterfaces/IConstAuxStoreMeta.h"
 
-
-BookkeeperTool::BookkeeperTool(const std::string& name)
-  : asg::AsgMetadataTool(name),
-    m_cutflowTaken(false)
+BookkeeperTool::BookkeeperTool(const std::string& type, 
+                               const std::string& name,
+                               const IInterface*  parent)
+  : GenericMetadataTool <xAOD::CutBookkeeperContainer, xAOD::CutBookkeeperAuxContainer>(type,name,parent)
 {
-  declareProperty("OutputCollName", m_outputCollName="CutBookkeepers",  
-    "The default name of the xAOD::CutBookkeeperContainer for output files");
-  declareProperty("InputCollName", m_inputCollName = "CutBookkeepers",
-    "The default name of the xAOD::CutBookkeeperContainer for input files");
-  declareProperty("CutFlowCollName", m_cutflowCollName = "CutBookkeepersFile",
-    "The default name of the xAOD::CutBookkeeperContainer for CutFlowSvc");
-#ifdef ASGTOOL_ATHENA
-  declareInterface< ::IMetaDataTool >( this );
-#endif // ASGTOOL_ATHENA
 }
 
-
-
 BookkeeperTool::~BookkeeperTool()
 {
 }
 
 
-
-StatusCode
-BookkeeperTool::initialize()
-{
-  ATH_MSG_DEBUG( "Initializing " << name() << " - package version " << PACKAGE_VERSION );
-
-  ATH_MSG_DEBUG("InputCollName = " << m_inputCollName);
-  ATH_MSG_DEBUG("OutputCollName = " << m_outputCollName);
-  ATH_MSG_DEBUG("CutFlowCollName = " << m_cutflowCollName);
-
-  return StatusCode::SUCCESS;
-}
-
-
-//__________________________________________________________________________
-StatusCode BookkeeperTool::beginInputFile()
-{
-  //OPENING NEW INPUT FILE
-  //Things to do:
-  // 1) note that a file is currently opened
-  // 2) Load CutBookkeepers from input file
-  //    2a) if incomplete from input, directly propagate to output
-  //    2b) if complete from input, wait for EndInputFile to decide what to do in output
-
-  // reset cutflow taken marker
-  m_cutflowTaken = false;
-
-  // Get the incomplete bookkeeper collection of the input metadata store
-  const xAOD::CutBookkeeperContainer* input_inc = 0;
-  // Construct input and output incomplete names
-  std::string inCollName = "Incomplete" + m_inputCollName;
-  std::string outCollName = "Incomplete" + m_outputCollName;
-  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
-    StatusCode ssc = inputMetaStore()->retrieve( input_inc, inCollName );
-    if (ssc.isSuccess()) {
-      // First make sure there is an incomplete container in the output store
-      if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outCollName)) ) {
-        xAOD::CutBookkeeperContainer* inc = new xAOD::CutBookkeeperContainer();
-        xAOD::CutBookkeeperAuxContainer* auxinc = new xAOD::CutBookkeeperAuxContainer();
-        inc->setStore(auxinc);
-        ATH_CHECK(outputMetaStore()->record(inc,outCollName));
-        ATH_CHECK(outputMetaStore()->record(auxinc,outCollName+"Aux."));
-      }
-      // retrieve the incomplete output container
-      xAOD::CutBookkeeperContainer* incompleteBook(NULL);
-      ATH_CHECK(outputMetaStore()->retrieve( incompleteBook, outCollName));
-      // update incomplete output with any incomplete input
-      ATH_CHECK(this->updateContainer(incompleteBook,input_inc));
-      ATH_MSG_DEBUG("Successfully merged input incomplete bookkeepers with output");
-    }
-  }
-  else {
-    ATH_MSG_INFO("No incomplete bookkeepers in this file " << inCollName);
-  }
-
-  // Get the complete bookkeeper collection of the input metadata store
-  const xAOD::CutBookkeeperContainer* input_com = 0;
-  inCollName = m_inputCollName;
-  outCollName = m_outputCollName;
-  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
-    if ( (inputMetaStore()->retrieve( input_com, inCollName )).isSuccess() ) {
-      // Check if a tmp is there. IT SHOULD NOT BE
-      //xAOD::CutBookkeeperContainer* incompleteBook(NULL);
-      if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outCollName+"tmp")) ) {
-        // Now create the tmp container
-        xAOD::CutBookkeeperContainer* tmp = new xAOD::CutBookkeeperContainer();
-        xAOD::CutBookkeeperAuxContainer* auxtmp = new xAOD::CutBookkeeperAuxContainer();
-        tmp->setStore(auxtmp);
-        if (updateContainer(tmp,input_com).isSuccess()) {
-          ATH_CHECK(outputMetaStore()->record(tmp,outCollName+"tmp"));
-          ATH_CHECK(outputMetaStore()->record(auxtmp,outCollName+"tmpAux."));
-        }
-        else {
-          ATH_MSG_WARNING("Could not update tmp container from input complete conatiner");
-        }
-      }
-    }
-    else {
-      ATH_MSG_WARNING("tmp collection already exists");
-      return StatusCode::SUCCESS;
-    }
-    ATH_MSG_DEBUG("Successfully copied complete bookkeepers to temp container");
-  }
-
-  //  Now make sure the output containers are in the output store
-  //
-  //  Make sure complete container exists in output
-  if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_outputCollName)) ) {
-      // Now create the complete container
-    xAOD::CutBookkeeperContainer* inc = new xAOD::CutBookkeeperContainer();
-    xAOD::CutBookkeeperAuxContainer* auxinc = new xAOD::CutBookkeeperAuxContainer();
-    inc->setStore(auxinc);
-    ATH_CHECK(outputMetaStore()->record(inc,m_outputCollName));
-    ATH_CHECK(outputMetaStore()->record(auxinc,m_outputCollName+"Aux."));
-  }
-  else {
-    ATH_MSG_WARNING("complete collection already exists");
-    //return StatusCode::SUCCESS;
-  }
-  //  Make sure incomplete container exists in output
-  std::string inc_name = "Incomplete"+m_outputCollName;
-  if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inc_name)) ) {
-      // Now create the complete container
-    xAOD::CutBookkeeperContainer* coll = new xAOD::CutBookkeeperContainer();
-    xAOD::CutBookkeeperAuxContainer* auxcoll = new xAOD::CutBookkeeperAuxContainer();
-    coll->setStore(auxcoll);
-    ATH_CHECK(outputMetaStore()->record(coll,inc_name));
-    ATH_CHECK(outputMetaStore()->record(auxcoll,inc_name+"Aux."));
-  }
-  else {
-    ATH_MSG_WARNING("incomplete collection already exists");
-  }
-  
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode BookkeeperTool::endInputFile()
-{
-
-  if (copyContainerToOutput(m_outputCollName).isFailure()) return StatusCode::FAILURE;
-
-  if (!m_cutflowTaken) {
-    if (addCutFlow().isFailure()) {
-      ATH_MSG_ERROR("Could not add CutFlow information");
-    }
-    m_cutflowTaken = true;
-  }
-  else {
-    ATH_MSG_DEBUG("Cutflow information written into container before endInputFile");
-  }
-    
-  return StatusCode::SUCCESS;
-}
-
-StatusCode BookkeeperTool::metaDataStop()
-{
-  //TERMINATING THE JOB (EndRun)
-  //Things to do:
-  // 1) Create new incomplete CutBookkeepers if relevant
-  // 2) Print cut flow summary
-  // 3) Write root file if requested
-  //  Make sure incomplete container exists in output
-  std::string inc_name = "Incomplete"+m_outputCollName;
-  if (copyContainerToOutput(inc_name).isFailure()) return StatusCode::FAILURE;
-
-
-  if (!m_cutflowTaken) {
-    if (addCutFlow().isFailure()) {
-      ATH_MSG_ERROR("Could not add CutFlow information");
-    }
-  }
-  else {
-    ATH_MSG_DEBUG("Cutflow information written into container before metaDataStop");
-  }
-
-  // Reset after metadata stop
-  m_cutflowTaken = false;
-  
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode
-BookkeeperTool::finalize()
-{
-  ATH_MSG_DEBUG( "Finalizing " << name() << " - package version " << PACKAGE_VERSION );
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode BookkeeperTool::addCutFlow()
-{
-  // Add the information from the current processing to the complete output
-  // --> same paradigm as original CutFlowSvc
-  // Get the complete bookkeeper collection of the output meta-data store
-  xAOD::CutBookkeeperContainer* completeBook(NULL); 
-  if( !(outputMetaStore()->retrieve( completeBook, m_outputCollName) ).isSuccess() ) {
-    ATH_MSG_ERROR( "Could not get complete CutBookkeepers from output MetaDataStore" );
-    return StatusCode::FAILURE;
-  }
-
-  // Get the bookkeeper from the current processing
-  const xAOD::CutBookkeeperContainer* fileCompleteBook(NULL);
-  if( outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_cutflowCollName) ) {
-    if( !(outputMetaStore()->retrieve( fileCompleteBook, m_cutflowCollName) ).isSuccess() ) {
-      ATH_MSG_WARNING( "Could not get CutFlowSvc CutBookkeepers from output MetaDataStore" );
-    }
-    else {
-      // update the complete output with the complete input
-      ATH_CHECK(this->updateContainer(completeBook,fileCompleteBook));
-    }
-  }
-  else {
-    ATH_MSG_INFO("No cutflow container " << m_cutflowCollName);
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-
 namespace {
 
-
 xAOD::CutBookkeeper*
 resolveLink (const xAOD::CutBookkeeper* old,
              xAOD::CutBookkeeperContainer& contToUpdate,
@@ -320,6 +107,9 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
         foundEBKToUpdate = true;
         break;
       }
+      else {
+        ATH_MSG_INFO("otherEBK("<<otherEBK->name()<<") != ebkToUpdate("<<ebkToUpdate->name());
+      }
     } // End: Inner loop over contToUpdate
     if (!foundEBKToUpdate) {
       xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper();
@@ -381,33 +171,3 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
   return StatusCode::SUCCESS;
 }
 
-
-StatusCode BookkeeperTool::copyContainerToOutput(const std::string& outname)
-{
-
-  // Get the complete bookkeeper collection of the output meta-data store
-  xAOD::CutBookkeeperContainer* contBook(nullptr); 
-  if( !(outputMetaStore()->retrieve( contBook, outname) ).isSuccess() ) {
-    ATH_MSG_ERROR( "Could not get " << outname << " CutBookkeepers from output MetaDataStore" );
-    return StatusCode::FAILURE;
-  }
-
-  // Get the tmp bookkeeper from the input
-  const xAOD::CutBookkeeperContainer* tmpBook(NULL);
-  if ( outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outname+"tmp") ) {
-    if( !(outputMetaStore()->retrieve( tmpBook, outname+"tmp") ).isSuccess() ) {
-      ATH_MSG_WARNING( "Could not get tmp CutBookkeepers from output MetaDataStore" );
-    }
-    else {
-      // update the complete output with the complete input
-      ATH_CHECK(this->updateContainer(contBook,tmpBook));
-      // remove the tmp container
-      const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
-      ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
-      ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
-    }
-  }
-    
-  return StatusCode::SUCCESS;
-}
-
diff --git a/Event/EventBookkeeperTools/python/CutFlowHelpers.py b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
index 892259abd7e..8ffb7d2c98c 100644
--- a/Event/EventBookkeeperTools/python/CutFlowHelpers.py
+++ b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
@@ -65,6 +65,7 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
     if not hasattr(svcMgr,"CutFlowSvc"): svcMgr += CfgMgr.CutFlowSvc()
     svcMgr.CutFlowSvc.InputStream   = inputStreamName
 
+
     # Make sure MetaDataSvc is ready
     if not hasattr(svcMgr,'MetaDataSvc'):
       from AthenaServices.AthenaServicesConf import MetaDataSvc
@@ -78,7 +79,8 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
     outname = "CutBookkeepers"
     cutflowtool = BookkeeperTool(outname+"Tool",
                                  InputCollName = inname,
-                                 OutputCollName= outname) 
+                                 OutputCollName= outname,
+                                 ProcessMetadataCollName=inname+"File") 
     svcMgr.ToolSvc += cutflowtool
 
 
@@ -141,7 +143,8 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#"+SGkey+"Aux.*" )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#Incomplete"+SGkey )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#Incomplete"+SGkey+"Aux.*" )
-        SGkey = "FileBookkeepers"
+        #SGkey = "FileBookkeepers"
+        SGkey = "CutBookkeepersFile"
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#"+SGkey )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#"+SGkey+"Aux.*" )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#Incomplete"+SGkey )
diff --git a/Event/EventBookkeeperTools/src/CutFlowSvc.cxx b/Event/EventBookkeeperTools/src/CutFlowSvc.cxx
index 5fa077dd209..bf83582cc45 100644
--- a/Event/EventBookkeeperTools/src/CutFlowSvc.cxx
+++ b/Event/EventBookkeeperTools/src/CutFlowSvc.cxx
@@ -81,7 +81,7 @@ CutFlowSvc::initialize()
   ATH_CHECK( incSvc.retrieve() );
   incSvc->addListener(this, IncidentType::BeginInputFile, 60); // pri has to be < 100 to be after MetaDataSvc.
   incSvc->addListener(this, IncidentType::EndInputFile, 50); // pri has to be > 10 to be before MetaDataSvc.
-  incSvc->addListener(this, "MetaDataStop", 50);
+  incSvc->addListener(this, "MetaDataStop", 30);
 
   // Create bookkeeper container for bookkeepers in _this_ processing
   auto fileBook = new xAOD::CutBookkeeperContainer();
diff --git a/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h b/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
index e30904bb808..c1e91f909c8 100644
--- a/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
+++ b/Event/xAOD/xAODEventFormat/xAODEventFormat/EventFormat.h
@@ -19,5 +19,11 @@ namespace xAOD {
 // Declare a CLID for the class:
 #include "xAODCore/CLASS_DEF.h"
 CLASS_DEF( xAOD::EventFormat, 243004407, 1 )
+#ifndef XAOD_STANDALONE
+#include "AthenaKernel/MetaCont.h"
+CLASS_DEF( MetaCont<xAOD::EventFormat> , 35480469 , 1 )
+#include "SGTools/BaseInfo.h"
+SG_BASE( MetaCont<xAOD::EventFormat>, MetaContBase );
+#endif // not XAOD_STANDALONE
 
 #endif // XAODEVENTFORMAT_EVENTFORMAT_H
diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx
index d40cc566895..d2e96bc3219 100644
--- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.cxx
+++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.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
 */
 
 // $Id: EventFormatMetaDataTool.cxx 651874 2015-03-05 14:16:19Z krasznaa $
@@ -8,8 +8,6 @@
 #include <stdexcept>
 
 // Gaudi/Athena include(s):
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/Incident.h"
 #include "AthenaKernel/errorcheck.h"
 
 // Local include(s):
@@ -23,132 +21,25 @@ namespace xAODMaker {
    EventFormatMetaDataTool::EventFormatMetaDataTool( const std::string& type,
                                                      const std::string& name,
                                                      const IInterface* parent )
-      : AthAlgTool( type, name, parent ),
-        m_inputMetaStore( "StoreGateSvc/InputMetaDataStore", name ),
-        m_outputMetaStore( "StoreGateSvc/MetaDataStore", name ),
-        m_format() {
-
-      declareProperty( "InputMetaStore", m_inputMetaStore );
-      declareProperty( "OutputMetaStore", m_outputMetaStore );
-
-      declareProperty( "InputKey", m_inputKey = "EventFormat" );
-      declareProperty( "OutputKey", m_outputKey = "EventFormat" );
-
-      declareInterface< ::IMetaDataTool >( this );
-      //declareInterface< ::IIncidentListener >( this );
+      : GenericMetadataToolNoAux <xAOD::EventFormat>(type,name,parent)
+   {
    }
 
    StatusCode EventFormatMetaDataTool::initialize() {
 
-      // Greet the user:
-      ATH_MSG_DEBUG( "Initialising - Package version: " << PACKAGE_VERSION );
-      ATH_MSG_DEBUG( "  InputMetaStore  = " << m_inputMetaStore );
-      ATH_MSG_DEBUG( "  OutputMetaStore = " << m_outputMetaStore );
-      ATH_MSG_DEBUG( "  InputKey  = " << m_inputKey );
-      ATH_MSG_DEBUG( "  OutputKey = " << m_outputKey );
-
-      // Connect to the metadata stores:
-      ATH_CHECK( m_inputMetaStore.retrieve() );
-      ATH_CHECK( m_outputMetaStore.retrieve() );
-
-      // Make the tool listen to certain incidents:
-      /*
-      ServiceHandle< ::IIncidentSvc > incSvc( "IncidentSvc", name() );
-      ATH_CHECK( incSvc.retrieve() );
-      incSvc->addListener( this, IncidentType::BeginInputFile );
-      incSvc->addListener( this, METADATASTOP, 70 );
-      */
-
-      // Reset the internal object if it exists:
-      m_format.reset();
-
       // Return gracefully:
       return StatusCode::SUCCESS;
    }
 
 
-   StatusCode EventFormatMetaDataTool::beginInputFile()
-   {
-      StatusCode sc = collectMetaData();
-      if( sc.isFailure() ) {
-         REPORT_ERROR( sc )
-            << "Failed to collect metadata from the input file";
-         throw std::runtime_error( "Failed to collect trigger configuration "
-                                   "metadata from the input" );
-      } 
-      return StatusCode::SUCCESS;
-   }
-
-
-   StatusCode EventFormatMetaDataTool::endInputFile()
-   {
-      return StatusCode::SUCCESS;
-   }
-
-
-   StatusCode EventFormatMetaDataTool::metaDataStop()
-   {
-      StatusCode sc = writeMetaData();
-      if( sc.isFailure() ) {
-         REPORT_ERROR( sc )
-            << "Failed to write metadata to the output store";
-         throw std::runtime_error( "Failed write xAOD::EventFormat "
-                                   "to the output" );
-      }
-      return StatusCode::SUCCESS;
-   }
-
-/*
-   void EventFormatMetaDataTool::handle( const Incident& inc ) {
-
-      // Some debugging information:
-      ATH_MSG_DEBUG( "Received incident: " << inc.type() );
-
-      if( inc.type() == IncidentType::BeginInputFile ) {
-         if( collectMetaData().isFailure() ) {
-            REPORT_ERROR( StatusCode::FAILURE )
-               << "Failed to collect metadata from the input file";
-            throw std::runtime_error( "Failed to collect trigger configuration "
-                                      "metadata from the input" );
-         }
-      } else if( inc.type() == METADATASTOP ) {
-         if( writeMetaData().isFailure() ) {
-            REPORT_ERROR( StatusCode::FAILURE )
-               << "Failed to write metadata to the output store";
-            throw std::runtime_error( "Failed write xAOD::EventFormat "
-                                      "to the output" );
-         }
-      } else {
-         ATH_MSG_WARNING( "Unknown incident type (" << inc.type() << ") "
-                          << "received" );
-      }
-
-      return;
-   }
-*/
-
-   StatusCode EventFormatMetaDataTool::collectMetaData() {
-
-      // If the input file doesn't have any event format metadata,
-      // then finish right away:
-      if( ! m_inputMetaStore->contains< xAOD::EventFormat >( m_inputKey ) ) {
-         return StatusCode::SUCCESS;
-      }
-
-      // Retrieve the input container:
-      const xAOD::EventFormat* input = 0;
-      ATH_CHECK( m_inputMetaStore->retrieve( input, m_inputKey ) );
-
-      // Create an output container if it doesn't exist yet:
-      if( ! m_format.get() ) {
-         ATH_MSG_DEBUG( "Creating output container" );
-         m_format.reset( new xAOD::EventFormat() );
-      }
+   StatusCode EventFormatMetaDataTool::updateContainer(
+                                         xAOD::EventFormat* output,
+                                   const xAOD::EventFormat* input ) {
 
       // Merge the new object into the output one:
       for( auto itr = input->begin(); itr != input->end(); ++itr ) {
-         if( ! m_format->exists( itr->second.hash() ) ) {
-            m_format->add( itr->second );
+         if( ! output->exists( itr->second.hash() ) ) {
+            output->add( itr->second );
          }
       }
 
@@ -156,25 +47,4 @@ namespace xAODMaker {
       return StatusCode::SUCCESS;
    }
 
-   StatusCode EventFormatMetaDataTool::writeMetaData() {
-
-      // The output may already have such an object, coming from some
-      // other source. Like the event format service.
-      if( m_outputMetaStore->contains< xAOD::EventFormat >( m_outputKey ) ) {
-         ATH_MSG_DEBUG( "xAOD::EventFormat object already in the output" );
-         return StatusCode::SUCCESS;
-      }
-
-      // Record the event format metadata, if any was found in the
-      // processed input files.
-      if( m_format.get() ) {
-         ATH_MSG_DEBUG( "Recording event format metadata" );
-         ATH_CHECK( m_outputMetaStore->record( std::move( m_format ),
-                                               m_outputKey ) );
-      }
-
-      // Return gracefully:
-      return StatusCode::SUCCESS;
-   }
-
 } // namespace xAODMaker
diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
index 33875ae4af5..78067e4aa77 100644
--- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
+++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- 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: EventFormatMetaDataTool.h 651874 2015-03-05 14:16:19Z krasznaa $
@@ -13,10 +13,7 @@
 #include <memory>
 
 // Gaudi/Athena include(s):
-#include "GaudiKernel/ServiceHandle.h"
-#include "AthenaKernel/IMetaDataTool.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
+#include "AthenaKernel/GenericMetadataToolNoAux.h"
 
 // EDM include(s):
 #include "xAODEventFormat/EventFormat.h"
@@ -35,8 +32,7 @@ namespace xAODMaker {
    /// $Revision: 651874 $
    /// $Date: 2015-03-05 15:16:19 +0100 (Thu, 05 Mar 2015) $
    ///
-   class EventFormatMetaDataTool : public virtual ::IMetaDataTool,
-                                   public ::AthAlgTool {
+   class EventFormatMetaDataTool : public GenericMetadataToolNoAux <xAOD::EventFormat> {
 
    public:
       /// Regular AlgTool constructor
@@ -46,44 +42,11 @@ namespace xAODMaker {
       /// Function initialising the tool
       virtual StatusCode initialize();
 
-   /// Function collecting the metadata from a new input file
-   virtual StatusCode beginInputFile(const SG::SourceID&) {return beginInputFile();}
-
-   /// Function collecting the metadata from a new input file
-   virtual StatusCode endInputFile(const SG::SourceID&) {return endInputFile();}
-
-   /// Function writing the collected metadata to the output
-   virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();}
-
-      /// Function called when a new input file is opened
-      virtual StatusCode beginInputFile();
-  
-      /// Function called when the currently open input file got completely
-      /// processed
-      virtual StatusCode endInputFile();
-  
-      /// Function called when the tool should write out its metadata
-      virtual StatusCode metaDataStop();
-  
    private:
-      /// Function collecting the event format metadata from the input file
-      StatusCode collectMetaData();
-      /// Function writing out the collected metadata
-      StatusCode writeMetaData();
-
-      /// Connection to the input metadata store
-      ServiceHandle< ::StoreGateSvc > m_inputMetaStore;
-      /// Connection to the output metadata store
-      ServiceHandle< ::StoreGateSvc > m_outputMetaStore;
-
-      /// The key of the trigger menu in the input file
-      std::string m_inputKey;
-      /// The key of the trigger menu for the output file
-      std::string m_outputKey;
-
-      /// The merged event format object
-      std::unique_ptr< xAOD::EventFormat > m_format;
-
+      /// Helper class to update a container with information from another one
+      virtual StatusCode updateContainer(xAOD::EventFormat* contToUpdate,
+                                   const xAOD::EventFormat* otherCont );
+  
    }; // class EventFormatMetaDataTool
 
 } // namespace xAODMaker
diff --git a/Event/xAOD/xAODMetaDataCnv/src/FileMetaDataCreatorTool.h b/Event/xAOD/xAODMetaDataCnv/src/FileMetaDataCreatorTool.h
index 1059a9bb4f2..3cc9ee1e7a5 100644
--- a/Event/xAOD/xAODMetaDataCnv/src/FileMetaDataCreatorTool.h
+++ b/Event/xAOD/xAODMetaDataCnv/src/FileMetaDataCreatorTool.h
@@ -76,9 +76,6 @@ namespace xAODMaker {
       /// Function collecting the metadata from a new input file
       virtual StatusCode endInputFile(const SG::SourceID&) {return StatusCode::SUCCESS;}
 
-      /// Function writing the collected metadata to the output
-      virtual StatusCode metaDataStop(const SG::SourceID&) {return StatusCode::SUCCESS;}
-
       /// @}
 
    private:
diff --git a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
index a0c1b5b4411..8b6af54ccdb 100644
--- a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
+++ b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
@@ -76,9 +76,6 @@ namespace xAODMaker {
    /// Function collecting the metadata from a new input file
    virtual StatusCode endInputFile(const SG::SourceID&) {return endInputFile();}
 
-   /// Function writing the collected metadata to the output
-   virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();}
-
       /// @}
 
    private:
-- 
GitLab


From c76150c61c7ff2cb8993dec7fd69237e37b6d410 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 1 Mar 2019 14:53:54 +0000
Subject: [PATCH 136/404] Use xAOD::EventInfo instead of EventInfo in SCT
 classes

---
 .../SCT_ConditionsAlgorithms/CMakeLists.txt   |  4 +---
 .../src/SCT_ConditionsParameterTestAlg.cxx    | 18 +++-------------
 .../src/SCT_ConditionsParameterTestAlg.h      |  3 ---
 .../src/SCT_MonitorConditionsTestAlg.cxx      | 20 +++++-------------
 .../src/SCT_MonitorConditionsTestAlg.h        |  9 --------
 .../src/SCT_ReadCalibChipDataTestAlg.cxx      | 16 +++-----------
 .../src/SCT_ReadCalibChipDataTestAlg.h        |  3 ---
 .../src/SCT_TdaqEnabledCondAlg.cxx            | 17 ++++-----------
 .../src/SCT_TdaqEnabledCondAlg.h              |  3 ---
 .../python/SCT_TdaqEnabledToolSetup.py        | 10 +--------
 .../InDetDetDescr/SCT_Cabling/CMakeLists.txt  |  5 ++---
 .../SCT_RawDataByteStreamCnv/CMakeLists.txt   |  3 +--
 .../share/InDetRecConditionsAccess.py         | 11 ----------
 .../SCT_Monitoring/CMakeLists.txt             |  3 +--
 .../SCT_Monitoring/SCTMotherTrigMonTool.h     |  4 ++--
 .../src/SCTMotherTrigMonTool.cxx              | 21 ++++++++-----------
 16 files changed, 32 insertions(+), 118 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt
index 2628a141270..c38d5779c42 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/CMakeLists.txt
@@ -20,8 +20,6 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetConditions/SCT_ConditionsData
                           InnerDetector/InDetConditions/SCT_ConditionsTools
                           InnerDetector/InDetDetDescr/SCT_Cabling
-                          Event/EventInfo
-                          Event/xAOD/xAODEventInfo
                           PRIVATE
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
@@ -35,7 +33,7 @@ atlas_add_component( SCT_ConditionsAlgorithms
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier DetDescrConditions GeoModelUtilities GaudiKernel SCT_ConditionsData SCT_CablingLib EventInfo xAODEventInfo AthenaPoolUtilities InDetIdentifier InDetReadoutGeometry TrkGeometry SCT_ConditionsToolsLib )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier DetDescrConditions GeoModelUtilities GaudiKernel SCT_ConditionsData SCT_CablingLib AthenaPoolUtilities InDetIdentifier InDetReadoutGeometry TrkGeometry SCT_ConditionsToolsLib )
 
 atlas_add_test( TestCalibChipRead
                 SCRIPT athena.py --threads=5 SCT_ConditionsAlgorithms/testCalibChipRead.py
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.cxx
index 5857013c413..3c016c33654 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.cxx
@@ -18,9 +18,6 @@
 // Include Athena stuff
 #include "Identifier/IdentifierHash.h"
 
-// Include Read Handle
-#include "StoreGate/ReadHandle.h"
-
 // Include STL stuff
 #include <string>
 #include <iostream>
@@ -40,9 +37,6 @@ StatusCode SCT_ConditionsParameterTestAlg::initialize() {
   //
   ATH_CHECK(m_conditionsParameterTool.retrieve());
 
-  // Read Handle
-  ATH_CHECK(m_currentEventKey.initialize());
-  
   return StatusCode::SUCCESS;
 } // SCT_ConditionsParameterTestAlg::execute()
 
@@ -55,16 +49,10 @@ StatusCode SCT_ConditionsParameterTestAlg::execute(const EventContext& ctx) cons
   StatusCode sc{StatusCode::SUCCESS, true};
   
   // Get the current event
-  SG::ReadHandle<xAOD::EventInfo> currentEvent{m_currentEventKey, ctx};
-  if (not currentEvent.isValid()) {
-    ATH_MSG_WARNING("Could not get event info");
-    return sc;
-  }
-  //
   ATH_MSG_DEBUG("Current Run.Event,Time: "
-                << "[" << currentEvent->runNumber()
-                << "." << currentEvent->eventNumber()
-                << "," << currentEvent->timeStamp()
+                << "[" << ctx.eventID().run_number()
+                << "." << ctx.eventID().event_number()
+                << "," << ctx.eventID().time_stamp()
                 << "]");
   
   bool paramFilled{false};
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.h
index 3c3274d108b..147c93c65c0 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ConditionsParameterTestAlg.h
@@ -13,8 +13,6 @@
 // Include Athena stuff
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "SCT_ConditionsTools/ISCT_ConditionsParameterTool.h"
-#include "StoreGate/ReadHandleKey.h"
-#include "xAODEventInfo/EventInfo.h"
 
 // Include Gaudi stuff
 #include "GaudiKernel/ToolHandle.h"
@@ -33,7 +31,6 @@ class SCT_ConditionsParameterTestAlg : public AthReentrantAlgorithm {
   StatusCode finalize() override;   //!< Gaudi finaliser
     
  private:
-  SG::ReadHandleKey<xAOD::EventInfo> m_currentEventKey{this, "EventInfoKey", "EventInfo", "Key of EventInfo"};
   ToolHandle<ISCT_ConditionsParameterTool> m_conditionsParameterTool{this, "SCT_ConditionsParameterTool", "SCT_ConditionsParameterTool", "Tool to retrieve SCT conditions parameters"};
 };
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.cxx
index 4b9b4a2c615..a5784b9b590 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.cxx
@@ -16,7 +16,6 @@
 //Athena includes
 #include "Identifier/IdentifierHash.h"
 #include "InDetIdentifier/SCT_ID.h"
-#include "StoreGate/ReadHandle.h"
 
 SCT_MonitorConditionsTestAlg::SCT_MonitorConditionsTestAlg(const std::string& name, ISvcLocator* pSvcLocator) : 
   AthReentrantAlgorithm(name, pSvcLocator),
@@ -33,10 +32,7 @@ StatusCode SCT_MonitorConditionsTestAlg::initialize()
   ATH_MSG_DEBUG("Found SCT_ID Tool");
 
   ATH_CHECK(m_pMonitorConditionsTool.retrieve());
-  ATH_MSG_DEBUG("Found SCT_MoniotorConditinosSvc");
-
-  // Read Handle
-  ATH_CHECK(m_evtKey.initialize());
+  ATH_MSG_DEBUG("Found SCT_MoniotorConditinosTool");
 
   return StatusCode::SUCCESS;
 
@@ -56,16 +52,10 @@ StatusCode SCT_MonitorConditionsTestAlg::execute(const EventContext& ctx) const
 
   ATH_MSG_DEBUG(" in execute()");
 
-  SG::ReadHandle<xAOD::EventInfo> evt{m_evtKey, ctx};
-  if (not evt.isValid()) {
-    ATH_MSG_FATAL("could not get event info ");
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_DEBUG("Event: [" << evt->runNumber()
-                  << "," << evt->eventNumber()
-                  << ":" << evt->timeStamp()
-                  << "]");
-  }
+  ATH_MSG_DEBUG("Event: [" << ctx.eventID().run_number()
+                << "," << ctx.eventID().event_number()
+                << ":" << ctx.eventID().time_stamp()
+                << "]");
  
   std::string defectlist; 
   std::string EfficiencyTable;
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.h
index 95542ed9128..c469867f17e 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_MonitorConditionsTestAlg.h
@@ -19,11 +19,6 @@
 
 #include "SCT_ConditionsTools/ISCT_MonitorConditionsTool.h"
 
-// Read Handle Key
-#include "StoreGate/ReadHandleKey.h"
-// Event Info
-#include "xAODEventInfo/EventInfo.h"
-
 //Gaudi
 #include "GaudiKernel/ToolHandle.h"
 
@@ -43,10 +38,6 @@ class SCT_MonitorConditionsTestAlg : public AthReentrantAlgorithm {
  private:
   ToolHandle<ISCT_MonitorConditionsTool> m_pMonitorConditionsTool{this, "SCT_MonitorConditionsTool", "SCT_MonitorConditionsTool", "Tool to retrieve noisy strip information"};
   const SCT_ID* m_sctId;
-
-  // Parameters to control the db access 
-  SG::ReadHandleKey<xAOD::EventInfo>       m_evtKey{this, "EventInfoKey", "EventInfo"};
-
 }; // end of class
 
 #endif // SCT_MonitorConditionsTestAlg_H
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.cxx
index 635b18b3789..4e5657f7859 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.cxx
@@ -12,7 +12,6 @@
 
 // Include Athena stuff
 #include "InDetIdentifier/SCT_ID.h"
-#include "StoreGate/ReadHandle.h"
 
 // Include Gaudi stuff
 
@@ -43,9 +42,6 @@ StatusCode SCT_ReadCalibChipDataTestAlg::initialize() {
   // Get the SCT_ReadCaliChipDataSvc
   ATH_CHECK(m_ReadCalibChipDataTool.retrieve());
 
-  // Read Handle
-  ATH_CHECK(m_currentEventKey.initialize());
-
   return StatusCode::SUCCESS;
 } // SCT_ReadCalibChipDataTestAlg::initialize()
 
@@ -96,16 +92,10 @@ StatusCode SCT_ReadCalibChipDataTestAlg::execute(const EventContext& ctx) const
   // Print where you are
   ATH_MSG_DEBUG("in execute()");
 
-  // Get the current event
-  SG::ReadHandle<xAOD::EventInfo> currentEvent{m_currentEventKey, ctx};
-  if (not currentEvent.isValid()) {
-    ATH_MSG_FATAL("Could not get event info");
-    return StatusCode::FAILURE;
-  }
   ATH_MSG_DEBUG("Current Run.Event,Time: "
-                << "[" << currentEvent->runNumber()
-                << "." << currentEvent->eventNumber()
-                << "," << currentEvent->timeStamp()
+                << "[" << ctx.eventID().run_number()
+                << "." << ctx.eventID().event_number()
+                << "," << ctx.eventID().time_stamp()
                 << "]");
 
   //Test Chip Data ConditionsSummary
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.h
index 18258542ffd..050f1c2501f 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_ReadCalibChipDataTestAlg.h
@@ -16,8 +16,6 @@
 
 #include "Identifier/Identifier.h"
 #include "SCT_ConditionsTools/ISCT_ReadCalibChipDataTool.h"
-#include "StoreGate/ReadHandleKey.h"
-#include "xAODEventInfo/EventInfo.h"
 
 #include "GaudiKernel/ToolHandle.h"
 
@@ -47,7 +45,6 @@ class SCT_ReadCalibChipDataTestAlg : public AthReentrantAlgorithm
   
   //----------Private Attributes----------//
   const SCT_ID*                       m_id_sct;        //!< ID helper for SCT
-  SG::ReadHandleKey<xAOD::EventInfo>  m_currentEventKey{this, "EventInfoKey", "EventInfo", "EventInfoKey"};
   Identifier                          m_moduleId;      //!< Module identifier
   Identifier                          m_waferId;       //!< Wafer identifier
   Identifier                          m_stripId;       //!< Strip identifier
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
index 688fd86c97a..8ceee2302db 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.cxx
@@ -4,7 +4,6 @@
 
 #include "SCT_TdaqEnabledCondAlg.h"
 
-#include "EventInfo/EventID.h"
 #include "Identifier/IdentifierHash.h"
 #include "SCT_Cabling/SCT_OnlineId.h"
 
@@ -38,9 +37,6 @@ StatusCode SCT_TdaqEnabledCondAlg::initialize()
     return StatusCode::FAILURE;
   }
 
-  // Read Handle
-  ATH_CHECK( m_eventInfoKey.initialize() );
-
   return StatusCode::SUCCESS;
 }
 
@@ -158,15 +154,10 @@ StatusCode SCT_TdaqEnabledCondAlg::finalize()
 }
 
 bool SCT_TdaqEnabledCondAlg::unfilledRun(const EventContext& ctx) const {
-  SG::ReadHandle<EventInfo> event{m_eventInfoKey, ctx};
-  if (event.isValid()) {
-    const unsigned int runNumber{event->event_ID()->run_number()};
-    const bool noDataExpected{runNumber < s_earliestRunForFolder};
-    if (noDataExpected) ATH_MSG_INFO("This run occurred before the /TDAQ/EnabledResources/ATLAS/SCT/Robins folder was filled in COOL; assuming the SCT is all ok.");
-    return noDataExpected;
-  }
-  ATH_MSG_WARNING("The event information could not be retrieved in this service");
-  return false; //this means the service will attempt to access the folder and fill it, even though the run number is unknown
+  const unsigned int runNumber{ctx.eventID().run_number()};
+  const bool noDataExpected{runNumber < s_earliestRunForFolder};
+  if (noDataExpected) ATH_MSG_INFO("This run occurred before the /TDAQ/EnabledResources/ATLAS/SCT/Robins folder was filled in COOL; assuming the SCT is all ok.");
+  return noDataExpected;
 }
 
 //parse a rod channel name to a rod number, names are of the format 'ROL-SCT-BA-00-210000'
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
index fe44a73c1c2..6822548b0f2 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_TdaqEnabledCondAlg.h
@@ -8,11 +8,9 @@
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "EventInfo/EventInfo.h"
 #include "SCT_Cabling/ISCT_CablingTool.h"
 #include "SCT_ConditionsData/SCT_TdaqEnabledCondData.h"
 #include "StoreGate/ReadCondHandleKey.h"
-#include "StoreGate/ReadHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 
 #include "GaudiKernel/ICondSvc.h"
@@ -34,7 +32,6 @@ class SCT_TdaqEnabledCondAlg : public AthReentrantAlgorithm
 
   SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKey", "/TDAQ/Resources/ATLAS/SCT/Robins", "Key of input (raw) conditions folder"};
   SG::WriteCondHandleKey<SCT_TdaqEnabledCondData> m_writeKey{this, "WriteKey", "SCT_TdaqEnabledCondData", "Key of output (derived) conditions data"};
-  SG::ReadHandleKey<EventInfo> m_eventInfoKey{this, "EventInfoKey", "ByteStreamEventInfo", "Key of non-xAOD EventInfo"};
   ServiceHandle<ICondSvc> m_condSvc; 
   ToolHandle<ISCT_CablingTool> m_cablingTool{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"};
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_TdaqEnabledToolSetup.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_TdaqEnabledToolSetup.py
index b690434d224..d8262e8e037 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_TdaqEnabledToolSetup.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_TdaqEnabledToolSetup.py
@@ -12,7 +12,6 @@ class SCT_TdaqEnabledToolSetup:
         self.alg = None
         self.toolName = "InDetSCT_TdaqEnabledTool"
         self.tool = None
-        self.eventInfoKey = "ByteStreamEventInfo"
 
     def getFolder(self):
         return self.folder
@@ -60,8 +59,7 @@ class SCT_TdaqEnabledToolSetup:
         if not hasattr(condSeq, self.algName):
             from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_TdaqEnabledCondAlg
             condSeq += SCT_TdaqEnabledCondAlg(name = self.algName,
-                                              ReadKey = self.folder,
-                                              EventInfoKey = self.eventInfoKey)
+                                              ReadKey = self.folder)
         self.alg = getattr(condSeq, self.algName)
 
     def setTool(self):
@@ -78,12 +76,6 @@ class SCT_TdaqEnabledToolSetup:
     def getToolName(self):
         return self.toolName
 
-    def setEventInfoKey(self, eventInfoKey):
-        self.eventInfoKey = eventInfoKey
-
-    def getEventInfoKey(self):
-        return self.eventInfoKey
-
     def setup(self):
         self.setFolders()
         self.setAlgs()
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt
index 68a56b75fb6..3b8a853779c 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/CMakeLists.txt
@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/StoreGate
                           Database/AthenaPOOL/AthenaPoolUtilities
                           Database/CoraCool
-                          Event/EventInfo
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           Tools/PathResolver )
 
@@ -29,12 +28,12 @@ atlas_add_library( SCT_CablingLib
                    PUBLIC_HEADERS SCT_Cabling
                    PRIVATE_INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
                    LINK_LIBRARIES AthenaBaseComps Identifier GaudiKernel StoreGateLib SGtests
-                   PRIVATE_LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities CoraCool EventInfo InDetIdentifier PathResolver )
+                   PRIVATE_LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities CoraCool InDetIdentifier PathResolver )
 
 atlas_add_component( SCT_Cabling
                      src/components/*.cxx
                      INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps Identifier GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CoraCool EventInfo InDetIdentifier PathResolver SCT_CablingLib )
+                     LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaBaseComps Identifier GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CoraCool InDetIdentifier PathResolver SCT_CablingLib )
 
 atlas_add_test( TestSCT_CablingCfg
                 SCRIPT share/TestSCT_CablingCfg.sh
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
index 8259be5b134..6aeecdbedf1 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/CMakeLists.txt
@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/StoreGate
                           DetectorDescription/Identifier
-                          Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           InnerDetector/InDetConditions/SCT_ConditionsData
                           InnerDetector/InDetConditions/SCT_ConditionsTools
@@ -33,7 +32,7 @@ atlas_add_component( SCT_RawDataByteStreamCnv
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel InDetRawData InDetByteStreamErrors AthenaBaseComps StoreGateLib SGtests Identifier EventInfo xAODEventInfo InDetIdentifier InDetReadoutGeometry SCT_CablingLib TrigSteeringEvent)
+                     LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel InDetRawData InDetByteStreamErrors AthenaBaseComps StoreGateLib SGtests Identifier xAODEventInfo InDetIdentifier InDetReadoutGeometry SCT_CablingLib TrigSteeringEvent)
 
 # Run tests:
 atlas_add_test( TestSCTDecode
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index 9e5e0421e11..e84ea5da786 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -7,16 +7,6 @@ from AthenaCommon.DetFlags import DetFlags
 
 isData = (globalflags.DataSource == 'data')
 
-eventInfoKey = "ByteStreamEventInfo"
-if not isData:
-    eventInfoKey = "McEventInfo"
-if globalflags.isOverlay() and isData :
-    if DetFlags.overlay.pixel_on() or DetFlags.overlay.SCT_on() or DetFlags.overlay.TRT_on():
-        from OverlayCommonAlgs.OverlayFlags import overlayFlags
-        eventInfoKey = (overlayFlags.dataStore() + '+' + eventInfoKey).replace("StoreGateSvc+","")
-    else :
-        eventInfoKey = "McEventInfo"
-
 if not ('conddb' in dir()):
     IOVDbSvc = Service("IOVDbSvc")
     from IOVDbSvc.CondDB import conddb
@@ -229,7 +219,6 @@ if DetFlags.haveRIO.SCT_on():
         from SCT_ConditionsTools.SCT_TdaqEnabledToolSetup import SCT_TdaqEnabledToolSetup
         sct_TdaqEnabledToolSetup = SCT_TdaqEnabledToolSetup()
         sct_TdaqEnabledToolSetup.setFolder(tdaqFolder)
-        sct_TdaqEnabledToolSetup.setEventInfoKey(eventInfoKey)
         sct_TdaqEnabledToolSetup.setup()
         InDetSCT_TdaqEnabledTool = sct_TdaqEnabledToolSetup.getTool()
         if (InDetFlags.doPrintConfigurables()):
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt
index 9749feb29e3..8aea144471a 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt
@@ -10,7 +10,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Commission/CommissionEvent
                           Control/AthenaMonitoring
                           Control/StoreGate
-                          Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           GaudiKernel
                           InnerDetector/InDetConditions/InDetConditionsSummaryService
@@ -49,7 +48,7 @@ atlas_add_component( SCT_Monitoring
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} AthenaMonitoringLib GaudiKernel InDetReadoutGeometry InDetPrepRawData MagFieldInterfaces ITrackToVertex TrkTrack TrkToolInterfaces CommissionEvent AthenaKernel AthContainers Identifier EventInfo InDetIdentifier InDetRawData InDetRIO_OnTrack LWHists PathResolver TrkSurfaces TrkEventUtils TrkMeasurementBase TrkParameters TrkRIO_OnTrack TrkSpacePoint TrkTrackSummary )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} AthenaMonitoringLib GaudiKernel InDetReadoutGeometry InDetPrepRawData MagFieldInterfaces ITrackToVertex TrkTrack TrkToolInterfaces CommissionEvent AthenaKernel AthContainers Identifier InDetIdentifier InDetRawData InDetRIO_OnTrack LWHists PathResolver TrkSurfaces TrkEventUtils TrkMeasurementBase TrkParameters TrkRIO_OnTrack TrkSpacePoint TrkTrackSummary )
 
 # Install files from the package:
 atlas_install_headers( SCT_Monitoring )
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
index c0960856bc3..527ad41df5a 100755
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
@@ -19,7 +19,7 @@
 #include <bitset>
 
 #include "StoreGate/ReadHandleKey.h"
-#include "EventInfo/EventInfo.h"
+#include "xAODEventInfo/EventInfo.h"
 
 //Fwd declarations
 class IInterface;
@@ -63,7 +63,7 @@ protected:
 private:
   std::bitset<N_TRIGGER_TYPES> m_firedTriggers;
 
-  SG::ReadHandleKey<EventInfo> m_eventInfoKey;
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfoKey", "Key of xAOD::EventInfo"};
 };
 
 #endif
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
index e831cf46946..78240d503e5 100755
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.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
 */
 
 /** @file SCTMotherTrigMonTool.cxx
@@ -12,8 +12,6 @@
 // Framework
 #include "GaudiKernel/IInterface.h"
 #include "GaudiKernel/StatusCode.h"
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/TriggerInfo.h"
 #include "StoreGate/ReadHandle.h"
 #include "TrigDecisionInterface/ITrigDecisionTool.h"
 
@@ -25,8 +23,7 @@ SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string &type, const std::s
   : ManagedMonitorToolBase(type, name, parent),
   m_doTrigger(true),
   m_isStream(false),
-  m_firedTriggers(0),
-  m_eventInfoKey(std::string("ByteStreamEventInfo")) {
+  m_firedTriggers(0) {
   declareProperty("doTrigger", m_doTrigger);
 }
 
@@ -45,9 +42,9 @@ SCTMotherTrigMonTool::initialize() {
 // ---------------------------------------------------------
 StatusCode
 SCTMotherTrigMonTool::checkTriggers() {
-  SG::ReadHandle<EventInfo> evtInfo(m_eventInfoKey);
+  SG::ReadHandle<xAOD::EventInfo> evtInfo(m_eventInfoKey);
   if (evtInfo.isValid()) {
-    m_firedTriggers = evtInfo->trigger_info()->level1TriggerType();
+    m_firedTriggers = evtInfo->level1TriggerType();
 
     return StatusCode::SUCCESS;
   }
@@ -76,15 +73,15 @@ SCTMotherTrigMonTool::isCalibrationNoise(const std::string &L1_Item) {
 
 bool
 SCTMotherTrigMonTool::isStream(const std::string &StreamName) {
-  SG::ReadHandle<EventInfo> evtInfo(m_eventInfoKey);
+  SG::ReadHandle<xAOD::EventInfo> evtInfo(m_eventInfoKey);
   if (evtInfo.isValid()) {
     m_isStream = false;
 
-    for (unsigned int i = 0; i < evtInfo->trigger_info()->streamTags().size(); ++i) {
-      ATH_MSG_DEBUG(" i " << i << " Stream-Name " << evtInfo->trigger_info()->streamTags()[i].name()
-                    << " type " << evtInfo->trigger_info()->streamTags()[i].type());
+    for (unsigned int i = 0; i < evtInfo->streamTags().size(); ++i) {
+      ATH_MSG_DEBUG(" i " << i << " Stream-Name " << evtInfo->streamTags()[i].name()
+                    << " type " << evtInfo->streamTags()[i].type());
 
-      if (evtInfo->trigger_info()->streamTags()[i].name().find(StreamName) != std::string::npos) {
+      if (evtInfo->streamTags()[i].name().find(StreamName) != std::string::npos) {
         m_isStream = true;
       }
     }
-- 
GitLab


From 2f0c59aafba63316974546d5a850d62c242d61b8 Mon Sep 17 00:00:00 2001
From: Jovan Mitrevski <jovan.mitrevski@cern.ch>
Date: Fri, 1 Mar 2019 14:56:40 +0000
Subject: [PATCH 137/404] Flags for new egamma configuration

---
 .../python/AllConfigFlags.py                  |   4 +
 .../python/egammaCaloToolsConfig.py           |  20 ++++
 .../src/egammaCheckEnergyDepositTool.h        |   2 +-
 .../egamma/egammaConfig/CMakeLists.txt        |  13 +++
 .../egamma/egammaConfig/doc/packagedoc.h      |  32 ++++++
 .../egamma/egammaConfig/python/__init__.py    |   1 +
 .../egammaConfig/python/egammaConfigFlags.py  | 108 ++++++++++++++++++
 7 files changed, 179 insertions(+), 1 deletion(-)
 create mode 100644 Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
 create mode 100644 Reconstruction/egamma/egammaConfig/CMakeLists.txt
 create mode 100644 Reconstruction/egamma/egammaConfig/doc/packagedoc.h
 create mode 100644 Reconstruction/egamma/egammaConfig/python/__init__.py
 create mode 100644 Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index f7468117dee..7068d8fa610 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -101,6 +101,10 @@ def _createCfgFlags():
         return createMuonConfigFlags()
     acf.addFlagsCategory( "Muon", __muon )
 
+    def __egamma():
+        from egammaConfig.egammaConfigFlags import createEgammaConfigFlags
+        return createEgammaConfigFlags()
+    acf.addFlagsCategory( "Egamma", __egamma )
 
     def __dq():
         from AthenaMonitoring.DQConfigFlags import createDQConfigFlags, createComplexDQConfigFlags
diff --git a/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py b/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
new file mode 100644
index 00000000000..a40efe7b4ef
--- /dev/null
+++ b/Reconstruction/egamma/egammaCaloTools/python/egammaCaloToolsConfig.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+__doc__ = "Tool configuration to instantiate all egammaCaloTools with default configuration."
+
+#---------------------------------------
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def CaloFillRectangularClusterCfg(flags):
+    result=ComponentAccumulator()
+
+    from CaloClusterCorrection.CaloClusterCorrectionConf import CaloFillRectangularCluster
+    caloFillRectangularCluster = CaloFillRectangularCluster(eta_size = 5,
+                                                            phi_size = 7,
+                                                            cells_name = flags.Egamma.Keys.Input.Cells)
+
+    result.addPrivateTool(caloFillRectangularCluster)
+    return result
+
+#---------------------------------------
+
diff --git a/Reconstruction/egamma/egammaCaloTools/src/egammaCheckEnergyDepositTool.h b/Reconstruction/egamma/egammaCaloTools/src/egammaCheckEnergyDepositTool.h
index ea8e84026ef..7c35efb887b 100644
--- a/Reconstruction/egamma/egammaCaloTools/src/egammaCheckEnergyDepositTool.h
+++ b/Reconstruction/egamma/egammaCaloTools/src/egammaCheckEnergyDepositTool.h
@@ -52,7 +52,7 @@ class egammaCheckEnergyDepositTool : virtual public IegammaCheckEnergyDepositToo
       "Threshold on maximum fraction of energy reconstructed in 2nd sampling"};
 
   /** @brief Threshold on maximum fraction of energy reconstructed in 3rd sampling */
-  Gaudi::Property<double> m_thrF3max {this, "ThrF3max", 0.65,
+  Gaudi::Property<double> m_thrF3max {this, "ThrF3max", 0.8,
       "Threshold on maximum fraction of energy reconstructed in 3rd sampling"};
 
 };
diff --git a/Reconstruction/egamma/egammaConfig/CMakeLists.txt b/Reconstruction/egamma/egammaConfig/CMakeLists.txt
new file mode 100644
index 00000000000..4148e8dde88
--- /dev/null
+++ b/Reconstruction/egamma/egammaConfig/CMakeLists.txt
@@ -0,0 +1,13 @@
+################################################################################
+# Package: egammaConfig
+################################################################################
+
+# Declare the package name:
+atlas_subdir( egammaConfig )
+
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+
+atlas_add_test( egammaConfigFlagsTest
+		SCRIPT python -m unittest -v egammaConfig.egammaConfigFlags
+		POST_EXEC_SCRIPT nopost.sh )
diff --git a/Reconstruction/egamma/egammaConfig/doc/packagedoc.h b/Reconstruction/egamma/egammaConfig/doc/packagedoc.h
new file mode 100644
index 00000000000..67c105d0333
--- /dev/null
+++ b/Reconstruction/egamma/egammaConfig/doc/packagedoc.h
@@ -0,0 +1,32 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+
+@page egammaConfig_page egammaConfig Package
+
+This package is responsible for configuring the electron and photon reconstruction and identification algorithms in the new style.
+
+The following reconstruction algorithms are implemented (Text below needs updating)
+
+ - The old one, implemented in egammaBuilder and managed through the python script egammaGetter, which is seeded from the electromagnetic (EM) calorimeters, starts from clusters reconstructed in the calorimeters by the SlidingWindowFinder (https://twiki.cern.ch/twiki/bin/view/Atlas/SlidingWindowClustering#Sliding_Window_Clustering). For each cluster, with ET(seed)>3GeV in the cluster container the best inner detector track is searched for within a given E/p range. The complexity of the extrapolation (coordinate systems, etc) is hidden in ExtrapolateToCaloTool. It then builds identification variables. As of release 21 this is no longer run.
+
+ - An alternative algorithm, implemented by topoEgammaBuilder and also managed by the python script egammaGetter, is based on topoclusters. It attempts to recover electrons that emit brem photons by creating "superclusters." Superclusters can also be used in photons to especially help converted photons. This is the default egamma algorithm for central electrons and photons as of release 21.
+
+ - An algorithm, implemented in egammaForwardBuilder and managed through the python script egammaForwardGetter, is dedicated to the reconstruction and identification of electrons in the forward region of ATLAS (2.5<|eta|<4.9). In contrast to the egamma and topoEgamma builders, this algorithm can use only the information from the calorimeters, as the tracking system is limited to |eta|<2.5, and the topological clusters (instead of SW clusters). The pre-selection and ID are done in the same algorithm. The variables used to discriminant between electron and hadrons are defined as the topo cluster moments or combination of them. This is done separately in two eta bins: the EMEC IW and the FCal using a cut based technic.
+
+The EDM for the electrons and photons is defined in Event/xAOD/xAODEgamma. Three collections are produced in the xAOD, Electrons, Photons, and ForwardElectrons.
+
+@author H. Ma <hma@bnl.gov>
+@author A. Poppleton <Alan.Poppleton@cern.ch>
+@author S. Rajagopalan <srinir@bnl.gov>
+@author M. Wielers <Monika.Wielers@cern.ch>
+@author A. Khodinov <khodinov@bnl.gov>
+@author F. Derue <derue@lpnhe.in2p3.fr>
+@author T. Koffas  <Thomas.Koffas@cern.ch>
+@author J. Mitrevski <Jovan.Mitrevski@cern.ch>
+@author C. Anastopoulos <Christos.Anastopoulos@cern.ch>
+@author D. Divalentino <david.di.valentino@cern.ch>
+@author R. Naranjo <Roger.Naranjo@cern.ch>
+*/
diff --git a/Reconstruction/egamma/egammaConfig/python/__init__.py b/Reconstruction/egamma/egammaConfig/python/__init__.py
new file mode 100644
index 00000000000..862aa9246de
--- /dev/null
+++ b/Reconstruction/egamma/egammaConfig/python/__init__.py
@@ -0,0 +1 @@
+# Needed to find properly
diff --git a/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py
new file mode 100644
index 00000000000..a91c9ea8612
--- /dev/null
+++ b/Reconstruction/egamma/egammaConfig/python/egammaConfigFlags.py
@@ -0,0 +1,108 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+# this is based on MuonConfigFlags as a guide
+
+from AthenaConfiguration.AthConfigFlags import AthConfigFlags
+
+def createEgammaConfigFlags(): 
+    egcf=AthConfigFlags()
+ 
+    # enable/disable the full egamma
+    egcf.addFlag("Egamma.enabled",True)
+
+    # do standard cluster-based egamma algorithm
+    egcf.addFlag("Egamma.doCaloSeeded",True)
+    egcf.addFlag("Egamma.doSuperclusters",True) # if true, do superculsers, false is SW
+    egcf.addFlag("Egamma.doTopoSeeded",True) # if doing SW, also add toposeeded electrons
+
+    # do forward egamma
+    egcf.addFlag("Egamma.doForwardSeeded",True)
+
+    # do egamma truth association when running on MC
+    egcf.addFlag("Egamma.doTruthAssociation",True)
+
+    # run the GSF refitting
+    egcf.addFlag("Egamma.doGSF",True) 
+
+    # build conversion vertices
+    egcf.addFlag("Egamma.doConversionBuilding",True) 
+
+    # The cluster corrections/calib
+    egcf.addFlag("Egamma.Calib.ClusterCorrectionVersion", 'v12phiflip_noecorrnogap')
+    egcf.addFlag("Egamma.Calib.MVAVersion", 'egammaMVACalib/offline/v7')
+   
+    ##################################################
+    # The keys: should update to use file peeking info
+    # Also not sure what's the best way to do this, might want to revisit
+    # one idea is to make the keys have tuples with type, name, etc
+    ##################################################
+
+    egcf.addFlag("Egamma.Keys.Input.Cells","AllCalo") #should make a lambda
+    egcf.addFlag("Egamma.Keys.Input.TopoClusters",'CaloTopoCluster') #input topoclusters
+    egcf.addFlag("Egamma.Keys.Input.TruthParticles", 'TruthParticles')
+    egcf.addFlag("Egamma.Keys.Input.TruthEvents", 'TruthEvents')
+
+    # the topoclusters selected for egamma from the input topoclusters
+    egcf.addFlag("Egamma.Keys.Internal.EgammaTopoClusters",'egammaTopoClusters') 
+    egcf.addFlag("Egamma.Keys.Internal.EgammaRecs", 'egammaRecCollection')
+    egcf.addFlag("Egamma.Keys.Internal.PhotonSuperRecs", 'PhotonSuperRecCollection')
+    egcf.addFlag("Egamma.Keys.Internal.ElectronSuperRecs", 'ElectronSuperRecCollection')
+ 
+    egcf.addFlag("Egamma.Keys.Output.ConversionVertices", 'GSFConversionVertices')
+    egcf.addFlag("Egamma.Keys.Output.ConversionVerticesSuppESD", '-vxTrackAtVertex')
+    egcf.addFlag("Egamma.Keys.Output.ConversionVerticesSuppAOD", '-vxTrackAtVertex')
+
+    egcf.addFlag("Egamma.Keys.Output.CaloClusters", 'egammaClusters')
+    egcf.addFlag("Egamma.Keys.Output.CaloClustersSuppESD", '')
+    egcf.addFlag("Egamma.Keys.Output.CaloClustersSuppAOD", '')
+
+    egcf.addFlag("Egamma.Keys.Output.TopoSeededClusters", 'egammaTopoSeededClusters')
+    egcf.addFlag("Egamma.Keys.Output.TopoSeededClustersSuppESD", '')
+    egcf.addFlag("Egamma.Keys.Output.TopoSeededClustersSuppAOD", '-CellLink')
+
+    egcf.addFlag("Egamma.Keys.Output.Electrons",'Electrons')
+    egcf.addFlag("Egamma.Keys.Output.ElectronsSuppESD",'')
+    egcf.addFlag("Egamma.Keys.Output.ElectronsSuppAOD",
+                 '-e033.-e011.-e333.-e335.-e337.-e377.-isEMLHLoose.-isEMLHTight.-isEMLHMedium.-isEMLoose.-isEMMultiLepton.-isEMMedium.-isEMTight')
+
+    egcf.addFlag("Egamma.Keys.Output.ForwardElectrons", 'ForwardElectrons')
+    egcf.addFlag("Egamma.Keys.Output.ForwardElectronsSuppESD", '')
+    egcf.addFlag("Egamma.Keys.Output.ForwardElectronsSuppAOD", 
+                 '-isEMTight.-isEMMedium.-isEMLoose')
+
+    egcf.addFlag("Egamma.Keys.Output.ForwardClusters", 'ForwardElectronClusters')
+    egcf.addFlag("Egamma.Keys.Output.ForwardClustersSuppESD", '-SisterCluster')
+    egcf.addFlag("Egamma.Keys.Output.ForwardClustersSuppAOD", 
+                 '-SisterCluster.-CellLink')
+
+    egcf.addFlag("Egamma.Keys.Output.Photons", 'Photons')
+    egcf.addFlag("Egamma.Keys.Output.PhotonsSuppESD", '')
+    egcf.addFlag("Egamma.Keys.Output.PhotonsSuppAOD", 
+                 '-e033.-e011.-e333.-e335.-e337.-e377.-isEMLoose.-isEMTight')
+
+    egcf.addFlag("Egamma.Keys.Output.GSFTrackParticles", 'GSFTrackParticles')
+    egcf.addFlag("Egamma.Keys.Output.GSFTrackParticlesSuppESD", 
+                 '-caloExtension.-cellAssociation.-perigeeExtrapEta.-perigeeExtrapPhi')
+    egcf.addFlag("Egamma.Keys.Output.GSFTrackParticlesSuppAOD",
+                 '-caloExtension.-cellAssociation.-perigeeExtrapEta.-perigeeExtrapPhi')
+
+    # not xAOD
+    egcf.addFlag("Egamma.Keys.Output.GSFTracks", 'GSFTracks')
+
+    egcf.addFlag("Egamma.Keys.Output.TruthParticles", 'egammaTruthParticles')
+    egcf.addFlag("Egamma.Keys.Output.TruthParticlesSuppESD", '-caloExtension')
+    egcf.addFlag("Egamma.Keys.Output.TruthParticlesSuppAOD", '-caloExtension')
+
+    return egcf
+
+# self test
+import unittest
+
+class TestEgammaConfigFlags(unittest.TestCase):
+    def runTest(self):
+        flags = createEgammaConfigFlags()
+        self.assertEqual(flags.Egamma.Keys.Output.Photons, "Photons")
+        self.assertEqual(flags._get("Egamma.Keys.Output.Photons"), "Photons")
+
+if __name__ == "__main__":
+    unittest.main()
-- 
GitLab


From a830739482d5604c17eba511ba8487f3570fbf0c Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 1 Mar 2019 15:59:06 +0100
Subject: [PATCH 138/404] Base Component enum on uint for consistency

---
 .../TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
index 472b1185887..61fd3b1caef 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETHelper.h
@@ -28,7 +28,7 @@
 
 class TrigEFMissingEtComponent {
   public: // all attributes are public: like a struct
-    enum Component 
+    enum Component : uint 
     { 
         PreSamplB = 0 , 
                    EMB1     , EMB2     , EMB3     ,     // LAr barrel
-- 
GitLab


From a60b0bc73a5d4a397901c3140604a9baf24dfc46 Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 1 Mar 2019 15:59:30 +0100
Subject: [PATCH 139/404] Embrace the new Component enum more fully

---
 .../src/EFMissingETFromHelper.cxx             | 120 +++++++++---------
 1 file changed, 60 insertions(+), 60 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index ef03dbc11a5..7e7735cdf84 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -174,9 +174,9 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
   met->setFlag( metHelper->GetStatus() );
 
-  unsigned int comp = met->getNumberOfComponents(); // final no. of aux. compon.
-  unsigned char nHelperComp = metHelper->GetElements(); // no. of transient aux. compon.
-  if (nHelperComp!=42) {
+  uint comp = met->getNumberOfComponents(); // final no. of aux. compon.
+  uint nHelperComp = metHelper->GetElements(); // no. of transient aux. compon.
+  if (nHelperComp != static_cast<unsigned char>(TrigEFMissingEtComponent::ComponentSize)) {
     ATH_MSG_WARNING( "Found " << nHelperComp << " aux components in the transient helper class.  Not supported!" );
   } else ATH_MSG_DEBUG( "Found " << nHelperComp << " aux components in the transient helper class" );
 
@@ -219,25 +219,25 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   met->setSumE(0.); met->setSumEt(0.);
 
   // take info from *metHelper and update *met
-  for (unsigned char  helper_i=0; helper_i<nHelperComp; ++helper_i) { // loop over transient components
+  for (uint helper_i=0; helper_i<nHelperComp; ++helper_i) { // loop over transient components
 
     // basic info - DK calibration
-    if (helper_i<nHelperComp-18){  
+    if (helper_i < nHelperComp-18){  
       ATH_MSG_DEBUG( "skip muon or Had Topo granular or EM Topo correction for all quantities" );
       copier.addHelperCompToMET(helper_i);
     }
 
-    if(save9comp && helper_i == 24) { 
+    if(save9comp && helper_i == static_cast<uint>(TrigEFMissingEtComponent::TCLCW) ) { 
       ATH_MSG_DEBUG( "Save summed HAD MET" );
       copier.addHelperCompToMET(helper_i);
     }
 
-    if( (save2comp || save6comp) && helper_i == 34) { 
+    if( (save2comp || save6comp) && helper_i == static_cast<uint>(TrigEFMissingEtComponent::JET)) { 
       ATH_MSG_DEBUG( "Save JET MET" );
       copier.addHelperCompToMET(helper_i);
     }
 
-    if(save3comp && helper_i == 39) { 
+    if(save3comp && helper_i == static_cast<uint>(TrigEFMissingEtComponent::TCPUC)) { 
       ATH_MSG_DEBUG( "Save PUC MET" );
       copier.addHelperCompToMET(helper_i);
     }
@@ -248,7 +248,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     if (comp == unsigned(nHelperComp-17) && helper_i < 24) { 
       ATH_MSG_DEBUG( "finest granularity");
       copier.setMETCompFromHelper(helper_i, helper_i);
-    } else if(comp == unsigned(nHelperComp-17) && helper_i == 41) { 
+    } else if(comp == unsigned(nHelperComp-17) && helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) { 
       ATH_MSG_DEBUG( "save muons");
       copier.setMETCompFromHelper(helper_i-17, helper_i);
     } else if (save6comp) {
@@ -256,7 +256,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
         ATH_MSG_DEBUG( "Central and Forward Jets");
         copier.setMETCompFromHelper(helper_i-34, helper_i);
       }
-      if (helper_i==41) { 
+      if (helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) { 
         ATH_MSG_DEBUG( "Muons");
         copier.setMETCompFromHelper(5, helper_i);
       }
@@ -268,37 +268,45 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
       } else if( helper_i > 29 && helper_i < 34) {     
         ATH_MSG_DEBUG( "EM scale quantities" );
         copier.setMETCompFromHelper(helper_i-25-1, helper_i);
-      } else if( helper_i == 41) {    
+      } else if( helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) {    
         ATH_MSG_DEBUG( "Muon" );
         copier.setMETCompFromHelper(helper_i-25-8, helper_i);
       }
     } else if (save5comp) {
-      switch (helper_i) {
-        case 0: case 1: case 2: case 3: 
+      switch (static_cast<TrigEFMissingEtComponent::Component>(helper_i)) {
+        case TrigEFMissingEtComponent::PreSamplB: case TrigEFMissingEtComponent::EMB1: 
+        case TrigEFMissingEtComponent::EMB2:      case TrigEFMissingEtComponent::EMB3: 
           ATH_MSG_DEBUG("LAr, barrel");
           copier.addMETCompWithHelper(0, 1, helper_i);
           break;
-        case 4: case 5: case 6: case 7: 
+        case TrigEFMissingEtComponent::PreSamplE: case TrigEFMissingEtComponent::EME1: 
+        case TrigEFMissingEtComponent::EME2: case TrigEFMissingEtComponent::EME3: 
           ATH_MSG_DEBUG("LAr, end-cap");
           /* FALLTHROUGH */
-        case 21:                        
+        case TrigEFMissingEtComponent::FCalEM:                        
           ATH_MSG_DEBUG("+ FCalEM");
           copier.addMETCompWithHelper(1, 2, helper_i);
           break;
-        case 12: case 13: case 14: 
+        case TrigEFMissingEtComponent::TileBar0: case TrigEFMissingEtComponent::TileBar1: case TrigEFMissingEtComponent::TileBar2: 
           ATH_MSG_DEBUG("Tile, barrel +");
           /* FALLTHROUGH */
-        case 18: case 19: case 20: 
+        case TrigEFMissingEtComponent::TileExt0: case TrigEFMissingEtComponent::TileExt1: case TrigEFMissingEtComponent::TileExt2: 
           ATH_MSG_DEBUG("Tile, extended barrel");
           copier.addMETCompWithHelper(2, 3, helper_i);
           break;
-        case 24: case 25: case 26: case 27: case 28:
-        case 29: case 30: case 31: case 32: case 33:
-        case 34: case 35: case 36: case 37: case 38:
-        case 39: case 40 :             
+        case TrigEFMissingEtComponent::TCLCW: 
+        case TrigEFMissingEtComponent::TCLCWB1: case TrigEFMissingEtComponent::TCLCWB2: 
+        case TrigEFMissingEtComponent::TCLCWE1: case TrigEFMissingEtComponent::TCLCWE2:
+        case TrigEFMissingEtComponent::TCEM:  
+        case TrigEFMissingEtComponent::TCEMB1:  case TrigEFMissingEtComponent::TCEMB2:  
+        case TrigEFMissingEtComponent::TCEME1:  case TrigEFMissingEtComponent::TCEME2:
+        case TrigEFMissingEtComponent::JET:   
+        case TrigEFMissingEtComponent::JETB1:   case TrigEFMissingEtComponent::JETB2:   
+        case TrigEFMissingEtComponent::JETE1:   case TrigEFMissingEtComponent::JETE2:
+        case TrigEFMissingEtComponent::TCPUC: case TrigEFMissingEtComponent::TCPUCUnc:             
           ATH_MSG_DEBUG("Topo. cluster elements or jets - do nothing.");
           break;
-        case 41: 
+        case TrigEFMissingEtComponent::Muons: 
           ATH_MSG_DEBUG("muons");
           copier.setMETCompFromHelper(4, helper_i);
           break;
@@ -307,28 +315,28 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
           copier.addMETCompWithHelper(3, 4, helper_i);
       }
     } else if (save3comp) {
-      switch (helper_i) {
-        case 39: 
+      switch (static_cast<TrigEFMissingEtComponent::Component>(helper_i)) {
+        case TrigEFMissingEtComponent::TCPUC: 
           ATH_MSG_DEBUG( "Corrected MET" );
           copier.setMETCompFromHelper(0, helper_i);
           break;
-        case 40: 
+        case TrigEFMissingEtComponent::TCPUCUnc: 
           ATH_MSG_DEBUG( "Original MET" );
           copier.setMETCompFromHelper(1, helper_i);
           break;
-        case 41: 
+        case TrigEFMissingEtComponent::Muons: 
           ATH_MSG_DEBUG( "Muons" );
           copier.setMETCompFromHelper(2, helper_i);
         default:
         ;
       }
     } else if (save2comp) { 
-      switch(helper_i){
-        case 34:
+      switch(static_cast<TrigEFMissingEtComponent::Component>(helper_i)){
+        case TrigEFMissingEtComponent::JET:
           ATH_MSG_DEBUG( "Jets+Mu only: Jets");
           copier.setMETCompFromHelper(0, helper_i);
           break;
-        case 41:
+        case TrigEFMissingEtComponent::Muons:
           ATH_MSG_DEBUG( "Jets+Mu only: Muons");
           copier.setMETCompFromHelper(1, helper_i);
           break;
@@ -336,7 +344,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
         ;
       }
     } else if (save1comp) { 
-      if (helper_i==41) { // REPLACE WITH A TEST OVER COMP. NAME
+      if (helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) { // REPLACE WITH A TEST OVER COMP. NAME
         ATH_MSG_DEBUG("Muons only");
         copier.setMETCompFromHelper(0, helper_i);
       }
@@ -371,40 +379,32 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     ATH_MSG_DEBUG( message );
   }
 
-  unsigned int Nc = met->getNumberOfComponents();
-
-  // if (Nc > 0) {
-  //   if(msgLvl(MSG::DEBUG)){
-        s="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
-			    s+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
-        ATH_MSG_DEBUG( s );
-   //   }
-   // }
-
-   for(uint j = 0; j < Nc; j++) {
-
-  	const char* name =               met->nameOfComponent(j).c_str();
-  	const short status =             met->statusComponent(j);
-  	const unsigned short usedChan =  met->usedChannelsComponent(j);
-  	const short sumOfSigns =         met->sumOfSignsComponent(j);
-  	const float calib0 =             met->calib0Component(j);
-  	const float calib1 =             met->calib1Component(j);
-  	const float ex =                 met->exComponent(j);
-  	const float ey =                 met->eyComponent(j);
-  	const float ez =                 met->ezComponent(j);
-  	const float sumE =               met->sumEComponent(j);
-  	const float sumEt =              met->sumEtComponent(j);
-
-    // if(msgLvl(MSG::DEBUG)){
+  if(msgLvl(MSG::DEBUG)){
+    unsigned int nMetComp = met->getNumberOfComponents();
+
+    s="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
+      s+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
+    ATH_MSG_DEBUG( s );
+
+    for(uint j = 0; j < nMetComp; j++) 
+    {
+    	const char* name =               met->nameOfComponent(j).c_str();
+    	const short status =             met->statusComponent(j);
+    	const unsigned short usedChan =  met->usedChannelsComponent(j);
+    	const short sumOfSigns =         met->sumOfSignsComponent(j);
+    	const float calib0 =             met->calib0Component(j);
+    	const float calib1 =             met->calib1Component(j);
+    	const float ex =                 met->exComponent(j);
+    	const float ey =                 met->eyComponent(j);
+    	const float ez =                 met->ezComponent(j);
+    	const float sumE =               met->sumEComponent(j);
+    	const float sumEt =              met->sumEtComponent(j);
+
       message = strformat ("REGTEST   %s   %6d %12d %10d   %6.2f  %6.3f %10.2f %10.2f %10.2f %10.2f %10.2f",
        name, status, usedChan, sumOfSigns, calib1, calib0, ex, ey, ez, sumE, sumEt);
       ATH_MSG_DEBUG( message );
-    // }
-
+    }
   }
-
-
-
   return StatusCode::SUCCESS;
 }
 
-- 
GitLab


From 3a3be6d66a1cd0a9489b69d36e93ea05713f1f81 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 1 Mar 2019 15:02:28 +0000
Subject: [PATCH 140/404] Revert SCT_AlignCondAlg to AthAlgorithm. Lock
 recursive mutex at the begining of each method. (ATLASRECTS-4824,
 ATLASSIM-3931)

---
 .../src/SCT_AlignCondAlg.cxx                  | 14 +++++-----
 .../src/SCT_AlignCondAlg.h                    | 21 ++++++++++++---
 .../InDetReadoutGeometry/SiDetectorElement.h  | 11 ++++----
 .../src/SiDetectorElement.cxx                 | 27 +++++++++----------
 4 files changed, 43 insertions(+), 30 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx
index fd9581a0323..bd970519288 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx
@@ -10,7 +10,7 @@
 #include <memory>
 
 SCT_AlignCondAlg::SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
-  : ::AthReentrantAlgorithm(name, pSvcLocator)
+  : ::AthAlgorithm(name, pSvcLocator)
   , m_writeKey{"SCTAlignmentStore", "SCTAlignmentStore"}
   , m_condSvc{"CondSvc", name}
   , m_detManager{nullptr}
@@ -44,12 +44,12 @@ StatusCode SCT_AlignCondAlg::initialize()
   return StatusCode::SUCCESS;
 }
 
-StatusCode SCT_AlignCondAlg::execute(const EventContext& ctx) const
+StatusCode SCT_AlignCondAlg::execute()
 {
   ATH_MSG_DEBUG("execute " << name());
 
   // ____________ Construct Write Cond Handle and check its validity ____________
-  SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx};
+  SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey};
 
   // Do we have a valid Write Cond Handle for current time?
   if (writeHandle.isValid()) {
@@ -72,7 +72,7 @@ StatusCode SCT_AlignCondAlg::execute(const EventContext& ctx) const
 
   if (not m_useDynamicAlignFolders.value()) { // Static
     // ____________ Get Read Cond Object ____________
-    SG::ReadCondHandle<AlignableTransformContainer> readHandleStatic{m_readKeyStatic, ctx};
+    SG::ReadCondHandle<AlignableTransformContainer> readHandleStatic{m_readKeyStatic};
     const AlignableTransformContainer* readCdoStatic{*readHandleStatic};
     if (readCdoStatic==nullptr) {
       ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKeyStatic.key());
@@ -91,19 +91,19 @@ StatusCode SCT_AlignCondAlg::execute(const EventContext& ctx) const
     }
   } else { // Dynamic
     // ____________ Get Read Cond Object ____________
-    SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL1{m_readKeyDynamicL1, ctx};
+    SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL1{m_readKeyDynamicL1};
     const CondAttrListCollection* readCdoDynamicL1{*readHandleDynamicL1};
     if (readCdoDynamicL1==nullptr) {
       ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKeyDynamicL1.key());
       return StatusCode::FAILURE;
     }
-    SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL2{m_readKeyDynamicL2, ctx};
+    SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL2{m_readKeyDynamicL2};
     const CondAttrListCollection* readCdoDynamicL2{*readHandleDynamicL2};
     if (readCdoDynamicL2==nullptr) {
       ATH_MSG_FATAL("Null pointer to the read conditions object of " << readHandleDynamicL2.key());
       return StatusCode::FAILURE;
     }
-    SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicL3{m_readKeyDynamicL3, ctx};
+    SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicL3{m_readKeyDynamicL3};
     const AlignableTransformContainer* readCdoDynamicL3{*readHandleDynamicL3};
     if (readCdoDynamicL3==nullptr) {
       ATH_MSG_FATAL("Null pointer to the read conditions object of " << readHandleDynamicL3.key());
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h
index daab6ebb54b..8db0a906403 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h
@@ -5,7 +5,7 @@
 #ifndef SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H
 #define SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H
 
-#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 
@@ -19,14 +19,29 @@ namespace InDetDD {
   class SCT_DetectorManager;
 }
 
-class SCT_AlignCondAlg : public AthReentrantAlgorithm
+// SCT_AlignCondAlg cannot inherit AthReentrantAlgorithm.
+// SCT_AlignCondAlg::execute uses the following methods.
+//  InDetDD::InDetDetectorManager::align
+//   InDetDD::InDetDetectorManager::processAlignmentContainer
+//    InDetDD::InDetDetectorManager::processKey
+//     InDetDD::SCT_DetectorManager::setAlignableTransformDelta
+//      InDetDD::SiDetectorElement::defModuleTransform
+//       InDetDD::SiDetectorElement::defTransform
+//        InDetDD::SiDetectorElement::defTransformCLHEP
+//         GeoVFullPhysVol::getDefAbsoluteTransform
+// GeoVFullPhysVol::getDefAbsoluteTransform is used without argument.
+// To be thread-safe, we need to pass non-const GeoVAlignmentStore pointer.
+// However, we cannot give non-const pointer for SiDetectorElement
+// in SCT_DetectorManager in the above chain.
+
+class SCT_AlignCondAlg : public AthAlgorithm
 {
  public:
   SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
   virtual ~SCT_AlignCondAlg() override = default;
 
   virtual StatusCode initialize() override;
-  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode execute() override;
   virtual StatusCode finalize() override;
 
  private:
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
index 8a0f0055449..6400ac183d1 100644
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElement.h
@@ -666,8 +666,8 @@ namespace InDetDD {
     
     inline Amg::Vector3D SiDetectorElement::globalPosition(const Amg::Vector2D &localPos) const
     {
-      if (!m_cacheValid) updateCache();
       std::lock_guard<std::recursive_mutex> lock(m_mutex);
+      if (!m_cacheValid) updateCache();
       return m_center + localPos[Trk::distEta] * m_etaAxis + localPos[Trk::distPhi] * m_phiAxis;
     }
 
@@ -678,8 +678,8 @@ namespace InDetDD {
     
      inline HepGeom::Point3D<double> SiDetectorElement::globalPositionCLHEP(const Amg::Vector2D &localPos) const
     {
-      if (!m_cacheValid) updateCache();
       std::lock_guard<std::recursive_mutex> lock(m_mutex);
+      if (!m_cacheValid) updateCache();
       return m_centerCLHEP + localPos[Trk::distEta] * m_etaAxisCLHEP + localPos[Trk::distPhi] * m_phiAxisCLHEP;
     }
      //here
@@ -695,15 +695,16 @@ namespace InDetDD {
     
     inline Amg::Vector2D SiDetectorElement::localPosition(const HepGeom::Point3D<double> & globalPosition) const
     {
-      if (!m_cacheValid) updateCache();
       std::lock_guard<std::recursive_mutex> lock(m_mutex);
+      if (!m_cacheValid) updateCache();
       HepGeom::Vector3D<double> relativePos = globalPosition - m_centerCLHEP;
       return Amg::Vector2D(relativePos.dot(m_phiAxisCLHEP), relativePos.dot(m_etaAxisCLHEP));
     }
 
-    inline Amg::Vector2D SiDetectorElement::localPosition(const Amg::Vector3D & globalPosition) const{
-      if (!m_cacheValid) updateCache();
+    inline Amg::Vector2D SiDetectorElement::localPosition(const Amg::Vector3D & globalPosition) const
+    {
       std::lock_guard<std::recursive_mutex> lock(m_mutex);
+      if (!m_cacheValid) updateCache();
       Amg::Vector3D relativePos = globalPosition - m_center;
       return Amg::Vector2D(relativePos.dot(m_phiAxis), relativePos.dot(m_etaAxis));
     }
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
index 1369b8dae36..bd2a80a8c96 100644
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx
@@ -381,19 +381,17 @@ SiDetectorElement::transformHit() const
 const Amg::Transform3D &
 SiDetectorElement::transform() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_transform;
 }
 
 const HepGeom::Transform3D &
 SiDetectorElement::transformCLHEP() const
 {
-  //if (!m_cacheValid) updateCache();
-  //return m_transform;
   //stuff to get the CLHEP version of the local to global transform.
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_transformCLHEP;
 }
 
@@ -507,48 +505,48 @@ SiDetectorElement::isModuleFrame() const
 const Amg::Vector3D & 
 SiDetectorElement::center() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_center;
 }
 
 const Amg::Vector3D & 
 SiDetectorElement::normal() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_normal;
 }
 
 const HepGeom::Vector3D<double> & 
 SiDetectorElement::etaAxisCLHEP() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_etaAxisCLHEP;
 }
 
 const HepGeom::Vector3D<double> & 
 SiDetectorElement::phiAxisCLHEP() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_phiAxisCLHEP;
 }
 
 const Amg::Vector3D & 
 SiDetectorElement::etaAxis() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_etaAxis;
 }
 
 const Amg::Vector3D & 
 SiDetectorElement::phiAxis() const
 {
-  if (!m_cacheValid) updateCache();
   std::lock_guard<std::recursive_mutex> lock(m_mutex);
+  if (!m_cacheValid) updateCache();
   return m_phiAxis;
 }
 
@@ -629,6 +627,7 @@ bool SiDetectorElement::isNextToInnermostPixelLayer() const
 // compute sin(tilt angle) at center:
 double SiDetectorElement::sinTilt() const
 {
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   if (!m_cacheValid) updateCache();
 
   // Tilt is defined as the angle between a refVector and the sensor normal.
@@ -643,7 +642,6 @@ double SiDetectorElement::sinTilt() const
   // HepGeom::Vector3D<double> refVector(m_center.x(), m_center.y(), 0);
   // return (refVector.cross(m_normal)).z()/refVector.mag();
   // or the equivalent
-  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   return (m_center.x() * m_normal.y() - m_center.y() * m_normal.x()) / m_center.perp();
 }
 
@@ -660,6 +658,7 @@ double SiDetectorElement::sinTilt() const
 
 double SiDetectorElement::sinTilt(const HepGeom::Point3D<double> &globalPos) const
 { 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   if (!m_cacheValid) updateCache();
 
   // It is assumed that the global position is already in the plane of the element.
@@ -667,7 +666,6 @@ double SiDetectorElement::sinTilt(const HepGeom::Point3D<double> &globalPos) con
   // tilt angle is not defined for the endcap
   if (isEndcap()) return 0;
   
-  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   // Angle between normal and radial vector.
   //HepGeom::Vector3D<double> refVector(globalPos.x(), globalPos.y(), 0);
   //return (refVector.cross(m_normal)).z()/refVector.mag();
@@ -677,7 +675,7 @@ double SiDetectorElement::sinTilt(const HepGeom::Point3D<double> &globalPos) con
 
 double SiDetectorElement::sinStereo() const
 {
-
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   if (!m_cacheValid) updateCache();
 
   // Stereo is the angle between a refVector and a vector along the strip/pixel in eta direction.
@@ -702,7 +700,6 @@ double SiDetectorElement::sinStereo() const
   //           = -(center cross etaAxis) . zAxis
   //           = (etaAxis cross center). z() 
 
-  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   double sinStereo;
   if (isBarrel()) {
     sinStereo = m_phiAxis.z();
@@ -726,9 +723,9 @@ double SiDetectorElement::sinStereo(const HepGeom::Point3D<double> &globalPos) c
   // sinStereo =  (refVector cross stripAxis) . normal
   //
 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   if (!m_cacheValid) updateCache();
 
-  std::lock_guard<std::recursive_mutex> lock(m_mutex);
   double sinStereo;
   if (isBarrel()) {
     if (m_design->shape() != InDetDD::Trapezoid) {
-- 
GitLab


From 0fdbf62162d4cd0c8ea4cad8e255372ca41be364 Mon Sep 17 00:00:00 2001
From: William Axel Leight <william.axel.leight@cern.ch>
Date: Fri, 1 Mar 2019 15:03:22 +0000
Subject: [PATCH 141/404] Resolve ATLASRECTS-4855 and add NSW variables

---
 .../xAODMuon/Root/MuonAuxContainer_v5.cxx     | 183 ++++++++++++++
 .../Root/MuonTrackSummaryAccessors_v1.cxx     |  29 ++-
 .../xAOD/xAODMuon/xAODMuon/MuonAuxContainer.h |   6 +-
 Event/xAOD/xAODMuon/xAODMuon/selection.xml    |   4 +
 .../xAODMuon/versions/MuonAuxContainer_v5.h   | 226 ++++++++++++++++++
 Event/xAOD/xAODMuon/xAODMuon/xAODMuonDict.h   |   4 +-
 .../src/xAODMuonAthenaPoolTPCnv.cxx           |   8 +-
 .../src/xAODMuonAuxContainerCnv.cxx           |  14 +-
 .../src/xAODMuonAuxContainerCnv_v4.cxx        |  75 ++++++
 .../src/xAODMuonAuxContainerCnv_v4.h          |  48 ++++
 .../xAODTracking/TrackingPrimitives.h         |  30 ++-
 .../MuonRecExample/python/MuonRecFlags.py     |   2 +-
 .../IsolationAlgs/python/IsoGetter.py         |   3 +-
 13 files changed, 616 insertions(+), 16 deletions(-)
 create mode 100644 Event/xAOD/xAODMuon/Root/MuonAuxContainer_v5.cxx
 create mode 100644 Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v5.h
 create mode 100644 Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.cxx
 create mode 100644 Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.h

diff --git a/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v5.cxx b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v5.cxx
new file mode 100644
index 00000000000..d06a294f9fb
--- /dev/null
+++ b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v5.cxx
@@ -0,0 +1,183 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// Local include(s):
+#include "xAODMuon/versions/MuonAuxContainer_v5.h"
+ 
+namespace xAOD {
+ 
+   MuonAuxContainer_v5::MuonAuxContainer_v5()
+      : AuxContainerBase() {
+
+        // iParticle
+        AUX_VARIABLE( pt );
+        AUX_VARIABLE( eta );
+        AUX_VARIABLE( phi );
+        AUX_VARIABLE(charge);
+
+
+        // Muon summary
+        AUX_VARIABLE( allAuthors );
+        AUX_VARIABLE( author );
+        AUX_VARIABLE( muonType );
+        AUX_VARIABLE( quality ); //quality, passesIDCuts and passesHighPtCuts are packed in here.
+
+        // Energyloss
+        AUX_VARIABLE( energyLossType );
+
+        // Muon-specific track summary (the other track summary information is retrieved from the TrackParticle)
+        AUX_VARIABLE( numberOfPrecisionLayers );
+        AUX_VARIABLE( numberOfPrecisionHoleLayers );
+        AUX_VARIABLE( numberOfPhiLayers );
+        AUX_VARIABLE( numberOfPhiHoleLayers );
+        AUX_VARIABLE( numberOfTriggerEtaLayers );
+        AUX_VARIABLE( numberOfTriggerEtaHoleLayers );
+        AUX_VARIABLE( primarySector );
+        AUX_VARIABLE( secondarySector );
+
+        AUX_VARIABLE( innerSmallHits );
+        AUX_VARIABLE( innerLargeHits );
+        AUX_VARIABLE( middleSmallHits );
+        AUX_VARIABLE( middleLargeHits );
+        AUX_VARIABLE( outerSmallHits );
+        AUX_VARIABLE( outerLargeHits );
+        AUX_VARIABLE( extendedSmallHits );
+        AUX_VARIABLE( extendedLargeHits );
+
+        AUX_VARIABLE( innerSmallHoles );
+        AUX_VARIABLE( innerLargeHoles );
+        AUX_VARIABLE( middleSmallHoles );
+        AUX_VARIABLE( middleLargeHoles );
+        AUX_VARIABLE( outerSmallHoles );
+        AUX_VARIABLE( outerLargeHoles );
+        AUX_VARIABLE( extendedSmallHoles );
+        AUX_VARIABLE( extendedLargeHoles );
+
+        AUX_VARIABLE( phiLayer1Hits );
+        AUX_VARIABLE( phiLayer2Hits );
+        AUX_VARIABLE( phiLayer3Hits );
+        AUX_VARIABLE( phiLayer4Hits );
+
+        AUX_VARIABLE( etaLayer1Hits );
+        AUX_VARIABLE( etaLayer2Hits );
+        AUX_VARIABLE( etaLayer3Hits );
+        AUX_VARIABLE( etaLayer4Hits );
+
+        AUX_VARIABLE( phiLayer1Holes );
+        AUX_VARIABLE( phiLayer2Holes );
+        AUX_VARIABLE( phiLayer3Holes );
+        AUX_VARIABLE( phiLayer4Holes );
+
+        AUX_VARIABLE( etaLayer1Holes );
+        AUX_VARIABLE( etaLayer2Holes );
+        AUX_VARIABLE( etaLayer3Holes );
+        AUX_VARIABLE( etaLayer4Holes );
+
+        AUX_VARIABLE( phiLayer1RPCHits );
+        AUX_VARIABLE( phiLayer2RPCHits );
+        AUX_VARIABLE( phiLayer3RPCHits );
+        AUX_VARIABLE( phiLayer4RPCHits );
+
+        AUX_VARIABLE( etaLayer1RPCHits );
+        AUX_VARIABLE( etaLayer2RPCHits );
+        AUX_VARIABLE( etaLayer3RPCHits );
+        AUX_VARIABLE( etaLayer4RPCHits );
+
+        AUX_VARIABLE( phiLayer1RPCHoles );
+        AUX_VARIABLE( phiLayer2RPCHoles );
+        AUX_VARIABLE( phiLayer3RPCHoles );
+        AUX_VARIABLE( phiLayer4RPCHoles );
+
+        AUX_VARIABLE( etaLayer1RPCHoles );
+        AUX_VARIABLE( etaLayer2RPCHoles );
+        AUX_VARIABLE( etaLayer3RPCHoles );
+        AUX_VARIABLE( etaLayer4RPCHoles );
+
+        AUX_VARIABLE( phiLayer1TGCHits );
+        AUX_VARIABLE( phiLayer2TGCHits );
+        AUX_VARIABLE( phiLayer3TGCHits );
+        AUX_VARIABLE( phiLayer4TGCHits );
+
+        AUX_VARIABLE( etaLayer1TGCHits );
+        AUX_VARIABLE( etaLayer2TGCHits );
+        AUX_VARIABLE( etaLayer3TGCHits );
+        AUX_VARIABLE( etaLayer4TGCHits );
+
+        AUX_VARIABLE( phiLayer1TGCHoles );
+        AUX_VARIABLE( phiLayer2TGCHoles );
+        AUX_VARIABLE( phiLayer3TGCHoles );
+        AUX_VARIABLE( phiLayer4TGCHoles );
+
+        AUX_VARIABLE( etaLayer1TGCHoles );
+        AUX_VARIABLE( etaLayer2TGCHoles );
+        AUX_VARIABLE( etaLayer3TGCHoles );
+        AUX_VARIABLE( etaLayer4TGCHoles );
+
+        // New Small Wheel
+        // STGC
+        AUX_VARIABLE( phiLayer1STGCHits );
+        AUX_VARIABLE( phiLayer2STGCHits );
+
+        AUX_VARIABLE( etaLayer1STGCHits );
+        AUX_VARIABLE( etaLayer2STGCHits );
+
+	AUX_VARIABLE( phiLayer1STGCHoles );
+        AUX_VARIABLE( phiLayer2STGCHoles );
+
+	AUX_VARIABLE( etaLayer1STGCHoles );
+	AUX_VARIABLE( etaLayer2STGCHoles );
+
+        // MM
+	AUX_VARIABLE( MMHits );
+	AUX_VARIABLE( MMHoles );
+        // Note: there is currently no MuonStationIndex for the two MM layers
+	// In the future it might be needed to add them in order to have
+        // separate counters as follows
+        // AUX_VARIABLE( Layer1MMHits );
+        // AUX_VARIABLE( Layer2MMHits );
+        // AUX_VARIABLE( Layer1MMHoles );
+	// AUX_VARIABLE( Layer2MMHoles );
+
+	AUX_VARIABLE( cscEtaHits );
+	AUX_VARIABLE( cscUnspoiledEtaHits );
+
+        // Links
+        AUX_VARIABLE( inDetTrackParticleLink );
+        AUX_VARIABLE( muonSpectrometerTrackParticleLink );
+        AUX_VARIABLE( extrapolatedMuonSpectrometerTrackParticleLink );
+        AUX_VARIABLE( msOnlyExtrapolatedMuonSpectrometerTrackParticleLink );
+        AUX_VARIABLE( combinedTrackParticleLink );
+        AUX_VARIABLE( clusterLink );
+        AUX_VARIABLE( muonSegmentLinks );
+        
+        // Paramdefs 
+        AUX_VARIABLE(spectrometerFieldIntegral      );
+        AUX_VARIABLE(scatteringCurvatureSignificance);
+        AUX_VARIABLE(scatteringNeighbourSignificance);
+        AUX_VARIABLE(momentumBalanceSignificance    );
+        AUX_VARIABLE(segmentDeltaEta                );
+        AUX_VARIABLE(segmentDeltaPhi                );
+        AUX_VARIABLE(segmentChi2OverDoF             );
+        AUX_VARIABLE(t0                             );
+        AUX_VARIABLE(beta                           );
+        AUX_VARIABLE(annBarrel                      );
+        AUX_VARIABLE(annEndCap                      );
+        AUX_VARIABLE(innAngle                       );
+        AUX_VARIABLE(midAngle                       );
+        AUX_VARIABLE(msInnerMatchChi2               );
+        AUX_VARIABLE(meanDeltaADCCountsMDT          );
+        AUX_VARIABLE(CaloLRLikelihood               );
+        AUX_VARIABLE(EnergyLoss                     );
+        AUX_VARIABLE(ParamEnergyLoss                );
+        AUX_VARIABLE(MeasEnergyLoss                 );
+        AUX_VARIABLE(EnergyLossSigma                );
+        AUX_VARIABLE(ParamEnergyLossSigmaPlus       );
+        AUX_VARIABLE(ParamEnergyLossSigmaMinus      );
+        AUX_VARIABLE(MeasEnergyLossSigma            );
+        AUX_VARIABLE(msInnerMatchDOF                );
+        AUX_VARIABLE(msOuterMatchDOF                );
+        AUX_VARIABLE(CaloMuonIDTag                  );
+   }
+ 
+} // namespace xAOD
diff --git a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
index 0da68c9354b..0059f42e14c 100644
--- a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
+++ b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
@@ -1,9 +1,7 @@
 /*
-  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: MuonTrackSummaryAccessors_v1.cxx 796148 2017-02-08 10:18:43Z wleight $
-
 // System include(s):
 #include <iostream>
 
@@ -105,6 +103,31 @@ namespace xAOD {
         DEFINE_ACCESSOR( uint8_t, etaLayer3TGCHoles );
         DEFINE_ACCESSOR( uint8_t, etaLayer4TGCHoles );
 
+	// New Small Wheel
+        // STGC
+	DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHits );
+	DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHits );
+
+        DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHits );
+        DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHits );
+
+	DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHoles );
+	DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHoles );
+
+	DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHoles );
+	DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHoles );
+
+	// MM
+        DEFINE_ACCESSOR( uint8_t, MMHits );
+	DEFINE_ACCESSOR( uint8_t, MMHoles );
+	// Note: there is currently no MuonStationIndex for the two MM layers
+	// In the future it might be needed to add them in order to have
+        // separate counters as follows
+        // DEFINE_ACCESSOR( uint8_t, Layer1MMHits );
+	// DEFINE_ACCESSOR( uint8_t, Layer2MMHits );
+	// DEFINE_ACCESSOR( uint8_t, Layer1MMHoles );
+	// DEFINE_ACCESSOR( uint8_t, Layer2MMHoles );
+
         DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits );
         DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits );
         DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits );
diff --git a/Event/xAOD/xAODMuon/xAODMuon/MuonAuxContainer.h b/Event/xAOD/xAODMuon/xAODMuon/MuonAuxContainer.h
index d51dcaf08cf..cffc16a574d 100644
--- a/Event/xAOD/xAODMuon/xAODMuon/MuonAuxContainer.h
+++ b/Event/xAOD/xAODMuon/xAODMuon/MuonAuxContainer.h
@@ -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
 */
 
 #ifndef XAODMUON_MUONAUXCONTAINER_H
 #define XAODMUON_MUONAUXCONTAINER_H
  
 // Local include(s):
-#include "xAODMuon/versions/MuonAuxContainer_v4.h"
+#include "xAODMuon/versions/MuonAuxContainer_v5.h"
  
 namespace xAOD {
    /// Definition of the current Muon auxiliary container
@@ -16,7 +16,7 @@ namespace xAOD {
    /// the container type as we get new I/O technologies for these
    /// objects.
    ///
-   typedef MuonAuxContainer_v4 MuonAuxContainer;
+   typedef MuonAuxContainer_v5 MuonAuxContainer;
 }
 
 // Set up a CLID and StoreGate inheritance for the class:
diff --git a/Event/xAOD/xAODMuon/xAODMuon/selection.xml b/Event/xAOD/xAODMuon/xAODMuon/selection.xml
index 1eb8ed1308c..e68fa1c1886 100644
--- a/Event/xAOD/xAODMuon/xAODMuon/selection.xml
+++ b/Event/xAOD/xAODMuon/xAODMuon/selection.xml
@@ -13,6 +13,10 @@
   <class name="xAOD::MuonAuxContainer_v4"
 	 id="8251F481-EA4C-4852-AE72-BED87E6FD2FB"/>
 
+  <!-- MuonAux _v5 dictionaries: -->
+  <class name="xAOD::MuonAuxContainer_v5"
+	 id="9245FA19-1552-4BBB-8CC3-57224E57A466"/>
+
   <!-- Muon_v1 dictionaries: -->
   <class name="xAOD::Muon_v1" />
   <class name="xAOD::MuonContainer_v1"
diff --git a/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v5.h b/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v5.h
new file mode 100644
index 00000000000..ff39bcacde3
--- /dev/null
+++ b/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v5.h
@@ -0,0 +1,226 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef XAODMUON_VERSIONS_MUONAUXCONTAINER_V5_H
+#define XAODMUON_VERSIONS_MUONAUXCONTAINER_V5_H
+ 
+// System include(s):
+#include <stdint.h>
+#include <vector>
+
+// Core include(s):
+#include "AthLinks/ElementLink.h"
+#include "xAODCore/AuxContainerBase.h"
+ 
+// xAOD include(s):
+#include "xAODTracking/TrackParticleContainer.h" 
+#include "xAODCaloEvent/CaloClusterContainer.h" 
+#include "xAODMuon/MuonSegmentContainer.h" 
+ 
+namespace xAOD {
+ 
+   /// Temporary container used until we have I/O for AuxStoreInternal
+   ///
+   /// This class is meant to serve as a temporary way to provide an auxiliary
+   /// store with Athena I/O capabilities for the Muon EDM. Will be exchanged for
+   /// a generic auxiliary container type (AuxStoreInternal) later on.
+   ///
+   /// @author Edward Moyse
+   ///
+   class MuonAuxContainer_v5 : public AuxContainerBase {
+ 
+   public:
+      /// Default constructor
+      MuonAuxContainer_v5();
+ 
+   private:
+      /// @name iParticle values
+      /// @{                          
+     std::vector< float >             pt;
+     std::vector< float >             eta;
+     std::vector< float >             phi;
+     std::vector< float >             charge;
+     /// @}  
+			                       	
+     /// @name Muon summary information
+     /// @{                                      	
+     std::vector< uint16_t >          allAuthors;
+     std::vector< uint16_t>           author;
+     std::vector< uint16_t>           muonType;
+     std::vector< uint8_t>            quality; //quality, passesIDCuts and passesHighPtCuts are packed in here.
+
+      /// @}  
+
+      /// @name TrackSummary and MuonTrackSummary information
+      /// @{
+      std::vector< uint8_t >          numberOfPrecisionLayers;
+      std::vector< uint8_t >          numberOfPrecisionHoleLayers;
+      std::vector< uint8_t >          numberOfPhiLayers;
+      std::vector< uint8_t >          numberOfPhiHoleLayers;
+      std::vector< uint8_t >          numberOfTriggerEtaLayers;
+      std::vector< uint8_t >          numberOfTriggerEtaHoleLayers;
+      std::vector< uint8_t >          primarySector;
+      std::vector< uint8_t >          secondarySector;
+      
+      std::vector< uint8_t >          innerSmallHits;
+      std::vector< uint8_t >          innerLargeHits;
+      std::vector< uint8_t >          middleSmallHits;
+      std::vector< uint8_t >          middleLargeHits;
+      std::vector< uint8_t >          outerSmallHits;
+      std::vector< uint8_t >          outerLargeHits;
+      std::vector< uint8_t >          extendedSmallHits;
+      std::vector< uint8_t >          extendedLargeHits;
+      
+      std::vector< uint8_t >          innerSmallHoles;
+      std::vector< uint8_t >          innerLargeHoles;
+      std::vector< uint8_t >          middleSmallHoles;
+      std::vector< uint8_t >          middleLargeHoles;
+      std::vector< uint8_t >          outerSmallHoles;
+      std::vector< uint8_t >          outerLargeHoles;
+      std::vector< uint8_t >          extendedSmallHoles;
+      std::vector< uint8_t >          extendedLargeHoles;
+      
+      std::vector< uint8_t >          phiLayer1Hits;
+      std::vector< uint8_t >          phiLayer2Hits;
+      std::vector< uint8_t >          phiLayer3Hits;
+      std::vector< uint8_t >          phiLayer4Hits;
+      
+      std::vector< uint8_t >          etaLayer1Hits;
+      std::vector< uint8_t >          etaLayer2Hits;
+      std::vector< uint8_t >          etaLayer3Hits;
+      std::vector< uint8_t >          etaLayer4Hits;
+      
+      std::vector< uint8_t >          phiLayer1Holes;
+      std::vector< uint8_t >          phiLayer2Holes;
+      std::vector< uint8_t >          phiLayer3Holes;
+      std::vector< uint8_t >          phiLayer4Holes;
+      
+      std::vector< uint8_t >          etaLayer1Holes;
+      std::vector< uint8_t >          etaLayer2Holes;
+      std::vector< uint8_t >          etaLayer3Holes;
+      std::vector< uint8_t >          etaLayer4Holes;
+
+      std::vector< uint8_t >          phiLayer1RPCHits;
+      std::vector< uint8_t >          phiLayer2RPCHits;
+      std::vector< uint8_t >          phiLayer3RPCHits;
+      std::vector< uint8_t >          phiLayer4RPCHits;
+      
+      std::vector< uint8_t >          etaLayer1RPCHits;
+      std::vector< uint8_t >          etaLayer2RPCHits;
+      std::vector< uint8_t >          etaLayer3RPCHits;
+      std::vector< uint8_t >          etaLayer4RPCHits;
+      
+      std::vector< uint8_t >          phiLayer1RPCHoles;
+      std::vector< uint8_t >          phiLayer2RPCHoles;
+      std::vector< uint8_t >          phiLayer3RPCHoles;
+      std::vector< uint8_t >          phiLayer4RPCHoles;
+      
+      std::vector< uint8_t >          etaLayer1RPCHoles;
+      std::vector< uint8_t >          etaLayer2RPCHoles;
+      std::vector< uint8_t >          etaLayer3RPCHoles;
+      std::vector< uint8_t >          etaLayer4RPCHoles;
+      
+      std::vector< uint8_t >          phiLayer1TGCHits;
+      std::vector< uint8_t >          phiLayer2TGCHits;
+      std::vector< uint8_t >          phiLayer3TGCHits;
+      std::vector< uint8_t >          phiLayer4TGCHits;
+      
+      std::vector< uint8_t >          etaLayer1TGCHits;
+      std::vector< uint8_t >          etaLayer2TGCHits;
+      std::vector< uint8_t >          etaLayer3TGCHits;
+      std::vector< uint8_t >          etaLayer4TGCHits;
+      
+      std::vector< uint8_t >          phiLayer1TGCHoles;
+      std::vector< uint8_t >          phiLayer2TGCHoles;
+      std::vector< uint8_t >          phiLayer3TGCHoles;
+      std::vector< uint8_t >          phiLayer4TGCHoles;
+      
+      std::vector< uint8_t >          etaLayer1TGCHoles;
+      std::vector< uint8_t >          etaLayer2TGCHoles;
+      std::vector< uint8_t >          etaLayer3TGCHoles;
+      std::vector< uint8_t >          etaLayer4TGCHoles;
+
+      // STGC
+      std::vector< uint8_t >          phiLayer1STGCHits;
+      std::vector< uint8_t >          phiLayer2STGCHits;
+
+      std::vector< uint8_t >          etaLayer1STGCHits;
+      std::vector< uint8_t >          etaLayer2STGCHits;
+
+      std::vector< uint8_t >          phiLayer1STGCHoles;
+      std::vector< uint8_t >          phiLayer2STGCHoles;
+
+      std::vector< uint8_t >          etaLayer1STGCHoles;
+      std::vector< uint8_t >          etaLayer2STGCHoles;
+
+      // MM
+      std::vector< uint8_t >          MMHits;
+      std::vector< uint8_t >          MMHoles;
+      // Note: there is currently no MuonStationIndex for the two MM layers
+      // In the future it might be needed to add them in order to have
+      // separate counters as follows
+      // std::vector< uint8_t >          Layer1MMHits;
+      // std::vector< uint8_t >          Layer2MMHits;
+      // std::vector< uint8_t >          Layer1MMHoles;
+      // std::vector< uint8_t >          Layer2MMHoles;
+
+      std::vector< uint8_t >          cscEtaHits;
+      std::vector< uint8_t >          cscUnspoiledEtaHits;
+
+      /// @}   
+      
+      /// @name Links 
+      /// @{    
+      std::vector<ElementLink< TrackParticleContainer > >                 inDetTrackParticleLink;
+      std::vector<ElementLink< TrackParticleContainer > >                 muonSpectrometerTrackParticleLink;
+      std::vector<ElementLink< TrackParticleContainer > >                 extrapolatedMuonSpectrometerTrackParticleLink;
+      std::vector<ElementLink< TrackParticleContainer > >                 msOnlyExtrapolatedMuonSpectrometerTrackParticleLink;
+      std::vector<ElementLink< TrackParticleContainer > >                 combinedTrackParticleLink;
+      std::vector<ElementLink< CaloClusterContainer   > >                 clusterLink;
+      std::vector<std::vector<ElementLink< MuonSegmentContainer   > > >   muonSegmentLinks;
+      /// @}
+      
+      /// @name Energy loss 
+      /// @{
+      std::vector< uint8_t>           energyLossType;
+      /// @}
+      
+      /// @name Param defs 
+      /// @{
+      std::vector< float>             spectrometerFieldIntegral      ;
+      std::vector< float>             scatteringCurvatureSignificance;
+      std::vector< float>             scatteringNeighbourSignificance;
+      std::vector< float>             momentumBalanceSignificance    ;
+      std::vector< float>             segmentDeltaEta                ;
+      std::vector< float>             segmentDeltaPhi                ;
+      std::vector< float>             segmentChi2OverDoF             ;
+      std::vector< float>             t0                             ;
+      std::vector< float>             beta                           ;
+      std::vector< float>             annBarrel                      ;
+      std::vector< float>             annEndCap                      ;
+      std::vector< float>             innAngle                       ;
+      std::vector< float>             midAngle                       ;
+      std::vector< float>             msInnerMatchChi2               ;
+      std::vector< float>             meanDeltaADCCountsMDT          ;
+      std::vector< float>             CaloLRLikelihood               ;
+      std::vector< float>             EnergyLoss                     ;
+      std::vector< float>             ParamEnergyLoss                ;
+      std::vector< float>             MeasEnergyLoss                 ;
+      std::vector< float>             EnergyLossSigma                ;
+      std::vector< float>             ParamEnergyLossSigmaPlus       ;
+      std::vector< float>             ParamEnergyLossSigmaMinus      ;
+      std::vector< float>             MeasEnergyLossSigma            ;
+      std::vector< int >              msInnerMatchDOF                ;
+      std::vector< int >              msOuterMatchDOF                ;
+      std::vector< int >              CaloMuonIDTag                  ;
+      /// @}
+ 
+   }; // class MuonAuxContainer_v5
+ 
+} // namespace xAOD
+ 
+#include "xAODCore/BaseInfo.h"
+SG_BASE( xAOD::MuonAuxContainer_v5, xAOD::AuxContainerBase ); 
+ 
+#endif
diff --git a/Event/xAOD/xAODMuon/xAODMuon/xAODMuonDict.h b/Event/xAOD/xAODMuon/xAODMuon/xAODMuonDict.h
index 775cbf16663..ef28b18f02e 100644
--- a/Event/xAOD/xAODMuon/xAODMuon/xAODMuonDict.h
+++ b/Event/xAOD/xAODMuon/xAODMuon/xAODMuonDict.h
@@ -1,10 +1,9 @@
 // Dear emacs, this is -*- 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: xAODMuonDict.h 745098 2016-05-05 15:47:04Z wleight $
 #ifndef XAODMUON_XAODMUONDICT_H
 #define XAODMUON_XAODMUONDICT_H
 
@@ -22,6 +21,7 @@
 #include "xAODMuon/versions/MuonAuxContainer_v2.h"
 #include "xAODMuon/versions/MuonAuxContainer_v3.h"
 #include "xAODMuon/versions/MuonAuxContainer_v4.h"
+#include "xAODMuon/versions/MuonAuxContainer_v5.h"
 #include "xAODMuon/MuonContainer.h"
 #include "xAODMuon/MuonAuxContainer.h"
 #include "xAODMuon/MuonSegmentContainer.h"
diff --git a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAthenaPoolTPCnv.cxx b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAthenaPoolTPCnv.cxx
index cf61b74fbe1..2f726cf73aa 100644
--- a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAthenaPoolTPCnv.cxx
+++ b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAthenaPoolTPCnv.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
 */
 
 // $Id:  $
@@ -12,12 +12,14 @@
 #include "xAODMuon/versions/MuonAuxContainer_v1.h"
 #include "xAODMuon/versions/MuonAuxContainer_v2.h"
 #include "xAODMuon/versions/MuonAuxContainer_v3.h"
+#include "xAODMuon/versions/MuonAuxContainer_v4.h"
 
 
 // Local include(s):
 #include "xAODMuonAuxContainerCnv_v1.h"
 #include "xAODMuonAuxContainerCnv_v2.h"
 #include "xAODMuonAuxContainerCnv_v3.h"
+#include "xAODMuonAuxContainerCnv_v4.h"
 
 // Declare the T/P converter(s):
 DECLARE_TPCNV_FACTORY( xAODMuonAuxContainerCnv_v1,
@@ -35,3 +37,7 @@ DECLARE_TPCNV_FACTORY( xAODMuonAuxContainerCnv_v3,
                        xAOD::MuonAuxContainer_v3,
                        Athena::TPCnvVers::Old )
 
+DECLARE_TPCNV_FACTORY( xAODMuonAuxContainerCnv_v4,
+                       xAOD::MuonAuxContainer,
+                       xAOD::MuonAuxContainer_v4,
+                       Athena::TPCnvVers::Old )
diff --git a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv.cxx b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv.cxx
index fa844389f59..1b4c49ee804 100644
--- a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv.cxx
+++ b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv.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
 */
 
 // System include(s):
@@ -12,6 +12,7 @@
 #include "xAODMuonAuxContainerCnv_v1.h"
 #include "xAODMuonAuxContainerCnv_v2.h"
 #include "xAODMuonAuxContainerCnv_v3.h"
+#include "xAODMuonAuxContainerCnv_v4.h"
 
 xAODMuonAuxContainerCnv::
 xAODMuonAuxContainerCnv( ISvcLocator* svcLoc )
@@ -34,11 +35,20 @@ xAODMuonAuxContainerCnv::createTransient() {
    static const pool::Guid v2_guid( "AB53C81C-B10C-11E4-AC59-6C3BE51AB9F1" );
    static const pool::Guid v3_guid( "ECC65005-302B-4662-ACBA-D2CE5A0218B8" );
    static const pool::Guid v4_guid( "8251F481-EA4C-4852-AE72-BED87E6FD2FB" );
+   static const pool::Guid v5_guid( "9245FA19-1552-4BBB-8CC3-57224E57A466" );
 
    // Check which version of the container we're reading:
-   if( compareClassGuid( v4_guid ) ) {
+   if( compareClassGuid( v5_guid ) ) {
      // It's the latest version, read it directly:
      return poolReadObject< xAOD::MuonAuxContainer >();
+   }else if( compareClassGuid( v4_guid ) ) {
+     // Handle dynamic to aux conversion.
+     // The v4 converter:
+     static xAODMuonAuxContainerCnv_v4 converter;
+     std::unique_ptr< xAOD::MuonAuxContainer_v4 >
+       old( poolReadObject< xAOD::MuonAuxContainer_v4 >() );
+
+     return converter.createTransient( old.get(), msg() );
    }else if( compareClassGuid( v3_guid ) ) {
      // Handle dynamic to aux conversion.
      // The v3 converter:
diff --git a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.cxx b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.cxx
new file mode 100644
index 00000000000..8971a1f3fc0
--- /dev/null
+++ b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.cxx
@@ -0,0 +1,75 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id:  $
+
+// System include(s):
+#include <stdexcept>
+
+// Gaudi/Athena include(s):
+#include "GaudiKernel/MsgStream.h"
+
+// Core EDM include(s):
+#include "AthContainers/tools/copyAuxStoreThinned.h"
+
+// Local include(s):
+#include "xAODMuonAuxContainerCnv_v4.h"
+#include "xAODMuon/MuonContainer.h"
+#include "xAODMuon/versions/MuonContainer_v1.h"
+
+/// Convenience macro for setting the level of output messages
+#define MSGLVL MSG::DEBUG
+
+/// Another convenience macro for printing messages in the converter
+#define ATH_MSG( MSG )                          \
+   do {                                         \
+      if( log.level() <= MSGLVL ) {             \
+         log << MSGLVL << MSG << endmsg;        \
+      }                                         \
+   } while( 0 )
+
+xAODMuonAuxContainerCnv_v4::xAODMuonAuxContainerCnv_v4()
+  : T_AthenaPoolTPCnvBase< xAOD::MuonAuxContainer,
+                           xAOD::MuonAuxContainer_v4 >() {
+
+}
+
+void xAODMuonAuxContainerCnv_v4::
+persToTrans( const xAOD::MuonAuxContainer_v4* oldObj,
+             xAOD::MuonAuxContainer* newObj,
+             MsgStream& log ) {
+
+   // Greet the user:
+   ATH_MSG( "Converting xAOD::MuonAuxContainer_v4 to current version..." );
+
+   // Clear the transient object:
+   newObj->resize( 0 );
+
+   // Copy the payload of the v1 object into the latest one by misusing
+   // the thinning code a bit...
+   SG::copyAuxStoreThinned( *oldObj, *newObj, 0 );
+
+   // Print what happened:
+   ATH_MSG( "Converting xAOD::MuonAuxContainer_v4 to current version "
+            "[OK]" );
+
+   return;
+}
+
+/// This function should never be called, as we are not supposed to convert
+/// object before writing.
+///
+void xAODMuonAuxContainerCnv_v4::
+transToPers( const xAOD::MuonAuxContainer*,
+             xAOD::MuonAuxContainer_v4*,
+             MsgStream& log ) {
+
+   log << MSG::ERROR
+       << "Somebody called xAODMuonAuxContainerCnv_v4::transToPers"
+       << endmsg;
+   throw std::runtime_error( "Somebody called xAODMuonAuxContainerCnv_v4::"
+                             "transToPers" );
+
+   return;
+}
diff --git a/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.h b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.h
new file mode 100644
index 00000000000..a6d74551cb4
--- /dev/null
+++ b/Event/xAOD/xAODMuonAthenaPool/src/xAODMuonAuxContainerCnv_v4.h
@@ -0,0 +1,48 @@
+// Dear emacs, this is -*- c++ -*-
+
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// $Id:  $
+#ifndef XAODMUONATHENAPOOL_XAODMUONAUXCONTAINERCNV_V4_H
+#define XAODMUONATHENAPOOL_XAODMUONAUXCONTAINERCNV_V4_H
+
+// Gaudi/Athena include(s):
+#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
+
+// EDM include(s):
+#include "xAODMuon/versions/MuonAuxContainer_v4.h"
+#include "xAODMuon/MuonAuxContainer.h"
+
+/// Converter class used for reading xAOD::MuonAuxContainer_v4
+///
+/// This converter implements the conversion from xAOD::MuonAuxContainer_v4
+/// to the latest version of the class. In a way that makes this converter
+/// usable both from the POOL converter, and the BS converter.
+///
+/// @author Edward.Moyse@cern.ch (based on example from Attila)
+///
+/// $Revision: 619884 $
+/// $Date: 2014-10-03 11:00:40 -0400 (Fri, 03 Oct 2014) $
+///
+class xAODMuonAuxContainerCnv_v4 :
+   public T_AthenaPoolTPCnvBase< xAOD::MuonAuxContainer,
+                                 xAOD::MuonAuxContainer_v4 > {
+
+public:
+   /// Default constructor
+   xAODMuonAuxContainerCnv_v4();
+
+   /// Function converting from the old type to the current one
+   virtual void persToTrans( const xAOD::MuonAuxContainer_v4* oldObj,
+                             xAOD::MuonAuxContainer* newObj,
+                             MsgStream& log );
+   /// Dummy function inherited from the base class
+   virtual void transToPers( const xAOD::MuonAuxContainer*,
+                             xAOD::MuonAuxContainer_v4*,
+                             MsgStream& log );
+
+}; // class xAODMuonAuxContainerCnv_v4
+
+#endif // XAODMUONATHENAPOOL_xAODMuonAuxContainerCnv_v4_H
diff --git a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
index 0f8cf6d6f76..ec153d5cc28 100644
--- a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
+++ b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  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: xAODPrimitives.h 576255 2013-12-19 12:54:41Z emoyse $
@@ -393,12 +393,38 @@ namespace xAOD {
     etaLayer3TGCHoles = 75,  //!< number of eta holes in the third  TGC trigger layer (T2)
     etaLayer4TGCHoles = 76,  //!< number of eta holes in the fourth TGC trigger layer (T3)
 
+    // New Small Wheel
+    //STGC
+    phiLayer1STGCHits  = 79,  //!< number of phi hits  in the first  STGC trigger layer (STGC1)
+    phiLayer2STGCHits  = 80,  //!< number of phi hits  in the second STGC trigger layer (STGC2)
+
+    etaLayer1STGCHits  = 81,  //!< number of eta hits  in the first  STGC trigger layer (STGC1)
+    etaLayer2STGCHits  = 82,  //!< number of eta hits  in the second STGC trigger layer (STGC2)
+
+    phiLayer1STGCHoles = 83,  //!< number of phi holes in the first  STGC trigger layer (STGC1)
+    phiLayer2STGCHoles = 84,  //!< number of phi holes in the second STGC trigger layer (STGC2)
+ 
+    etaLayer1STGCHoles = 85,  //!< number of eta holes in the first  STGC trigger layer (STGC1)
+    etaLayer2STGCHoles = 86,  //!< number of eta holes in the second STGC trigger layer (STGC2)
+
+    //MM
+    MMHits = 87,
+    MMHoles = 88,
+    // Note: there is currently no MuonStationIndex for the two MM layers
+    // In the future it might be needed to add them in order to have 
+    // separate counters as follows
+    // Layer1MMHits  = 87,  //!< number of eta hits  in the first  MM layer
+    // Layer2MMHits  = 88,  //!< number of eta hits  in the second MM layer
+    // Layer1MMHoles = 89,  //!< number of eta holes in the first  MM layer
+    // Layer2MMHoles = 90,  //!< number of eta holes in the second MM layer
+
+
     //CSC debugging
     cscEtaHits = 77,           //!<number of CSC eta clusters on the track
     cscUnspoiledEtaHits = 78,  //!<number of unspoiled CSC eta clusters on track
 
     // -- numbers...
-    numberOfMuonSummaryTypes       = 79
+    numberOfMuonSummaryTypes       = 89
   };
 
   /// A convenience namespace to make the client code easier to understand
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py
index 0fc394c6532..99b0c627f50 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecFlags.py
@@ -419,7 +419,7 @@ class MuonRec(JobPropertyContainer):
         setDefault(self.useAlignmentCorrections,DetFlags.detdescr.Muon_on() and rec.doMuon())
         setDefault(self.writeSDOs, rec.doWriteESD() and globalflags.DataSource != 'data')
         setDefault(self.useTGCPriorNextBC,True)
-        setDefault(self.doMuonIso,False)
+        setDefault(self.doMuonIso,True)
 
         if beamFlags.beamType == 'cosmics' or beamFlags.beamType == 'singlebeam':
             setDefault(self.doSegmentT0Fit,True)
diff --git a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
index 4e97081babe..541f6067a3a 100644
--- a/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
+++ b/Reconstruction/RecoAlgs/IsolationAlgs/python/IsoGetter.py
@@ -264,8 +264,7 @@ if doPFlow:
   IsoCorEg.append([ isoPar.coreCone, isoPar.pileupCorrection ])
   IsoCorEgExtra.append([isoPar.ptCorrection])
   IsoCorMu.append([ isoPar.coreCone, isoPar.pileupCorrection ])
-  IsoCorMuExtra.append([isoPar.ptCorrection])
-
+  IsoCorMuExtra.append([])
 
 from IsolationAlgs.IsolationAlgsConf import IsolationBuilder
 isoBuilder = AlgFactory(IsolationBuilder,
-- 
GitLab


From 334511644fe47c2cf34823dddfd159d400ed1bc7 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 1 Mar 2019 15:04:57 +0000
Subject: [PATCH 142/404] XMLCoreParser+IdDictParser: Enable thread-safety
 static checker.

---
 .../IdDictParser/src/IdDictParser.cxx         |  24 +-
 Tools/XMLCoreParser/CMakeLists.txt            |   4 +-
 .../XMLCoreParser/ATLAS_CHECK_THREAD_SAFETY   |   1 +
 .../XMLCoreParser/XMLCoreParser.h             |  69 +++--
 Tools/XMLCoreParser/src/DOMNode.cxx           |  13 +-
 Tools/XMLCoreParser/src/DOMNode.h             |  10 +-
 Tools/XMLCoreParser/src/ExpatCoreParser.cxx   | 164 ++++------
 Tools/XMLCoreParser/src/ExpatCoreParser.h     |  62 ++--
 Tools/XMLCoreParser/src/XMLCoreParser.cxx     | 287 +++++-------------
 Tools/XMLCoreParser/src/texpat.cxx            |   4 +-
 Tools/XMLCoreParser/test/example2_test.cxx    |   5 +-
 11 files changed, 251 insertions(+), 392 deletions(-)
 create mode 100644 Tools/XMLCoreParser/XMLCoreParser/ATLAS_CHECK_THREAD_SAFETY

diff --git a/DetectorDescription/IdDictParser/src/IdDictParser.cxx b/DetectorDescription/IdDictParser/src/IdDictParser.cxx
index ec3949ed6cb..7a4b0e9cc1c 100755
--- a/DetectorDescription/IdDictParser/src/IdDictParser.cxx
+++ b/DetectorDescription/IdDictParser/src/IdDictParser.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
 */
 
 // $Header: /build/atlas/cvs/atlas/offline/DetectorDescription/IdDictParser/src/IdDictParser.cxx,v 1.13 2008-12-09 09:55:22 dquarrie Exp $  
@@ -158,18 +158,16 @@ using namespace IdDictParserNS;
  
 IdDictParser::IdDictParser () : XMLCoreParser ()  
 {  
-  initialize_factories ();
-
-  register_factory ("IdDict", new IdDictMgrFactory);  
-  register_factory ("IdDictionary", new DictionaryFactory);  
-  register_factory ("field", new FieldFactory);  
-  register_factory ("label", new LabelFactory);  
-  register_factory ("alternate_regions", new AltRegionsFactory);  
-  register_factory ("region", new RegionFactory);  
-  register_factory ("subregion", new SubRegionFactory);  
-  register_factory ("range", new RangeFactory);  
-  register_factory ("reference", new ReferenceFactory);  
-  register_factory ("dictionary", new DictionaryRefFactory);  
+  register_factory ("IdDict",            std::make_unique<IdDictMgrFactory>());  
+  register_factory ("IdDictionary",      std::make_unique<DictionaryFactory>());  
+  register_factory ("field",             std::make_unique<FieldFactory>());  
+  register_factory ("label",             std::make_unique<LabelFactory>());  
+  register_factory ("alternate_regions", std::make_unique<AltRegionsFactory>());  
+  register_factory ("region",            std::make_unique<RegionFactory>());  
+  register_factory ("subregion",         std::make_unique<SubRegionFactory>());  
+  register_factory ("range",             std::make_unique<RangeFactory>());  
+  register_factory ("reference",         std::make_unique<ReferenceFactory>());  
+  register_factory ("dictionary",        std::make_unique<DictionaryRefFactory>());
  
   m_dictionary = 0; 
   m_field      = 0; 
diff --git a/Tools/XMLCoreParser/CMakeLists.txt b/Tools/XMLCoreParser/CMakeLists.txt
index a47f651d44b..70f1ed494bc 100644
--- a/Tools/XMLCoreParser/CMakeLists.txt
+++ b/Tools/XMLCoreParser/CMakeLists.txt
@@ -6,7 +6,9 @@
 atlas_subdir( XMLCoreParser )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PRIVATE
+atlas_depends_on_subdirs( PUBLIC
+                          Control/CxxUtils
+                          PRIVATE
                           AtlasTest/TestTools )
 
 # External dependencies:
diff --git a/Tools/XMLCoreParser/XMLCoreParser/ATLAS_CHECK_THREAD_SAFETY b/Tools/XMLCoreParser/XMLCoreParser/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..2e6525a4683
--- /dev/null
+++ b/Tools/XMLCoreParser/XMLCoreParser/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tools/XMLCoreParser
diff --git a/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h b/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
index 988d43584bd..d7f242ae916 100755
--- a/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
+++ b/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
@@ -1,13 +1,16 @@
 /*
-  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 XMLCoreParser_hpp
 #define XMLCoreParser_hpp
  
-#include <string> 
+#include <string>
+#include <map>
+#include <memory>
 
 class XMLCoreParser;
+class XMLCoreParserImpl;
 
 namespace CoreParser
 {
@@ -17,32 +20,51 @@ namespace CoreParser
 class XMLCoreNode
 {
 public:
-  XMLCoreNode (CoreParser::DOMNode* node) : m_node (node)
-      {
-      }
+  XMLCoreNode (const CoreParser::DOMNode* node)
+    : m_node (node),
+      m_owns (false)
+  {
+  }
 
-  XMLCoreNode (const XMLCoreNode& other) : m_node (other.m_node)
-      {
-      }
+  XMLCoreNode (std::unique_ptr<CoreParser::DOMNode> node)
+    : m_node (node.release()),
+      m_owns (true)
+  {
+  }
 
-  XMLCoreNode&  operator= (const XMLCoreNode& other)  
-      {
-          m_node = other.m_node;
-          return *this;
-      }
+  XMLCoreNode (const XMLCoreNode& other)
+    : m_node (other.m_node),
+      m_owns (false)
+  {
+  }
+
+  XMLCoreNode (XMLCoreNode&& other)
+    : m_node (other.m_node),
+      m_owns (other.m_owns)
+  {
+    other.m_node = nullptr;
+    other.m_owns = false;
+  }
+
+  XMLCoreNode&  operator= (const XMLCoreNode& other);
+    
+  XMLCoreNode&  operator= (XMLCoreNode&& other);
+
+  ~XMLCoreNode();
     
   operator const CoreParser::DOMNode& () const
       {
         return (*m_node);
       }
 
-  CoreParser::DOMNode& get_node () const
+  const CoreParser::DOMNode& get_node () const
       {
         return (*m_node);
       }
 
 private:
-  CoreParser::DOMNode* m_node;
+  const CoreParser::DOMNode* m_node;
+  bool m_owns;
 };
 
 class XMLCoreFactory 
@@ -95,18 +117,23 @@ public:
   XMLCoreNode parse (const std::string& file_name); 
   void visit (const std::string& file_name); 
  
-  void initialize_factories ();
-  void register_factory (const std::string& name, XMLCoreFactory* factory); 
-  void register_default_factory (XMLCoreFactory* factory); 
+  void register_default_factory (std::unique_ptr<XMLCoreFactory> factory); 
+  void register_factory (const std::string& name,
+                         std::unique_ptr<XMLCoreFactory> factory); 
   void register_external_entity (const std::string& name, const std::string& file_name); 
-  void register_text_entity (const std::string& name, const std::string& text); 
+  void register_text_entity (const std::string& name, const std::string& text);
  
-  static void debug_test (XMLCoreParser& parser, XMLCoreFactory* factory = 0);
   
 private: 
  
-  void visit (const XMLCoreNode& node); 
+  void visit (const XMLCoreNode& node);
   void terminate ();
+  XMLCoreFactory* find_factory (const std::string& name);
+
+
+  typedef std::map <std::string, std::unique_ptr<XMLCoreFactory> > FactoryMap; 
+  FactoryMap m_factories;
+  std::unique_ptr<XMLCoreFactory> m_default_factory;
 }; 
  
 #endif 
diff --git a/Tools/XMLCoreParser/src/DOMNode.cxx b/Tools/XMLCoreParser/src/DOMNode.cxx
index d2488b2d4ef..1474a50737d 100755
--- a/Tools/XMLCoreParser/src/DOMNode.cxx
+++ b/Tools/XMLCoreParser/src/DOMNode.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
 */
 
 
@@ -81,7 +81,7 @@ const std::string& CoreParser::DOMNode::get_value () const
   return (m_value);
 }
 
-CoreParser::DOMSiblings& CoreParser::DOMNode::get_siblings()
+const CoreParser::DOMSiblings& CoreParser::DOMNode::get_siblings() const
 {
   return (m_siblings);
 }
@@ -106,10 +106,9 @@ CoreParser::DOMNode* CoreParser::DOMNode::get_next_sibling ()
   return (*m_it);
 }
 
-void CoreParser::DOMNode::print (const std::string& header) const
+void CoreParser::DOMNode::print (const std::string& header,
+                                 int depth /*= 0*/) const
 {
-  static int depth = 0;
-
   if (header != "")
     {
       std::cout << header << std::endl;
@@ -150,9 +149,7 @@ void CoreParser::DOMNode::print (const std::string& header) const
 	{
 	  const DOMNode* n = *sit;
 	  
-	  depth++;
-	  n->print ();
-	  depth--;
+	  n->print ("", depth+1);
 	}
       
       for (i = 0; i < depth; i++) std::cout << "  ";
diff --git a/Tools/XMLCoreParser/src/DOMNode.h b/Tools/XMLCoreParser/src/DOMNode.h
index ffe5fba57b0..5fff95c48a4 100755
--- a/Tools/XMLCoreParser/src/DOMNode.h
+++ b/Tools/XMLCoreParser/src/DOMNode.h
@@ -1,9 +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
 */
 
-#ifndef __DOMNode_h__
-#define __DOMNode_h__
+#ifndef XMLCOREPARSER_DOMNODE_H
+#define XMLCOREPARSER_DOMNODE_H
 
 #include <string>
 #include <vector>
@@ -37,11 +37,11 @@ namespace CoreParser
       const DOMNamedNodeMap& get_attributes() const;
       const std::string& get_name () const;
       const std::string& get_value () const;
-      DOMSiblings& get_siblings();
+      const DOMSiblings& get_siblings() const;
       unsigned int sibling_number () const;
       DOMNode* get_first_child ();
       DOMNode* get_next_sibling ();
-      void print (const std::string& header = "") const;
+      void print (const std::string& header = "", int depth=0) const;
       
       NodeType m_type;
       std::string m_name;
diff --git a/Tools/XMLCoreParser/src/ExpatCoreParser.cxx b/Tools/XMLCoreParser/src/ExpatCoreParser.cxx
index 3b922d3c278..703450dc07d 100755
--- a/Tools/XMLCoreParser/src/ExpatCoreParser.cxx
+++ b/Tools/XMLCoreParser/src/ExpatCoreParser.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
 */
 
 
@@ -18,25 +18,21 @@
 
 #include "ExpatCoreParser.h"
 
+std::mutex ExpatCoreParser::s_mutex;
+ExpatCoreParser::ExternalEntityMap ExpatCoreParser::s_entities;
+ExpatCoreParser::ExternalEntityMap ExpatCoreParser::s_text_entities;
+
 class ExpatCoreParserDebugger
 { 
 public: 
+  static bool get_debug_state()
+  {
+    return ::getenv ("XMLDEBUG") != 0;
+  }
   static bool debug ()
       {
-        static bool first = true;
-        static bool debug_state = false;
-
-        if (first)
-          {
-            first = false;
-
-            if (::getenv ("XMLDEBUG") != 0)
-              {
-                debug_state = true;
-              }
-          }
-
-        return (debug_state);
+        static const bool debug_state = get_debug_state();
+        return debug_state;
       }
 }; 
 
@@ -44,33 +40,33 @@ public:
 
 #define BUFFSIZE 1000
 
-void ExpatCoreParser::start (void* /*user_data*/, const char* el, const char** attr)
+void ExpatCoreParser::start (void* user_data, const char* el, const char** attr)
 {
-  ExpatCoreParser& me = instance ();
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   me.do_start (el, attr);
 }
 
-void ExpatCoreParser::end (void* /*user_data*/, const char* el)
+void ExpatCoreParser::end (void* user_data, const char* el)
 {
-  ExpatCoreParser& me = instance ();
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   me.do_end (el);
 }
 
-void ExpatCoreParser::char_data (void* /*user_data*/, const XML_Char* s, int len)
+void ExpatCoreParser::char_data (void* user_data, const XML_Char* s, int len)
 {
-  ExpatCoreParser& me = instance ();
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   me.do_char_data (s, len);
 }
 
-void ExpatCoreParser::default_handler (void* /*user_data*/, const XML_Char* s, int len)
+void ExpatCoreParser::default_handler (void* user_data, const XML_Char* s, int len)
 {
-  ExpatCoreParser& me = instance ();
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   me.do_default_handler (s, len);
 }
 
-void ExpatCoreParser::comment (void* /*userData*/, const XML_Char* s)
+void ExpatCoreParser::comment (void* user_data, const XML_Char* s)
 {
-  ExpatCoreParser& me = instance ();
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   me.do_comment (s);
 }
 
@@ -80,7 +76,8 @@ int ExpatCoreParser::external_entity (XML_Parser parser,
 				      const XML_Char* systemId,
 				      const XML_Char* /*publicId*/)
 {
-  ExpatCoreParser& me = instance ();
+  void* user_data = XML_GetUserData (parser);
+  ExpatCoreParser& me = *reinterpret_cast<ExpatCoreParser*> (user_data);
   return (me.do_external_entity (parser, context, systemId));
 }
   
@@ -92,8 +89,8 @@ void ExpatCoreParser::register_external_entity (const std::string& name, const s
 		<< " file_name=" << file_name << std::endl; 
     }
 
-  ExpatCoreParser& me = instance ();
-  return (me.do_register_external_entity (name, file_name));
+  lock_t lock (s_mutex);
+  s_entities[name] = file_name; 
 } 
   
 void ExpatCoreParser::register_text_entity (const std::string& name, const std::string& text) 
@@ -104,8 +101,8 @@ void ExpatCoreParser::register_text_entity (const std::string& name, const std::
 		<< std::endl; 
     }
 
-  ExpatCoreParser& me = instance ();
-  return (me.do_register_text_entity (name, text));
+  lock_t lock (s_mutex);
+  s_text_entities[name] = text; 
 } 
 
 void ExpatCoreParser::entity (void* /*userData*/,
@@ -151,15 +148,16 @@ void ExpatCoreParser::entity (void* /*userData*/,
     }
 }
 
-CoreParser::DOMNode* ExpatCoreParser::get_document ()
+std::unique_ptr<CoreParser::DOMNode> ExpatCoreParser::get_document ()
 {
-  return (m_top);
+  return std::move(m_top);
 }
 
-ExpatCoreParser::ExpatCoreParser ()
+ExpatCoreParser::ExpatCoreParser (const std::string& prefix)
+  : m_top (nullptr),
+    m_last (nullptr),
+    m_prefix (prefix)
 {
-  m_top = 0;
-  m_last = 0;
 }
 
 void ExpatCoreParser::do_start (const char* el, const char** attr)
@@ -168,17 +166,17 @@ void ExpatCoreParser::do_start (const char* el, const char** attr)
   
   std::map <std::string, std::string> a;
   
-  if (m_top == 0) 
+  if (!m_top)
     {
-      m_top = new CoreParser::DOMNode ();
-      m_last = m_top;
+      m_top = std::make_unique<CoreParser::DOMNode> ();
+      m_last = m_top.get();
     }
 
   CoreParser::DOMNode* node = new CoreParser::DOMNode (CoreParser::DOMNode::ELEMENT_NODE, el, m_last);
   
   if (ExpatCoreParserDebugger::debug ())
     {
-      std::cout << "ExpatCoreParser::do_start> el=" << el << " top=" << m_top << " last=" << m_last << " node=" << node << std::endl; 
+      std::cout << "ExpatCoreParser::do_start> el=" << el << " top=" << m_top.get() << " last=" << m_last << " node=" << node << std::endl; 
     }
   
   m_last = node;
@@ -244,17 +242,17 @@ void ExpatCoreParser::do_default_handler (const XML_Char* s, int len)
   
 void ExpatCoreParser::do_comment (const XML_Char* s)
 {
-  if (m_top == 0) 
+  if (!m_top) 
     {
-      m_top = new CoreParser::DOMNode ();
-      m_last = m_top;
+      m_top = std::make_unique<CoreParser::DOMNode> ();
+      m_last = m_top.get();
     }
 
   CoreParser::DOMNode* node = new CoreParser::DOMNode (CoreParser::DOMNode::COMMENT_NODE, s, m_last);
   
   if (ExpatCoreParserDebugger::debug ())
     {
-      std::cout << "ExpatCoreParser::do_comment> s=" << s << " top=" << m_top << " last=" << m_last << " node=" << node << std::endl; 
+      std::cout << "ExpatCoreParser::do_comment> s=" << s << " top=" << m_top.get() << " last=" << m_last << " node=" << node << std::endl; 
     }
 
   // Node is owned by m_last.
@@ -359,6 +357,7 @@ int ExpatCoreParser::generic_parse (XML_Parser p, const std::string& file_name)
   XML_SetCharacterDataHandler (p, char_data);
   XML_SetExternalEntityRefHandler (p, external_entity);
   XML_SetCommentHandler (p, comment);
+  XML_SetUserData (p, this);
   //XML_SetDefaultHandlerExpand (p, default_handler);
   //XML_SetEntityDeclHandler (p, entity);
   //XML_UseParserAsHandlerArg (p);
@@ -423,6 +422,7 @@ int ExpatCoreParser::generic_text_parse (XML_Parser p, const std::string& text)
   XML_SetCharacterDataHandler (p, char_data);
   XML_SetExternalEntityRefHandler (p, external_entity);
   XML_SetCommentHandler (p, comment);
+  XML_SetUserData (p, this);
   //XML_SetDefaultHandlerExpand (p, default_handler);
   //XML_SetEntityDeclHandler (p, entity);
   //XML_UseParserAsHandlerArg (p);
@@ -523,35 +523,11 @@ int ExpatCoreParser::do_external_entity (XML_Parser parser,
   return (status);
 }
 
-void ExpatCoreParser::do_register_external_entity (const std::string& name, const std::string& file_name) 
-{
-  if (ExpatCoreParserDebugger::debug ())
-    {
-      std::cout << "ExpatCoreParser::do_register_external_entity> name=" << name
-		<< " file_name=" << file_name << std::endl; 
-    }
-  
-  m_entities[name] = file_name; 
-} 
-
-void ExpatCoreParser::do_register_text_entity (const std::string& name, const std::string& text) 
-{
-  if (ExpatCoreParserDebugger::debug ())
-    {
-      std::cout << "ExpatCoreParser::do_register_text_entity> name=" << name
-		<< std::endl; 
-    }
-  
-  m_text_entities[name] = text; 
-} 
-
-const std::string& ExpatCoreParser::find_external_entity (const std::string& name) const
+const std::string& ExpatCoreParser::find_external_entity (const std::string& name)
 { 
-  ExternalEntityMap::const_iterator it; 
-  
-  it = m_entities.find (name); 
-  
-  if (it == m_entities.end ()) 
+  lock_t lock (s_mutex);
+  ExternalEntityMap::const_iterator it = s_entities.find (name); 
+  if (it == s_entities.end ()) 
     {
       static const std::string empty;
       return (empty); 
@@ -562,13 +538,11 @@ const std::string& ExpatCoreParser::find_external_entity (const std::string& nam
     } 
 } 
 
-const std::string& ExpatCoreParser::find_text_entity (const std::string& name) const
+const std::string& ExpatCoreParser::find_text_entity (const std::string& name)
 { 
-  ExternalEntityMap::const_iterator it = m_text_entities.begin (); 
-  
-  it = m_text_entities.find (name); 
-
-  if (it == m_text_entities.end ()) 
+  lock_t lock (s_mutex);
+  ExternalEntityMap::const_iterator it = s_text_entities.find (name); 
+  if (it == s_text_entities.end ()) 
     {
       static const std::string empty;
       return (empty); 
@@ -579,54 +553,32 @@ const std::string& ExpatCoreParser::find_text_entity (const std::string& name) c
     } 
 } 
 
-ExpatCoreParser& ExpatCoreParser::instance ()
-{
-  static ExpatCoreParser me;
-  
-  return (me);
-}
-
-CoreParser::DOMNode* ExpatCoreParser::parse (const std::string& file_name)
+std::unique_ptr<CoreParser::DOMNode>
+ExpatCoreParser::parse (const std::string& file_name)
 {
-  static ExpatCoreParser& me = instance ();
-
   std::string name = file_name;
 
   std::string::size_type pos = file_name.rfind ('/');
+  std::string prefix;
   if (pos != std::string::npos)
     {
-      me.m_prefix = file_name.substr (0, pos);
+      prefix = file_name.substr (0, pos);
       name = file_name.substr (pos + 1);
     }
-  else
-    {
-      me.m_prefix = "";
-    }
 
+  ExpatCoreParser me (prefix);
   XML_Parser p = XML_ParserCreate (NULL);
 
   if (!p) 
     {
       std::cout << "ExpatCoreParser::Couldn't allocate memory for parser" << std::endl;
-     exit(-1);
+      std::abort();
     }
 
-  me.clean ();
-
   me.generic_parse (p, name);
 
   XML_ParserFree (p);
 
-  return (me.get_document ());
+  return me.get_document ();
 }
 
-void ExpatCoreParser::clean ()
-{
-  m_last = 0;
-
-  if (m_top != 0)
-    {
-      delete m_top;
-      m_top = 0;
-    }
-}
diff --git a/Tools/XMLCoreParser/src/ExpatCoreParser.h b/Tools/XMLCoreParser/src/ExpatCoreParser.h
index ebffc8f194d..b4155c455d4 100755
--- a/Tools/XMLCoreParser/src/ExpatCoreParser.h
+++ b/Tools/XMLCoreParser/src/ExpatCoreParser.h
@@ -1,13 +1,16 @@
 /*
-  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 __ExpatCoreParser_h__
-#define __ExpatCoreParser_h__
+#ifndef XMLCOREPARSER_EXPATCOREPARSER_H
+#define XMLCOREPARSER_EXPATCOREPARSER_H
 
 #include <expat.h>
 #include <map>
+#include <mutex>
+#include <memory>
 #include "DOMNode.h"
+#include "CxxUtils/checker_macros.h"
 
 class ExpatCoreParser
 {
@@ -15,9 +18,24 @@ public:
 
   typedef std::map <std::string, std::string> ExternalEntityMap; 
 
-  static CoreParser::DOMNode* parse (const std::string& file_name);
+  static std::unique_ptr<CoreParser::DOMNode> parse (const std::string& file_name);
 
-  static ExpatCoreParser& instance ();
+  static void register_external_entity (const std::string& name, const std::string& file_name);  
+  static void register_text_entity (const std::string& name, const std::string& text);  
+ 
+private:
+
+  ExpatCoreParser (const std::string& prefix);
+  void do_start (const char* el, const char** attr);
+  void do_end (const char* el);
+  void do_char_data (const XML_Char* s, int len);
+  void do_default_handler (const XML_Char* s, int len);
+  void do_comment (const XML_Char* s);
+  int generic_parse (XML_Parser p, const std::string& file_name);
+  int generic_text_parse (XML_Parser p, const std::string& text);
+  int do_external_entity (XML_Parser parser,
+			  const XML_Char* context,
+			  const XML_Char* systemId);
 
   static void start (void* /*user_data*/, const char* el, const char** attr);
   static void end (void* /*user_data*/, const char* el);
@@ -38,37 +56,21 @@ public:
 		      const XML_Char* systemId,
 		      const XML_Char* publicId,
 		      const XML_Char* /*notationName*/);
-  CoreParser::DOMNode* get_document ();
-
-  static void register_external_entity (const std::string& name, const std::string& file_name);  
-  static void register_text_entity (const std::string& name, const std::string& text);  
- 
-private:
-
-  ExpatCoreParser ();
-  void do_start (const char* el, const char** attr);
-  void do_end (const char* el);
-  void do_char_data (const XML_Char* s, int len);
-  void do_default_handler (const XML_Char* s, int len);
-  void do_comment (const XML_Char* s);
-  int generic_parse (XML_Parser p, const std::string& file_name);
-  int generic_text_parse (XML_Parser p, const std::string& text);
-  int do_external_entity (XML_Parser parser,
-			  const XML_Char* context,
-			  const XML_Char* systemId);
+  std::unique_ptr<CoreParser::DOMNode> get_document ();
 
-  void do_register_external_entity (const std::string& name, const std::string& file_name);  
-  void do_register_text_entity (const std::string& name, const std::string& text);  
-  const std::string& find_external_entity (const std::string& name) const;
-  const std::string& find_text_entity (const std::string& name) const;
+  static const std::string& find_external_entity (const std::string& name);
+  static const std::string& find_text_entity (const std::string& name);
 
   void clean ();
 
-  CoreParser::DOMNode* m_top;
+  std::unique_ptr<CoreParser::DOMNode> m_top;
   CoreParser::DOMNode* m_last;
   std::string m_prefix;
-  ExternalEntityMap m_entities; 
-  ExternalEntityMap m_text_entities; 
+
+  static std::mutex s_mutex;
+  typedef std::lock_guard<std::mutex> lock_t;
+  static ExternalEntityMap s_entities ATLAS_THREAD_SAFE;
+  static ExternalEntityMap s_text_entities ATLAS_THREAD_SAFE;
 };
 
 #endif
diff --git a/Tools/XMLCoreParser/src/XMLCoreParser.cxx b/Tools/XMLCoreParser/src/XMLCoreParser.cxx
index 9cf57d5cb65..bdeeea33a25 100755
--- a/Tools/XMLCoreParser/src/XMLCoreParser.cxx
+++ b/Tools/XMLCoreParser/src/XMLCoreParser.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,27 +11,48 @@
  
 class XMLCoreParserDebugger
 { 
-public: 
+public:
+  static bool get_debug_state()
+  {
+    return ::getenv ("XMLDEBUG") != 0;
+  }
   static bool debug ()
       {
-        static bool first = true;
-        static bool debug_state = false;
+        static const bool debug_state = get_debug_state();
+        return debug_state;
+      }
+};
 
-        if (first)
-          {
-            first = false;
+#include "ExpatCoreParser.h"
 
-            if (::getenv ("XMLDEBUG") != 0)
-              {
-                debug_state = true;
-              }
-          }
 
-        return (debug_state);
-      }
-}; 
+XMLCoreNode&  XMLCoreNode::operator= (const XMLCoreNode& other)  
+{
+  if (this != &other) {
+    if (m_owns) delete m_node;
+    m_node = other.m_node;
+    m_owns = false;
+  }
+  return *this;
+}
+    
+XMLCoreNode&  XMLCoreNode::operator= (XMLCoreNode&& other)  
+{
+  if (this != &other) {
+    if (m_owns) delete m_node;
+    m_node = other.m_node;
+    m_owns = other.m_owns;
+    other.m_node = nullptr;
+    other.m_owns = false;
+  }
+  return *this;
+}
+
+XMLCoreNode::~XMLCoreNode()
+{
+  if (m_owns) delete m_node;
+}
 
-#include "ExpatCoreParser.h"
 
 /* 
  *
@@ -269,7 +290,7 @@ bool XMLCoreFactory::check_int (const int n, const XMLCoreNode& node, const std:
       if (nodename != "" ) std::cerr << "for name=" << nodename << std::endl; 
       if (volume != "" ) std::cerr << "for volume=" << volume << std::endl; 
  
-      exit(4); 
+      std::abort();
     } 
  
   return true; 
@@ -309,7 +330,7 @@ bool XMLCoreFactory::check_double (const int n, const XMLCoreNode& node, const s
       if (name1 != "" ) std::cerr << "for name=" << name << std::endl; 
       if (volume != "" ) std::cerr << "for volume=" << volume << std::endl; 
  
-      exit(4); 
+      std::abort();
     } 
  
   return true; 
@@ -319,114 +340,8 @@ class DummyFactory : public XMLCoreFactory
 {
 }; 
 
-class XMLCoreParserImpl
-{ 
-public: 
- 
-  typedef std::map <std::string, XMLCoreFactory*> FactoryMap; 
- 
-  static XMLCoreParserImpl& instance () 
-      { 
-        static XMLCoreParserImpl me; 
- 
-        return (me); 
-      } 
- 
-  CoreParser::DOMNode* parse (const std::string& file_name) 
-      { 
-	CoreParser::DOMNode* doc = ExpatCoreParser::parse (file_name);
-
-	if (XMLCoreParserDebugger::debug ())
-	  {
-	    if (doc != 0) doc->print ("============ ALL =============");
-	  }
-
-	return (doc); 
-      } 
- 
-  void initialize_factories ()
-      {
-        m_default_factory = 0;
-        for (FactoryMap::iterator i = m_factories.begin();
-             i != m_factories.end();
-             ++i) {
-            delete i->second;
-        }
-        m_factories.clear ();
-      }
- 
-  void register_factory (const std::string& name, XMLCoreFactory* factory) 
-      {
-        if (XMLCoreParserDebugger::debug ())
-          {
-            std::cout << "XMLCoreFactory::register_factory> name=" << name
-                      << " factory=" << factory << std::endl; 
-          }
-
-        m_factories[name] = factory; 
-      } 
- 
-  void register_default_factory (XMLCoreFactory* factory) 
-      { 
-        m_default_factory = factory; 
-      } 
- 
-  XMLCoreFactory* find_factory (const std::string& name) 
-      { 
-        FactoryMap::iterator it; 
- 
-        it = m_factories.find (name); 
- 
-        if (it == m_factories.end ()) 
-          { 
-            return (m_default_factory); 
-          } 
-        else 
-          { 
-            return ((*it).second); 
-          } 
-      } 
- 
- 
-private: 
- 
-  XMLCoreParserImpl ()
-      { 
-        m_initialized = false; 
-        m_default_factory = 0; 
-        initialize (); 
-      } 
- 
-  ~XMLCoreParserImpl () {
-    initialize_factories();
-  }
-
-  bool initialize () 
-      { 
-        if (m_initialized) return (true); 
-   
-        m_initialized = true; 
-         
-        return (true); 
-      } 
- 
-  void terminate () 
-      { 
-        if (!m_initialized) return; 
-         
-        m_initialized = false; 
-      } 
- 
-  bool m_initialized; 
- 
-  FactoryMap m_factories; 
-  XMLCoreFactory* m_default_factory; 
-}; 
-     
- 
 XMLCoreParser::XMLCoreParser () 
 { 
-  XMLCoreParserImpl::instance (); 
 } 
  
 XMLCoreParser::~XMLCoreParser () 
@@ -455,34 +370,14 @@ void XMLCoreParser::set_create_entity_reference_nodes ()
  
 XMLCoreNode XMLCoreParser::parse (const std::string& file_name) 
 {
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
-   
-  CoreParser::DOMNode* doc = p.parse (file_name); 
-
-  XMLCoreNode n (doc);
-       
-  return (n); 
-}
-
-void XMLCoreParser::debug_test (XMLCoreParser& parser, XMLCoreFactory* factory) 
-{
+  std::unique_ptr<CoreParser::DOMNode> doc = ExpatCoreParser::parse (file_name);
   if (XMLCoreParserDebugger::debug ())
-    {
-      std::cout << "XMLCoreParser::debug_test " << std::endl; 
-    }
-
-  XMLCoreNode node (0);
-
-  if (factory == 0)
-    {
-      XMLCoreParserImpl& p = XMLCoreParserImpl::instance ();
-
-      factory = p.find_factory ("AGDD");
-    }
-
-  if (factory != 0) factory->start (parser, node);
+  {
+    if (doc != 0) doc->print ("============ ALL =============");
+  }
+  return XMLCoreNode (std::move (doc));
 }
- 
+
 void XMLCoreParser::visit (const std::string& file_name) 
 { 
   if (XMLCoreParserDebugger::debug ())
@@ -491,38 +386,24 @@ void XMLCoreParser::visit (const std::string& file_name)
                 << file_name << std::endl; 
     }
 
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
-  
-  CoreParser::DOMNode* doc = p.parse (file_name.c_str ());
-
-  if (doc != 0)
-    {
-      if (XMLCoreParserDebugger::debug ())
-	{
-	  doc->print ();
-	}
-
-      XMLCoreNode n (doc);
+  XMLCoreNode n = parse (file_name.c_str ());
 
-      if (XMLCoreParserDebugger::debug ())
-	{
-          CoreParser::DOMNode& node = n.get_node();
-	  CoreParser::DOMNode* nptr = &node;
-	  std::cout << "XMLCoreParser::visit node=" << nptr << std::endl; 
-	}
+  if (XMLCoreParserDebugger::debug ())
+  {
+    const CoreParser::DOMNode& node = n.get_node();
+    const CoreParser::DOMNode* nptr = &node;
+    std::cout << "XMLCoreParser::visit node=" << nptr << std::endl; 
+  }
 
-      visit (n); 
-    }
+  visit (n);
 } 
  
-void XMLCoreParser::visit (const XMLCoreNode& core_node) 
+void XMLCoreParser::visit (const XMLCoreNode& core_node)
 { 
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
- 
   // Get the name and value out for convenience 
 
-  CoreParser::DOMNode& node = core_node.get_node ();
-  CoreParser::DOMNode* nptr = &node;
+  const CoreParser::DOMNode& node = core_node.get_node ();
+  const CoreParser::DOMNode* nptr = &node;
 
   const std::string& nodeName = node.get_name(); 
   const std::string& nodeValue = node.get_value(); 
@@ -532,7 +413,7 @@ void XMLCoreParser::visit (const XMLCoreNode& core_node)
       std::cout << "XMLCoreParser::visit node(" << nptr << ") " << nodeName << std::endl; 
     }
 
-  XMLCoreFactory* factory = p.find_factory (nodeName); 
+  XMLCoreFactory* factory = find_factory (nodeName); 
  
   if (XMLCoreParserDebugger::debug ())
     {
@@ -543,12 +424,8 @@ void XMLCoreParser::visit (const XMLCoreNode& core_node)
     { 
     case CoreParser::DOMNode::DOCUMENT_NODE : 
       { 
-	CoreParser::DOMSiblings& siblings = node.get_siblings ();
-	CoreParser::DOMSiblings::iterator it;
-	
-	for (it = siblings.begin (); it != siblings.end (); ++it)
-	  {
-	    CoreParser::DOMNode* child = *it;
+	const CoreParser::DOMSiblings& siblings = node.get_siblings ();
+        for (const CoreParser::DOMNode* child : siblings) {
             XMLCoreNode n (child);
             visit (n); 
           } 
@@ -569,15 +446,11 @@ void XMLCoreParser::visit (const XMLCoreNode& core_node)
           {
             std::cerr << "XMLCoreParser> Cannot find factory for element " 
                       << nodeName << std::endl;
-            register_factory (nodeName, new DummyFactory);
+            register_factory (nodeName, std::make_unique<DummyFactory>());
           }
  
-	CoreParser::DOMSiblings& siblings = node.get_siblings ();
-	CoreParser::DOMSiblings::iterator it;
-	
-	for (it = siblings.begin (); it != siblings.end (); ++it)
-	  {
-	    CoreParser::DOMNode* child = *it;
+	const CoreParser::DOMSiblings& siblings = node.get_siblings ();
+        for (const CoreParser::DOMNode* child : siblings) {
             XMLCoreNode n (child);
             visit (n); 
           } 
@@ -613,24 +486,23 @@ void XMLCoreParser::visit (const XMLCoreNode& core_node)
     }
 } 
  
-void XMLCoreParser::initialize_factories ()
+void XMLCoreParser::register_default_factory (std::unique_ptr<XMLCoreFactory> factory) 
 {
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
-  p.initialize_factories ();
+  m_default_factory = std::move (factory);
 }
 
-void XMLCoreParser::register_factory (const std::string& name, XMLCoreFactory* factory) 
+void XMLCoreParser::register_factory (const std::string& name,
+                                      std::unique_ptr<XMLCoreFactory> factory) 
 { 
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
-  p.register_factory (name, factory); 
+  if (XMLCoreParserDebugger::debug ())
+  {
+    std::cout << "XMLCoreFactory::register_factory> name=" << name
+              << " factory=" << factory.get() << std::endl; 
+  }
+
+  m_factories[name] = std::move (factory);
 }
 
-void XMLCoreParser::register_default_factory (XMLCoreFactory* factory) 
-{ 
-  XMLCoreParserImpl& p = XMLCoreParserImpl::instance (); 
-  p.register_default_factory (factory); 
-} 
- 
 void XMLCoreParser::register_external_entity (const std::string& name, const std::string& file_name)
 {
   if (XMLCoreParserDebugger::debug ())
@@ -652,5 +524,14 @@ void XMLCoreParser::register_text_entity (const std::string& name, const std::st
 
   ExpatCoreParser::register_text_entity (name, text); 
 }
-
-
+ 
+ 
+XMLCoreFactory* XMLCoreParser::find_factory (const std::string& name) 
+{ 
+  FactoryMap::iterator it = m_factories.find (name);
+  if (it != m_factories.end ()) 
+  { 
+    return (*it).second.get();
+  }
+  return m_default_factory.get();
+} 
diff --git a/Tools/XMLCoreParser/src/texpat.cxx b/Tools/XMLCoreParser/src/texpat.cxx
index 88dda8849be..9f36d5f10c4 100755
--- a/Tools/XMLCoreParser/src/texpat.cxx
+++ b/Tools/XMLCoreParser/src/texpat.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
 */
 
 
@@ -8,7 +8,7 @@
 
 int main (int /*argc*/, char* argv[])
 { 
-  CoreParser::DOMNode* doc = ExpatCoreParser::parse (argv[1]);
+  std::unique_ptr<CoreParser::DOMNode> doc = ExpatCoreParser::parse (argv[1]);
            
   if (doc != 0) doc->print ("============ ALL =============");
 
diff --git a/Tools/XMLCoreParser/test/example2_test.cxx b/Tools/XMLCoreParser/test/example2_test.cxx
index a885d07997c..ed1a1029f95 100755
--- a/Tools/XMLCoreParser/test/example2_test.cxx
+++ b/Tools/XMLCoreParser/test/example2_test.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 "XMLCoreParser/XMLCoreParser.h" 
@@ -37,9 +37,8 @@ public:
 int main (int argc, char* argv[]) 
 { 
   XMLCoreParser p;
-  Printer printer;
  
-  p.register_default_factory (&printer);
+  p.register_default_factory (std::make_unique<Printer>());
 
   p.register_external_entity ("InnerDetector", "OtherInDet.xml");
   p.register_external_entity ("LArCalorimeter", "NULL");
-- 
GitLab


From 12ef80736b79249b113c9329ebd72a08179282fd Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 1 Mar 2019 15:09:52 +0000
Subject: [PATCH 143/404] AthenaBaseComps: AthFilterAlgorithm should use
 handles.

---
 .../share/AthenaPoolMultiTestEventNoSplit.ref |  4 +--
 .../share/AthenaPoolMultiTestEventSplit.ref   |  4 +--
 .../AthenaBaseComps/AthFilterAlgorithm.h      | 11 ++++++--
 .../src/AthFilterAlgorithm.cxx                | 27 +++++++++++--------
 .../src/EventCounterAlg.cxx                   |  3 +--
 .../src/EventCounterAlg.h                     |  3 ---
 6 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
index ac90afb7c08..8fa9bc3a1d2 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 0
+Splitter1           DEBUG input handles: 1
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 0
+Splitter3           DEBUG input handles: 1
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 Triggered            INFO in initialize()
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
index ec05ffbaf9a..c738c3a7fc0 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 0
+Splitter1           DEBUG input handles: 1
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 0
+Splitter3           DEBUG input handles: 1
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 Triggered            INFO in initialize()
diff --git a/Control/AthenaBaseComps/AthenaBaseComps/AthFilterAlgorithm.h b/Control/AthenaBaseComps/AthenaBaseComps/AthFilterAlgorithm.h
index cdacea9352d..f36a3a2964b 100644
--- a/Control/AthenaBaseComps/AthenaBaseComps/AthFilterAlgorithm.h
+++ b/Control/AthenaBaseComps/AthenaBaseComps/AthFilterAlgorithm.h
@@ -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
 */
 
 // AthFilterAlgorithm.h 
@@ -18,6 +18,8 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "AthenaKernel/ICutFlowSvc.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandleKey.h"
 
 class AthFilterAlgorithm
   : public ::AthAlgorithm
@@ -48,7 +50,7 @@ class AthFilterAlgorithm
    *  It will in turn invoke the initialize() method of the derived algorithm,
    *  and of any sub-algorithms which it creates.
    */
-  virtual StatusCode sysInitialize();
+  virtual StatusCode sysInitialize() override;
   
   /// Set the filter passed flag to the specified state
   virtual void setFilterPassed( bool state ) const;
@@ -64,6 +66,9 @@ class AthFilterAlgorithm
   /// return the @c CutIdentifier corresponding to the top-level cut of this filter algorithm
   CutIdentifier cutID();
 
+  /// EventInfo key for use in derived classes.
+  const SG::ReadHandleKey<xAOD::EventInfo>& eventInfoKey() const;
+
 
   /////////////////////////////////////////////////////////////////// 
   // Private data: 
@@ -88,6 +93,8 @@ class AthFilterAlgorithm
   bool m_resetSelfDescription;
   void doNotResetSelfDescription( Property& );
 
+  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey
+  { this, "EventInfoKey", "EventInfo", "" };
 }; 
 
 // I/O operators
diff --git a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx b/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx
index 22a696bf8a3..78746db210c 100644
--- a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx
+++ b/Control/AthenaBaseComps/src/AthFilterAlgorithm.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
 */
 
 // AthFilterAlgorithm.cxx
@@ -12,6 +12,7 @@
 // AthenaBaseComps includes
 #include "AthenaBaseComps/AthFilterAlgorithm.h"
 #include "xAODEventInfo/EventInfo.h"
+#include "StoreGate/ReadHandle.h"
 
 // STL includes
 
@@ -91,6 +92,8 @@ AthFilterAlgorithm::sysInitialize()
     }
   }
 
+  ATH_CHECK( m_eventInfoKey.initialize() );
+
   // re-direct to base class...
   return AthAlgorithm::sysInitialize();
 }
@@ -104,16 +107,11 @@ AthFilterAlgorithm::setFilterPassed( bool state ) const
   if (state) {
     double evtWeight=1.0;
 
-    const xAOD::EventInfo* evtInfo = nullptr;
-    StatusCode sc = evtStore()->retrieve(evtInfo);
-    if ( sc.isFailure() || NULL == evtInfo ) {
-      ATH_MSG_ERROR("Could not retrieve xAOD::EventInfo from StoreGate ");
-      evtWeight=-1000.;
-    } else {
-      // Only try to access the mcEventWeight if we are running on Monte Carlo, duhhh!
-      if ( evtInfo->eventType(xAOD::EventInfo::IS_SIMULATION) ) {
-        evtWeight = evtInfo->mcEventWeight();
-      }
+    const EventContext& ctx = Gaudi::Hive::currentContext();
+    SG::ReadHandle<xAOD::EventInfo> evtInfo (m_eventInfoKey, ctx);
+    // Only try to access the mcEventWeight if we are running on Monte Carlo, duhhh!
+    if ( evtInfo->eventType(xAOD::EventInfo::IS_SIMULATION) ) {
+      evtWeight = evtInfo->mcEventWeight();
     }
     m_cutFlowSvc->addEvent(m_cutID,evtWeight);
   }
@@ -136,3 +134,10 @@ AthFilterAlgorithm::setFilterDescription(const std::string& descr)
 
   return;
 }
+
+const SG::ReadHandleKey<xAOD::EventInfo>&
+AthFilterAlgorithm::eventInfoKey() const
+{
+  return m_eventInfoKey;
+}
+
diff --git a/Event/EventBookkeeperTools/src/EventCounterAlg.cxx b/Event/EventBookkeeperTools/src/EventCounterAlg.cxx
index f9709885509..6968d07074a 100644
--- a/Event/EventBookkeeperTools/src/EventCounterAlg.cxx
+++ b/Event/EventBookkeeperTools/src/EventCounterAlg.cxx
@@ -65,7 +65,6 @@ StatusCode EventCounterAlg::initialize()
                                    xAOD::CutBookkeeper::CutLogic::ALLEVENTSPROCESSED,
                                    "AllStreams");
 
-  ATH_CHECK( m_eventInfoKey.initialize() );
   return StatusCode::SUCCESS;
 }
 
@@ -89,7 +88,7 @@ StatusCode EventCounterAlg::execute()
   // Update also the other counters for the non-nominal MC weights
   if (m_trackOtherMCWeights) {
     // Get the EventInfo object
-    SG::ReadHandle<xAOD::EventInfo> evtInfo (m_eventInfoKey, ctx);
+    SG::ReadHandle<xAOD::EventInfo> evtInfo (eventInfoKey(), ctx);
     // Only try to access the mcEventWeight is we are running on Monte Carlo, duhhh!
     if ( !(evtInfo->eventType(xAOD::EventInfo::IS_SIMULATION)) ) {
       ATH_MSG_DEBUG("We are not running on simulation and thus, nothing to be done here");
diff --git a/Event/EventBookkeeperTools/src/EventCounterAlg.h b/Event/EventBookkeeperTools/src/EventCounterAlg.h
index 20feee50201..e489cf7ba49 100644
--- a/Event/EventBookkeeperTools/src/EventCounterAlg.h
+++ b/Event/EventBookkeeperTools/src/EventCounterAlg.h
@@ -70,9 +70,6 @@ class EventCounterAlg
 
   /// Keep a vector of all cutIDs for the non-nominal MC event weights
   std::vector<CutIdentifier> m_mcCutIDs;
-
-  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey
-  { this, "EventInfoKey", "EventInfo", "" };
 };
 
 // I/O operators
-- 
GitLab


From fe9f981e765c7b8f01cad6531c1f48f5597174ae Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Fri, 1 Mar 2019 15:16:13 +0000
Subject: [PATCH 144/404] Add LArMonitoring package

---
 .../LArMonitoring/ATLAS_CHECK_THREAD_SAFETY   |  0
 LArCalorimeter/LArMonitoring/CMakeLists.txt   | 48 +++++++++++++++++++
 LArCalorimeter/LArMonitoring/README.md        |  6 +++
 .../LArMonitoring/python/LArMonConfigFlags.py | 37 ++++++++++++++
 .../src/LArTrigStreamMatching.cxx             | 27 +++++++++++
 .../LArMonitoring/src/LArTrigStreamMatching.h | 20 ++++++++
 6 files changed, 138 insertions(+)
 create mode 100644 LArCalorimeter/LArMonitoring/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 LArCalorimeter/LArMonitoring/CMakeLists.txt
 create mode 100644 LArCalorimeter/LArMonitoring/README.md
 create mode 100644 LArCalorimeter/LArMonitoring/python/LArMonConfigFlags.py
 create mode 100644 LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.cxx
 create mode 100644 LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.h

diff --git a/LArCalorimeter/LArMonitoring/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArMonitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/LArCalorimeter/LArMonitoring/CMakeLists.txt b/LArCalorimeter/LArMonitoring/CMakeLists.txt
new file mode 100644
index 00000000000..bf036da5b68
--- /dev/null
+++ b/LArCalorimeter/LArMonitoring/CMakeLists.txt
@@ -0,0 +1,48 @@
+################################################################################
+# Package: LArMonitoring
+################################################################################
+
+# Declare the package name:
+atlas_subdir( LArMonitoring )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Calorimeter/CaloDetDescr
+                          Calorimeter/CaloGeoHelpers
+                          Calorimeter/CaloIdentifier
+                          Calorimeter/CaloInterface
+                          Control/AthenaMonitoring
+                          DetectorDescription/Identifier
+                          Event/EventContainers
+                          LArCalorimeter/LArElecCalib
+                          LArCalorimeter/LArIdentifier
+                          LArCalorimeter/LArRawEvent
+                          LArCalorimeter/LArRecConditions
+                          LArCalorimeter/LArCabling
+                          Trigger/TrigAnalysis/TrigDecisionTool
+                          PRIVATE
+                          Calorimeter/CaloConditions
+                          Control/AthenaKernel
+                          Database/AthenaPOOL/AthenaPoolUtilities
+                          Event/xAOD/xAODEventInfo
+                          Trigger/TrigAnalysis/TrigAnalysisInterfaces
+                          LArCalorimeter/LArCOOLConditions
+                          LArCalorimeter/LArRawConditions
+                          LArCalorimeter/LArRecEvent )
+
+# External dependencies:
+find_package( Boost COMPONENTS filesystem thread system )
+find_package( CLHEP )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+
+# Component(s) in the package:
+atlas_add_component( LArMonitoring
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CaloDetDescrLib CaloGeoHelpers CaloIdentifier AthenaMonitoringLib  SGtests Identifier LArIdentifier LArRawEvent LArRecConditions LArCablingLib TrigDecisionToolLib CaloConditions AthenaKernel AthenaPoolUtilities xAODEventInfo LArCOOLConditions LArRawConditions LArRecEvent )
+
+# Install files from the package:
+atlas_install_python_modules( python/*.py )
+atlas_install_joboptions( share/*.txt share/*.py )
+
diff --git a/LArCalorimeter/LArMonitoring/README.md b/LArCalorimeter/LArMonitoring/README.md
new file mode 100644
index 00000000000..8fb9e57e44a
--- /dev/null
+++ b/LArCalorimeter/LArMonitoring/README.md
@@ -0,0 +1,6 @@
+# LArMonitoring: Package containing all LAr classes for online and offline monitoring
+
+## Introduction
+
+Created in rel. 22, this package is the successor of LArMonTools, and should contain 
+MT friendly classes for LAr monitoring 
diff --git a/LArCalorimeter/LArMonitoring/python/LArMonConfigFlags.py b/LArCalorimeter/LArMonitoring/python/LArMonConfigFlags.py
new file mode 100644
index 00000000000..95ec76c63ef
--- /dev/null
+++ b/LArCalorimeter/LArMonitoring/python/LArMonConfigFlags.py
@@ -0,0 +1,37 @@
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+##
+## @file LArMonitoring/python/LArMonConfigFlags.py
+## @purpose Python module to hold flags to configure LArMonitoring
+##
+
+""" LArMonConfigFlags
+    Python module to hold flags for LAr DQ monitoring
+
+"""
+
+__author__ = "P. Strizenec"
+__version__= "$Revision: 0.1 $"
+__doc__    = "LArMonConfigFlags"
+
+__all__    = [ "LArMonConfigFlags" ]
+
+from AthenaConfiguration.AthConfigFlags import AthConfigFlags
+
+def createLArMonConfigFlags():
+    acf=AthConfigFlags()
+    acf.addFlag('LArMon.LArDigitKey', 'FREE')
+    acf.addFlag('LArMon.EventBlockSize', 0)
+    # individual algos
+    acf.addFlag('LArMon.doLArRawChannelMon', False)
+    acf.addFlag('LArMon.doLArCollisionTimeMon', True)
+    acf.addFlag('LArMon.doLArAffectedRegions', True)
+    acf.addFlag('LArMon.doLArFEBMon', True)
+    acf.addFlag('LArMon.doLArHVCorrectionMon', True)
+    acf.addFlag('LArMon.doLArCosmicsMon', False)
+    acf.addFlag('LArMon.doLArCoverage', True)
+    acf.addFlag('LArMon.doLArDigitMon', True)
+    acf.addFlag('LArMon.doLArNoisyROMon', True)
+    acf.addFlag('LArMon.doLArRODMon', True)
+    acf.addFlag('LArMon.doLArNoiseCorrelationMon', False)
+    return acf
diff --git a/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.cxx b/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.cxx
new file mode 100644
index 00000000000..fb94d49b68a
--- /dev/null
+++ b/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.cxx
@@ -0,0 +1,27 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArTrigStreamMatching.h"
+
+std::vector<unsigned> LArMon::trigStreamMatching(const std::vector<std::string>& streamsFromJobO, const std::vector<xAOD::EventInfo::StreamTag>& streamInEvent) {
+
+  //The return value. Relying on RVO not to copy it when returning to caller
+  std::vector<unsigned> foundStreams;
+  const unsigned nStreamsInJobO=streamsFromJobO.size();
+  for (unsigned i=0;i<nStreamsInJobO;++i) {
+    bool found=false;
+    for (const xAOD::EventInfo::StreamTag& streamTag : streamInEvent) {
+      if (streamsFromJobO[i]==streamTag.name()) {
+	foundStreams.push_back(i);
+	found=true;
+	break; //inner loop
+      }//end-if
+    }//end inner loop (over streamInEvent)
+    //Not-found case:
+    if (!found) foundStreams.push_back(nStreamsInJobO);
+  }//end outer loop (over streamInJobO)
+  
+  return foundStreams;
+}
+
diff --git a/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.h b/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.h
new file mode 100644
index 00000000000..5e089520d96
--- /dev/null
+++ b/LArCalorimeter/LArMonitoring/src/LArTrigStreamMatching.h
@@ -0,0 +1,20 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARMONTOOLS_LARTRIGSTREAMMACHING
+#define LARMONTOOLS_LARTRIGSTREAMMACHING
+
+#include <vector>
+#include <string>
+
+#include "xAODEventInfo/EventInfo.h"
+
+namespace LArMon {
+
+//Returns a vector with the indices of the streamsFromJobO that match an entry in streamsInEvent. For streams that are not part of streamsFromJobO
+//streamsFromJobO.size() is added to the return vector
+std::vector<unsigned> trigStreamMatching(const std::vector<std::string>& streamsFromJobO, const std::vector<xAOD::EventInfo::StreamTag>& streamInEvent);
+
+}
+#endif
-- 
GitLab


From 9d2f094a1bc03f3f244c2b2cb424191161115c45 Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Fri, 1 Mar 2019 10:04:19 -0600
Subject: [PATCH 145/404] Code cleanup.

---
 Control/AthenaServices/src/DecisionAlg.h | 35 ++----------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/Control/AthenaServices/src/DecisionAlg.h b/Control/AthenaServices/src/DecisionAlg.h
index d320e5d5ba7..7660fb071f8 100644
--- a/Control/AthenaServices/src/DecisionAlg.h
+++ b/Control/AthenaServices/src/DecisionAlg.h
@@ -1,5 +1,3 @@
-// Dear emacs, this is -*- C++ -*-
-
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
@@ -7,41 +5,12 @@
 #ifndef ATHENASERVICES_DECISIONALG_H
 #define ATHENASERVICES_DECISIONALG_H
 
-// STL include files
-#include <memory>
-#include <map>
-#include <set>
-#include <vector>
-#include <string>
-
-// Required for inheritance
-#include "GaudiKernel/IDataSelector.h"
-#include "GaudiKernel/Property.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-
-#include "GaudiKernel/IIncidentListener.h"
 #include "AthenaBaseComps/FilteredAlgorithm.h"
-#include "GaudiKernel/IIoComponent.h"
-
-// forward declarations
-class IClassIDSvc;
-class OutputStreamSequencerSvc;
-class StoreGateSvc;
-class IDecisionAlgTool;
-class IAthenaOutputTool;
-class IItemListSvc;
-
-namespace SG {
-   class DataProxy;
-   class IFolder;
-   class FolderItem;
-}
 
 /** @class DecisionAlg
    * @brief Call through interface to FilteredAlgorithm
    * 
-   * @author srinir@bnl.gov
+   * @author cranshaw@anl.gov
    * $Id: DecisionAlg.h,v 1.12 2008-12-15 19:14:58 binet Exp $
    */
 class DecisionAlg : public FilteredAlgorithm
@@ -55,4 +24,4 @@ public:
 
 };
 
-#endif // ATHENASERVICES_OUTPUTSTREAM_H
+#endif // ATHENASERVICES_DECISIONALG_H
-- 
GitLab


From 3bc3d8451267a28a5e49144ef92f6aef30b1a9aa Mon Sep 17 00:00:00 2001
From: Gabriel Gallardo <gabriel.gallardo@cern.ch>
Date: Fri, 1 Mar 2019 17:12:34 +0100
Subject: [PATCH 146/404] Replace snprintf

---
 .../TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
index 2545065ee93..cda3f6640d4 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETHelper.cxx
@@ -165,9 +165,7 @@ TrigEFMissingEtHelper::TrigEFMissingEtHelper(unsigned char len){
   // Initialize component names and calibration constants (c0, c1) = (0, 1)
   for (unsigned char i=0; i<m_elements; ++i){
     if(m_elements==42){ // finest granularity
-      strcpy(m_vecOfComponents[i].m_name, 
-        TrigEFMissingEtComponent::ComponentToName((TrigEFMissingEtComponent::Component) i).c_str());
-      // std::snprintf(m_vecOfComponents[i].m_name,10, "%s", TrigEFMissingEtComponent::ComponentToName(i));
+      std::snprintf(m_vecOfComponents[i].m_name,10, "%s", TrigEFMissingEtComponent::ComponentToName(i).c_str());
       m_vecOfComponents[i].m_calib0 = 0.0;
       m_vecOfComponents[i].m_calib1 = 1.0;
     } else {
-- 
GitLab


From afd92c63991649c7ae4127a9c4da737d2d11a909 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Fri, 1 Mar 2019 17:25:02 +0100
Subject: [PATCH 147/404] Migrate InDetOverlay to Overlay::debugPrint

---
 .../InDetOverlay/InDetOverlay/PixelOverlay.h   |  6 +++---
 .../InDetOverlay/InDetOverlay/SCTOverlay.h     |  8 ++++----
 .../InDetOverlay/src/PixelOverlay.cxx          | 15 +++++++++------
 .../InDetOverlay/src/SCTOverlay.cxx            | 18 ++++++++++--------
 .../InDetOverlay/src/TRTOverlay.cxx            | 10 +++++-----
 5 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/PixelOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/PixelOverlay.h
index 08a1d10d7d4..3895a5f35ef 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/PixelOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/PixelOverlay.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 INDETOVERLAY_PIXELOVERLAY_H
@@ -14,8 +14,8 @@ public:
 
   PixelOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
 private:
   SG::ReadHandleKey<PixelRDO_Container> m_bkgInputKey{ this, "BkgInputKey", "OriginalEvent_SG+PixelRDOs", "ReadHandleKey for Background Input PixelRDO_Container" };
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/SCTOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/SCTOverlay.h
index 936fa55261a..cfe4b9a0e76 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/SCTOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/SCTOverlay.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 INDETOVERLAY_SCTOVERLAY_H
@@ -16,8 +16,8 @@ public:
 
   SCTOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
   // SCT collection merging needs an ID helper.  Instead of retrieving
   // it thousands of times per event in the collection merging code,
@@ -29,7 +29,7 @@ public:
                     BkgSource=0, SignalSource=1, NumberOfSources=2};
 
 private:
-  const SCT_ID *m_sctId;
+  const SCT_ID *m_sctId{};
 
   SG::ReadHandleKey<SCT_RDO_Container> m_bkgInputKey{ this, "BkgInputKey", "OriginalEvent_SG+SCT_RDOs", "ReadHandleKey for Background Input SCT_RDO_Container" };
   SG::ReadHandleKey<SCT_RDO_Container> m_signalInputKey{ this, "SignalInputKey", "BkgEvent_0_SG+SCT_RDOs", "ReadHandleKey for Signal Input SCT_RDO_Container" };
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
index 3764e37f2d5..2e53492529d 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
@@ -1,16 +1,20 @@
 /*
-  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 "InDetOverlay/PixelOverlay.h"
 
+#include "IDC_OverlayBase/IDC_OverlayHelpers.h"
+
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
 namespace Overlay
 {
   // Specialize copyCollection() for the Pixel
-  template<> void copyCollection(const InDetRawDataCollection<PixelRDORawData> *input_coll, InDetRawDataCollection<PixelRDORawData> *copy_coll)
+  template<>
+  void copyCollection(const InDetRawDataCollection<PixelRDORawData> *input_coll,
+                      InDetRawDataCollection<PixelRDORawData> *copy_coll)
   {
     copy_coll->setIdentifier(input_coll->identify());
     InDetRawDataCollection<PixelRDORawData>::const_iterator firstData = input_coll->begin();
@@ -29,7 +33,6 @@ namespace Overlay
 PixelOverlay::PixelOverlay(const std::string &name, ISvcLocator *pSvcLocator)
   : IDC_OverlayBase(name, pSvcLocator)
 {
-  
 }
 
 StatusCode PixelOverlay::initialize()
@@ -69,7 +72,7 @@ StatusCode PixelOverlay::execute()
     bkgContainerPtr = bkgContainer.cptr();
 
     ATH_MSG_DEBUG("Found background Pixel RDO container " << bkgContainer.name() << " in store " << bkgContainer.store());
-    ATH_MSG_DEBUG("Pixel Background = " << shortPrint(bkgContainer.cptr()));
+    ATH_MSG_DEBUG("Pixel Background = " << Overlay::debugPrint(bkgContainer.cptr()));
   }
 
   SG::ReadHandle<PixelRDO_Container> signalContainer(m_signalInputKey);
@@ -78,7 +81,7 @@ StatusCode PixelOverlay::execute()
     return StatusCode::FAILURE;
   }
   ATH_MSG_DEBUG("Found signal Pixel RDO container " << signalContainer.name() << " in store " << signalContainer.store());
-  ATH_MSG_DEBUG("Pixel Signal     = " << shortPrint(signalContainer.cptr()));
+  ATH_MSG_DEBUG("Pixel Signal     = " << Overlay::debugPrint(signalContainer.cptr()));
 
   // Creating output RDO container
   SG::WriteHandle<PixelRDO_Container> outputContainer(m_outputKey);
@@ -88,7 +91,7 @@ StatusCode PixelOverlay::execute()
   if (outputContainer.isValid()) {
     overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
 
-    ATH_MSG_DEBUG("Pixel Result   = " << shortPrint(outputContainer.ptr()));
+    ATH_MSG_DEBUG("Pixel Result   = " << Overlay::debugPrint(outputContainer.ptr()));
   }
 
   ATH_MSG_DEBUG("execute() end");
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
index 07e5c0052e6..23d20575158 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
@@ -1,17 +1,21 @@
 /*
-  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 "InDetIdentifier/SCT_ID.h"
 #include "InDetOverlay/SCTOverlay.h"
 
+#include "IDC_OverlayBase/IDC_OverlayHelpers.h"
+
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
 namespace Overlay
 {
   // Specialize copyCollection() for the SCT
-  template<> void copyCollection(const InDetRawDataCollection<SCT_RDORawData> *input_coll, InDetRawDataCollection<SCT_RDORawData> *copy_coll)
+  template<>
+  void copyCollection(const InDetRawDataCollection<SCT_RDORawData> *input_coll,
+                      InDetRawDataCollection<SCT_RDORawData> *copy_coll)
   {  
     copy_coll->setIdentifier(input_coll->identify());
     InDetRawDataCollection<SCT_RDORawData>::const_iterator firstData = input_coll->begin();
@@ -176,10 +180,8 @@ namespace Overlay
 
 
 SCTOverlay::SCTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
-  : IDC_OverlayBase(name, pSvcLocator),
-    m_sctId(nullptr)
+  : IDC_OverlayBase(name, pSvcLocator)
 {
-  
 }
 
 StatusCode SCTOverlay::initialize()
@@ -225,7 +227,7 @@ StatusCode SCTOverlay::execute()
     bkgContainerPtr = bkgContainer.cptr();
 
     ATH_MSG_DEBUG("Found background SCT RDO container " << bkgContainer.name() << " in store " << bkgContainer.store());
-    ATH_MSG_DEBUG("SCT Background = " << shortPrint(bkgContainer.cptr(), 50));
+    ATH_MSG_DEBUG("SCT Background = " << Overlay::debugPrint(bkgContainer.cptr(), 50));
   }
 
   SG::ReadHandle<SCT_RDO_Container> signalContainer(m_signalInputKey);
@@ -234,7 +236,7 @@ StatusCode SCTOverlay::execute()
     return StatusCode::FAILURE;
   }
   ATH_MSG_DEBUG("Found signal SCT RDO container " << signalContainer.name() << " in store " << signalContainer.store());
-  ATH_MSG_DEBUG("SCT Signal     = " << shortPrint(signalContainer.cptr(), 50));
+  ATH_MSG_DEBUG("SCT Signal     = " << Overlay::debugPrint(signalContainer.cptr(), 50));
 
   // Creating output RDO container
   SG::WriteHandle<SCT_RDO_Container> outputContainer(m_outputKey);
@@ -244,7 +246,7 @@ StatusCode SCTOverlay::execute()
   if (outputContainer.isValid()) {
     overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
 
-    ATH_MSG_DEBUG("SCT Result   = " << shortPrint(outputContainer.ptr(), 50));
+    ATH_MSG_DEBUG("SCT Result   = " << Overlay::debugPrint(outputContainer.ptr(), 50));
   }
 
   ATH_MSG_DEBUG("execute() end");
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index 72def77cadf..4e15da8f192 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
@@ -5,7 +5,6 @@
 #include "AthenaKernel/RNGWrapper.h"
 #include "CLHEP/Random/RandomEngine.h"
 #include "CLHEP/Random/RandFlat.h"
-#include "CLHEP/Units/SystemOfUnits.h"
 #include "HepMC/GenParticle.h"
 
 #include "InDetIdentifier/TRT_ID.h"
@@ -15,6 +14,8 @@
 #include "InDetRawData/TRT_RDORawData.h"
 #include "InDetSimData/InDetSimDataCollection.h"
 
+#include "IDC_OverlayBase/IDC_OverlayHelpers.h"
+
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
@@ -134,7 +135,7 @@ StatusCode TRTOverlay::execute() {
     bkgContainerPtr = bkgContainer.cptr();
 
     ATH_MSG_DEBUG("Found background TRT RDO container " << bkgContainer.name() << " in store " << bkgContainer.store());
-    ATH_MSG_DEBUG("TRT Background = " << shortPrint(bkgContainer.cptr()));
+    ATH_MSG_DEBUG("TRT Background = " << Overlay::debugPrint(bkgContainer.cptr()));
   }
 
   SG::ReadHandle<TRT_RDO_Container> signalContainer(m_signalInputKey);
@@ -143,7 +144,7 @@ StatusCode TRTOverlay::execute() {
     return StatusCode::FAILURE;
   }
   ATH_MSG_DEBUG("Found signal TRT RDO container " << signalContainer.name() << " in store " << signalContainer.store());
-  ATH_MSG_DEBUG("TRT Signal     = " << shortPrint(signalContainer.cptr()));
+  ATH_MSG_DEBUG("TRT Signal     = " << Overlay::debugPrint(signalContainer.cptr()));
 
   SG::ReadHandle<InDetSimDataCollection> signalSDOContainer(m_signalInputSDOKey);
   if (!signalSDOContainer.isValid()) {
@@ -168,7 +169,7 @@ StatusCode TRTOverlay::execute() {
       overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
     }
 
-    ATH_MSG_DEBUG("TRT Result   = " << shortPrint(outputContainer.ptr()));
+    ATH_MSG_DEBUG("TRT Result   = " << Overlay::debugPrint(outputContainer.ptr()));
   }
 
   ATH_MSG_DEBUG("execute() end");
@@ -372,4 +373,3 @@ void TRTOverlay::mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
     outputCollection->push_back(p_rdo);
   } // <= while
 }
-
-- 
GitLab


From ed34d4facd5ab15b027e1f7578f1ad72d337ce48 Mon Sep 17 00:00:00 2001
From: Steven Randolph Schramm <Steven.Schramm@cern.ch>
Date: Thu, 26 Jan 2017 21:01:59 +0100
Subject: [PATCH 148/404] Fixed memory leak in trimmed jet triggers
 (TrigHLTJetRec-00-00-56)

2017-01-26 Steven Schramm
	* TrigHLTJetRec-00-00-56
   	* src/TrigHLTJetRecGroomer.cxx: fixed memory leak

2016-12-10 Steven Schramm
	* Adding base wrapper for SoftKiller
	* No actual SK functionality, but shell to add SK in place
	* python/TrigHLTJetRecConfig.py: Added SoftKiller configuration class
	* TrigHLTJetRec/TrigHLTSoftKiller.h: Added SoftKiller base class
	* src/TrigHLTSoftKiller.cxx: Added SoftKiller base class implementation
	* src/components/TrigHLTJetRec_entries.cxx: Added SoftKiller to algs

Former-commit-id: 0630ec00fcef6dcf2209ac0ecb97f10762963c42
---
 .../TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py | 3 +++
 .../TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx     | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index c7c6a162316..d8c75a00ba6 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -1528,6 +1528,9 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
                        vcSGkey=primVtxSGkey,
                        )
         addTrkMomsTool(trkmomstoolname, **trkmomsoptions)
+=======
+                                                     
+>>>>>>> 72e6b7d9ee... Fixed memory leak in trimmed jet triggers (TrigHLTJetRec-00-00-56)
 
 # Data scouting algorithm
 class TrigHLTJetDSSelector(TrigHLTJetRecConf.TrigHLTJetDSSelector):
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
index 547893ebbfa..d9d7c446f0f 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
@@ -23,7 +23,6 @@
 #include "TrigHLTJetRec/TriggerJetBuildTool.h"
 #include "TrigHLTJetRec/TriggerJetGroomerTool.h"
 
-
 #include "TrigHLTJetRec/IParticleNullRejectionTool.h"
 #include "TrigHLTJetRec/IParticlePtEtaRejectionTool.h"
 #include "TrigHLTJetRec/EMTopoRejectionTool.h"
-- 
GitLab


From 9a378d3a1cfa7bc921340eff9a618bfa25aec488 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 1 Mar 2019 17:58:33 +0100
Subject: [PATCH 149/404] Fix to match normal Athena configuration

---
 .../python/AllConfigFlags.py                  |   6 +-
 .../python/ComponentAccumulator.py            | 129 +++++++++---------
 .../python/MainServicesConfig.py              |  22 +--
 3 files changed, 81 insertions(+), 76 deletions(-)

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index f7468117dee..0eb5404a5a0 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -19,9 +19,9 @@ def _createCfgFlags():
     acf.addFlag('Concurrency.NumConcurrentEvents', 0)
 
     acf.addFlag('Scheduler.CheckDependencies', True)
-    acf.addFlag('Scheduler.ShowDataDeps', False)
-    acf.addFlag('Scheduler.ShowDataFlow', False)
-    acf.addFlag('Scheduler.ShowControlFlow', False)
+    acf.addFlag('Scheduler.ShowDataDeps', True)
+    acf.addFlag('Scheduler.ShowDataFlow', True)
+    acf.addFlag('Scheduler.ShowControlFlow', True)
 
     acf.addFlag('Common.isOnline', False ) #  Job runs in an online environment (access only to resources available at P1) # former global.isOnline
 
diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py
index 06287a25bc2..e3df021c15a 100644
--- a/Control/AthenaConfiguration/python/ComponentAccumulator.py
+++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py
@@ -26,7 +26,7 @@ class ComponentAccumulator(object):
 
     def __init__(self,sequenceName='AthAlgSeq'):
         self._msg=logging.getLogger('ComponentAccumulator')
-        self._sequence=AthSequencer(sequenceName)    #(Nested) sequence of event processing algorithms per sequence + their private tools
+        self._sequence=AthSequencer(sequenceName,Sequential=True)    #(Nested) sequence of event processing algorithms per sequence + their private tools
         self._conditionsAlgs=[]          #Unordered list of conditions algorithms + their private tools
         self._services=[]                #List of service, not yet sure if the order matters here in the MT age
         self._eventInputs=set()          #List of items (as strings) to be read from the input (required at least for BS-reading).
@@ -577,7 +577,6 @@ class ComponentAccumulator(object):
             elif isinstance(v,GaudiHandles.GaudiHandleArray):
                 self._jocat[name][k]=str([ v1.getFullName() for v1 in v ])
             else:
-                print name,k,v
                 if name not in self._jocat:
                     self._jocat[name] = {}
                 self._jocat[name][k]=str(v)
@@ -592,66 +591,69 @@ class ComponentAccumulator(object):
         from AthenaCommon.Utils.unixtools import find_datafile
         import pickle
         if useBootStrapFile:
-          import glob
-          # first load basics from the bootstrap-pickle
-          # a better solution to be discussed
-          # prefer local file
-          localbs = glob.glob("bootstrap.pkl")
-          if len( localbs ) == 0:
-              # if local bootstrap is missing, use one from the release
-              bsfilename=find_datafile("bootstrap.pkl")
-          else:
-              bsfilename = "./"+localbs[0]
-
-          bsfile=open(bsfilename)
-          self._jocat=pickle.load(bsfile)
-          self._jocfg=pickle.load(bsfile)
-          self._pycomps=pickle.load(bsfile)
-          bsfile.close()
+            import glob
+            # first load basics from the bootstrap-pickle
+            # a better solution to be discussed
+            # prefer local file
+            localbs = glob.glob("bootstrap.pkl")
+            if len( localbs ) == 0:
+                # if local bootstrap is missing, use one from the release
+                bsfilename=find_datafile("bootstrap.pkl")
+            else:
+                bsfilename = "./"+localbs[0]
+
+            bsfile=open(bsfilename)
+            self._jocat=pickle.load(bsfile)
+            self._jocfg=pickle.load(bsfile)
+            self._pycomps=pickle.load(bsfile)
+            bsfile.close()
   
         else:
-          from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg, MainServicesSerialCfg
-          if threaded:
-            from AthenaConfiguration.AllConfigFlags import ConfigFlags
-            flags = ConfigFlags.clone()
-            flags.Concurrency.NumThreads = 1
-            flags.Concurrency.NumConcurrentEvents = 1
-            basecfg = MainServicesThreadedCfg(flags)
-            basecfg.merge(self)
-            self = basecfg
-          else: #Serial
-            basecfg = MainServicesSerialCfg()
-            basecfg.merge(self)
-            self = basecfg
-          self.printConfig()
-          self._jocat={}
-          self._jocfg={}
-          self._pycomps={}
-          self._jocfg["ApplicationMgr"]={}
-          self._jocfg["ApplicationMgr"]["ExtSvc"] = "['ToolSvc/ToolSvc', \
-                                                      'AuditorSvc/AuditorSvc', \
-                                                      'MessageSvc/MessageSvc', \
-                                                      'IncidentSvc/IncidentSvc',\
-                                                      'EvtPersistencySvc/EventPersistencySvc',\
-                                                      'HistogramSvc/HistogramDataSvc',\
-                                                      'NTupleSvc/NTupleSvc',\
-                                                      'RndmGenSvc/RndmGenSvc',\
-                                                      'ChronoStatSvc/ChronoStatSvc',\
-                                                      'StatusCodeSvc/StatusCodeSvc',\
-                                                      'StoreGateSvc/StoreGateSvc',\
-                                                      'StoreGateSvc/DetectorStore',\
-                                                      'StoreGateSvc/HistoryStore',\
-                                                      'ClassIDSvc/ClassIDSvc',\
-                                                      'AthDictLoaderSvc/AthDictLoaderSvc',\
-                                                      'AthenaSealSvc/AthenaSealSvc',\
-                                                      'CoreDumpSvc/CoreDumpSvc',\
-                                                      'JobOptionsSvc/JobOptionsSvc']"
-
-          for seqName, algoList in flatSequencers( self._sequence ).iteritems():
-            self._jocat[seqName] = {}
-            self._jocat[seqName]["Members"] = "[]"
-            for alg in algoList:
-              self._jocat[alg.name()] = {}
+            from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg, MainServicesSerialCfg
+            if threaded:
+              from AthenaConfiguration.AllConfigFlags import ConfigFlags
+              flags = ConfigFlags.clone()
+              flags.Concurrency.NumThreads = 1
+              flags.Concurrency.NumConcurrentEvents = 1
+              basecfg = MainServicesThreadedCfg(flags)
+              basecfg.printConfig()
+              basecfg.merge(self)
+              self = basecfg
+              self.printConfig()
+            else: #Serial
+              basecfg = MainServicesSerialCfg()
+              basecfg.merge(self)
+              self = basecfg
+            self._jocat={}
+            self._jocfg={}
+            self._pycomps={}
+            self._jocfg["ApplicationMgr"]={}
+            self._jocfg["ApplicationMgr"]["ExtSvc"] = "['ToolSvc/ToolSvc', \
+                                                        'AuditorSvc/AuditorSvc', \
+                                                        'MessageSvc/MessageSvc', \
+                                                        'IncidentSvc/IncidentSvc',\
+                                                        'EvtPersistencySvc/EventPersistencySvc',\
+                                                        'HistogramSvc/HistogramDataSvc',\
+                                                        'NTupleSvc/NTupleSvc',\
+                                                        'RndmGenSvc/RndmGenSvc',\
+                                                        'ChronoStatSvc/ChronoStatSvc',\
+                                                        'StatusCodeSvc/StatusCodeSvc',\
+                                                        'StoreGateSvc/StoreGateSvc',\
+                                                        'StoreGateSvc/DetectorStore',\
+                                                        'StoreGateSvc/HistoryStore',\
+                                                        'ClassIDSvc/ClassIDSvc',\
+                                                        'AthDictLoaderSvc/AthDictLoaderSvc',\
+                                                        'AthenaSealSvc/AthenaSealSvc',\
+                                                        'CoreDumpSvc/CoreDumpSvc',\
+                                                        'JobOptionsSvc/JobOptionsSvc']"
+
+            #Code seems to be wrong here
+            for seqName, algoList in flatSequencers( self._sequence ).iteritems():
+                self._jocat[seqName] = {}
+                for alg in algoList:
+                  self._jocat[alg.name()] = {}
+            for k, v in self._sequence.getValuedProperties().items():
+                self._jocat[self._sequence.getName()][k]=str(v)
 
         #EventAlgorithms
         for seqName, algoList  in flatSequencers( self._sequence ).iteritems():
@@ -661,10 +663,13 @@ class ComponentAccumulator(object):
                 evtalgseq.append( alg.getFullName() )
 
 
+        print self._sequence
         for seqName, algoList  in flatSequencers( self._sequence ).iteritems():
             # part of the sequence may come from the bootstrap, we need to retain the content, that is done here
-            mergedSequence = ast.literal_eval(self._jocat[seqName]["Members"]) +  [alg.getFullName() for alg in algoList]
-            self._jocat[seqName]["Members"] = str( mergedSequence )
+            for prop in self._jocat[seqName]:
+                if prop == "Members":
+                    mergedSequence = ast.literal_eval(self._jocat[seqName]["Members"]) +  [alg.getFullName() for alg in algoList]
+                    self._jocat[seqName]["Members"] = str( mergedSequence )
 
 
         #Conditions Algorithms:
diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index 0fa5ebe1649..fa8ddfe57d0 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -23,16 +23,15 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
     
 
     #Build standard sequences:
-    #cfg.addSequence(AthSequencer("AthMasterSeq"))
-    cfg.addSequence(AthSequencer('AthAlgEvtSeq'),parentName="AthMasterSeq") 
-    cfg.addSequence(AthSequencer('AthOutSeq'),parentName="AthMasterSeq")
+    cfg.addSequence(AthSequencer('AthAlgEvtSeq',Sequential=True, StopOverride=True),parentName="AthMasterSeq") 
+    cfg.addSequence(AthSequencer('AthOutSeq',Prompt=False),parentName="AthMasterSeq")
     cfg.addSequence(AthSequencer('AthRegSeq'),parentName="AthMasterSeq")
 
-    cfg.addSequence(AthSequencer('AthBeginSeq'),parentName='AthAlgEvtSeq')
+    cfg.addSequence(AthSequencer('AthBeginSeq',Sequential=True),parentName='AthAlgEvtSeq')
     cfg.addSequence(AthSequencer('AthAllAlgSeq'),parentName='AthAlgEvtSeq') 
-    cfg.addSequence(AthSequencer('AthEndSeq'),parentName='AthAlgEvtSeq') 
+    cfg.addSequence(AthSequencer('AthAlgSeq',Sequential=False,IgnoreFilterPassed=True),parentName='AthAllAlgSeq')
+    cfg.addSequence(AthSequencer('AthEndSeq',Sequential=True),parentName='AthAlgEvtSeq') 
     cfg.addSequence(AthSequencer('AthCondSeq'),parentName='AthAllAlgSeq')
-    cfg.addSequence(AthSequencer('AthAlgSeq'),parentName='AthAllAlgSeq')
 
     #Set up incident firing:
     from AthenaServices.AthenaServicesConf import AthIncFirerAlg
@@ -52,7 +51,7 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
     from StoreGate.StoreGateConf import StoreGateSvc
     cfg.addService(StoreGateSvc())
     cfg.addService(StoreGateSvc("DetectorStore"))
-    cfg.addService(StoreGateSvc("ConditionStore"))
+    cfg.addService(StoreGateSvc("HistoryStore"))
     
     cfg.setAppProperty('InitializationLoopCheck',False)
     return cfg
@@ -78,7 +77,8 @@ def MainServicesThreadedCfg(cfgFlags):
 
     msgsvc = MessageSvc()
     msgsvc.defaultLimit = 0 
-    msgFmt = "% F%40W%S%4W%e%s%7W%R%T %0W%M"
+    #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)
 
@@ -92,8 +92,8 @@ def MainServicesThreadedCfg(cfgFlags):
     hivesvc.NSlots = cfgFlags.Concurrency.NumConcurrentEvents
     cfg.addService( hivesvc )
 
-    import StoreGate.StoreGateConf as StoreGateConf
-    cfg.addService( StoreGateConf.StoreGateSvc("ConditionStore") )
+    from StoreGate.StoreGateConf import StoreGateSvc
+    cfg.addService( StoreGateSvc("ConditionStore") )
 
     from GaudiHive.GaudiHiveConf import AlgResourcePool
     from AthenaCommon.Constants import INFO
@@ -115,7 +115,7 @@ def MainServicesThreadedCfg(cfgFlags):
     # dependencies are not found in the store.  It should probably be changed
     # to True eventually.
     inputloader = SGInputLoader (FailIfNoProxy = False)
-    cfg.addEventAlgo( inputloader )
+    cfg.addEventAlgo( inputloader, "AthAlgSeq" )
     scheduler.DataLoaderAlg = inputloader.getName()
 
     from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
-- 
GitLab


From 9b3d5fefbe9fec3e64754e69427251f34bda6c62 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 1 Mar 2019 17:59:13 +0100
Subject: [PATCH 150/404] Adapt to current deficiencies in MessageSvc generated
 by python bootstrap

---
 .../TrigUpgradeTest/CMakeLists.txt            |  2 +-
 .../TrigUpgradeTest/share/NewJO.ref           | 38 +++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 54d8c8d0d79..7b7f42e70e7 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
@@ -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.sh
-   EXTRA_PATTERNS "-s .*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMoniMT .*INFO.*"
+   EXTRA_PATTERNS "-s .*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMo.*INFO.*"
    PROPERTIES TIMEOUT 1000
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO
    )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
index ce273875761..b151ce2bd29 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
@@ -1,21 +1,21 @@
 Storing config in the config newJOtest.pkl
 Py:Athena            INFO now loading newJOtest.pkl  ... 
-TrigSignatureMoniMT                                INFO Chains passing step (1st row events & 2nd row decision counts
-TrigSignatureMoniMT                                INFO Chain name                   L1,      AfterPS, [... steps ...], Output
-TrigSignatureMoniMT                                INFO All                           20        20        0         0         8         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        20        15        0         0         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            44        0         
-TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        14        0         0         
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            41        0         
-TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        8         0         0         
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            13        0         
-TrigSignatureMoniMT                                INFO HLT_g10_etcut                 20        20        8         8         8         
-TrigSignatureMoniMT                                INFO HLT_g10_etcut decisions                           12        12        
-TrigSignatureMoniMT                                INFO HLT_g15_etcut                 20        20        5         8         8         
-TrigSignatureMoniMT                                INFO HLT_g15_etcut decisions                           6         12        
-TrigSignatureMoniMT                                INFO HLT_mu10                      20        20        1         0         1         
-TrigSignatureMoniMT                                INFO HLT_mu10 decisions                                1         0         
-TrigSignatureMoniMT                                INFO HLT_mu20                      20        20        0         0         0         
-TrigSignatureMoniMT                                INFO HLT_mu20 decisions                                0         0         
-TrigSignatureMoniMT                                INFO HLT_mu8                       20        20        1         0         1         
-TrigSignatureMoniMT                                INFO HLT_mu8 decisions                                 1         0         
+TrigSignatureMo...   INFO Chains passing step (1st row events & 2nd row decision counts
+TrigSignatureMo...   INFO Chain name                   L1,      AfterPS, [... steps ...], Output
+TrigSignatureMo...   INFO All                           20        20        0         0         8         
+TrigSignatureMo...   INFO HLT_e3_etcut                  20        20        15        0         0         
+TrigSignatureMo...   INFO HLT_e3_etcut decisions                            44        0         
+TrigSignatureMo...   INFO HLT_e5_etcut                  20        20        14        0         0         
+TrigSignatureMo...   INFO HLT_e5_etcut decisions                            41        0         
+TrigSignatureMo...   INFO HLT_e7_etcut                  20        20        8         0         0         
+TrigSignatureMo...   INFO HLT_e7_etcut decisions                            13        0         
+TrigSignatureMo...   INFO HLT_g10_etcut                 20        20        8         8         8         
+TrigSignatureMo...   INFO HLT_g10_etcut decisions                           12        12        
+TrigSignatureMo...   INFO HLT_g15_etcut                 20        20        5         8         8         
+TrigSignatureMo...   INFO HLT_g15_etcut decisions                           6         12        
+TrigSignatureMo...   INFO HLT_mu10                      20        20        1         0         1         
+TrigSignatureMo...   INFO HLT_mu10 decisions                                1         0         
+TrigSignatureMo...   INFO HLT_mu20                      20        20        0         0         0         
+TrigSignatureMo...   INFO HLT_mu20 decisions                                0         0         
+TrigSignatureMo...   INFO HLT_mu8                       20        20        1         0         1         
+TrigSignatureMo...   INFO HLT_mu8 decisions                                 1         0         
-- 
GitLab


From e4c816c4c25beb3c60b169f07135d580ccf9fb51 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 1 Mar 2019 17:24:13 +0000
Subject: [PATCH 151/404] Enable SCT only in SCT test algorithms

---
 .../SCT_ConditionsAlgorithms/share/testCalibChipRead.py  | 9 ++++-----
 .../SCT_ConditionsAlgorithms/share/testCalibRead.py      | 4 +---
 .../SCT_ConditionsAlgorithms/share/testConfig.py         | 3 +--
 .../SCT_ConditionsAlgorithms/share/testDCSConditions.py  | 3 +--
 .../SCT_ConditionsAlgorithms/share/testLinkMasking.py    | 4 +---
 .../SCT_ConditionsAlgorithms/share/testMajority.py       | 3 +--
 .../SCT_ConditionsAlgorithms/share/testModuleVeto.py     | 3 +--
 .../SCT_ConditionsAlgorithms/share/testMonRead.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testParameters.py     | 6 +-----
 .../SCT_ConditionsAlgorithms/share/testReadout.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testRodVeto.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testSensors.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testSilicon.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testStripVeto.py      | 3 +--
 .../SCT_ConditionsAlgorithms/share/testSummary.py        | 3 +--
 .../SCT_ConditionsAlgorithms/share/testTdaqEnabled.py    | 3 +--
 .../InDetDetDescr/SCT_Cabling/share/TestSCT_Cabling.py   | 4 +---
 .../SCT_Cabling/share/TestSCT_CablingSimple.py           | 4 +---
 .../SCT_RawDataByteStreamCnv/share/testSCTDecode.py      | 3 +--
 .../SCT_RawDataByteStreamCnv/share/testSCTEncode.py      | 3 +--
 20 files changed, 23 insertions(+), 50 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibChipRead.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibChipRead.py
index eb9ce392b14..37428a1a173 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibChipRead.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibChipRead.py
@@ -66,14 +66,12 @@ IOVDbSvc.OutputLevel = DEBUG
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.pixel_setOff()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
@@ -96,8 +94,9 @@ import AtlasGeoModel.GeoModelInit
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
-from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
-topSequence +=xAODMaker__EventInfoCnvAlg(OutputLevel=2)
+if not hasattr(topSequence, "xAODMaker::EventInfoCnvAlg"):
+    from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
+    topSequence +=xAODMaker__EventInfoCnvAlg(OutputLevel=2)
 
 from SCT_ConditionsTools.SCT_ReadCalibChipDataToolSetup import SCT_ReadCalibChipDataToolSetup
 sct_ReadCalibChipDataToolSetup = SCT_ReadCalibChipDataToolSetup()
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibRead.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibRead.py
index 5ffcddbf566..bef49de68b9 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibRead.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testCalibRead.py
@@ -60,14 +60,12 @@ print globalflags
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.pixel_setOff()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testConfig.py
index 68ce1da17f1..4dfaf5f0043 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testConfig.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testConfig.py
@@ -36,13 +36,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testDCSConditions.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testDCSConditions.py
index 2e1468d1bde..bf8d35b437c 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testDCSConditions.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testDCSConditions.py
@@ -47,13 +47,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testLinkMasking.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testLinkMasking.py
index 78485036f0f..8734d51d2f5 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testLinkMasking.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testLinkMasking.py
@@ -38,14 +38,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
-DetFlags.pixel_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMajority.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMajority.py
index 51f603a6e99..f763e900410 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMajority.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMajority.py
@@ -36,13 +36,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testModuleVeto.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testModuleVeto.py
index c4562d4abd8..57643278eac 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testModuleVeto.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testModuleVeto.py
@@ -35,13 +35,12 @@ print globalflags
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMonRead.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMonRead.py
index 8dc15da66ca..6522dba2f5d 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMonRead.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testMonRead.py
@@ -38,13 +38,12 @@ condSeq+=xAODMaker__EventInfoCnvAlg(OutputLevel=2)
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testParameters.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testParameters.py
index 4dd83f0d9ad..8008b7729df 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testParameters.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testParameters.py
@@ -50,13 +50,12 @@ rec.projectName.set_Value_and_Lock("data12_8TeV")
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
@@ -113,9 +112,6 @@ conddb.addFolder("SCT","/SCT/DAQ/Configuration/MUR")
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
 
-from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
-topSequence += xAODMaker__EventInfoCnvAlg(OutputLevel=2)
-
 from SCT_ConditionsTools.SCT_ConditionsParameterToolSetup import SCT_ConditionsParameterToolSetup
 sct_ConditionsParameterToolSetup = SCT_ConditionsParameterToolSetup()
 sct_ConditionsParameterToolSetup.setup()
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py
index 23b0ad23d1b..b566531ed37 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py
@@ -36,13 +36,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testRodVeto.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testRodVeto.py
index 9d0e6087b9c..d25fefd2471 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testRodVeto.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testRodVeto.py
@@ -37,13 +37,12 @@ print globalflags
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSensors.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSensors.py
index 9110d785891..701b6cbd011 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSensors.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSensors.py
@@ -51,13 +51,12 @@ conddb.dbdata="COMP200"
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSilicon.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSilicon.py
index 3df46cbb099..6329af73598 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSilicon.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSilicon.py
@@ -38,13 +38,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testStripVeto.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testStripVeto.py
index 203175cfedb..2bdd389fe02 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testStripVeto.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testStripVeto.py
@@ -35,13 +35,12 @@ print globalflags
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSummary.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSummary.py
index 0d2d3d30625..ff80dfc12e1 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSummary.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testSummary.py
@@ -26,13 +26,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags 
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py
index 18fd821e9f1..455ad32eff4 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py
@@ -49,13 +49,12 @@ print 'globalTags.DatabaseInstance', globalflags.DatabaseInstance
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_Cabling.py b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_Cabling.py
index 7683b8f135c..d6ba8f8021c 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_Cabling.py
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_Cabling.py
@@ -33,14 +33,12 @@ print globalflags
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.pixel_setOff()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py
index 56cf8e9fea9..4bbf11d7d77 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/share/TestSCT_CablingSimple.py
@@ -52,14 +52,12 @@ globalflags.DataSource="geant4"
 #--------------------------------------------------------------
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.pixel_setOff()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
index b03413cd52d..f67b4de2e4d 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
@@ -46,13 +46,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTEncode.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTEncode.py
index 916cf37f2e1..b8b2692b23f 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTEncode.py
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTEncode.py
@@ -46,13 +46,12 @@ print globalflags
 # --- switch on InnerDetector
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.SCT_setOn()
-DetFlags.ID_setOn()
+DetFlags.ID_setOff()
 DetFlags.Calo_setOff()
 DetFlags.Muon_setOff()
 DetFlags.Truth_setOff()
 DetFlags.LVL1_setOff()
 DetFlags.SCT_setOn()
-DetFlags.TRT_setOff()
 
 # ---- switch parts of ID off/on as follows
 #switch off tasks
-- 
GitLab


From 07442dd94106bbb3f9a771ec74b32e955bc84365 Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Fri, 1 Mar 2019 17:48:15 +0000
Subject: [PATCH 152/404] Make a bit cleaner the implications of having
 CachedValue for the Perigee Parameters

---
 Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h | 17 +++++--
 Tracking/TrkEvent/TrkTrack/src/Track.cxx    | 51 ++++++++++-----------
 2 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
index bc8746a378e..1b1a5cd0a60 100755
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
@@ -191,10 +191,10 @@ namespace Trk
        /**									   
         * Find perigee in the vector of track parameters.
         * It can be used to lazy-init the m_perigeeParameters			   
-        */									   
-       void findPerigee() const;						   
-        									     
-       /**									   
+        */									      									     
+       void findPerigee() const;
+
+        /**									   
         * A vector of TrackParameters: these can be any of the classes that	   
         * derive from Trk::TrackParameters, for example, Perigee, MeasuredPerigee, 
         * AtaCylinder etc.							   
@@ -260,6 +260,13 @@ namespace Trk
 #ifndef NDEBUG 									     
        static std::atomic<unsigned int> s_numberOfInstantiations;				   
 #endif       
+       private:
+       /**
+        * find PerigeeImpl. 
+        * Assumes that Perigee parameters are currently inValid
+        */
+       void findPerigeeImpl() const;						   
+             
 };//end of class definitions
 
 
@@ -291,7 +298,7 @@ inline const Trk::Perigee* Trk::Track::perigeeParameters() const
     if(!m_perigeeParameters.isValid()){
     //findPerigee performs the setting of the parameters
     //i.e does the CachedValue set
-      findPerigee();
+      findPerigeeImpl();
     }
     //Here the cached value type is a pointer 
     return *(m_perigeeParameters.ptr());
diff --git a/Tracking/TrkEvent/TrkTrack/src/Track.cxx b/Tracking/TrkEvent/TrkTrack/src/Track.cxx
index b18bd9411b2..91e9b3c9df7 100755
--- a/Tracking/TrkEvent/TrkTrack/src/Track.cxx
+++ b/Tracking/TrkEvent/TrkTrack/src/Track.cxx
@@ -29,15 +29,12 @@ Trk::Track::Track ():
   m_cachedParameterVector{},
   m_cachedMeasurementVector{},
   m_cachedOutlierVector{}, 
-  m_trackStateVector( 0 ),
-  m_perigeeParameters{},
-  m_fitQuality(0),
-  m_trackSummary(0)
+  m_trackStateVector(nullptr),
+  m_perigeeParameters{},//default c-tor value to invalid
+  m_fitQuality(nullptr),
+  m_trackSummary(nullptr)
 {
   if (debug) std::cout<<"Trk::Track Ctor 1 :"<<this<<std::endl;
-  //perigee parameters are nullptr and invalid
-  m_perigeeParameters.store(nullptr); 
-  m_perigeeParameters.reset();
 
 #ifndef NDEBUG
   s_numberOfInstantiations++; // new Track, so increment total count
@@ -53,12 +50,12 @@ Trk::Track::Track( const TrackInfo& info,
   m_trackStateVector(trackStateOnSurfaces),
   m_perigeeParameters{},//default c-tor value to invalid
   m_fitQuality(fitQuality),
-  m_trackSummary(0),
+  m_trackSummary(nullptr),
   m_trackInfo( info )
 {
   if (debug) std::cout<<"Trk::Track Ctor 2 :"<<this<<std::endl;
   //find the Perigee params they will become valid given the outcome
-  findPerigee();
+  findPerigeeImpl();
 #ifndef NDEBUG
   s_numberOfInstantiations++; // new Track, so increment total count
 #endif
@@ -69,10 +66,10 @@ Trk::Track::Track (const Track& rhs):
   m_cachedParameterVector {},
   m_cachedMeasurementVector {},
   m_cachedOutlierVector{}, 
-  m_trackStateVector( 0 ),
+  m_trackStateVector(nullptr),
   m_perigeeParameters{}, //default c-tor value to invalid
-  m_fitQuality(0),
-  m_trackSummary(0)
+  m_fitQuality(nullptr),
+  m_trackSummary(nullptr)
 {
   if (debug) std::cout<<"Trk::Track Ctor 3 :"<<this<<std::endl;
   using namespace Trk;
@@ -122,9 +119,10 @@ Trk::Track& Trk::Track::operator= (const Track& rhs)
     if (rhs.trackSummary()!=nullptr){
       m_trackSummary = new TrackSummary( *(rhs.m_trackSummary) );
     }
-    //perigee parameters are nullptr and invalid
-    m_perigeeParameters.store(nullptr); 
+    //perigee parameters set to invalid
     m_perigeeParameters.reset();
+    
+    //Create the TrackStateVector and the perigeeParamters
     if( rhs.m_trackStateVector!=0 )
     {
       m_trackStateVector = new DataVector<const TrackStateOnSurface>;
@@ -136,13 +134,9 @@ Trk::Track& Trk::Track::operator= (const Track& rhs)
         TrackStateOnSurface* tsos = (**itTSoS).clone();
         m_trackStateVector->push_back( tsos );
         if(tsos!=nullptr){
-          if(!m_perigeeParameters.isValid()){//should be invalid from above
-            //Now will contain a ptr and be valid
-            if (const Trk::Perigee* perigee = 
-                dynamic_cast<const Trk::Perigee*>( tsos->trackParameters()))
-            {
-              m_perigeeParameters.store(perigee);
-            }
+          const Trk::Perigee*  perigee = dynamic_cast<const Trk::Perigee*>(tsos->trackParameters() ) ;
+          if (perigee!=0 && tsos->type(TrackStateOnSurface::Perigee)){ 
+            m_perigeeParameters.store(perigee);//Now they will be valid
           }
         }
       }
@@ -182,7 +176,13 @@ const DataVector<const Trk::TrackParameters>* Trk::Track::trackParameters() cons
   return m_cachedParameterVector.ptr();
 }
 
-void Trk :: Track :: findPerigee() const
+void Trk::Track::findPerigee() const {
+  if (!m_perigeeParameters.isValid()){
+    findPerigeeImpl();
+  }
+} 
+
+void Trk::Track::findPerigeeImpl() const
 {
   // loop through all passed parameters and, if there is a Perigee in there,
   // assign it to Perigee parameters. Obviously there should never be more
@@ -191,12 +191,7 @@ void Trk :: Track :: findPerigee() const
   // there can be other objects, like VertexOnTrack measurements, with
   // params at a Perigee surface, thus an additional TSoS type check. AS/WL
 
-  /* Here I assume, that this is externally wrapped like
-   * if (!m_perigeeParameters.valid){
-   *  findPerigee();
-   * }
-   */
-  const Trk::Perigee* tmpPerigeeParameters=nullptr; 
+ const Trk::Perigee* tmpPerigeeParameters=nullptr; 
   if (m_trackStateVector!=nullptr){
     DataVector<const TrackStateOnSurface>::const_iterator it = 
       m_trackStateVector->begin();
-- 
GitLab


From 5da592b9d4521254bb47628673a8824c41b66d25 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Fri, 1 Mar 2019 06:13:30 +0100
Subject: [PATCH 153/404] Workaround for ATEAM-506: cherry-pick
 EventInfoNonConstCnvAlg from 21.0

EventInfoNonConstCnvAlg was introduced in 21.0 and was not meant to be migrated
to the master. The goal of this manual cherry-pick is to provide a quick
workaround to the problems discussed in ATEAM-506.

Also added some protection against the usage of EventInfoNonConstCnvAlg in
AthenaMT
---
 .../src/EventInfoNonConstCnvAlg.cxx           | 83 +++++++++++++++++++
 .../src/EventInfoNonConstCnvAlg.h             | 50 +++++++++++
 .../components/xAODEventInfoCnv_entries.cxx   |  2 +
 .../share/RecExCommon_topOptions.py           |  7 ++
 4 files changed, 142 insertions(+)
 create mode 100644 Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
 create mode 100644 Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h

diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
new file mode 100644
index 00000000000..ce9195bc325
--- /dev/null
+++ b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
@@ -0,0 +1,83 @@
+//
+// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+//
+
+// Local include(s).
+#include "EventInfoNonConstCnvAlg.h"
+
+// EDM include(s).
+#include "xAODEventInfo/EventInfo.h"
+#include "xAODEventInfo/EventAuxInfo.h"
+
+#include "GaudiKernel/ConcurrencyFlags.h"
+
+// System include(s).
+#include <memory>
+
+namespace xAODMaker {
+
+   EventInfoNonConstCnvAlg::EventInfoNonConstCnvAlg( const std::string& name,
+                                                     ISvcLocator* svcLoc )
+      : AthAlgorithm( name, svcLoc ) {
+
+      // Declare the algorithm's properties.
+      declareProperty( "EventInfoKey", m_key = "EventInfo",
+                       "Event store key for the xAOD::EventInfo object to "
+                       "modify" );
+   }
+
+  StatusCode EventInfoNonConstCnvAlg::initialize()
+  {
+    if(Gaudi::Concurrency::ConcurrencyFlags::numThreads()>0) {
+      ATH_MSG_FATAL("EventInfoNonConstCnvAlg can be used ONLY in serial Athena!");
+      return StatusCode::FAILURE;
+    }
+    return StatusCode::SUCCESS;
+  }
+
+   StatusCode EventInfoNonConstCnvAlg::execute() {
+
+      // Check if xAOD::EventInfo is available.
+      if( ! evtStore()->contains< xAOD::EventInfo >( m_key ) ) {
+         // If not, then let's just stop right away.
+         ATH_MSG_VERBOSE( "No xAOD::EventInfo with key \"" << m_key << "\"" );
+         return StatusCode::SUCCESS;
+      }
+
+      // Retrieve the const object.
+      const xAOD::EventInfo* ei = nullptr;
+      ATH_CHECK( evtStore()->retrieve( ei, m_key ) );
+
+      // Check if it's already set up to be modifiable.
+      if( ei->getStore() ) {
+         // If so, let's assume that SG will also let the object be retrieved
+         // as a non-const pointer.
+         ATH_MSG_VERBOSE( "xAOD::EventInfo with key \"" << m_key
+                          << "\" seems to be modifiable -> not touching it" );
+         return StatusCode::SUCCESS;
+      }
+
+      // Access the aux container as well now.
+      const xAOD::EventAuxInfo* aux = nullptr;
+      ATH_CHECK( evtStore()->retrieve( aux, m_key + "Aux." ) );
+
+      // Make a deep copy of the object.
+      auto newei = std::make_unique< xAOD::EventInfo >();
+      auto newaux = std::make_unique< xAOD::EventAuxInfo >();
+      newei->setStore( newaux.get() );
+      *newei = *ei;
+      ATH_MSG_VERBOSE( "Made a deep copy of \"" << m_key << "\"" );
+
+      // Overwrite the original object with its deep copy.
+      static const bool ALLOW_MODS = true;
+      ATH_CHECK( evtStore()->overwrite( std::move( newei ), m_key,
+                                        ALLOW_MODS ) );
+      ATH_CHECK( evtStore()->overwrite( std::move( newaux ), m_key + "Aux.",
+                                        ALLOW_MODS ) );
+      ATH_MSG_VERBOSE( "Overwrote \"" << m_key << "\" with its deep copy" );
+
+      // Return gracefully.
+      return StatusCode::SUCCESS;
+   }
+
+} // namespace xAODMaker
diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h
new file mode 100644
index 00000000000..5f12b14746e
--- /dev/null
+++ b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h
@@ -0,0 +1,50 @@
+// Dear emacs, this is -*- c++ -*-
+//
+// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+//
+#ifndef XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
+#define XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
+
+// System include(s).
+#include <string>
+
+// Gaudi/Athena include(s).
+#include "AthenaBaseComps/AthAlgorithm.h"
+
+namespace xAODMaker {
+
+   /// Algorithm making a const @c xAOD::EventInfo object non-const
+   ///
+   /// In jobs that process an input file which already has an
+   /// @c xAOD::EventInfo object in it, which itself has information that we
+   /// need to keep, but the job wants to further modify that object, we need
+   /// to make sure that algorithms are able to do those modifications.
+   ///
+   /// This algorithm can be used to make the @c xAOD::EventInfo object in
+   /// StoreGate modifiable.
+   ///
+   /// Note that this implementation is *only* meant for 21.X. For release
+   /// 22.X we will take care of this a bit differently.
+   ///
+   /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
+   ///
+   class EventInfoNonConstCnvAlg final : public AthAlgorithm {
+
+   public:
+      /// Algorithm constructor
+      EventInfoNonConstCnvAlg( const std::string& name, ISvcLocator* svcLoc );
+
+      virtual StatusCode initialize() override;
+
+      /// Function executing the algorithm
+      virtual StatusCode execute() override;
+
+   private:
+      /// Key for the xAOD::EventInfo object
+      std::string m_key;
+
+   }; // class EventInfoNonConstCnvAlg
+
+} // namespace xAODMaker
+
+#endif // XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
diff --git a/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx b/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
index 81ca4015122..2386ce9c9bb 100644
--- a/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
+++ b/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
@@ -1,6 +1,7 @@
 #include "../EventInfoCnvTool.h"
 #include "../EventInfoSelectorTool.h"
 #include "../EventInfoCnvAlg.h"
+#include "../EventInfoNonConstCnvAlg.h"
 #include "../EventInfoReaderAlg.h"
 #include "../EventDuplicateFinderAlg.h"
 
@@ -9,6 +10,7 @@
 DECLARE_COMPONENT( xAODMaker::EventInfoCnvTool )
 DECLARE_COMPONENT( xAODMaker::EventInfoSelectorTool )
 DECLARE_COMPONENT( xAODMaker::EventInfoCnvAlg )
+DECLARE_COMPONENT( xAODMaker::EventInfoNonConstCnvAlg )
 DECLARE_COMPONENT( xAODReader::EventInfoReaderAlg )
 DECLARE_COMPONENT( xAODReader::EventDuplicateFinderAlg )
 
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index 0bd34f4164f..e706ef8a209 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -463,11 +463,18 @@ topSequence+=EventCounter(Frequency=100)
 from AthenaCommon.AlgSequence import AthSequencer
 condSeq = AthSequencer("AthCondSeq")
 
+from AthenaCommon.ConcurrencyFlags import jobproperties as jpCF
+nThreads = jpCF.ConcurrencyFlags.NumThreads()
+
 if( ( not objKeyStore.isInInput( "xAOD::EventInfo") ) and \
         ( not hasattr( topSequence, "xAODMaker::EventInfoCnvAlg" ) ) ):
     from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
     condSeq+=xAODMaker__EventInfoCnvAlg()
     pass
+else:
+    if( (nThreads == 0) and (not hasattr( topSequence, "xAODMaker::EventInfoNonConstCnvAlg" ) ) ):
+        topSequence += CfgMgr.xAODMaker__EventInfoNonConstCnvAlg()
+        pass
 
 # bytestream reading need to shedule some algorithm
 
-- 
GitLab


From faea2f246eb69920e406bc73a9fe9a8ec1ab1ff1 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Fri, 1 Mar 2019 20:47:06 +0100
Subject: [PATCH 154/404] using innerTubeRadius instead of 14.6 in
 MdtCalibDbAlg

---
 .../MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx      | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index 49300ee6895..a72837d9787 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -465,6 +465,14 @@ StatusCode MdtCalibDbAlg::loadRt(){
     std::vector<MuonCalib::SamplePoint> tr_points(0), ts_points(0);  //all the points in time,radius [RT] and time,sigma [resolution func]
     float multilayer_tmax_diff(-9e9);
 
+    double innerTubeRadius = -9999.;
+    const MuonGM::MdtReadoutElement *detEl = m_detMgr->getMdtReadoutElement( m_mdtIdHelper->channelID(athenaId,1,1,1) );
+    if( !detEl ){
+      ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_mdtIdHelper->print_to_string(athenaId) );
+    } else {
+      innerTubeRadius = detEl->innerTubeRadius();
+    }
+
     char *RTPar= new char [payload.size()+1];
     strncpy(RTPar, payload.c_str(), payload.size()+1);
     RTPar[payload.size()]='\0';   //terminate string (not sure this is really needed because payload.c_str() should be terminated in \0)
@@ -476,7 +484,7 @@ StatusCode MdtCalibDbAlg::loadRt(){
 	float radius = atof(pch1);       
 	if( m_rtShift != 0. ) {
 	  float oldradius = radius;
-	  float rshift = m_rtShift*1.87652e-2*radius*(radius-14.6);
+	  float rshift = m_rtShift*1.87652e-2*radius*(radius-innerTubeRadius);
 	  radius = oldradius + rshift;
 	  ATH_MSG_DEBUG( "DEFORM RT: old radius " << oldradius << " new radius " 
 			  << radius << " shift " << rshift << " max shift " << m_rtShift );
@@ -521,7 +529,7 @@ StatusCode MdtCalibDbAlg::loadRt(){
 
     if(rt_ts_applied != m_TimeSlewingCorrection) {
       float sign(rt_ts_applied ? -1.0 : 1.0);
-      float slice_width = 14.6/static_cast<float>(m_MeanCorrectionVsR.size());
+      float slice_width = innerTubeRadius/static_cast<float>(m_MeanCorrectionVsR.size());
       for(std::vector<MuonCalib::SamplePoint>::iterator it=tr_points.begin(); it!=tr_points.end(); it++) {
 	int slice_number=static_cast<int>(std::floor(it->x2()/slice_width));		
 	if (slice_number<0)
-- 
GitLab


From 7d8dda8962cc19ef3fa372d986671ae532cd95ab Mon Sep 17 00:00:00 2001
From: cranshaw <Jack.Cranshaw@cern.ch>
Date: Fri, 1 Mar 2019 16:33:31 -0600
Subject: [PATCH 155/404] New reference file for test.

---
 .../share/AthenaPoolMultiTestEventSplitDecision.ref           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
index 78338d879b8..d447b55989a 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 0
+Splitter1           DEBUG input handles: 1
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 0
+Splitter3           DEBUG input handles: 1
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
-- 
GitLab


From a208f49748cb4b2a0056f362cc156e62e7aff407 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sat, 2 Mar 2019 10:09:09 +0100
Subject: [PATCH 156/404] Add ATLAS_CHECK_THREAD_SAFETY

---
 InnerDetector/InDetG4/SCT_G4_SD/ATLAS_CHECK_THREAD_SAFETY | 1 +
 InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx    | 4 ++--
 InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.cxx       | 6 +++---
 InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.h         | 4 ++--
 InnerDetector/InDetG4/SCT_G4_SD/src/SctSensor_CTB.cxx     | 4 ++--
 5 files changed, 10 insertions(+), 9 deletions(-)
 create mode 100644 InnerDetector/InDetG4/SCT_G4_SD/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetG4/SCT_G4_SD/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetG4/SCT_G4_SD/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..f436d7dcc46
--- /dev/null
+++ b/InnerDetector/InDetG4/SCT_G4_SD/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetG4/SCT_G4_SD
diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
index 589886198db..6a8ef0e94b1 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.cxx
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorGmxSD.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
 */
 
 //
@@ -38,7 +38,7 @@ G4bool SctSensorGmxSD::ProcessHits(G4Step *aStep, G4TouchableHistory * /* not us
   }
   edep *= CLHEP::MeV;
 
-  G4TouchableHistory *myTouch = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
+  const G4TouchableHistory *myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
   //
   // Get the hit start and end point local coordinates
   //
diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.cxx b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.cxx
index 16608466500..c25fecf6380 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.cxx
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.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
 */
 
 //
@@ -54,7 +54,7 @@ G4bool SctSensorSD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/)
   //
   // Get the Touchable History:
   //
-  G4TouchableHistory *myTouch = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
+  const G4TouchableHistory *myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
   //
   // Get the hit coordinates. Start and End Point
   //
@@ -105,7 +105,7 @@ G4bool SctSensorSD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/)
   return true;
 }
 
-void SctSensorSD::indexMethod(G4TouchableHistory *myTouch, double coord1z,
+void SctSensorSD::indexMethod(const G4TouchableHistory *myTouch, double coord1z,
                               int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side) {
 
 
diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.h b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.h
index 3cc6b108dc9..417901b891f 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.h
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensorSD.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
 */
 
 /****************************************************************
@@ -41,7 +41,7 @@ public:
   template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
 
 private:
-  void indexMethod(G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side);
+  void indexMethod(const G4TouchableHistory *myTouch, double coord1z, int &brlEcap, int &layerDisk, int &etaMod, int &phiMod, int &side);
 protected:
   // The hits collection
   SG::WriteHandle<SiHitCollection> m_HitColl;
diff --git a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensor_CTB.cxx b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensor_CTB.cxx
index 81e8e9da5ea..ce8729d475f 100644
--- a/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensor_CTB.cxx
+++ b/InnerDetector/InDetG4/SCT_G4_SD/src/SctSensor_CTB.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
 */
 
 //
@@ -58,7 +58,7 @@ G4bool SctSensor_CTB::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/)
   //
   // Get the Touchable History:
   //
-  G4TouchableHistory*  myTouch = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
+  const G4TouchableHistory*  myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
   //
   // Get the hit coordinates. Start and End Point
   //
-- 
GitLab


From e557e382c209fe9e5f97432ce919f83215630d7d Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sat, 2 Mar 2019 11:54:00 +0100
Subject: [PATCH 157/404] Add ATLAS_CHECK_THREAD_SAFETY

---
 .../SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY                  | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..8fd15b490e9
--- /dev/null
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SiLorentzAngleSvc
-- 
GitLab


From 8d7e64dc3d046138636899d3c4fef3b216d161c9 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sat, 2 Mar 2019 12:11:28 +0100
Subject: [PATCH 158/404] Add ATLAS_CHECK_THREAD_SAFETY

---
 .../SCTExtension/SCTExtension/ATLAS_CHECK_THREAD_SAFETY          | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetPerformance/SCTExtension/SCTExtension/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetPerformance/SCTExtension/SCTExtension/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetPerformance/SCTExtension/SCTExtension/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6399682e7e3
--- /dev/null
+++ b/InnerDetector/InDetPerformance/SCTExtension/SCTExtension/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetPerformance/SCTExtension
-- 
GitLab


From 9c47276836ba740530771d141e397e38b8dcce02 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sat, 2 Mar 2019 15:23:00 +0100
Subject: [PATCH 159/404] Add ATLAS_CHECK_THREAD_SAFETY

---
 .../SCT_Monitoring/SCT_Monitoring/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 .../InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..fc7962c0e8a
--- /dev/null
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetMonitoring/SCT_Monitoring
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
index 7ea24447472..dad87c13808 100755
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
@@ -66,10 +66,10 @@ using namespace SCT_Monitoring;
 namespace {// anonymous namespace for functions at file scope
   const bool testOffline(false);
 
-  std::string histogramPath[] = {
+  const std::string histogramPath[] = {
     "SCT/SCTEC/eff", "SCT/SCTB/eff", "SCT/SCTEA/eff", "SCT/GENERAL/eff"
   };
-  std::string histogramPathRe[] = {
+  const std::string histogramPathRe[] = {
     "SCT/SCTEC/eff/perLumiBlock", "SCT/SCTB/eff/perLumiBlock", "SCT/SCTEA/eff/perLumiBlock"
   };// 23.01.2015
 
-- 
GitLab


From 87c5164c240c8f7f257033c2f31695613aaa720f Mon Sep 17 00:00:00 2001
From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>
Date: Sat, 2 Mar 2019 17:19:36 +0100
Subject: [PATCH 160/404] Reworked cf tree generating function

---
 .../Menu/GenerateMenuMT_newJO.py              |  21 ++--
 .../python/HLTMenuConfig/Menu/HLTCFConfig.py  | 110 +++++++++++++++++-
 2 files changed, 121 insertions(+), 10 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index aea1926e3c4..b9174f9fd6e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -2,7 +2,7 @@
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaCommon.CFElements import seqAND
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import decisionTree_From_Chains, \
-    generateDecisionTree
+    generateDecisionTree, generateDecisionTreeOld
 
 from AthenaCommon.Logging import logging
 from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
@@ -43,10 +43,6 @@ def generateMenu( flags ):
     menuChains = []
     allChainDicts =[]
 
-    menuAcc = ComponentAccumulator()
-    mainSequenceName = 'HLTAllSteps'
-    menuAcc.addSequence( seqAND(mainSequenceName) )
-
     chainAccumulators = []
 
     for name, cfgFlag in list(flags._flagdict.iteritems()):
@@ -79,14 +75,21 @@ def generateMenu( flags ):
     _log.info('Obtained Menu Chain objects')
 
     # pass all menuChain to CF builder    
+    mainSequenceName = 'HLTAllSteps'
+    useReworked = True
 
+    if useReworked:
+        menuAcc = generateDecisionTree(mainSequenceName, menuChains, allChainDicts)
+    else:
+        menuAcc = ComponentAccumulator()
+        menuAcc.addSequence( seqAND(mainSequenceName) )
+        chainsAcc = generateDecisionTreeOld(menuAcc.getSequence(mainSequenceName), menuChains, allChainDicts)
+        menuAcc.merge(chainsAcc)
 
-    chainsAcc = generateDecisionTree(menuAcc.getSequence(mainSequenceName), menuChains, allChainDicts)
-    chainsAcc.printConfig()
-
-    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 bece7d71b2d..1051edd739f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -65,6 +65,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 +331,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()
@@ -432,6 +437,109 @@ def generateDecisionTree(HLTNode, chains, allChainDicts):
     return acc
 
 
+def connectStepToFilter(chainStep, filter):
+    filter_output = filter.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, filter.Alg.name(), sequence.seed)
+        sequence.connectToFilter(output)
+
+
+def generateDecisionTree(mainSequenceName, chains, allChainDicts):
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    from collections import defaultdict
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
+    from AthenaCommon.CFElements import findOwningSequence
+
+    log.debug("Run decisionTree_From_Chains on %s", mainSequenceName)
+
+    acc = ComponentAccumulator()
+    mainSequenceName = 'HLTAllSteps'
+    acc.addSequence( seqAND(mainSequenceName) )
+
+    chainStepsMatrix = defaultdict(lambda: defaultdict(list))
+
+    ## Fill chain steps matrix
+    for chain in chains:
+        chain.decodeHypoToolConfs(allChainDicts)
+        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:
+                        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
+
+
 def findFilter(filter_name, cfseqList):
       """
       searches for a filter, with given name, in the CF sequence list of this step
-- 
GitLab


From 37d14b97354a51bc69a56a145815bc7f6b54717f Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Sat, 2 Mar 2019 20:57:02 +0100
Subject: [PATCH 161/404] fixed docu

---
 .../TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
index 9303d13438b..d458fecd821 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/TriggerEDMSerialiserTool.h
@@ -39,7 +39,7 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
  private: 
   Gaudi::Property< std::vector< std::string > > m_collectionsToSerialize {
     this, "CollectionsToSerialize", {},
-    "EDM streaming configuration \'collectionKeyType, module1,module2,module3\' where collectionKeyType is a string formatted like for "
+    "EDM streaming configuration \'collectionKeyType;module1,module2,module3\' where collectionKeyType is a string formatted like for "
     "AthenaOutputStream, e.g. TYPE#SG.aux1.aux2..etc. The type has to be an exact type, i.e. with _vN not the alias "
     "type. moduleIdVec is the vector of HLTResult ROB module IDs to which the collection should be written. ID=0 is "
     "the main result, other IDs are used for data scouting."
-- 
GitLab


From 62e6c927d4521672da6d9232f972b49d3345ddc8 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 2 Mar 2019 22:16:18 +0100
Subject: [PATCH 162/404] Identifier: Enable thread-safety checking.

Enable thread-safety static checker.  Fix identified issues:

The code handling sorted iteration over MultiRange was not thread-safe.
However, it is not actually used anywhere, so just remove it.

Error handling in ExpandedIdentifier is not thread-safe, but it also mostly
useful.  Remove, and replace the two places where we might actually report
errors with exceptions.

Remove unneeded static, make another static const.

Fix past-the-end indexing error in Range::const_identifier_factory::operator++().

Also fix cppcheck warnings: Better to initialize fields in the initializer list
rather then in a ctor body.
---
 .../Identifier/ATLAS_CHECK_THREAD_SAFETY      |   1 +
 .../Identifier/ExpandedIdentifier.h           | 114 +-----
 .../Identifier/Identifier/Range.h             |  26 +-
 .../Identifier/src/ExpandedIdentifier.cxx     |  20 +-
 DetectorDescription/Identifier/src/Range.cxx  | 377 ++++--------------
 5 files changed, 84 insertions(+), 454 deletions(-)
 create mode 100644 DetectorDescription/Identifier/Identifier/ATLAS_CHECK_THREAD_SAFETY

diff --git a/DetectorDescription/Identifier/Identifier/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/Identifier/Identifier/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3cb15597ac8
--- /dev/null
+++ b/DetectorDescription/Identifier/Identifier/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/Identifier
diff --git a/DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h b/DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h
index dd3aa92232d..79e3ef1b642 100644
--- a/DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h
+++ b/DetectorDescription/Identifier/Identifier/ExpandedIdentifier.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 IDENTIFIER_EXPANDEDIDENTIFIER_H
@@ -88,18 +88,6 @@
 //                                       /1 == /1/3  
 //
 //
-//  error_code last_error ()             : returns the last error code 
-//                                         produced by the most recent 
-//                                         identifier operation. The possible
-//                                         values are :
-//
-//                                             none
-//                                             bad_parameter
-//                                             field_not_found
-//
-//  const std::string last_error_text () : returns a text describing the 
-//                                         last error.
-//
 //  ----------------------------------------------------
 //
 //  Example of how to use an identifier :
@@ -109,10 +97,6 @@
 //  ExpandedIdentifier id;
 //
 //  id << 125 << 236 << 306 << 2222;
-//  if (id.last_error () != ExpandedIdentifier::none)
-//    {
-//      cout << "Error : " << id.last_error_text () << endl;
-//    }
 //
 //  for (size_type i = 0; i < id.fields (); ++i)
 //    {
@@ -138,19 +122,6 @@ public:
       max_value = 0x3FFFFFFF
     } max_value_type;
 
-    //----------------------------------------------------------------
-    // Possible errors that may occur in operations.
-    //----------------------------------------------------------------
-  typedef enum
-    {
-      none,                 // success
-      bad_parameter,        // bad value for any method parameter
-      field_not_found,      // the field number is not found
-      
-      errors,
-      get
-    } error_code;
-
     //----------------------------------------------------------------
     // Constructors
     //----------------------------------------------------------------
@@ -229,22 +200,6 @@ public:
    */
   int match (const ExpandedIdentifier& other) const;
 
-    //----------------------------------------------------------------
-    // Error management
-    //----------------------------------------------------------------
-
-    //----------------------------------------------------------------
-    // Return the error produced in the last operation
-    // The value identifier::none represents the successful condition.
-    //----------------------------------------------------------------
-  error_code last_error () const;
-
-    //----------------------------------------------------------------
-    // Return a textual equivalent to the error produced
-    // in the last operation
-    //----------------------------------------------------------------
-  const std::string last_error_text () const;
-
     //----------------------------------------------------------------
     // Utilities
     //----------------------------------------------------------------
@@ -262,11 +217,6 @@ private:
     // The actual identifier data.
     //----------------------------------------------------------------
   element_vector m_fields;
-
-    //----------------------------------------------------------------
-    // Maintains the last error code (shared by all objects).
-    //----------------------------------------------------------------
-  error_code set_last_error (error_code code = get) const;
 };
 //-----------------------------------------------
 
@@ -278,16 +228,13 @@ private:
 inline
 ExpandedIdentifier::ExpandedIdentifier ()
 {
-  set_last_error (none);
 }
 
 //-----------------------------------------------
 inline
 ExpandedIdentifier::ExpandedIdentifier (const ExpandedIdentifier& other)
+  : m_fields (other.m_fields)
 {
-  set_last_error (none);
-
-  m_fields = other.m_fields;
 }
 
 //-----------------------------------------------
@@ -296,7 +243,6 @@ ExpandedIdentifier&
 ExpandedIdentifier::operator= (const ExpandedIdentifier& other)
 {
   if (this != &other) {
-    set_last_error (none);
     m_fields = other.m_fields;
   }
   return *this;
@@ -308,7 +254,6 @@ ExpandedIdentifier&
 ExpandedIdentifier::operator= (ExpandedIdentifier&& other)
 {
   if (this != &other) {
-    set_last_error (none);
     m_fields = std::move(other.m_fields);
   }
   return *this;
@@ -318,8 +263,6 @@ ExpandedIdentifier::operator= (ExpandedIdentifier&& other)
 inline
 ExpandedIdentifier::ExpandedIdentifier (const ExpandedIdentifier& other, size_type start)
 {
-  set_last_error (none);
-
   if (start < other.fields ())
     {
       element_vector::const_iterator it = other.m_fields.begin ();
@@ -336,8 +279,6 @@ ExpandedIdentifier::ExpandedIdentifier (const ExpandedIdentifier& other, size_ty
 inline
 void ExpandedIdentifier::add (element_type value)
 {
-  set_last_error (none);
-
   // Max size of id levels should be < 10
   if(m_fields.capacity() < 10) m_fields.reserve(10);
   m_fields.push_back (value);
@@ -347,8 +288,6 @@ void ExpandedIdentifier::add (element_type value)
 inline
 ExpandedIdentifier& ExpandedIdentifier::operator << (element_type value)
 {
-  set_last_error (none);
-
   // Max size of id levels should be < 10
   if(m_fields.capacity() < 10) m_fields.reserve(10);
   m_fields.push_back (value);
@@ -360,18 +299,8 @@ ExpandedIdentifier& ExpandedIdentifier::operator << (element_type value)
 inline
 ExpandedIdentifier::element_type & ExpandedIdentifier::operator [] (size_type index)
 {
-  set_last_error (none);
-
-  if (index >= m_fields.size ())
-    {
-      static element_type dummy = 0;
-
-      set_last_error (field_not_found);
-
-      return (dummy);
-    }
-
-  return (m_fields[index]);
+  // Raises an exception if index is out-of-bounds.
+  return m_fields.at (index);
 }
 
 //-----------------------------------------------
@@ -388,16 +317,8 @@ void ExpandedIdentifier::clear ()
 inline
 ExpandedIdentifier::element_type ExpandedIdentifier::operator [] (size_type index) const
 {
-  set_last_error (none);
-
-  if (index >= m_fields.size ())
-    {
-      set_last_error (field_not_found);
-
-      return (0);
-    }
-
-  return (m_fields[index]);
+  // Raises an exception if index is out-of-bounds.
+  return m_fields.at (index);
 }
 
 //-----------------------------------------------
@@ -498,28 +419,5 @@ int ExpandedIdentifier::match (const ExpandedIdentifier& other) const
   return (1);
 }
 
-  // Error management
-//-----------------------------------------------
-inline
-ExpandedIdentifier::error_code ExpandedIdentifier::last_error () const
-{
-  return (set_last_error (get));
-}
-
-//----------------------------------------------------------------
-inline
-ExpandedIdentifier::error_code ExpandedIdentifier::set_last_error (error_code code) const
-{
-  static error_code last = none;
-  
-  if (code != get)
-    {
-      last = code;
-    }
-  
-  return (last);
-}
-
-
 
 #endif
diff --git a/DetectorDescription/Identifier/Identifier/Range.h b/DetectorDescription/Identifier/Identifier/Range.h
index 699f7285a43..dfdbfcb3004 100644
--- a/DetectorDescription/Identifier/Identifier/Range.h
+++ b/DetectorDescription/Identifier/Identifier/Range.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 IDENTIFIER_RANGE_H
@@ -249,11 +249,11 @@ public:
    *   will have their min=max=id[i] 
    */ 
   Range (const ExpandedIdentifier& root); 
-     
+
   /** 
    * Build a range from a textual description. 
    */ 
-  void build (const std::string& text); 
+  void build (const std::string& text);
  
   /** 
    *   Build a range from a single ExpandedIdentifier 
@@ -364,7 +364,7 @@ public:
     public: 
 	identifier_factory (); 
 	identifier_factory (const identifier_factory& other); 
-	identifier_factory (const MultiRange& multirange, bool sort); 
+	identifier_factory (const MultiRange& multirange); 
 	~identifier_factory (); 
  
 	identifier_factory& operator = (const identifier_factory& other); 
@@ -383,7 +383,6 @@ public:
 	typedef id_vec::const_iterator 		id_const_iterator;
 
 	ExpandedIdentifier		m_id;
-	bool 				m_sort;
 	Range::const_identifier_factory	m_id_fac_it; 
 	Range::const_identifier_factory	m_id_fac_end; 
 	range_vector::const_iterator   	m_range_it; 
@@ -398,7 +397,7 @@ public:
     public: 
 	const_identifier_factory (); 
 	const_identifier_factory (const const_identifier_factory& other); 
-	const_identifier_factory (const MultiRange& multirange, bool sort); 
+	const_identifier_factory (const MultiRange& multirange); 
 	~const_identifier_factory (); 
  
 	const_identifier_factory& operator = (const const_identifier_factory& other);
@@ -416,7 +415,6 @@ public:
 	typedef id_vec::const_iterator 		id_const_iterator;
 
 	ExpandedIdentifier		m_id;
-	bool 				m_sort;
 	Range::const_identifier_factory	m_id_fac_it; 
 	Range::const_identifier_factory	m_id_fac_end; 
 	range_vector::const_iterator   	m_range_it; 
@@ -429,7 +427,6 @@ public:
   /// Constructors 
   MultiRange (); 
   MultiRange (const MultiRange& other); 
-  MultiRange (const std::string& text); 
 
 
   /// Assignment.
@@ -440,10 +437,7 @@ public:
    *   two overlapping ones 
    */ 
   MultiRange (const Range& r, const Range& s); 
- 
-  /// Build a range from a textual description. 
-  void build (const std::string& text); 
- 
+
   /// Modifications 
  
   void clear (); 
@@ -484,8 +478,8 @@ public:
   void reduce (); 
  
   // identifier_factory management 
-  identifier_factory 		factory_begin (bool sort = false); 
-  const_identifier_factory 	factory_begin (bool sort = false) const; 
+  identifier_factory 		factory_begin (); 
+  const_identifier_factory 	factory_begin () const; 
   identifier_factory 		factory_end (); 
   const_identifier_factory 	factory_end () const; 
 
@@ -504,10 +498,6 @@ private:
   friend class const_identifier_factory;
   typedef std::vector<ExpandedIdentifier>	id_vec;
   range_vector 		m_ranges; 
-  // number of iterators accessing m_ids
-  mutable size_type 	m_it_count;  
-  mutable id_vec	m_ids;
-
 }; 
  
 
diff --git a/DetectorDescription/Identifier/src/ExpandedIdentifier.cxx b/DetectorDescription/Identifier/src/ExpandedIdentifier.cxx
index 584d48552e3..86387b11b35 100644
--- a/DetectorDescription/Identifier/src/ExpandedIdentifier.cxx
+++ b/DetectorDescription/Identifier/src/ExpandedIdentifier.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
 */
 
 
@@ -43,8 +43,6 @@ ExpandedIdentifier::ExpandedIdentifier (const std::string& text)
 //-----------------------------------------------
 void ExpandedIdentifier::set (const std::string& text)
 {
-  set_last_error (none);
-
   clear ();
   if (text.size () == 0) return;
   const char* ctext = text.c_str ();
@@ -94,22 +92,6 @@ int ExpandedIdentifier::prefix_less (const ExpandedIdentifier& other) const
   return (0);
 }
 
-  // Error management
-
-//-----------------------------------------------
-const std::string ExpandedIdentifier::last_error_text () const
-{
-  static const std::string text[] = {
-    "none",
-    "bad parameter",
-    "field not found"
-  };
-  
-  error_code code = last_error ();
-  
-  return (text[code]);
-}
-
 //-----------------------------------------------
 ExpandedIdentifier::operator std::string () const
 {
diff --git a/DetectorDescription/Identifier/src/Range.cxx b/DetectorDescription/Identifier/src/Range.cxx
index ec4d2e29ee2..9e821eb4b97 100644
--- a/DetectorDescription/Identifier/src/Range.cxx
+++ b/DetectorDescription/Identifier/src/Range.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
 */
 
  
@@ -322,17 +322,16 @@ Range::field::field ()
  
 //----------------------------------------------- 
 Range::field::field (const field& other) 
-  : m_values (other.m_values),
-    m_indexes (other.m_indexes)
+  : m_minimum (other.m_minimum),
+    m_maximum (other.m_maximum),
+    m_values (other.m_values),
+    m_indexes (other.m_indexes),
+    m_indices (other.m_indices),
+    m_previous (other.m_previous),
+    m_next (other.m_next),
+    m_mode (other.m_mode),
+    m_continuation_mode (other.m_continuation_mode)
 { 
-  m_minimum  = other.m_minimum; 
-  m_maximum  = other.m_maximum; 
-  m_indices  = other.m_indices;
-  m_previous = other.m_previous;
-  m_next     = other.m_next;
-  m_mode     = other.m_mode; 
-  m_continuation_mode = other.m_continuation_mode;
-
 } 
 
 //----------------------------------------------- 
@@ -556,7 +555,7 @@ bool Range::field::overlaps_with (const field& other) const
       all_values 
     } check_type; 
  
-  static check_type check_needed[5][5] = 
+  static const check_type check_needed[5][5] = 
   { 
     {done, done,    done,    done,          done}, 
     {done, done,    min_max, min_max,       min_max}, 
@@ -1173,9 +1172,9 @@ Range::Range ()
 } 
  
 //----------------------------------------------- 
-Range::Range (const Range& other) 
+Range::Range (const Range& other)
+  : m_fields (other.m_fields)
 { 
-  m_fields = other.m_fields; 
 } 
  
 //----------------------------------------------- 
@@ -2007,7 +2006,7 @@ void Range::const_identifier_factory::operator ++ ()
   if (m_id.fields () == 0) return; 
  
   size_type fields = m_id.fields (); 
-  size_type i = fields; 
+  size_type i = fields - 1; 
  
     // 
     // Starting from the end, we try to increment the m_id fields 
@@ -2352,16 +2351,13 @@ private:
  
 //----------------------------------------------- 
 MultiRange::MultiRange () 
-    :
-    m_it_count(0)
 { 
 } 
  
 //----------------------------------------------- 
 MultiRange::MultiRange (const MultiRange& other) 
     : 
-    m_ranges (other.m_ranges),
-    m_it_count(0)
+    m_ranges (other.m_ranges)
 { 
 } 
 
@@ -2369,12 +2365,7 @@ MultiRange::MultiRange (const MultiRange& other)
 MultiRange& MultiRange::operator= (const MultiRange& other) 
 {
   if (this != &other) {
-    if (m_it_count > 0) {
-      // Can't do this if we still have iterators referencing us.
-      std::abort();
-    }
     m_ranges = other.m_ranges;
-    m_it_count = other.m_it_count;
   }
   return *this;
 }
@@ -2386,28 +2377,11 @@ MultiRange& MultiRange::operator= (const MultiRange& other)
  *   source file. 
  */ 
 MultiRange::MultiRange (const Range& r, const Range& s) 
-    : 
-    m_it_count(0)
 { 
   m_ranges.push_back (r); 
   m_ranges.push_back (s); 
 } 
- 
-//----------------------------------------------- 
-MultiRange::MultiRange (const std::string& text) 
-    : 
-    m_it_count(0)
-{ 
-  build (text); 
-} 
- 
-//----------------------------------------------- 
-void MultiRange::build (const std::string& text) 
-{ 
-  static MultiRangeParser parser; 
-  parser.run (text, *this); 
-} 
- 
+
 //----------------------------------------------- 
 void MultiRange::clear () 
 { 
@@ -2553,19 +2527,17 @@ bool MultiRange::has_overlap () const
 } 
  
 //----------------------------------------------- 
-MultiRange::identifier_factory MultiRange::factory_begin (bool sort) 
+MultiRange::identifier_factory MultiRange::factory_begin () 
 { 
   const MultiRange& me = *this; 
-  if (sort) m_it_count++;
-  return (identifier_factory (me, sort)); 
+  return (identifier_factory (me)); 
 } 
  
 //----------------------------------------------- 
-MultiRange::const_identifier_factory MultiRange::factory_begin (bool sort) const 
+MultiRange::const_identifier_factory MultiRange::factory_begin () const 
 { 
   const MultiRange& me = *this; 
-  if (sort) m_it_count++;
-  return (const_identifier_factory (me, sort)); 
+  return (const_identifier_factory (me)); 
 } 
  
 //----------------------------------------------- 
@@ -2587,7 +2559,6 @@ MultiRange::const_identifier_factory MultiRange::factory_end () const
 //----------------------------------------------- 
 MultiRange::identifier_factory::identifier_factory () 
     : 
-    m_sort(false),
     m_multirange(0)
 { 
 }
@@ -2596,7 +2567,6 @@ MultiRange::identifier_factory::identifier_factory ()
 MultiRange::identifier_factory::identifier_factory (const identifier_factory& other) 
     :
     m_id 		(other.m_id),
-    m_sort 		(other.m_sort),
     m_id_fac_it  	(other.m_id_fac_it),
     m_id_fac_end 	(other.m_id_fac_end),
     m_range_it 		(other.m_range_it),
@@ -2605,107 +2575,31 @@ MultiRange::identifier_factory::identifier_factory (const identifier_factory& ot
     m_id_vec_end 	(other.m_id_vec_end),
     m_multirange	(other.m_multirange)
 {
-	    
-    if (m_sort && m_multirange) {
-	m_multirange->m_it_count++;
-//  	std::cout << "MultiRange::identifier_factory::operator =: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-    }
 } 
  
 //----------------------------------------------- 
-MultiRange::identifier_factory::identifier_factory (const MultiRange& multirange, bool sort) 
+MultiRange::identifier_factory::identifier_factory (const MultiRange& multirange) 
     :
-    m_sort(sort),
     m_range_it(multirange.m_ranges.begin()),
     m_range_end(multirange.m_ranges.end()),
     m_multirange(&multirange)
 { 
     if (m_range_it == m_range_end)return;  // no ranges
     /** 
-     *  For sorted ids, must set up initial id vector. For unsorted,
-     *  one can just set up iterators over ranges and ids.
+     *  Set up iterators over ranges and ids.
      */
-    if (m_sort) {
-	if (m_multirange->m_ids.size() > 0) {
-	    // id vector has already been created
-	    // Set up iterator over ids
-	    m_id_vec_it  = m_multirange->m_ids.begin();
-	    m_id_vec_end = m_multirange->m_ids.end();
-	    if (m_id_vec_it != m_id_vec_end) {
-		// Set id
-		m_id = *m_id_vec_it;
-	    }
-	}
-	else {
-	    // Limit sorted access to just under 500K ids
-	    size_type nids = m_multirange->cardinality();
-	    if (500000 < nids) {
-		std::cout << "MultiRange::identifier_factory: unable to provide " 
-			  << " access to sorted identifier iterator. Limited to < 500k ids." 
-			  << std::endl;
-	    }
-	    else {
-		// Access and sort ids, removing duplicates
-		std::set<ExpandedIdentifier> ids;
-		for (; m_range_it != m_range_end; ++m_range_it) {
-		    m_id_fac_it  = (*m_range_it).factory_begin();
-		    m_id_fac_end = (*m_range_it).factory_end();
-		    for (; m_id_fac_it != m_id_fac_end; ++m_id_fac_it) {
-			ids.insert(*m_id_fac_it);
-		    }
-		}
-		std::set<ExpandedIdentifier>::iterator    firstIds = ids.begin();
-		std::set<ExpandedIdentifier>::iterator    lastIds  = ids.end();
-		for(; firstIds != lastIds; ++firstIds) {
-		    m_multirange->m_ids.push_back (*firstIds); 
-		}
-		// Set up iterator over ids
-		m_id_vec_it  = m_multirange->m_ids.begin();
-		m_id_vec_end = m_multirange->m_ids.end();
-		if (m_id_vec_it != m_id_vec_end) {
-		    // Set id
-		    m_id = *m_id_vec_it;
-		}
-	    }	    
-	}
-    }
-    else {
-	/** 
-	 *  No sort: Set up the iterators for range and identifiers
-	 */
-	if (m_range_it != m_range_end) {
-	    m_id_fac_it  = (*m_range_it).factory_begin();
-	    m_id_fac_end = (*m_range_it).factory_end();
-	    if(m_id_fac_it != m_id_fac_end) {
-		// Set id
-		m_id = *m_id_fac_it;
-	    }
-	}
+    if (m_range_it != m_range_end) {
+      m_id_fac_it  = (*m_range_it).factory_begin();
+      m_id_fac_end = (*m_range_it).factory_end();
+      if(m_id_fac_it != m_id_fac_end) {
+        // Set id
+        m_id = *m_id_fac_it;
+      }
     }
 }
  
 MultiRange::identifier_factory::~identifier_factory ()
 {
-    // remove id buffer in multirange if no iterator is still using it
-    if (m_sort && m_multirange) {
-	if(m_multirange->m_it_count) {
-	    m_multirange->m_it_count--;
-	}
-	else {
-	    std::cout << "MultiRange::identifier_factory::~identifier_factory: it_count ALREADY 0" 
-		      << std::endl;
-	}
-//  	std::cout << "MultiRange::identifier_factory::~identifier_factory: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-	if (!m_multirange->m_it_count) {
-	    m_multirange->m_ids.clear();
-//  	std::cout << "MultiRange::identifier_factory::~identifier_factory: cleared id buffer" 
-//  		  << std::endl;
-	}    
-    }
 }
 
 
@@ -2714,7 +2608,6 @@ MultiRange::identifier_factory& MultiRange::identifier_factory::operator = (cons
 { 
   if (this != &other) {
     m_id 		= other.m_id;
-    m_sort 		= other.m_sort;
     m_id_fac_it  	= other.m_id_fac_it;
     m_id_fac_end 	= other.m_id_fac_end;
     m_range_it 		= other.m_range_it;
@@ -2722,14 +2615,6 @@ MultiRange::identifier_factory& MultiRange::identifier_factory::operator = (cons
     m_id_vec_it 	= other.m_id_vec_it;
     m_id_vec_end 	= other.m_id_vec_end;
     m_multirange	= other.m_multirange;
-    // Must increment number of iterators looking at the id buffer in
-    // the multirange
-    if (m_sort && m_multirange) {
-	m_multirange->m_it_count++;
-//  	std::cout << "MultiRange::identifier_factory::operator =: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-    }
   }
   return (*this); 
 } 
@@ -2739,7 +2624,6 @@ MultiRange::identifier_factory& MultiRange::identifier_factory::operator = (iden
 { 
   if (this != &other) {
     m_id 		= std::move(other.m_id);
-    m_sort 		= other.m_sort;
     m_id_fac_it  	= std::move(other.m_id_fac_it);
     m_id_fac_end 	= std::move(other.m_id_fac_end);
     m_range_it 		= other.m_range_it;
@@ -2758,36 +2642,21 @@ void MultiRange::identifier_factory::operator ++ ()
  
     if (m_id.fields () == 0) return; 
 
-    /** 
-     *  Advance iterators depending upon whether or not we have sorted.
-     */
-
-    if (m_sort) {
-	m_id.clear();
-	if (m_id_vec_it != m_id_vec_end) {
-	    ++m_id_vec_it;
-	    if (m_id_vec_it != m_id_vec_end) {
-		m_id = *m_id_vec_it;
-	    }
-	}
-    }
-    else {
-	m_id.clear();
-	if (m_range_it != m_range_end) {
-	    if (m_id_fac_it != m_id_fac_end) {
-		++m_id_fac_it;
-	    }
-	    if (m_id_fac_it == m_id_fac_end) {
-		++m_range_it;
-		if (m_range_it != m_range_end) {
-		    m_id_fac_it  = (*m_range_it).factory_begin();
-		    m_id_fac_end = (*m_range_it).factory_end();
-		}
-	    }
-	    if (m_id_fac_it != m_id_fac_end) {
-		m_id = *m_id_fac_it;
-	    }
-	}
+    m_id.clear();
+    if (m_range_it != m_range_end) {
+      if (m_id_fac_it != m_id_fac_end) {
+        ++m_id_fac_it;
+      }
+      if (m_id_fac_it == m_id_fac_end) {
+        ++m_range_it;
+        if (m_range_it != m_range_end) {
+          m_id_fac_it  = (*m_range_it).factory_begin();
+          m_id_fac_end = (*m_range_it).factory_end();
+        }
+      }
+      if (m_id_fac_it != m_id_fac_end) {
+        m_id = *m_id_fac_it;
+      }
     }
 } 
 
@@ -2815,7 +2684,6 @@ bool MultiRange::identifier_factory::operator != (const identifier_factory& othe
 //----------------------------------------------- 
 MultiRange::const_identifier_factory::const_identifier_factory () 
     : 
-    m_sort(false),
     m_multirange(0)
 { 
 } 
@@ -2824,7 +2692,6 @@ MultiRange::const_identifier_factory::const_identifier_factory ()
 MultiRange::const_identifier_factory::const_identifier_factory (const const_identifier_factory& other) 
     :
     m_id 		(other.m_id),
-    m_sort 		(other.m_sort),
     m_id_fac_it  	(other.m_id_fac_it),
     m_id_fac_end 	(other.m_id_fac_end),
     m_range_it 		(other.m_range_it),
@@ -2833,117 +2700,34 @@ MultiRange::const_identifier_factory::const_identifier_factory (const const_iden
     m_id_vec_end 	(other.m_id_vec_end),
     m_multirange	(other.m_multirange)
 {
-	    
-    if (m_sort && m_multirange) {
-	m_multirange->m_it_count++;
-//  	std::cout << "MultiRange::const_identifier_factory::operator =: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-    }
 } 
  
  
 //----------------------------------------------- 
-MultiRange::const_identifier_factory::const_identifier_factory (const MultiRange& multirange, bool sort) 
+MultiRange::const_identifier_factory::const_identifier_factory (const MultiRange& multirange) 
     :
-    m_sort(sort),
     m_range_it(multirange.m_ranges.begin()),
     m_range_end(multirange.m_ranges.end()),
     m_multirange(&multirange)
 { 
 
-//      std::cout << "MultiRange::const_identifier_factory::const_identifier_factory: sort "  
-//  	      << sort << " size " << m_multirange->m_ids.size()
-//  	      << " range it " << (m_range_it == m_range_end)
-//  	      << " multi range " << (std::string)(*m_multirange)
-//  	      << std::endl;
-    
-
     if (m_range_it == m_range_end)return;  // no ranges
     /** 
-     *  For sorted ids, must set up initial id vector. For unsorted,
-     *  one can just set up iterators over ranges and ids.
+     *  Set up iterators over ranges and ids.
      */
-    if (m_sort) {
-	if (m_multirange->m_ids.size() > 0) {
-	    // id vector has already been created
-	    // Set up iterator over ids
-	    m_id_vec_it  = m_multirange->m_ids.begin();
-	    m_id_vec_end = m_multirange->m_ids.end();
-	    if (m_id_vec_it != m_id_vec_end) {
-		// Set id
-		m_id = *m_id_vec_it;
-	    }
-	}
-	else {
-	    // Limit sorted access to just under 500K ids
-	    size_type nids = m_multirange->cardinality();
-	    if (500000 < nids) {
-		std::cout << "MultiRange::identifier_factory: unable to provide " 
-			  << " access to sorted identifier iterator. Limited to < 500k ids." 
-			  << std::endl;
-	    }
-	    else {
-		// Access and sort ids, removing duplicates
-		std::set<ExpandedIdentifier> ids;
-		for (; m_range_it != m_range_end; ++m_range_it) {
-		    m_id_fac_it  = (*m_range_it).factory_begin();
-		    m_id_fac_end = (*m_range_it).factory_end();
-		    for (; m_id_fac_it != m_id_fac_end; ++m_id_fac_it) {
-			ids.insert(*m_id_fac_it);
-		    }
-		}
-		std::set<ExpandedIdentifier>::iterator    firstIds = ids.begin();
-		std::set<ExpandedIdentifier>::iterator    lastIds  = ids.end();
-		for(; firstIds != lastIds; ++firstIds) {
-		    m_multirange->m_ids.push_back (*firstIds); 
-		}
-		// Set up iterator over ids
-		m_id_vec_it  = m_multirange->m_ids.begin();
-		m_id_vec_end = m_multirange->m_ids.end();
-		if (m_id_vec_it != m_id_vec_end) {
-		    // Set id
-		    m_id = *m_id_vec_it;
-		}
-	    }	    
-	}
-    }
-    else {
-	/** 
-	 *  No sort: Set up the iterators for range and identifiers
-	 */
-	if (m_range_it != m_range_end) {
-	    m_id_fac_it  = (*m_range_it).factory_begin();
-	    m_id_fac_end = (*m_range_it).factory_end();
-	    if(m_id_fac_it != m_id_fac_end) {
-		// Set id
-		m_id = *m_id_fac_it;
-	    }
-	}
+    if (m_range_it != m_range_end) {
+      m_id_fac_it  = (*m_range_it).factory_begin();
+      m_id_fac_end = (*m_range_it).factory_end();
+      if(m_id_fac_it != m_id_fac_end) {
+        // Set id
+        m_id = *m_id_fac_it;
+      }
     }
 } 
 
  
 MultiRange::const_identifier_factory::~const_identifier_factory ()
 {
-    // remove id buffer in multirange if no iterator is still using it
-    if (m_sort && m_multirange) {
-	if(m_multirange->m_it_count) {
-	    m_multirange->m_it_count--;
-	}
-	else {
-	    std::cout << "MultiRange::const_identifier_factory::~const_identifier_factory: it_count ALREADY 0" 
-		      << std::endl;
-	}
-//  	std::cout << "MultiRange::const_identifier_factory::~const_identifier_factory: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-	if (!m_multirange->m_it_count) {
-	    m_multirange->m_ids.clear();
-//  	std::cout << "MultiRange::const_identifier_factory::const_~identifier_factory: cleared id buffer" 
-//  		  << std::endl;
-	}    
-    }
 }
 
  
@@ -2952,7 +2736,6 @@ MultiRange::const_identifier_factory& MultiRange::const_identifier_factory::oper
 { 
   if (this != &other) {
     m_id 		= other.m_id;
-    m_sort 		= other.m_sort;
     m_id_fac_it  	= other.m_id_fac_it;
     m_id_fac_end 	= other.m_id_fac_end;
     m_range_it 		= other.m_range_it;
@@ -2960,14 +2743,6 @@ MultiRange::const_identifier_factory& MultiRange::const_identifier_factory::oper
     m_id_vec_it 	= other.m_id_vec_it;
     m_id_vec_end 	= other.m_id_vec_end;
     m_multirange	= other.m_multirange;
-    // Must increment number of iterators looking at the id buffer in
-    // the multirange
-    if (m_sort && m_multirange) {
-	m_multirange->m_it_count++;
-//  	std::cout << "MultiRange::const_identifier_factory::operator =: it_count" 
-//  		  << m_multirange->m_it_count 
-//  		  << std::endl;
-    }
   } 
   return (*this); 
 } 
@@ -2977,7 +2752,6 @@ MultiRange::const_identifier_factory& MultiRange::const_identifier_factory::oper
 { 
   if (this != &other) {
     m_id 		= std::move(other.m_id);
-    m_sort 		= other.m_sort;
     m_id_fac_it  	= std::move(other.m_id_fac_it);
     m_id_fac_end 	= std::move(other.m_id_fac_end);
     m_range_it 		= other.m_range_it;
@@ -2996,36 +2770,21 @@ void MultiRange::const_identifier_factory::operator ++ ()
  
     if (m_id.fields () == 0) return; 
 
-    /** 
-     *  Advance iterators depending upon whether or not we have sorted.
-     */
-
-    if (m_sort) {
-	m_id.clear();
-	if (m_id_vec_it != m_id_vec_end) {
-	    ++m_id_vec_it;
-	    if (m_id_vec_it != m_id_vec_end) {
-		m_id = *m_id_vec_it;
-	    }
-	}
-    }
-    else {
-	m_id.clear();
-	if (m_range_it != m_range_end) {
-	    if (m_id_fac_it != m_id_fac_end) {
-		++m_id_fac_it;
-	    }
-	    if (m_id_fac_it == m_id_fac_end) {
-		++m_range_it;
-		if (m_range_it != m_range_end) {
-		    m_id_fac_it  = (*m_range_it).factory_begin();
-		    m_id_fac_end = (*m_range_it).factory_end();
-		}
-	    }
-	    if (m_id_fac_it != m_id_fac_end) {
-		m_id = *m_id_fac_it;
-	    }
-	}
+    m_id.clear();
+    if (m_range_it != m_range_end) {
+      if (m_id_fac_it != m_id_fac_end) {
+        ++m_id_fac_it;
+      }
+      if (m_id_fac_it == m_id_fac_end) {
+        ++m_range_it;
+        if (m_range_it != m_range_end) {
+          m_id_fac_it  = (*m_range_it).factory_begin();
+          m_id_fac_end = (*m_range_it).factory_end();
+        }
+      }
+      if (m_id_fac_it != m_id_fac_end) {
+        m_id = *m_id_fac_it;
+      }
     }
 } 
  
-- 
GitLab


From 8748a3e6b7047ded51c44f8b58e281a21d923e87 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 23 Feb 2019 16:17:04 +0100
Subject: [PATCH 163/404] LArIdentifier: Remove need for MT-unsafe
 set_do_checks().

set_do_checks() is not thread-safe when used on a const object.
For the methods in LArOnlineID that can do checking, add versions that
take an extra bool argument to force checking either on or off.
---
 .../LArIdentifier/LArIdentifier/LArOnlineID.h | 21 +-----
 .../LArIdentifier/LArOnlineID_Base.h          | 29 ++++++--
 .../LArIdentifier/src/LArOnlineID_Base.cxx    | 66 +++++++++++++++----
 .../LArIdentifier/test/test_laronlineid.cxx   |  8 +--
 4 files changed, 82 insertions(+), 42 deletions(-)

diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID.h
index 0cb31483e65..177f0ff3fbd 100755
--- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID.h
+++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID.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 LARONLINEID_H
@@ -280,13 +280,6 @@ inline HWIdentifier LArOnlineID::calib_module_Id(int barrel_ec, int pos_neg,
   m_side_impl.pack       (pos_neg          , result);
   m_feedthrough_impl.pack(feedthrough      , result);
   m_slot_impl.pack       (slot             , result); 
-  /* Do checks */
-  /*
-  if(m_do_checks) 
-  {
-  calib_module_Id_checks ( barrel_ec, pos_neg, feedthrough, slot );
-  }
-  */
   return result;
 }
 
@@ -338,10 +331,6 @@ inline HWIdentifier LArOnlineID::calib_channel_Id( int barrel_ec, int pos_neg, i
   m_slot_impl.pack           (slot                 , result);
   m_channel_in_slot_impl.pack(channel              , result);
 
-  /* Do checks */
-  if(m_do_checks) {
-    //channel_Id_checks( barrel_ec, pos_neg, feedthrough, slot, channel );
-  }
   return result;
 }
 
@@ -355,10 +344,6 @@ inline HWIdentifier LArOnlineID::calib_channel_Id(const HWIdentifier feedthrough
   m_slot_impl.pack            (slot  , result);
   m_channel_in_slot_impl.pack (channel, result);
 
-  /* Do checks */
-  if(m_do_checks) {
-    //channel_Id_checks( feedthroughId, slot, channel );
-  }
   return result;
 }
 
@@ -370,10 +355,6 @@ inline HWIdentifier LArOnlineID::calib_channel_Id(const HWIdentifier febId, int
   m_channel_in_slot_impl.reset(result);
   m_channel_in_slot_impl.pack (channel, result);
 
-  /* Do checks */
-  if(m_do_checks) {
-    //channel_Id_checks( febId, channel );
-  }
   return result;
 }
 inline HWIdentifier LArOnlineID::calib_channel_Id(IdentifierHash channelHashId) const
diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h
index 457d2ba52a9..bbec67b295d 100755
--- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.h
+++ b/LArCalorimeter/LArIdentifier/LArIdentifier/LArOnlineID_Base.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 LARONLINEID_BASE_H
@@ -122,7 +122,9 @@ class LArOnlineID_Base : public AtlasDetectorID
   /**
    * @brief Create a feedthrough identifier from fields 
    */
-  HWIdentifier feedthrough_Id( int barrel_ec, int pos_neg, int feedthrough ) const;
+  HWIdentifier feedthrough_Id( int barrel_ec, int pos_neg, int feedthrough) const;
+  HWIdentifier feedthrough_Id( int barrel_ec, int pos_neg, int feedthrough,
+                               bool checks) const;
   
   /**
    * @brief Create a feedthrough identifier from hash_id 
@@ -147,7 +149,12 @@ class LArOnlineID_Base : public AtlasDetectorID
   HWIdentifier feb_Id(int barrel_ec,
 		      int pos_neg,
 		      int feedthrough, 
-		      int slot ) const;
+		      int slot) const;
+  HWIdentifier feb_Id(int barrel_ec,
+		      int pos_neg,
+		      int feedthrough, 
+		      int slot,
+                      bool checks) const;
   /**
    * @brief create feb identifier from hash id 
    */
@@ -173,7 +180,13 @@ class LArOnlineID_Base : public AtlasDetectorID
 			  int pos_neg,
 			  int feedthrough, 
 			  int slot,
-			  int channel ) const;
+			  int channel) const;
+  HWIdentifier channel_Id(int barrel_ec,
+			  int pos_neg,
+			  int feedthrough, 
+			  int slot,
+			  int channel,
+                          bool checks) const;
   /**
    * @brief Create channel identifiers from hash id 
    */
@@ -206,11 +219,15 @@ class LArOnlineID_Base : public AtlasDetectorID
   /**
    * @brief Define a channel identifier from a feedthrough identifier
    */
-  HWIdentifier channel_Id(const HWIdentifier feedthroughId, int slot, int channel ) const;
+  HWIdentifier channel_Id(const HWIdentifier feedthroughId, int slot, int channel) const;
+  HWIdentifier channel_Id(const HWIdentifier feedthroughId, int slot, int channel,
+                          bool checks) const;
   /**
    * @brief Define a channel identifier from a feb identifier
    */
-  HWIdentifier channel_Id(const HWIdentifier febId, int channel ) const;
+  HWIdentifier channel_Id(const HWIdentifier febId, int channel) const;
+  HWIdentifier channel_Id(const HWIdentifier febId, int channel,
+                          bool checks) const;
 
 
   /**
diff --git a/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx b/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx
index 2720a17375e..384974915bd 100755
--- a/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx
+++ b/LArCalorimeter/LArIdentifier/src/LArOnlineID_Base.cxx
@@ -1394,7 +1394,9 @@ bool LArOnlineID_Base::isValidId(const HWIdentifier id) const {
 							   
 
 
-HWIdentifier LArOnlineID_Base::feedthrough_Id (int barrel_ec, int pos_neg, int feedthrough ) const 
+HWIdentifier
+LArOnlineID_Base::feedthrough_Id (int barrel_ec, int pos_neg, int feedthrough,
+                                  bool checks) const 
 {
   HWIdentifier result(0);
 
@@ -1408,12 +1410,18 @@ HWIdentifier LArOnlineID_Base::feedthrough_Id (int barrel_ec, int pos_neg, int f
 	m_slar_impl.pack       (1                , result);
 
   /* Do checks */
-  if(m_do_checks) 
+  if(checks) 
     {
       feedthrough_Id_checks ( barrel_ec, pos_neg, feedthrough );
     }
   return result;
 }
+HWIdentifier
+LArOnlineID_Base::feedthrough_Id (int barrel_ec, int pos_neg, int feedthrough) const
+{
+  return feedthrough_Id (barrel_ec, pos_neg, feedthrough, do_checks());
+}
+
 
 HWIdentifier LArOnlineID_Base::feedthrough_Id(IdentifierHash feedthroughHashId) const
 /*=============================================================================== */
@@ -1456,8 +1464,10 @@ std::vector<HWIdentifier>::const_iterator LArOnlineID_Base::feedthrough_end(void
 /* FEB id */
 /*========*/
 
-HWIdentifier LArOnlineID_Base::feb_Id(int barrel_ec, int pos_neg, 
-					int feedthrough, int slot ) const 
+HWIdentifier
+LArOnlineID_Base::feb_Id(int barrel_ec, int pos_neg, 
+                         int feedthrough, int slot,
+                         bool checks ) const 
 /*==================================================================== */
 {
   HWIdentifier result(0);
@@ -1473,12 +1483,19 @@ HWIdentifier LArOnlineID_Base::feb_Id(int barrel_ec, int pos_neg,
     m_slar_impl.pack       (1                , result);
 
   /* Do checks */
-  if(m_do_checks) {
+  if(checks) {
     feb_Id_checks ( barrel_ec, pos_neg, feedthrough, slot );
   }
   return result;
 }
 
+HWIdentifier
+LArOnlineID_Base::feb_Id(int barrel_ec, int pos_neg, 
+                         int feedthrough, int slot) const
+{
+  return feb_Id (barrel_ec, pos_neg, feedthrough, slot, do_checks());
+}
+
 HWIdentifier LArOnlineID_Base::feb_Id(const HWIdentifier feedthroughId , int slot) const
 /*==================================================================================== */
 {
@@ -1538,8 +1555,10 @@ IdentifierHash LArOnlineID_Base::feb_Hash_binary_search (HWIdentifier febId) con
     return (0);
 }
 
-HWIdentifier LArOnlineID_Base::channel_Id( int barrel_ec, int pos_neg, int feedthrough, 
-					     int slot,      int channel ) const 
+HWIdentifier
+LArOnlineID_Base::channel_Id( int barrel_ec, int pos_neg, int feedthrough, 
+                              int slot,      int channel,
+                              bool checks) const 
 /*============================================================================== */
 {  
   HWIdentifier result(0);
@@ -1555,12 +1574,19 @@ HWIdentifier LArOnlineID_Base::channel_Id( int barrel_ec, int pos_neg, int feedt
      m_slar_impl.pack           (1                    , result);
 
   /* Do checks */
-  if(m_do_checks) {
+  if(checks) {
     channel_Id_checks( barrel_ec, pos_neg, feedthrough, slot, channel );
   }
   return result;
 }
 
+HWIdentifier
+LArOnlineID_Base::channel_Id( int barrel_ec, int pos_neg, int feedthrough, 
+                              int slot,      int channel) const
+{
+  return channel_Id (barrel_ec, pos_neg, feedthrough, slot, channel,
+                     do_checks());
+}
 
 HWIdentifier LArOnlineID_Base::channel_Id(IdentifierHash channelHashId) const
 /*===================================================================*/
@@ -1569,7 +1595,9 @@ HWIdentifier LArOnlineID_Base::channel_Id(IdentifierHash channelHashId) const
 }
 
 
-HWIdentifier LArOnlineID_Base::channel_Id(const HWIdentifier feedthroughId,int slot,int channel) const 
+HWIdentifier
+LArOnlineID_Base::channel_Id(const HWIdentifier feedthroughId,int slot,int channel,
+                             bool checks) const 
 /*==================================================================================================== */
 {  
   HWIdentifier result(feedthroughId);
@@ -1582,13 +1610,21 @@ HWIdentifier LArOnlineID_Base::channel_Id(const HWIdentifier feedthroughId,int s
     m_slar_impl.pack            (1  , result);
 
   /* Do checks */
-  if(m_do_checks) {
+  if(checks) {
       channel_Id_checks( feedthroughId, slot, channel );
   }
   return result;
 }
 
-HWIdentifier LArOnlineID_Base::channel_Id(const HWIdentifier febId, int channel) const 
+HWIdentifier
+LArOnlineID_Base::channel_Id(const HWIdentifier feedthroughId,int slot,int channel) const
+{
+  return channel_Id (feedthroughId, slot, channel, do_checks());
+}
+
+HWIdentifier
+LArOnlineID_Base::channel_Id(const HWIdentifier febId, int channel,
+                             bool checks) const 
 /*======================================================================================= */
 {  
   HWIdentifier result(febId);
@@ -1599,12 +1635,18 @@ HWIdentifier LArOnlineID_Base::channel_Id(const HWIdentifier febId, int channel)
 	m_slar_impl.pack (1, result);
 
   /* Do checks */
-  if(m_do_checks) {
+  if(checks) {
     channel_Id_checks( febId, channel );
   }
   return result;
 }
 
+HWIdentifier
+LArOnlineID_Base::channel_Id(const HWIdentifier febId, int channel) const
+{
+  return channel_Id (febId, channel, do_checks());
+}
+
 //----------------------------------------------------------------------------
 IdentifierHash LArOnlineID_Base::channel_Hash (HWIdentifier channelId) const
 {
diff --git a/LArCalorimeter/LArIdentifier/test/test_laronlineid.cxx b/LArCalorimeter/LArIdentifier/test/test_laronlineid.cxx
index 68719095a08..7adcac87fe3 100755
--- a/LArCalorimeter/LArIdentifier/test/test_laronlineid.cxx
+++ b/LArCalorimeter/LArIdentifier/test/test_laronlineid.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 "IdDictParser/IdDictParser.h"  
@@ -35,10 +35,10 @@ static void check_lar_online_id_decoding(IdDictMgr& idd)
   }
 
   const LArOnlineID* p_laronline_id = &laronline_id;
-  bool verif = p_laronline_id->do_checks();
+  bool verif = laronline_id.do_checks();
   std::cout << "[TEST_LARONLINE] [1] Do_check verif0 = " << verif << std::endl;
-  p_laronline_id->set_do_checks(true);
-  verif = p_laronline_id->do_checks();
+  laronline_id.set_do_checks(true);
+  verif = laronline_id.do_checks();
   std::cout << "[TEST_LARONLINE] [1] Do_Check verif1 = " << verif << std::endl;
   std::string l_version = laronline_id.dictionaryVersion();
   l_version = "fullAtlas";
-- 
GitLab


From 06b20d63acc361a4d380388cea47d3a340efc54a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 1 Mar 2019 15:26:39 +0100
Subject: [PATCH 164/404] TileGeoG4Calib:  Remove calls to MT-unsafe
 set_do_checks.

Remove calls to MT-unsafe set_do_checks.
---
 .../TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD2.cc         | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD2.cc b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD2.cc
index 5e3e1f26c05..2c53a7118f0 100644
--- a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD2.cc
+++ b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD2.cc
@@ -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
 */
 
 /////////////////////////////////////////////////////////////////////////
@@ -1096,17 +1096,14 @@ void TileGeoG4CalibSD::DefaultHitIDCalculatorTB(int sample, int region, int eta,
 //-----------------------------------------------------------------------------------
 //DM Hit ID MAKER
 Identifier TileGeoG4CalibSD::DM_ID_Maker(int subDet, int nType, int nSample, int nRegion, int nTower, int nModule) {
-  G4bool doo_checks = m_caloDM_ID->do_checks();
   Identifier caloDMID;
   try {
-    m_caloDM_ID->set_do_checks(true);
-    caloDMID = m_caloDM_ID->zone_id(subDet, nType, nSample, nRegion, nTower, nModule);
+    caloDMID = m_caloDM_ID->zone_id(subDet, nType, nSample, nRegion, nTower, nModule, true);
   } catch (const CaloID_Exception & CalEx) {
     DebugDMCellIDFields(nSample);
     G4cout << "ERROR: M_ID_Maker() - WRONG ID -> " << CalEx.message() << G4endl;
   }
 
-  m_caloDM_ID->set_do_checks(doo_checks);
   return caloDMID;
 }
 
-- 
GitLab


From fc050e5391f816469c794ae4b0cbd15df692d586 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 1 Mar 2019 15:27:00 +0100
Subject: [PATCH 165/404] TileDetDescr: Explicit do_checks flag.

Allow passing an explicit do_checks flag to TileDetDescrManager::create_elements(),
removing need for a MT-unsafe call to set_do_checks().
---
 .../TileDetDescr/TileDetDescr/TileDetDescrManager.h  |  3 ++-
 .../TileDetDescr/src/TileDetDescrManager.cxx         | 12 ++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/TileCalorimeter/TileDetDescr/TileDetDescr/TileDetDescrManager.h b/TileCalorimeter/TileDetDescr/TileDetDescr/TileDetDescrManager.h
index b4275a44e9a..3fe94129f3d 100755
--- a/TileCalorimeter/TileDetDescr/TileDetDescr/TileDetDescrManager.h
+++ b/TileCalorimeter/TileDetDescr/TileDetDescr/TileDetDescrManager.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 TileDetDescrManager_h
@@ -176,6 +176,7 @@ class TileDetDescrManager : public GeoVDetectorManager
   
   // Create elements  
   void create_elements();
+  void create_elements(bool checks);
 
   //  Insertion
   void add(TileDetDescrRegion* region);
diff --git a/TileCalorimeter/TileDetDescr/src/TileDetDescrManager.cxx b/TileCalorimeter/TileDetDescr/src/TileDetDescrManager.cxx
index d337f3b0b09..8fdc6ef949c 100755
--- a/TileCalorimeter/TileDetDescr/src/TileDetDescrManager.cxx
+++ b/TileCalorimeter/TileDetDescr/src/TileDetDescrManager.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 "TileDetDescr/TileDetDescrManager.h"
@@ -137,6 +137,10 @@ void TileDetDescrManager::print() const
 }
 
 void TileDetDescrManager::create_elements()
+{
+  create_elements (m_tile_id->do_checks());
+}
+void TileDetDescrManager::create_elements(bool checks)
 {
   MLOG(INFO) << "Entering create_elements()" << endmsg;
 
@@ -336,7 +340,7 @@ void TileDetDescrManager::create_elements()
       CaloDetDescriptor* modDescr;
       
       try {
-        Identifier id = m_tile_id->module_id(section,side,module);
+        Identifier id = m_tile_id->module_id(section,side,module, checks);
         IdentifierHash idhash;
         /* int result = */ m_tile_id->get_hash(id,idhash,&module_context);
         modDescr = new CaloDetDescriptor(id,(AtlasDetectorID *)m_tile_id,m_cell_id);
@@ -383,7 +387,7 @@ void TileDetDescrManager::create_elements()
             int tower = (int)((eta + 0.01) * 10); // tower number in 0.1 granularity
 
             try {
-              Identifier id = m_tile_id->cell_id(section,side,module,tower,sample);
+              Identifier id = m_tile_id->cell_id(section,side,module,tower,sample,checks);
               IdentifierHash idhash;
               /* int result = */ m_tile_id->get_hash(id,idhash,&cell_context);
 
@@ -452,7 +456,7 @@ void TileDetDescrManager::create_elements()
               
 	      // Temporary solution for cell volumes
 	      if(section == TileID::BARREL && side == -1 && ieta == 0 && sample == 2)
-                ++volumeIndex; // skip D0 in negagive side
+                ++volumeIndex; // skip D0 in negative side
 	      if(section == TileID::BARREL)
 		elt->set_volume(vBarrelCells[volumeIndex++]);
 	      else if(section == TileID::EXTBAR)
-- 
GitLab


From ab55c372731a5538404d71051b1cfa6b2e0f6f6e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 1 Mar 2019 15:27:35 +0100
Subject: [PATCH 166/404] InDetGlobalMonitoring: Remove calls to set_do_checks.

Remove MT-unsafe calls to set_do_checks; instead, pass the flag expicitly
to helper methods.
---
 .../src/InDetGlobalNoiseOccupancyMonTool.cxx  | 26 +++++++------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx
index 929a0b5dd4e..59b7146d541 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx
@@ -1143,20 +1143,17 @@ int InDetGlobalNoiseOccupancyMonTool::GetSCTCounts(int barrel_ec_sel, bool do_ch
     int barrel_ec = barrel_ec_sel;
     int nStripsCntr = 0;
 
-    // IDhelper do checks on components.  Like strips.
-    m_sctID->set_do_checks(do_checks_flg);
-
     Identifier rdoId;
     int layer_disk_max = 0;
     if(barrel_ec_sel == 0)
     {
 	layer_disk_max = 3;
-	rdoId= m_sctID->strip_id(barrel_ec, 0, 0, -6, 0, 0); // start point for barrel
+	rdoId= m_sctID->strip_id(barrel_ec, 0, 0, -6, 0, 0, do_checks_flg); // start point for barrel
     }
     else if(barrel_ec_sel == -2 || barrel_ec_sel == 2)
     {
 	layer_disk_max = 8;
-	rdoId = m_sctID->strip_id(barrel_ec, 0, 0, 0, 0, 0); // start point for ec
+	rdoId = m_sctID->strip_id(barrel_ec, 0, 0, 0, 0, 0, do_checks_flg); // start point for ec
     }
 
     for(int layerItr = 0 ; layerItr <= layer_disk_max ; layerItr++) // 3 layer_disk for Barrel
@@ -1171,7 +1168,7 @@ int InDetGlobalNoiseOccupancyMonTool::GetSCTCounts(int barrel_ec_sel, bool do_ch
 		    int strip_max_m = m_sctID->strip_max(rdoId);
 		    for(int stripItr = 0 ; stripItr <= strip_max_m ; stripItr++) // strips
 		    {
-			rdoId = m_sctID->strip_id(barrel_ec, layerItr, phiItr, etaItr, sideItr, stripItr);
+			rdoId = m_sctID->strip_id(barrel_ec, layerItr, phiItr, etaItr, sideItr, stripItr, do_checks_flg);
 			nStripsCntr++;
 		    }
 		}
@@ -1180,7 +1177,7 @@ int InDetGlobalNoiseOccupancyMonTool::GetSCTCounts(int barrel_ec_sel, bool do_ch
     }
   
     // Start point for the positive part.  Good for barrel and ec.
-    rdoId = m_sctID->strip_id(barrel_ec, 0, 0, 1, 0, 0);
+    rdoId = m_sctID->strip_id(barrel_ec, 0, 0, 1, 0, 0, do_checks_flg);
     for(int layerItr = 0 ; layerItr <= layer_disk_max ; layerItr++) // 3 layer_disk for Barrel
     {
 	for(int phiItr = 0 ; phiItr <= m_sctID->phi_module_max(rdoId) ; phiItr++) // phi modules
@@ -1193,7 +1190,7 @@ int InDetGlobalNoiseOccupancyMonTool::GetSCTCounts(int barrel_ec_sel, bool do_ch
 		    int strip_max_m = m_sctID->strip_max(rdoId);
 		    for(int stripItr = 0 ; stripItr <= strip_max_m ; stripItr++) // strips
 		    {
-			rdoId = m_sctID->strip_id(barrel_ec, layerItr, phiItr, etaItr, sideItr, stripItr);
+			rdoId = m_sctID->strip_id(barrel_ec, layerItr, phiItr, etaItr, sideItr, stripItr, do_checks_flg);
 			//m_sctID->print(rdoId);
 			nStripsCntr++;
 		    }
@@ -1228,27 +1225,24 @@ int InDetGlobalNoiseOccupancyMonTool::GetPixelCounts(int barrel_ec_sel, bool do_
     int barrel_ec = barrel_ec_sel;
     int nPixelCntr = 0;
 
-    // IDhelper do checks on components.  Like strips.
-    m_pixelID->set_do_checks(do_checks_flg);
-
     Identifier rdoId;
     int layer_disk_max = 0;
     if(barrel_ec_sel == 0)
     {
 	layer_disk_max = 2;
-	rdoId= m_pixelID->pixel_id(barrel_ec, 0, 0, 0, 0, 0); // start point for barrel
+	rdoId= m_pixelID->pixel_id(barrel_ec, 0, 0, 0, 0, 0, do_checks_flg); // start point for barrel
     }
     else if(barrel_ec_sel == -2 || barrel_ec_sel == 2)
     {
 	layer_disk_max = 2;
-	rdoId = m_pixelID->pixel_id(barrel_ec, 0, 0, 0, 0, 0); // start point for ec
+	rdoId = m_pixelID->pixel_id(barrel_ec, 0, 0, 0, 0, 0, do_checks_flg); // start point for ec
     }
 
     for(int layerItr = 0 ; layerItr <= layer_disk_max ; layerItr++) // 3 layer_disk for Barrel
     {
-	int eta_module_min = m_pixelID->eta_module_min( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0) );
-	int phi_module_max = m_pixelID->phi_module_max( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0) );
-	int eta_module_max = m_pixelID->eta_module_max( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0) );
+       int eta_module_min = m_pixelID->eta_module_min( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0, do_checks_flg) );
+	int phi_module_max = m_pixelID->phi_module_max( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0, do_checks_flg) );
+	int eta_module_max = m_pixelID->eta_module_max( m_pixelID->pixel_id(barrel_ec, layerItr, 0, 0, 0, 0, do_checks_flg) );
 	for(int phiItr = 0 ; phiItr <= phi_module_max ; phiItr++) // phi modules
 	{
 	    for(int etaItr = eta_module_min; etaItr <= eta_module_max; etaItr++) // eta modules
-- 
GitLab


From 6a20a896b4d53fc72beebcd5c286e5dc73b84995 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 2 Mar 2019 22:06:43 +0100
Subject: [PATCH 167/404] AthenaPoolTest: Update reference files.

Update reference files.
---
 AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt b/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt
index 74c8699ad22..ad3606cf6f4 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt
@@ -75,7 +75,7 @@ function (athenapooltest_run_test testName jo pattern)
                   @ONLY )
   atlas_add_test( ${testName}
                   SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/athenapooltest_${testName}.sh
-                  ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-04"
+                  ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-05"
                   POST_EXEC_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/test/post_check_with_select.sh ${testName} ${pattern}"
                   PROPERTIES TIMEOUT 900
                    )
-- 
GitLab


From f88740e4cf3fc21fe2ff24f50dd1ef96078e33cb Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Sun, 3 Mar 2019 15:28:31 +0100
Subject: [PATCH 168/404] Turn off muon isolation in cosmic MuonRecRTT test

Temporary solution until I can figure out why it doens't work.
---
 .../MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_cosmic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_cosmic.sh b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_cosmic.sh
index 4fb827732a3..d3e499f22a6 100755
--- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_cosmic.sh
+++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonRecRTT/test/test_muonrecrtt_cosmic.sh
@@ -12,4 +12,4 @@ set -x
 
 echo "List of files = " ${ArtInFile}
 
-Reco_tf.py --maxEvents=9000 --conditionsTag RAWtoESD:CONDBR2-BLKPA-2017-12 --geometryVersion ATLAS-R2-2016-01-00-01 --inputBSFile=${ArtInFile} --outputAODFile=MuonCosmic_Reco.AOD.pool.root --preExec 'from RecExConfig.RecFlags  import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup' --postExec 'r2e:topSequence.BeamBackgroundFiller.Enable = False'
+Reco_tf.py --maxEvents=9000 --conditionsTag RAWtoESD:CONDBR2-BLKPA-2017-12 --geometryVersion ATLAS-R2-2016-01-00-01 --inputBSFile=${ArtInFile} --outputAODFile=MuonCosmic_Reco.AOD.pool.root --preExec 'from RecExConfig.RecFlags  import rec; rec.doTrigger=False; import MuonCombinedRecExample.MuonCombinedRecOnlySetup;from MuonRecExample.MuonRecFlags import muonRecFlags; muonRecFlags.doMuonIso.set_Value_and_Lock(False)' --postExec 'r2e:topSequence.BeamBackgroundFiller.Enable = False'
-- 
GitLab


From 36683427e973c8df7d0742c01005aea650988141 Mon Sep 17 00:00:00 2001
From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>
Date: Sun, 3 Mar 2019 15:55:15 +0100
Subject: [PATCH 169/404] Remove hypo tools decoding and unnecessary function
 argument

---
 .../python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py      | 6 +++---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py | 7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index b9174f9fd6e..b4e212246bc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -74,14 +74,14 @@ def generateMenu( flags ):
 
     _log.info('Obtained Menu Chain objects')
 
-    # pass all menuChain to CF builder    
-    mainSequenceName = 'HLTAllSteps'
+    # pass all menuChain to CF builder
     useReworked = True
 
     if useReworked:
-        menuAcc = generateDecisionTree(mainSequenceName, menuChains, allChainDicts)
+        menuAcc = generateDecisionTree(menuChains, allChainDicts)
     else:
         menuAcc = ComponentAccumulator()
+        mainSequenceName = 'HLTAllSteps'
         menuAcc.addSequence( seqAND(mainSequenceName) )
         chainsAcc = generateDecisionTreeOld(menuAcc.getSequence(mainSequenceName), menuChains, allChainDicts)
         menuAcc.merge(chainsAcc)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index 1051edd739f..d3a7a8d3e75 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -454,23 +454,22 @@ def connectStepToFilter(chainStep, filter):
         sequence.connectToFilter(output)
 
 
-def generateDecisionTree(mainSequenceName, chains, allChainDicts):
+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
 
-    log.debug("Run decisionTree_From_Chains on %s", mainSequenceName)
-
     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:
-        chain.decodeHypoToolConfs(allChainDicts)
         for stepNumber, chainStep in enumerate(chain.steps):
             chainName = chainStep.name.split('_')[0]
             chainStepsMatrix[stepNumber][chainName].append(chain)
-- 
GitLab


From 0b0dad82aea04a1f93f18d245dc59e3e6f811f2a Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Mon, 4 Mar 2019 09:14:05 +0100
Subject: [PATCH 170/404] Updated all projects to use atlasexternals-2.0.25.

---
 Projects/AnalysisBase/externals.txt   | 2 +-
 Projects/AnalysisTop/externals.txt    | 2 +-
 Projects/AthDataQuality/externals.txt | 2 +-
 Projects/AthSimulation/externals.txt  | 2 +-
 Projects/Athena/externals.txt         | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index ead962ca27d..4454336bc6a 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.24
+AnalysisBaseExternalsVersion = 2.0.25
diff --git a/Projects/AnalysisTop/externals.txt b/Projects/AnalysisTop/externals.txt
index 33393f68871..397ba201f2a 100644
--- a/Projects/AnalysisTop/externals.txt
+++ b/Projects/AnalysisTop/externals.txt
@@ -1,4 +1,4 @@
 # Versions of the various externals to build before starting the build of
 # this project, when doing a full stack nightly build.
 
-AnalysisBaseExternalsVersion = 2.0.24
+AnalysisBaseExternalsVersion = 2.0.25
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index c4562fadd94..fa8d37a6e03 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.24
+AtlasExternalsVersion = 2.0.25
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 7a965a681ea..28b4bfa25b0 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.24
+AthSimulationExternalsVersion = 2.0.25
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index 6344db7470d..d03228bfb61 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.24
+AthenaExternalsVersion = 2.0.25
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v31r0.002
-- 
GitLab


From a910c73cfbebef0e7cf66d306c472f0a21955f0f Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Mon, 4 Mar 2019 09:48:21 +0100
Subject: [PATCH 171/404] Added cx_Oracle as a dependency to each package that
 directly uses it.

There are a lot more python dependencies that we should add as well,
but for now this should do...
---
 Database/AthenaPOOL/AtlasCollectionTools/CMakeLists.txt       | 3 +++
 Database/CoolRunQuery/CMakeLists.txt                          | 4 +++-
 Event/EventOverlay/EventOverlayJobTransforms/CMakeLists.txt   | 3 +++
 .../InDetExample/InDetBeamSpotExample/CMakeLists.txt          | 3 +++
 LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt   | 3 +++
 .../MuonAlignError/MuonAlignErrorTool/CMakeLists.txt          | 1 +
 .../MuonCalib/MuonCalibDbOperations/CMakeLists.txt            | 3 +--
 TileCalorimeter/TileCalib/TileCalibBlobPython/CMakeLists.txt  | 3 +++
 Tools/PyJobTransforms/CMakeLists.txt                          | 1 +
 Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt        | 1 +
 Trigger/TrigConfiguration/TrigDbHltUpload/CMakeLists.txt      | 1 +
 Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt       | 1 +
 Trigger/TrigMonitoring/TrigJetMonitoring/CMakeLists.txt       | 1 +
 Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt             | 1 +
 14 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/Database/AthenaPOOL/AtlasCollectionTools/CMakeLists.txt b/Database/AthenaPOOL/AtlasCollectionTools/CMakeLists.txt
index 1d3ec8d5be6..5a90092bfdd 100644
--- a/Database/AthenaPOOL/AtlasCollectionTools/CMakeLists.txt
+++ b/Database/AthenaPOOL/AtlasCollectionTools/CMakeLists.txt
@@ -14,6 +14,9 @@ atlas_depends_on_subdirs( PRIVATE
                           Database/APR/StorageSvc
                           TestPolicy )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Component(s) in the package:
 atlas_add_library( AtlasCollectionTools
                    src/LumiMetaHandler.cxx
diff --git a/Database/CoolRunQuery/CMakeLists.txt b/Database/CoolRunQuery/CMakeLists.txt
index 01dcbe77d5a..994f19576bb 100644
--- a/Database/CoolRunQuery/CMakeLists.txt
+++ b/Database/CoolRunQuery/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 722392 2016-02-08 12:13:08Z krasznaa $
 #
 # CMake description for the package.
 #
@@ -6,6 +5,9 @@
 # Declare the package's name:
 atlas_subdir( CoolRunQuery )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Declare the python modules of the package:
 atlas_install_python_modules( python/*.py python/html python/selector
    python/utils python/output )
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/CMakeLists.txt b/Event/EventOverlay/EventOverlayJobTransforms/CMakeLists.txt
index 7fcde34640c..ea881ca5c06 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/CMakeLists.txt
+++ b/Event/EventOverlay/EventOverlayJobTransforms/CMakeLists.txt
@@ -5,6 +5,9 @@
 # Declare the package name:
 atlas_subdir( EventOverlayJobTransforms )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Tools/PyJobTransforms
diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/CMakeLists.txt b/InnerDetector/InDetExample/InDetBeamSpotExample/CMakeLists.txt
index 0fa19bd6d89..c5973df0112 100644
--- a/InnerDetector/InDetExample/InDetBeamSpotExample/CMakeLists.txt
+++ b/InnerDetector/InDetExample/InDetBeamSpotExample/CMakeLists.txt
@@ -5,6 +5,9 @@
 # Declare the package name:
 atlas_subdir( InDetBeamSpotExample )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt b/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt
index b119036e72b..a59ea727020 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt
@@ -9,6 +9,9 @@ atlas_subdir( LArCalibProcessing )
 atlas_depends_on_subdirs( PRIVATE
                           TestPolicy )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
diff --git a/MuonSpectrometer/MuonAlignment/MuonAlignError/MuonAlignErrorTool/CMakeLists.txt b/MuonSpectrometer/MuonAlignment/MuonAlignError/MuonAlignErrorTool/CMakeLists.txt
index 44ece2d7c24..0727b257a3c 100644
--- a/MuonSpectrometer/MuonAlignment/MuonAlignError/MuonAlignErrorTool/CMakeLists.txt
+++ b/MuonSpectrometer/MuonAlignment/MuonAlignError/MuonAlignErrorTool/CMakeLists.txt
@@ -27,6 +27,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( Eigen )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_component( MuonAlignErrorTool
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/CMakeLists.txt b/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/CMakeLists.txt
index bf01de165d6..63562f078ee 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/CMakeLists.txt
+++ b/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/CMakeLists.txt
@@ -25,8 +25,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
-# tag NEEDS_CORAL_BASE was not recognized in automatic conversion in cmt2cmake
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_library( MuonCalibDbOperationsLib
diff --git a/TileCalorimeter/TileCalib/TileCalibBlobPython/CMakeLists.txt b/TileCalorimeter/TileCalib/TileCalibBlobPython/CMakeLists.txt
index 25b1468e20c..365ea234d0e 100644
--- a/TileCalorimeter/TileCalib/TileCalibBlobPython/CMakeLists.txt
+++ b/TileCalorimeter/TileCalib/TileCalibBlobPython/CMakeLists.txt
@@ -5,6 +5,9 @@
 # Declare the package name:
 atlas_subdir( TileCalibBlobPython )
 
+# Necessary external(s):
+find_package( cx_Oracle )
+
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
diff --git a/Tools/PyJobTransforms/CMakeLists.txt b/Tools/PyJobTransforms/CMakeLists.txt
index e741394ebc9..ac5258b3502 100644
--- a/Tools/PyJobTransforms/CMakeLists.txt
+++ b/Tools/PyJobTransforms/CMakeLists.txt
@@ -7,6 +7,7 @@ atlas_subdir( PyJobTransforms )
 
 # External dependencies:
 find_package( PythonLibs )
+find_package( cx_Oracle )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
index 42ad499a6a2..ef6d1bdca61 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
@@ -31,6 +31,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( COOL COMPONENTS CoolKernel )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread PyROOT )
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_library( TrigConfigSvcLib
diff --git a/Trigger/TrigConfiguration/TrigDbHltUpload/CMakeLists.txt b/Trigger/TrigConfiguration/TrigDbHltUpload/CMakeLists.txt
index 250d914623e..a44aaa2ced1 100644
--- a/Trigger/TrigConfiguration/TrigDbHltUpload/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigDbHltUpload/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( TrigDbHltUpload )
 
 # External dependencies:
 find_package( Oracle )
+find_package( cx_Oracle )
 
 # Install files from the package:
 atlas_install_scripts( share/ConvertHLTSetup_txt2xml.py
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt
index aa0f42dc006..902000fd447 100644
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt
@@ -24,6 +24,7 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_library( TrigHLTMonitoringLib
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigJetMonitoring/CMakeLists.txt
index 137342856d2..61cef9ab561 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/CMakeLists.txt
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/CMakeLists.txt
@@ -22,6 +22,7 @@ atlas_depends_on_subdirs( PUBLIC
 # External dependencies:
 find_package( Boost )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_component( TrigJetMonitoring
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt b/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
index 020069f2440..7aec365fe46 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
@@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PUBLIC
 
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
+find_package( cx_Oracle )
 
 # Component(s) in the package:
 atlas_add_library( L1TopoConfig
-- 
GitLab


From be94a65c02c45846e12ed07b7146504c2f835540 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 10:06:50 +0100
Subject: [PATCH 172/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetSimData package

---
 .../InDetSimData/InDetSimData/ATLAS_CHECK_THREAD_SAFETY          | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..d7ae968f921
--- /dev/null
+++ b/InnerDetector/InDetRawEvent/InDetSimData/InDetSimData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRawEvent/InDetSimData
-- 
GitLab


From f570e20d5f5dd86da6bd49e1d9de796ff48234b6 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 10:12:08 +0100
Subject: [PATCH 173/404] Add ATLAS_CHECK_THREAD_SAFETY to
 InnerDetector/InDetRawEvent/InDetRawData package

---
 .../InDetRawData/InDetRawData/ATLAS_CHECK_THREAD_SAFETY          | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetRawEvent/InDetRawData/InDetRawData/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRawEvent/InDetRawData/InDetRawData/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRawEvent/InDetRawData/InDetRawData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3f33a4d2822
--- /dev/null
+++ b/InnerDetector/InDetRawEvent/InDetRawData/InDetRawData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRawEvent/InDetRawData
-- 
GitLab


From 5d320cb59ee027c03095618f752cb160d425d4cc Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 4 Mar 2019 10:53:14 +0100
Subject: [PATCH 174/404] Thread-safety fixes and enable static checker

- `MonitoredTimer`: Make `stop()` a non-const method to avoid the
  `mutable` member variable.
- Mark a few legacy (serial) athena monitoring source files as non-thread safe.
---
 .../AthenaMonitoring/ATLAS_CHECK_THREAD_SAFETY           | 1 +
 .../AthenaMonitoring/AthenaMonitoring/AthenaMonManager.h | 4 +++-
 .../AthenaMonitoring/ManagedMonitorToolBase.h            | 3 +++
 .../AthenaMonitoring/AthenaMonitoring/MonitoredTimer.h   | 6 +++---
 Control/AthenaMonitoring/src/AthenaMonManager.cxx        | 2 ++
 Control/AthenaMonitoring/src/ManagedMonitorToolBase.cxx  | 2 ++
 Control/AthenaMonitoring/src/MonitoredTimer.cxx          | 9 +++++----
 7 files changed, 19 insertions(+), 8 deletions(-)
 create mode 100644 Control/AthenaMonitoring/AthenaMonitoring/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Control/AthenaMonitoring/AthenaMonitoring/ATLAS_CHECK_THREAD_SAFETY b/Control/AthenaMonitoring/AthenaMonitoring/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..a70125eccc7
--- /dev/null
+++ b/Control/AthenaMonitoring/AthenaMonitoring/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Control/AthenaMonitoring
diff --git a/Control/AthenaMonitoring/AthenaMonitoring/AthenaMonManager.h b/Control/AthenaMonitoring/AthenaMonitoring/AthenaMonManager.h
index 52f71189a3c..12d12e9a590 100755
--- a/Control/AthenaMonitoring/AthenaMonitoring/AthenaMonManager.h
+++ b/Control/AthenaMonitoring/AthenaMonitoring/AthenaMonManager.h
@@ -14,6 +14,9 @@
 #include "xAODEventInfo/EventInfo.h"
 #include "StoreGate/ReadHandleKey.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;    // legacy (serial) DQ monitoring framework
+
 class ISvcLocator;
 class ITHistSvc;
 class ManagedMonitorToolBase;
@@ -27,7 +30,6 @@ class LWHist;
  * configuration variables and organizing the output data.  It provides
  * all the functionality and behaviour of AthenaMon.
  *
- * $Id: AthenaMonManager.h,v 1.21 2009-05-08 09:50:22 sschaetz Exp $
  *
  * @author Michael Wilson, CERN, January 2007
  */
diff --git a/Control/AthenaMonitoring/AthenaMonitoring/ManagedMonitorToolBase.h b/Control/AthenaMonitoring/AthenaMonitoring/ManagedMonitorToolBase.h
index a7450e304b4..f5c2a2be4be 100755
--- a/Control/AthenaMonitoring/AthenaMonitoring/ManagedMonitorToolBase.h
+++ b/Control/AthenaMonitoring/AthenaMonitoring/ManagedMonitorToolBase.h
@@ -57,6 +57,9 @@ class IDQFilterTool;
 #include "AthenaMonitoring/IDQFilterTool.h"
 #include "GaudiKernel/ITHistSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;    // legacy (serial) DQ monitoring framework
+
 /**
  * Provides functionality for users to implement
  * and save histograms, ntuples, and summary data, while allowing a central
diff --git a/Control/AthenaMonitoring/AthenaMonitoring/MonitoredTimer.h b/Control/AthenaMonitoring/AthenaMonitoring/MonitoredTimer.h
index d9c30b7118c..8a739d6df95 100644
--- a/Control/AthenaMonitoring/AthenaMonitoring/MonitoredTimer.h
+++ b/Control/AthenaMonitoring/AthenaMonitoring/MonitoredTimer.h
@@ -30,9 +30,9 @@ namespace Monitored {
     Timer(Timer const&) = delete;
 
     void start();      //<! (re)starts the timer
-    void stop() const; //<! stops the timer
+    void stop();       //<! stops the timer
 
-    operator double() const; //!< duration between start and stop in microseconds
+    operator double() const; //!< duration between start and stop (or current time) in microseconds
 
     const std::vector<double> getVectorRepresentation() const override { return {double(*this)}; }
 
@@ -41,7 +41,7 @@ namespace Monitored {
 
     typedef std::chrono::high_resolution_clock clock_type;
     clock_type::time_point m_startTime;
-    mutable clock_type::time_point m_stopTime;
+    clock_type::time_point m_stopTime;
 
     Timer& operator=(Timer const&) = delete;
   };
diff --git a/Control/AthenaMonitoring/src/AthenaMonManager.cxx b/Control/AthenaMonitoring/src/AthenaMonManager.cxx
index 371be6a1434..ac74febd0c4 100755
--- a/Control/AthenaMonitoring/src/AthenaMonManager.cxx
+++ b/Control/AthenaMonitoring/src/AthenaMonManager.cxx
@@ -34,6 +34,8 @@
 #include <limits.h>
 #include <vector>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;    // legacy (serial) DQ monitoring framework
+
 class AthenaMonManager::Imp {
 public:
     Imp(AthenaMonManager*man,const std::string& name) :  m_theManager(man),
diff --git a/Control/AthenaMonitoring/src/ManagedMonitorToolBase.cxx b/Control/AthenaMonitoring/src/ManagedMonitorToolBase.cxx
index b5f70828d8b..ab73e8a71ae 100755
--- a/Control/AthenaMonitoring/src/ManagedMonitorToolBase.cxx
+++ b/Control/AthenaMonitoring/src/ManagedMonitorToolBase.cxx
@@ -32,6 +32,8 @@
 #include "AthenaMonitoring/IDQFilterTool.h"
 #include "GaudiKernel/ITHistSvc.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;    // legacy (serial) DQ monitoring framework
+
 //____________________________________________________________________
 class ManagedMonitorToolBase::Imp {
 public:
diff --git a/Control/AthenaMonitoring/src/MonitoredTimer.cxx b/Control/AthenaMonitoring/src/MonitoredTimer.cxx
index e5fe2222fe9..76c0d18b36d 100644
--- a/Control/AthenaMonitoring/src/MonitoredTimer.cxx
+++ b/Control/AthenaMonitoring/src/MonitoredTimer.cxx
@@ -21,12 +21,13 @@ namespace Monitored {
 
   void Timer::start() { m_startTime = clock_type::now(); }
 
-  void Timer::stop() const { m_stopTime = clock_type::now(); }
+  void Timer::stop() { m_stopTime = clock_type::now(); }
 
   Timer::operator double() const {
-    if (m_stopTime == clock_type::time_point()) // never stoppped
-      stop();
-    auto d = std::chrono::duration_cast<std::chrono::microseconds>(m_stopTime - m_startTime);
+    clock_type::time_point stopTime = m_stopTime;
+    if (stopTime == clock_type::time_point()) // never stopped
+      stopTime = clock_type::now();
+    auto d = std::chrono::duration_cast<std::chrono::microseconds>(stopTime - m_startTime);
     return d.count();
   }
 
-- 
GitLab


From f98ed4a85eed5f2368c46c724a778c216afb1840 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 12:08:58 +0100
Subject: [PATCH 175/404] Add ATLAS_CHECK_THREAD_SAFETY to
 InDetPrepRawDataFormation package and fix thread-safe issue in CacheCreator.

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../src/CacheCreator.cxx                      | 30 +++++--------------
 .../src/CacheCreator.h                        | 30 ++++++++++++-------
 3 files changed, 28 insertions(+), 33 deletions(-)
 create mode 100644 InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/InDetPrepRawDataFormation/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/InDetPrepRawDataFormation/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/InDetPrepRawDataFormation/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..39f44f5fcb1
--- /dev/null
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/InDetPrepRawDataFormation/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx
index d26095c7c55..23153111ff4 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.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
 */
 
 
@@ -18,24 +18,8 @@ namespace InDet{
     m_pTRTHelper(nullptr),
     m_pix_idHelper(nullptr),
     m_sct_idHelper(nullptr),
-    m_rioContainerCacheKey(""),
-    m_SCTclusterContainerCacheKey(""),
-    m_PIXclusterContainerCacheKey(""),
-    m_PIXSpacePointCacheKey(""),
-    m_SCTSpacePointCacheKey(""),
-
-    m_SCTRDOCacheKey(""), m_PixRDOCacheKey(""),
-    m_disableTRT(false), m_disableWarning(false)
+    m_disableWarningCheck(false)
     {
-        declareProperty("TRT_DriftCircleKey", m_rioContainerCacheKey);
-        declareProperty("SCT_ClusterKey"    , m_SCTclusterContainerCacheKey);
-        declareProperty("Pixel_ClusterKey"  , m_PIXclusterContainerCacheKey);
-        declareProperty("SpacePointCachePix"  , m_PIXSpacePointCacheKey);
-        declareProperty("SpacePointCacheSCT"  , m_SCTSpacePointCacheKey);
-        declareProperty("SCTRDOCacheKey", m_SCTRDOCacheKey);
-        declareProperty("disableTRT"  , m_disableTRT);
-        declareProperty("PixRDOCacheKey", m_PixRDOCacheKey);
-        declareProperty("DisableViewWarning", m_disableWarning);
     }
 
 
@@ -47,7 +31,7 @@ namespace InDet{
         ATH_CHECK( m_SCTSpacePointCacheKey.initialize(!m_SCTSpacePointCacheKey.key().empty()) );
         ATH_CHECK( m_SCTRDOCacheKey.initialize(!m_SCTRDOCacheKey.key().empty()) );
         ATH_CHECK( m_PixRDOCacheKey.initialize(!m_PixRDOCacheKey.key().empty()) );
-        if(!m_disableTRT) ATH_CHECK(detStore()->retrieve(m_pTRTHelper  , "TRT_ID"));
+        if (!m_disableTRT.value()) ATH_CHECK(detStore()->retrieve(m_pTRTHelper  , "TRT_ID"));
         ATH_CHECK(detStore()->retrieve(m_sct_idHelper, "SCT_ID"));
         ATH_CHECK(detStore()->retrieve(m_pix_idHelper, "PixelID"));
         return StatusCode::SUCCESS;
@@ -65,15 +49,15 @@ namespace InDet{
     StatusCode CacheCreator::execute (const EventContext& ctx) const
     {
 
-        if(!m_disableWarning){
-          if(isInsideView(ctx)){
+        if (!m_disableWarningCheck and !m_disableWarning.value()){
+          if (isInsideView(ctx)){
             ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration");
             return StatusCode::FAILURE;
           }
-          m_disableWarning = true; //only check once
+          m_disableWarningCheck = true; //only check once
         }
 
-        if(!m_disableTRT) ATH_CHECK(createContainer(m_rioContainerCacheKey, m_pTRTHelper->straw_layer_hash_max(), ctx));
+        if (!m_disableTRT.value()) ATH_CHECK(createContainer(m_rioContainerCacheKey, m_pTRTHelper->straw_layer_hash_max(), ctx));
         
         ATH_CHECK(createContainer(m_SCTclusterContainerCacheKey, m_sct_idHelper->wafer_hash_max(), ctx));
         
diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h
index 68f35cd0316..89e6aeb2571 100644
--- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h
+++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.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
 */
 
 
@@ -22,6 +22,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
 #include "AthenaPoolUtilities/CondAttrListCollection.h" 
 
+#include <atomic>
+
 class TRT_ID;
 class PixelID;
 class SCT_ID;
@@ -41,15 +43,23 @@ namespace InDet{
         const TRT_ID* m_pTRTHelper;
         const PixelID* m_pix_idHelper;
         const SCT_ID*  m_sct_idHelper;
-        SG::WriteHandleKey<InDet::TRT_DriftCircleContainerCache> m_rioContainerCacheKey;
-        SG::WriteHandleKey<SCT_ClusterContainerCache>            m_SCTclusterContainerCacheKey;
-        SG::WriteHandleKey<InDet::PixelClusterContainerCache>    m_PIXclusterContainerCacheKey;
-        SG::WriteHandleKey<SpacePointCache>    m_PIXSpacePointCacheKey;
-        SG::WriteHandleKey<SpacePointCache>    m_SCTSpacePointCacheKey;
-        SG::WriteHandleKey<SCT_RDO_Cache>      m_SCTRDOCacheKey;
-        SG::WriteHandleKey<PixelRDO_Cache>     m_PixRDOCacheKey;
-        bool m_disableTRT;
-        mutable bool m_disableWarning;
+        SG::WriteHandleKey<InDet::TRT_DriftCircleContainerCache> m_rioContainerCacheKey
+          {this, "TRT_DriftCircleKey", ""};
+        SG::WriteHandleKey<SCT_ClusterContainerCache>            m_SCTclusterContainerCacheKey
+          {this, "SCT_ClusterKey", ""};
+        SG::WriteHandleKey<InDet::PixelClusterContainerCache>    m_PIXclusterContainerCacheKey
+          {this,"Pixel_ClusterKey", ""};
+        SG::WriteHandleKey<SpacePointCache>    m_PIXSpacePointCacheKey
+          {this, "SpacePointCachePix", ""};
+        SG::WriteHandleKey<SpacePointCache>    m_SCTSpacePointCacheKey
+          {this, "SpacePointCacheSCT", ""};
+        SG::WriteHandleKey<SCT_RDO_Cache>      m_SCTRDOCacheKey
+          {this, "SCTRDOCacheKey", ""};
+        SG::WriteHandleKey<PixelRDO_Cache>     m_PixRDOCacheKey
+          {this, "PixRDOCacheKey", ""};
+        BooleanProperty m_disableTRT{this, "disableTRT", false};
+        BooleanProperty m_disableWarning{this, "DisableViewWarning", false};
+        mutable std::atomic_bool m_disableWarningCheck;
 	//Temporary workarounds for problem in scheduler - remove later
         bool isInsideView(const EventContext&) const;
         template<typename T>
-- 
GitLab


From 2bd13b2e63a8f4e8cc57831154c453938096cb5d Mon Sep 17 00:00:00 2001
From: MatousVozak <matous.vozak@cern.ch>
Date: Mon, 4 Mar 2019 13:08:38 +0100
Subject: [PATCH 176/404] creating PT sequence and adding it into muon sig

---
 .../TrigUpgradeTest/python/InDetPT.py         | 130 ++++++++++++++++++
 .../TrigUpgradeTest/python/MuonSetup.py       |  27 +++-
 2 files changed, 156 insertions(+), 1 deletion(-)
 create mode 100644 Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
new file mode 100644
index 00000000000..2f9432edbd5
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
@@ -0,0 +1,130 @@
+#  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
+  
+  
+  #Return list of Track keys, TrackParticle keys, and PT algs
+  return  nameTrackCollections, nameTrackParticles, [InDetTrigMTAmbiguitySolver, InDetTrigMTxAODTrackParticleCnvAlg]
+  
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
index d02fdb78144..01a860748fd 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
@@ -584,8 +584,33 @@ 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] 
+  print 'TRACKPARTICLES %s' %trackParticles
+
   #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="")
-- 
GitLab


From 3d14fadbe04919551cedcd99db7524e41b1a689f Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <gemmeren@anl.gov>
Date: Mon, 4 Mar 2019 06:34:45 -0600
Subject: [PATCH 177/404] Remove RegistrationStream testing from
 AthenaPoolExampleAlgorithms

---
 .../CMakeLists.txt                            |  18 +-
 .../share/AthenaPoolExample_Filter.ref        | 835 ------------------
 .../AthenaPoolExample_FilterJobOptions.py     | 128 ---
 .../share/AthenaPoolExample_RFilter.ref       | 342 -------
 .../AthenaPoolExample_RFilterJobOptions.py    |  99 ---
 .../share/AthenaPoolExample_RWJobOptions.py   |  19 -
 .../share/AthenaPoolExample_ReWrite.ref       | 201 -----
 .../share/AthenaPoolExample_ReWriteAgain.ref  | 202 -----
 ...thenaPoolExample_ReWriteAgainJobOptions.py |  19 -
 .../share/AthenaPoolExample_ReWriteNext.ref   | 241 -----
 ...AthenaPoolExample_ReWriteNextJobOptions.py |  19 -
 11 files changed, 4 insertions(+), 2119 deletions(-)
 delete mode 100644 Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
 delete mode 100755 Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_FilterJobOptions.py
 delete mode 100644 Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
 delete mode 100755 Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilterJobOptions.py

diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt
index 5e26a1e8edd..853aefdb5d3 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/CMakeLists.txt
@@ -72,7 +72,7 @@ function( _add_test testName toExecute )
 endfunction( _add_test )
 
 # Test(s) in the package:
-# Write 'Hits', with multistreamand TAGs
+# Write 'Hits', with multistreamand
 _add_test( AthenaPoolExample_Write 
    "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_WriteJobOptions.py"
    EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:"
@@ -102,26 +102,16 @@ _add_test( AthenaPoolExample_ReWriteNext
    "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py"
    DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_ReWriteAgain_ctest
    EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:" )
-# Read via TAGs and use query to filter events
-_add_test( AthenaPoolExample_Filter
-   "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_FilterJobOptions.py"
-   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_ReWriteNext_ctest
-   EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:" )
-_add_test( AthenaPoolExample_RFilter
-   "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_RFilterJobOptions.py"
-   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_Filter_ctest
-   EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:" )
-# Read all (including bad files, skipped for now expected failure)
+# Read all
 _add_test( AthenaPoolExample_ReadAgain
    "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadAgainJobOptions.py"
-   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_RFilter_ctest
+   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_ReWriteNext_ctest
    EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:" )
 
 # Concatenate jobs write 'Hits' and 'Tracks' to different streams
 _add_test( AthenaPoolExample_Concat
    "athena.py AthenaPoolExampleAlgorithms/AthenaPoolExample_ConcatJobOptions.py"
-   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_RFilter_ctest
-           AthenaPoolExampleAlgorithms_AthenaPoolExample_ReadAgain_ctest
+   DEPENDS AthenaPoolExampleAlgorithms_AthenaPoolExample_ReadAgain_ctest
    EXTRA_PATTERNS "Warning in <TFile::Init>: no StreamerInfo found|BYTES_READ|READ_CALLS|DEBUG lookupPFN|DEBUG registered PFN|XMLCatalog +INFO|Found address:"
    PRE_EXEC test/pre_check.sh )
 _add_test( AthenaPoolExample_ReadConcat
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
deleted file mode 100644
index 3b4d975e73f..00000000000
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Filter.ref
+++ /dev/null
@@ -1,835 +0,0 @@
-Tue Feb 26 09:22:30 CST 2019
-Preloading tcmalloc_minimal.so
-Athena               INFO including file "AthenaCommon/Preparation.py"
-Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
-Athena               INFO executing ROOT6Setup
-Athena               INFO including file "AthenaCommon/Execution.py"
-Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_FilterJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-Athena               INFO including file "AthenaCommon/runbatch.py"
-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 v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:38 2019
-====================================================================================================================================
-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 3110 CLIDRegistry entries for module ALL
-CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
-AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
-ReadData            DEBUG Property update for OutputLevel : new value = 2
-ReadData             INFO in initialize()
-MetaDataSvc         DEBUG Property update for OutputLevel : new value = 2
-MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
-MetaDataSvc         DEBUG Service base class initialized successfully
-AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
-PoolSvc             DEBUG Property update for OutputLevel : new value = 2
-PoolSvc             DEBUG Service base class initialized successfully
-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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
-PoolSvc              INFO Successfully setup replica sorting algorithm
-PoolSvc             DEBUG OutputLevel is 
-PoolSvc              INFO Setting up APR FileCatalog and Streams
-PoolSvc             DEBUG POOL ReadCatalog is file:Catalog.xml
-PoolSvc              INFO POOL WriteCatalog is file:Catalog1.xml
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool'])
-EventSelector       DEBUG Property update for OutputLevel : new value = 2
-EventSelector        INFO Initializing EventSelector - package version EventSelectorAthenaPool-00-00-00
-EventSelector       DEBUG Service base class initialized successfully
-EventSelector.Q...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 20?0 CLIDRegistry entries for module ALL
-EventSelector.Q...   INFO in initialize()
-EventSelector        INFO reinitialization...
-EventSelector        INFO EventSelection with query EventNumber > 5
-EventSelector       DEBUG Try item: "SimplePoolCollection3.root" from the collection list.
-EventSelector        INFO Using standard collection ref 
-MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile3.root
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile3...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:ExampleTrackContainer_p1 Typ:ExampleTrackContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[5 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
-SimplePoolFile3...  DEBUG --->Reading Shape[6 , ????]: [1 Column(s)]
-SimplePoolFile3...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 7 Entries in total.
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleTrackContainer_p1/MyTracks) [20?]  (4 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLCollectionTree(RunNumber) [20?]  (8 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventNumber) [20?]  (9 , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/POOLCollectionTree(MagicNumber) [20?]  (a , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (b , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (c , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-SimplePoolFile3...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (d , ffffffff)
-SimplePoolFile3...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 12 Entries in total.
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile3...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile3...  DEBUG --->Reading Param:PFN=[SimplePoolFile3.root]
-SimplePoolFile3...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile3...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 58 CLIDRegistry entries for module ALL
-EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
-MetaDataHdrForm...  DEBUG Opening
-MetaDataHdrForm...  DEBUG    attributes# = 1
-MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
-MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
-MetaDataSvc         DEBUG Loaded input meta data store proxies
-AthenaPoolAddre...  DEBUG Property update for OutputLevel : new value = 2
-AthenaPoolAddre...  DEBUG Service base class initialized successfully
-ReadData            DEBUG input handles: 2
-ReadData            DEBUG output handles: 0
-ReadData            DEBUG Data Deps for ReadData
-  + INPUT   ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
-  + INPUT   ( 'ExampleTrackContainer' , 'StoreGateSvc+MyTracks' ) 
-WriteTag             INFO in initialize()
-Stream1             DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
-Stream1             DEBUG In initialize 
-Stream1             DEBUG Found IDecisionSvc.
-DecisionSvc          INFO Inserting stream: Stream1 with no Algs
-Stream1             DEBUG End initialize 
-Stream1             DEBUG In initialize
-Stream1             DEBUG Found StoreGateSvc store.
-Stream1             DEBUG Found MetaDataStore store.
-OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...   INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00
-AthenaPoolAddre...  DEBUG Cannot find DataHeader in DetectorStore.
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...   INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
-Stream1              INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo'])
-Stream1              INFO Data output: SimplePoolFile5.root
-Stream1              INFO I/O reinitialization...
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-Stream1             DEBUG End initialize
-Stream1             DEBUG input handles: 0
-Stream1             DEBUG output handles: 0
-Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
-Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
-Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
-Stream1             DEBUG Data Deps for Stream1
-  + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
-RegStream1          DEBUG Property update for OutputLevel : new value = 2
-RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found IDecisionSvc.
-DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found  'StoreName':StoreGateSvc store.
-RegStream1.TagTool  DEBUG Property update for OutputLevel : new value = 2
-RegStream1          DEBUG  Tool initialized
-RegStream1          DEBUG  Not class requested by Tool, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG input handles: 0
-RegStream1          DEBUG output handles: 0
-RegStream1          DEBUG Adding private ToolHandle tool RegStream1.TagTool (RegistrationStreamTagTool)
-RegStream1          DEBUG Data Deps for RegStream1
-HistogramPersis...WARNING Histograms saving not required.
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
-EventSelector       DEBUG Try item: "SimplePoolCollection3.root" from the collection list.
-ApplicationMgr       INFO Application Manager Started successfully
-MetaDataSvc         DEBUG handle() BeginInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
-MetaDataSvc         DEBUG Loaded input meta data store proxies
-MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
-EventSelector        INFO Request skipping event from: EventSelector.QueryTag
-EventSelector        INFO skipping event 1
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
-EventSelector        INFO Request skipping event from: EventSelector.QueryTag
-EventSelector        INFO skipping event 2
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
-EventSelector        INFO Request skipping event from: EventSelector.QueryTag
-EventSelector        INFO skipping event 3
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
-EventSelector        INFO Request skipping event from: EventSelector.QueryTag
-EventSelector        INFO skipping event 4
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
-POOLContainerFo...  DEBUG Opening
-POOLContainerFo...  DEBUG    attributes# = 1
-POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
-POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'EventInfo_p4_McEventInfo'
-CollectionTree(...  DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree
-AthenaPoolConve...   INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector 
-AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 0 events processed so far  <<<===
-ReadData            DEBUG in execute()
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaData(EventStreamInfo_p3/Stream1)
-MetaData(EventS...  DEBUG Opening
-MetaData(EventS...  DEBUG    attributes# = 1
-MetaData(EventS...  DEBUG Branch container 'EventStreamInfo_p3_Stream1'
-MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream1) of type ROOT_Tree
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 10 run: 1
-ReadData             INFO Get Smart data ptr 1
-SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(ExampleTrackContainer_p1/MyTracks)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'ExampleTrackContainer_p1_MyTracks'
-CollectionTree(...  DEBUG Opened container CollectionTree(ExampleTrackContainer_p1/MyTracks) of type ROOT_Tree
-ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 10  run: 1
-WriteTag             INFO registered all data
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile5.root returned FID: '' tech=
-PersistencySvc:...  DEBUG registered PFN: SimplePoolFile5.root with FID:????
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile5.root
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-##Shapes            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-##Links             DEBUG No objects passing selection criteria... Container has 0 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
-ClassIDSvc           INFO  getRegistryEntries: read 25 CLIDRegistry entries for module ALL
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'EventInfo_p4_McEventInfo'
-CollectionTree(...  DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[0 , ????]:  [1 Column(s)] 
-SimplePoolFile5...  DEBUG ---->Class:EventInfo_p4
-SimplePoolFile5...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] CollectionTree(ExampleTrackContainer_p1/MyTracks)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'ExampleTrackContainer_p1_MyTracks'
-CollectionTree(...  DEBUG Opened container CollectionTree(ExampleTrackContainer_p1/MyTracks) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/CollectionTree(ExampleTrackContainer_p1/MyTracks) [20?]  (4 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[1 , ????]:  [1 Column(s)] 
-SimplePoolFile5...  DEBUG ---->Class:ExampleTrackContainer_p1
-SimplePoolFile5...  DEBUG ---->[0]:ExampleTrackContainer_p1 Typ:ExampleTrackContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLContainerForm(DataHeaderForm)
-POOLContainerFo...  DEBUG Opening
-POOLContainerFo...  DEBUG    attributes# = 1
-POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
-POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[2 , ????]:  [1 Column(s)] 
-SimplePoolFile5...  DEBUG ---->Class:DataHeaderForm_p5
-SimplePoolFile5...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[3 , ????]:  [1 Column(s)] 
-SimplePoolFile5...  DEBUG ---->Class:DataHeader_p5
-SimplePoolFile5...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-PoolSvc              INFO Writing ExplicitROOT Collection - do not pass session pointer
-RegStream1.TagTool   INFO No Primary Key defined
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 1 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 11 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 11  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 2 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 12 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 12  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 3 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 13 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 13  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 4 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 14 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 14  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 5 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 15 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 15  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 6 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 16 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 16  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 7 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 17 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 17  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 8 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 18 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 18  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 3
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 9 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData             INFO EventStreamInfo: Number of events = 20
-ReadData             INFO EventStreamInfo: ItemList:
-ReadData             INFO CLID = 2101, key = McEventInfo
-ReadData             INFO CLID = 9103, key = MyTracks
-ReadData             INFO CLID = 222376821, key = StreamX
-ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
-ReadData             INFO TagInfo: 
-ReadData             INFO EventInfo event: 19 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-WriteTag             INFO EventInfo event: 19  run: 1
-WriteTag             INFO registered all data
-Stream1             DEBUG addItemObjects(2101,"*") called
-Stream1             DEBUG            Key:*
-Stream1             DEBUG  Added object 2101,"McEventInfo"
-Stream1             DEBUG addItemObjects(9103,"MyTracks") called
-Stream1             DEBUG            Key:MyTracks
-Stream1             DEBUG  Added object 9103,"MyTracks"
-Stream1             DEBUG  Collected objects:
-Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
-Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"RunEventTag") 
-RegStream1          DEBUG  get ref for (222376821,"*") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1 for requested key=*
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009] for Stream1_derived
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to RunEventTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"*") 
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
-MetaDataSvc         DEBUG handle() EndInputFile for FID:????
-EventSelector        INFO Disconnecting input sourceID: ????
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
-MetaDataSvc         DEBUG handle() LastInputFile for end
-AthenaEventLoopMgr   INFO No more events in event selection 
-Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
-RegStream1.TagTool   INFO Collection Events output: 10
-MetaDataSvc         DEBUG MetaDataSvc::stop()
-Stream1             DEBUG handle() incident type: MetaDataStop
-MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
-Stream1             DEBUG addItemObjects(167728019,"Stream1") called
-Stream1             DEBUG            Key:Stream1
-Stream1             DEBUG  Added object 167728019,"Stream1"
-Stream1             DEBUG addItemObjects(1316383046,"*") called
-Stream1             DEBUG            Key:*
-StorageSvc           INFO Building shape according to reflection information using shape ID for:
-StorageSvc           INFO EventStreamInfo_p3 [????]
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaData(EventStreamInfo_p3/Stream1)
-MetaData(EventS...  DEBUG Opening
-MetaData(EventS...  DEBUG    attributes# = 1
-MetaData(EventS...  DEBUG Branch container 'EventStreamInfo_p3_Stream1'
-MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream1) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[4 , ????]:  [1 Column(s)] 
-SimplePoolFile5...  DEBUG ---->Class:EventStreamInfo_p3
-SimplePoolFile5...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
-MetaDataHdrForm...  DEBUG Opening
-MetaDataHdrForm...  DEBUG    attributes# = 1
-MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
-MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-Stream1              INFO Records written: 11
-Stream1             DEBUG Leaving handle
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
-ApplicationMgr       INFO Application Manager Stopped successfully
-IncidentProcAlg1     INFO Finalize
-ReadData             INFO in finalize()
-WriteTag             INFO in finalize()
-IncidentProcAlg2     INFO Finalize
-Stream1             DEBUG finalize: Optimize output
-Stream1             DEBUG finalize: end optimize output
-RegStream1          DEBUG In finalize
-DecisionSvc          INFO Finalized successfully.
-AthDictLoaderSvc     INFO in finalize...
-ToolSvc              INFO Removing all tools created by ToolSvc
-EventSelector.Q...   INFO in finalize()
-*****Chrono*****     INFO ****************************************************************************************************
-*****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
-*****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 11
-cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 32
-fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 32
-cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 43
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.286(+- 1.67)/    0/   10 [ms] #= 35
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.909(+- 2.87)/    0/   10 [ms] #= 33
-ChronoStatSvc        INFO Time User   : Tot= 0.65  [s]                                             #=  1
-*****Chrono*****     INFO ****************************************************************************************************
-ChronoStatSvc.f...   INFO  Service finalized successfully 
-ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
-Athena               INFO leaving with code 0: "successful run"
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_FilterJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_FilterJobOptions.py
deleted file mode 100755
index 4c32e95b3ac..00000000000
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_FilterJobOptions.py
+++ /dev/null
@@ -1,128 +0,0 @@
-## @file AthenaPoolExample_RWJobOptions.py
-## @brief Example job options file to illustrate how to read/write data from/to Pool.
-## @author Peter van Gemmeren <gemmeren@anl.gov>
-## $Id: AthenaPoolExample_RWJobOptions.py,v 1.34 2009-03-20 15:30:21 gemmeren Exp $
-###############################################################
-#
-# This Job option:
-# ----------------
-# 1. Reads the data (EventInfo, ExampleHits) from the SimplePoolFile1.root file
-#    that has been written with the AthneaPoolExample_WriteJobOptions.py
-# 2. Writes SimplePoolFile3.root file with ExampleTracks using ReWriteData algorithm
-# ------------------------------------------------------------
-# Expected output file (20 events):
-# -rw-r--r--  1 gemmeren zp 11395 Aug  5 17:34 SimplePoolCollection3.root
-# -rw-r--r--  1 gemmeren zp 27536 Aug  5 17:34 SimplePoolFile3.root
-# ------------------------------------------------------------
-# File:SimplePoolFile3.root
-# Size:       26.891 kb
-# Nbr Events: 20
-#
-# ================================================================================
-#      Mem Size       Disk Size        Size/Evt      MissZip/Mem  items  (X) Container Name (X=Tree|Branch)
-# ================================================================================
-#       12.317 kb        1.429 kb        0.071 kb        0.000       20  (T) DataHeader
-# --------------------------------------------------------------------------------
-#        3.846 kb        0.313 kb        0.016 kb        0.288       20  (B) EventInfo_p3_McEventInfo
-#        3.001 kb        0.428 kb        0.021 kb        0.535        1  (T) MetaDataHdrDataHeaderForm
-#       11.894 kb        0.794 kb        0.040 kb        0.135       20  (T) POOLContainer_DataHeaderForm
-#       10.578 kb        0.903 kb        0.045 kb        0.379        1  (T) MetaDataHdrDataHeader
-#       18.453 kb        1.200 kb        0.060 kb        0.383        1  (B) EventStreamInfo_p2_Stream1
-#       49.426 kb        3.881 kb        0.194 kb        0.261       20  (B) ExampleTrackContainer_p1_MyTracks
-# ================================================================================
-#      109.515 kb        8.948 kb        0.447 kb        0.000       20  TOTAL (POOL containers)
-# ================================================================================
-#
-#==============================================================
-
-## basic job configuration
-import AthenaCommon.AtlasUnixStandardJob
-
-## get a handle on the default top-level algorithm sequence
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-from AthenaCommon.AlgSequence import AthSequencer
-regSequence = AthSequencer("AthRegSeq")
-
-## get a handle on the ServiceManager
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-from AthenaCommon.AppMgr import theApp
-theApp.EvtMax = 200000
-
-#--------------------------------------------------------------
-#---   Read portion  -----
-#--------------------------------------------------------------
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-svcMgr.EventSelector.InputCollections = [ "SimplePoolCollection3.root" ]; # ** mandatory parameter ** // The input file name
-svcMgr.EventSelector.CollectionType = "ExplicitROOT"
-svcMgr.AthenaPoolAddressProviderSvc.DataHeaderIterator = False
-
-svcMgr.EventSelector.Query = "EventNumber > 5"
-
-#Explicitly specify the output file catalog
-svcMgr.PoolSvc.ReadCatalog = [ "file:Catalog.xml" ]
-svcMgr.PoolSvc.WriteCatalog = "file:Catalog1.xml"
-
-from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag
-QueryTag = AthPoolEx__QueryTag("QueryTag")
-svcMgr.EventSelector.HelperTools = [ QueryTag ]
-
-#--------------------------------------------------------------
-# Private Application Configuration options
-#--------------------------------------------------------------
-# Load "user algorithm" top algorithms to be run, and the libraries that house them
-from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__ReadData,AthPoolEx__ReWriteData
-topSequence += AthPoolEx__ReadData("ReadData")
-
-#--------------------------------------------------------------
-#---   Secondary Write portion  ----- Don't change it !!!
-#--------------------------------------------------------------
-from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
-Stream1 = AthenaPoolOutputStream( "Stream1" , "SimplePoolFile5.root" )
-Stream1.ItemList += [ "ExampleTrackContainer#MyTracks" ]
-Stream1.WritingTool.ProcessingTag = "Stream1_derived"
-
-#--------------------------------------------------------------
-# Event Collection Registration
-#--------------------------------------------------------------
-from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__WriteTag
-topSequence += AthPoolEx__WriteTag( "WriteTag" )
-
-from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
-TagTool = RegistrationStreamTagTool("TagTool")
-
-from RegistrationServices.RegistrationServicesConf import RegistrationStream
-RegStream1 = RegistrationStream( "RegStream1" , CollectionType="ExplicitROOT" , Tool=TagTool )
-RegStream1.WriteInputDataHeader = False
-RegStream1.OutputCollection = "SimplePoolCollection5.root"
-RegStream1.ItemList += [ "DataHeader#*" ]
-RegStream1.ItemList += [ "TagAthenaAttributeList#RunEventTag" ]
-regSequence += RegStream1
-
-#--------------------------------------------------------------
-# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
-#--------------------------------------------------------------
-svcMgr.MessageSvc.OutputLevel = 3
-svcMgr.MessageSvc.defaultLimit = 100000
-
-svcMgr.MetaDataSvc.OutputLevel = 2
-svcMgr.EventSelector.OutputLevel = 2
-svcMgr.EventSelector.HelperTools[0].OutputLevel = 3
-svcMgr.AthenaPoolAddressProviderSvc.OutputLevel = 2
-svcMgr.PoolSvc.OutputLevel = 2
-topSequence.ReadData.OutputLevel = 2
-Stream1.OutputLevel = 2
-Stream1.WritingTool.OutputLevel = 3
-Stream1.HelperTools[0].OutputLevel = 3
-RegStream1.OutputLevel = 2
-RegStream1.Tool.OutputLevel = 3
-
-#
-# End of job options file
-#
-###############################################################
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
deleted file mode 100644
index 03bac03aed5..00000000000
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilter.ref
+++ /dev/null
@@ -1,342 +0,0 @@
-Tue Feb 26 09:22:42 CST 2019
-Preloading tcmalloc_minimal.so
-Athena               INFO including file "AthenaCommon/Preparation.py"
-Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
-Athena               INFO executing ROOT6Setup
-Athena               INFO including file "AthenaCommon/Execution.py"
-Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RFilterJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
-Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-Athena               INFO including file "AthenaCommon/runbatch.py"
-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 v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:51 2019
-====================================================================================================================================
-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 3110 CLIDRegistry entries for module ALL
-CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
-AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
-ReadData            DEBUG Property update for OutputLevel : new value = 2
-ReadData             INFO in initialize()
-MetaDataSvc         DEBUG Property update for OutputLevel : new value = 2
-MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
-MetaDataSvc         DEBUG Service base class initialized successfully
-AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
-PoolSvc             DEBUG Property update for OutputLevel : new value = 2
-PoolSvc             DEBUG Service base class initialized successfully
-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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
-PoolSvc              INFO Successfully setup replica sorting algorithm
-PoolSvc             DEBUG OutputLevel is 
-PoolSvc              INFO Setting up APR FileCatalog and Streams
-PoolSvc             DEBUG POOL ReadCatalog is file:Catalog.xml
-PoolSvc             DEBUG POOL ReadCatalog is file:Catalog1.xml
-PoolSvc              INFO POOL WriteCatalog is file:Catalog2.xml
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool'])
-EventSelector       DEBUG Property update for OutputLevel : new value = 2
-EventSelector        INFO Initializing EventSelector - package version EventSelectorAthenaPool-00-00-00
-EventSelector       DEBUG Service base class initialized successfully
-EventSelector        INFO reinitialization...
-EventSelector        INFO EventSelection with query EventNumber > 9
-EventSelector       DEBUG Try item: "SimplePoolCollection5.root" from the collection list.
-EventSelector        INFO Using standard collection ref 
-AthenaPoolAddre...  DEBUG Property update for OutputLevel : new value = 2
-AthenaPoolAddre...  DEBUG Service base class initialized successfully
-ReadData            DEBUG input handles: 2
-ReadData            DEBUG output handles: 0
-ReadData            DEBUG Data Deps for ReadData
-  + INPUT   ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
-  + INPUT   ( 'ExampleTrackContainer' , 'StoreGateSvc+MyTracks' ) 
-HistogramPersis...WARNING Histograms saving not required.
-AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
-ApplicationMgr       INFO Application Manager Initialized successfully
-EventSelector       DEBUG Try item: "SimplePoolCollection5.root" from the collection list.
-ApplicationMgr       INFO Application Manager Started successfully
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000A].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
-EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile5.root
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:ExampleTrackContainer_p1 Typ:ExampleTrackContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleTrackContainer_p1/MyTracks) [20?]  (4 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile5...  DEBUG --->Reading Param:PFN=[SimplePoolFile5.root]
-SimplePoolFile5...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile5...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
-POOLContainerFo...  DEBUG Opening
-POOLContainerFo...  DEBUG    attributes# = 1
-POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
-POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'EventInfo_p4_McEventInfo'
-CollectionTree(...  DEBUG Opened container CollectionTree(EventInfo_p4/McEventInfo) of type ROOT_Tree
-AthenaPoolConve...   INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector 
-AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 0 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ClassIDSvc           INFO  getRegistryEntries: read 2092 CLIDRegistry entries for module ALL
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 10 run: 1
-ReadData             INFO Get Smart data ptr 1
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(ExampleTrackContainer_p1/MyTracks)
-CollectionTree(...  DEBUG Opening
-CollectionTree(...  DEBUG    attributes# = 1
-CollectionTree(...  DEBUG Branch container 'ExampleTrackContainer_p1_MyTracks'
-CollectionTree(...  DEBUG Opened container CollectionTree(ExampleTrackContainer_p1/MyTracks) of type ROOT_Tree
-ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000B].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 1 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ClassIDSvc           INFO  getRegistryEntries: read 10 CLIDRegistry entries for module ALL
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 11 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000C].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 2 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 12 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000D].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 3 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 13 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000E].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 4 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 14 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000F].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 5 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 15 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000010].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 6 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 16 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000011].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 7 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 17 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000012].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 8 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 18 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
-EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 2
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_derived_ref = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
-EventSelector       DEBUG record AthenaAttribute, name = Stream1_ref = [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000013].
-EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
-EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
-AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
-AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 9 events processed so far  <<<===
-ReadData            DEBUG in execute()
-ReadData          WARNING Could not find EventStreamInfo
-ReadData             INFO EventInfo event: 19 run: 1
-ReadData             INFO Get Smart data ptr 1
-ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector = Track made in: DummyHitDetector
-ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
-ReadData             INFO Could not find ExampleHitContainer/MyHits
-AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
-EventSelector        INFO Disconnecting input sourceID: ????
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
-AthenaEventLoopMgr   INFO No more events in event selection 
-MetaDataSvc         DEBUG MetaDataSvc::stop()
-ApplicationMgr       INFO Application Manager Stopped successfully
-IncidentProcAlg1     INFO Finalize
-ReadData             INFO in finalize()
-IncidentProcAlg2     INFO Finalize
-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=   70 [ms] Ave/Min/Max= 3.18(+- 12.6)/    0/   60 [ms] #= 22
-cObj_ALL             INFO Time User   : Tot=   80 [ms] Ave/Min/Max= 3.81(+-   15)/    0/   70 [ms] #= 21
-ChronoStatSvc        INFO Time User   : Tot= 0.54  [s]                                             #=  1
-*****Chrono*****     INFO ****************************************************************************************************
-ChronoStatSvc.f...   INFO  Service finalized successfully 
-ApplicationMgr       INFO Application Manager Finalized successfully
-ApplicationMgr       INFO Application Manager Terminated successfully
-Athena               INFO leaving with code 0: "successful run"
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilterJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilterJobOptions.py
deleted file mode 100755
index cf2c6a6adb9..00000000000
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RFilterJobOptions.py
+++ /dev/null
@@ -1,99 +0,0 @@
-## @file AthenaPoolExample_RWJobOptions.py
-## @brief Example job options file to illustrate how to read/write data from/to Pool.
-## @author Peter van Gemmeren <gemmeren@anl.gov>
-## $Id: AthenaPoolExample_RWJobOptions.py,v 1.34 2009-03-20 15:30:21 gemmeren Exp $
-###############################################################
-#
-# This Job option:
-# ----------------
-# 1. Reads the data (EventInfo, ExampleHits) from the SimplePoolFile1.root file
-#    that has been written with the AthneaPoolExample_WriteJobOptions.py
-# 2. Writes SimplePoolFile3.root file with ExampleTracks using ReWriteData algorithm
-# ------------------------------------------------------------
-# Expected output file (20 events):
-# -rw-r--r--  1 gemmeren zp 11395 Aug  5 17:34 SimplePoolCollection3.root
-# -rw-r--r--  1 gemmeren zp 27536 Aug  5 17:34 SimplePoolFile3.root
-# ------------------------------------------------------------
-# File:SimplePoolFile3.root
-# Size:       26.891 kb
-# Nbr Events: 20
-#
-# ================================================================================
-#      Mem Size       Disk Size        Size/Evt      MissZip/Mem  items  (X) Container Name (X=Tree|Branch)
-# ================================================================================
-#       12.317 kb        1.429 kb        0.071 kb        0.000       20  (T) DataHeader
-# --------------------------------------------------------------------------------
-#        3.846 kb        0.313 kb        0.016 kb        0.288       20  (B) EventInfo_p3_McEventInfo
-#        3.001 kb        0.428 kb        0.021 kb        0.535        1  (T) MetaDataHdrDataHeaderForm
-#       11.894 kb        0.794 kb        0.040 kb        0.135       20  (T) POOLContainer_DataHeaderForm
-#       10.578 kb        0.903 kb        0.045 kb        0.379        1  (T) MetaDataHdrDataHeader
-#       18.453 kb        1.200 kb        0.060 kb        0.383        1  (B) EventStreamInfo_p2_Stream1
-#       49.426 kb        3.881 kb        0.194 kb        0.261       20  (B) ExampleTrackContainer_p1_MyTracks
-# ================================================================================
-#      109.515 kb        8.948 kb        0.447 kb        0.000       20  TOTAL (POOL containers)
-# ================================================================================
-#
-#==============================================================
-
-## basic job configuration
-import AthenaCommon.AtlasUnixStandardJob
-
-## get a handle on the default top-level algorithm sequence
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-## get a handle on the ServiceManager
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-
-#--------------------------------------------------------------
-# Event related parameters
-#--------------------------------------------------------------
-from AthenaCommon.AppMgr import theApp
-theApp.EvtMax = 200000
-
-#--------------------------------------------------------------
-#---   Read portion  -----
-#--------------------------------------------------------------
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-svcMgr.EventSelector.InputCollections = [ "SimplePoolCollection5.root" ]; # ** mandatory parameter ** // The input file name
-svcMgr.EventSelector.CollectionType = "ExplicitROOT"
-#svcMgr.EventSelector.DerivedRefName = "Stream1_derived"
-
-svcMgr.EventSelector.Query = "EventNumber > 9"
-svcMgr.EventSelector.ProcessMetadata = False
-
-#Explicitly specify the output file catalog
-svcMgr.PoolSvc.ReadCatalog = [ "file:Catalog.xml" ]
-svcMgr.PoolSvc.ReadCatalog += [ "file:Catalog1.xml" ]
-svcMgr.PoolSvc.WriteCatalog = "file:Catalog2.xml"
-
-#from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import TagRemappingTool
-#TagRemappingTool = TagRemappingTool("TagRemappingTool")
-#TagRemappingTool.JoinListKey = "Stream1_ref"
-#TagRemappingTool.TargetTagFile = "SimplePoolCollection5.root"
-#svcMgr.EventSelector.HelperTools = [ TagRemappingTool ]
-
-#--------------------------------------------------------------
-# Private Application Configuration options
-#--------------------------------------------------------------
-# Load "user algorithm" top algorithms to be run, and the libraries that house them
-from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__ReadData,AthPoolEx__ReWriteData
-topSequence += AthPoolEx__ReadData("ReadData")
-
-#--------------------------------------------------------------
-# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
-#--------------------------------------------------------------
-svcMgr.MessageSvc.OutputLevel = 3
-svcMgr.MessageSvc.defaultLimit = 100000
-
-svcMgr.MetaDataSvc.OutputLevel = 2
-svcMgr.EventSelector.OutputLevel = 2
-svcMgr.AthenaPoolAddressProviderSvc.OutputLevel = 2
-svcMgr.PoolSvc.OutputLevel = 2
-topSequence.ReadData.OutputLevel = 2
-
-#
-# End of job options file
-#
-###############################################################
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RWJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RWJobOptions.py
index d2ce1a0825b..ef363d22b76 100755
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RWJobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RWJobOptions.py
@@ -11,7 +11,6 @@
 # 2. Writes SimplePoolFile3.root file with ExampleTracks using ReWriteData algorithm
 # ------------------------------------------------------------
 # Expected output file (20 events):
-# -rw-r--r--  1 gemmeren zp 11395 Aug  5 17:34 SimplePoolCollection3.root
 # -rw-r--r--  1 gemmeren zp 27536 Aug  5 17:34 SimplePoolFile3.root
 # ------------------------------------------------------------
 # File:SimplePoolFile3.root
@@ -41,8 +40,6 @@ import AthenaCommon.AtlasUnixStandardJob
 ## get a handle on the default top-level algorithm sequence
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
-from AthenaCommon.AlgSequence import AthSequencer
-regSequence = AthSequencer("AthRegSeq")
 
 ## get a handle on the ServiceManager
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
@@ -98,20 +95,6 @@ StreamerSvc = AthenaRootStreamerSvc()
 StreamerSvc.Streamers  += [ "ExampleHitStreamer_p0" ]
 svcMgr += StreamerSvc
 
-#--------------------------------------------------------------
-# Event Collection Registration
-#--------------------------------------------------------------
-from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
-TagTool = RegistrationStreamTagTool("TagTool")
-
-from RegistrationServices.RegistrationServicesConf import RegistrationStream
-RegStream1 = RegistrationStream( "RegStream1" , CollectionType="ExplicitROOT" , Tool=TagTool )
-RegStream1.WriteInputDataHeader = False
-RegStream1.OutputCollection = "SimplePoolCollection3.root"
-RegStream1.ItemList += [ "DataHeader#Stream1" ]
-RegStream1.ItemList += [ "TagAthenaAttributeList#" + MagicWriteTag.Key ]
-regSequence += RegStream1
-
 #--------------------------------------------------------------
 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
 #--------------------------------------------------------------
@@ -128,8 +111,6 @@ topSequence.ReWriteData.OutputLevel = 2
 Stream1.OutputLevel = 2
 Stream1.WritingTool.OutputLevel = 3
 Stream1.HelperTools[0].OutputLevel = 3
-RegStream1.OutputLevel = 2
-RegStream1.Tool.OutputLevel = 3
 
 #
 # End of job options file
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index 176d63aa24d..7c7ac2c1524 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -170,24 +170,7 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-RegStream1          DEBUG Property update for OutputLevel : new value = 2
-RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
 ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found IDecisionSvc.
-DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found  'StoreName':StoreGateSvc store.
-RegStream1.TagTool  DEBUG Property update for OutputLevel : new value = 2
-RegStream1          DEBUG  Tool initialized
-RegStream1          DEBUG  Not class requested by Tool, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG input handles: 0
-RegStream1          DEBUG output handles: 0
-RegStream1          DEBUG Adding private ToolHandle tool RegStream1.TagTool (RegistrationStreamTagTool)
-RegStream1          DEBUG Data Deps for RegStream1
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -406,17 +389,6 @@ SimplePoolFile3...  DEBUG --->Adding Assoc :????/POOLCollectionTree(MagicNumber)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile3.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile3.root and cont: POOLContainerForm(DataHeaderForm)
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-PoolSvc              INFO Writing ExplicitROOT Collection - do not pass session pointer
-RegStream1.TagTool   INFO No Primary Key defined
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -487,15 +459,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -566,15 +529,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -645,15 +599,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -724,15 +669,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -803,15 +739,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -882,15 +809,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -961,15 +879,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1040,15 +949,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1119,15 +1019,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1198,15 +1089,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1277,15 +1159,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1356,15 +1229,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1435,15 +1299,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1514,15 +1369,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1593,15 +1439,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1672,15 +1509,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1751,15 +1579,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1830,15 +1649,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1909,15 +1719,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
@@ -1926,7 +1727,6 @@ Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All]
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
-RegStream1.TagTool   INFO Collection Events output: 20
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
@@ -1974,7 +1774,6 @@ MagicWriteTag        INFO in finalize()
 IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
-RegStream1          DEBUG In finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
index dbfcfb71701..73bf9a645d8 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -164,24 +164,7 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-RegStream1          DEBUG Property update for OutputLevel : new value = 2
-RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
 ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found IDecisionSvc.
-DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found  'StoreName':StoreGateSvc store.
-RegStream1.TagTool  DEBUG Property update for OutputLevel : new value = 2
-RegStream1          DEBUG  Tool initialized
-RegStream1          DEBUG  Not class requested by Tool, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG input handles: 0
-RegStream1          DEBUG output handles: 0
-RegStream1          DEBUG Adding private ToolHandle tool RegStream1.TagTool (RegistrationStreamTagTool)
-RegStream1          DEBUG Data Deps for RegStream1
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -460,17 +443,6 @@ SimplePoolFile3...  DEBUG --->Adding Assoc :????/POOLCollectionTree(MagicNumber)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile3.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile3.root and cont: POOLContainerForm(DataHeaderForm)
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-PoolSvc              INFO Writing ExplicitROOT Collection - do not pass session pointer
-RegStream1.TagTool   INFO No Primary Key defined
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -542,15 +514,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -621,15 +584,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -700,15 +654,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -779,15 +724,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -858,15 +794,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -937,15 +864,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1016,15 +934,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1095,15 +1004,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1174,15 +1074,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1253,15 +1144,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1332,15 +1214,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1411,15 +1284,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1490,15 +1354,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1569,15 +1424,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1648,15 +1494,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1727,15 +1564,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1806,15 +1634,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1885,15 +1704,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 0
@@ -1964,15 +1774,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
@@ -1981,8 +1782,6 @@ EventSelector        INFO Disconnecting input sourceID: ????
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
-RegStream1.TagTool   INFO Collection Events output: 20
-RegStream1.TagTool   INFO Unable to register collection: PFN 'RootCollection||PFN:SimplePoolCollection3.root' already registered ( POOL : "registerPFN" from "FileCatalog" )
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
@@ -2030,7 +1829,6 @@ MagicWriteTag        INFO in finalize()
 IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
-RegStream1          DEBUG In finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgainJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgainJobOptions.py
index 73c20880b23..bd01141291f 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgainJobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgainJobOptions.py
@@ -11,7 +11,6 @@
 # 2. Writes SimplePoolFile3.root file with ExampleTracks using ReWriteData algorithm
 # ------------------------------------------------------------
 # Expected output file (20 events):
-# -rw-r--r--  1 gemmeren zp 11395 Aug  5 17:34 SimplePoolCollection3.root
 # -rw-r--r--  1 gemmeren zp 27536 Aug  5 17:34 SimplePoolFile3.root
 # ------------------------------------------------------------
 # File:SimplePoolFile3.root
@@ -41,8 +40,6 @@ import AthenaCommon.AtlasUnixStandardJob
 ## get a handle on the default top-level algorithm sequence
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
-from AthenaCommon.AlgSequence import AthSequencer
-regSequence = AthSequencer("AthRegSeq")
 
 ## get a handle on the ServiceManager
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
@@ -98,20 +95,6 @@ StreamerSvc = AthenaRootStreamerSvc()
 StreamerSvc.Streamers  += [ "ExampleHitStreamer_p0" ]
 svcMgr += StreamerSvc
 
-#--------------------------------------------------------------
-# Event Collection Registration
-#--------------------------------------------------------------
-from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
-TagTool = RegistrationStreamTagTool("TagTool")
-
-from RegistrationServices.RegistrationServicesConf import RegistrationStream
-RegStream1 = RegistrationStream( "RegStream1" , CollectionType="ExplicitROOT" , Tool=TagTool )
-RegStream1.WriteInputDataHeader = False
-RegStream1.OutputCollection = "SimplePoolCollection3.root"
-RegStream1.ItemList += [ "DataHeader#Stream1" ]
-RegStream1.ItemList += [ "TagAthenaAttributeList#" + MagicWriteTag.Key ]
-regSequence += RegStream1
-
 #--------------------------------------------------------------
 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
 #--------------------------------------------------------------
@@ -128,8 +111,6 @@ topSequence.ReWriteData.OutputLevel = 2
 Stream1.OutputLevel = 2
 Stream1.WritingTool.OutputLevel = 3
 Stream1.HelperTools[0].OutputLevel = 3
-RegStream1.OutputLevel = 2
-RegStream1.Tool.OutputLevel = 3
 
 #
 # End of job options file
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index aaf9bcd318b..70d5e12ca4d 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -170,24 +170,7 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-RegStream1          DEBUG Property update for OutputLevel : new value = 2
-RegStream1.RegS...  DEBUG Property update for OutputLevel : new value = 2
 ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found IDecisionSvc.
-DecisionSvc          INFO Inserting stream: RegStream1 with no Algs
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG In initialize 
-RegStream1          DEBUG Found  'StoreName':StoreGateSvc store.
-RegStream1.TagTool  DEBUG Property update for OutputLevel : new value = 2
-RegStream1          DEBUG  Tool initialized
-RegStream1          DEBUG  Not class requested by Tool, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-RegStream1          DEBUG End initialize 
-RegStream1          DEBUG input handles: 0
-RegStream1          DEBUG output handles: 0
-RegStream1          DEBUG Adding private ToolHandle tool RegStream1.TagTool (RegistrationStreamTagTool)
-RegStream1          DEBUG Data Deps for RegStream1
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -372,19 +355,6 @@ SimplePoolFile4...  DEBUG --->Adding Assoc :????/POOLCollectionTree(MagicNumber)
 SimplePoolFile4...  DEBUG ---->ClassID:????
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile4.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile4.root and cont: POOLContainerForm(DataHeaderForm)
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000000]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
-PoolSvc              INFO Writing ExplicitROOT Collection - do not pass session pointer
-RegStream1.TagTool   INFO No Primary Key defined
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -423,17 +393,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000001]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -472,17 +431,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000002]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -521,17 +469,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000003]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -570,17 +507,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000004]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -619,17 +545,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000005]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -668,17 +583,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000006]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -717,17 +621,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000007]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -766,17 +659,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000008]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -815,17 +697,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000009]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -864,17 +735,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -913,17 +773,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -962,17 +811,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1011,17 +849,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1060,17 +887,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1109,17 +925,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1158,17 +963,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000010]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1207,17 +1001,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000011]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1256,17 +1039,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000012]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
@@ -1305,17 +1077,6 @@ Stream1             DEBUG  Added object 9103,"MyTracks"
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
-RegStream1          DEBUG RegistrationStream execute
-RegStream1          DEBUG getRefs: Not DataHeader, skipping (40774349,"MagicTag") 
-RegStream1          DEBUG  get ref for (222376821,"Stream1") 
-RegStream1          DEBUG Retrieved DataHeader with key Stream1
-RegStream1          DEBUG Pushing back ref [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013] for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Found ref for input header [DB=????][CNT=][CLID=????][TECH=0000020?][OID=00000006-00000013]
-RegStream1          DEBUG Adding ref for Stream1
-RegStream1          DEBUG Setting tagKey to MagicTag
-RegStream1          DEBUG  Not class requested by Tool, skipping (222376821,"Stream1") 
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
@@ -1324,7 +1085,6 @@ Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All]
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
-RegStream1.TagTool   INFO Collection Events output: 20
 MetaDataSvc         DEBUG MetaDataSvc::stop()
 Stream1             DEBUG handle() incident type: MetaDataStop
 MetaDataSvc         DEBUG  calling metaDataStop for ToolSvc.IOVDbMetaDataTool
@@ -1372,7 +1132,6 @@ MagicWriteTag        INFO in finalize()
 IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
-RegStream1          DEBUG In finalize
 DecisionSvc          INFO Finalized successfully.
 AthenaPoolCnvSvc    DEBUG releasing all workers
 AthDictLoaderSvc     INFO in finalize...
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNextJobOptions.py b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNextJobOptions.py
index 854056abddb..b9d9276fbde 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNextJobOptions.py
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNextJobOptions.py
@@ -11,7 +11,6 @@
 # 2. Writes SimplePoolFile4.root file with ExampleTracks using ReWriteData algorithm
 # ------------------------------------------------------------
 # Expected output file (20 events):
-# -rw-r--r--  1 gemmeren zp 11395 Aug  5 17:34 SimplePoolCollection4.root
 # -rw-r--r--  1 gemmeren zp 27536 Aug  5 17:34 SimplePoolFile4.root
 # ------------------------------------------------------------
 # File:SimplePoolFile4.root
@@ -41,8 +40,6 @@ import AthenaCommon.AtlasUnixStandardJob
 ## get a handle on the default top-level algorithm sequence
 from AthenaCommon.AlgSequence import AlgSequence
 topSequence = AlgSequence()
-from AthenaCommon.AlgSequence import AthSequencer
-regSequence = AthSequencer("AthRegSeq")
 
 ## get a handle on the ServiceManager
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
@@ -98,20 +95,6 @@ StreamerSvc = AthenaRootStreamerSvc()
 StreamerSvc.Streamers  += [ "ExampleHitStreamer_p0" ]
 svcMgr += StreamerSvc
 
-#--------------------------------------------------------------
-# Event Collection Registration
-#--------------------------------------------------------------
-from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool
-TagTool = RegistrationStreamTagTool("TagTool")
-
-from RegistrationServices.RegistrationServicesConf import RegistrationStream
-RegStream1 = RegistrationStream( "RegStream1" , CollectionType="ExplicitROOT" , Tool=TagTool )
-RegStream1.WriteInputDataHeader = False
-RegStream1.OutputCollection = "SimplePoolCollection4.root"
-RegStream1.ItemList += [ "DataHeader#Stream1" ]
-RegStream1.ItemList += [ "TagAthenaAttributeList#" + MagicWriteTag.Key ]
-regSequence += RegStream1
-
 #--------------------------------------------------------------
 # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
 #--------------------------------------------------------------
@@ -128,8 +111,6 @@ topSequence.ReWriteData.OutputLevel = 2
 Stream1.OutputLevel = 2
 Stream1.WritingTool.OutputLevel = 3
 Stream1.HelperTools[0].OutputLevel = 3
-RegStream1.OutputLevel = 2
-RegStream1.Tool.OutputLevel = 3
 
 #
 # End of job options file
-- 
GitLab


From e6ebadae1b9aa9d636e72678d13e2f00a36d5996 Mon Sep 17 00:00:00 2001
From: MihaMuskinja <miha.muskinja@gmail.com>
Date: Mon, 4 Mar 2019 12:39:04 +0100
Subject: [PATCH 178/404] replaces parameterized_sin with parameterized_sincos

---
 .../DistanceCalculatorSaggingOff.cxx                   | 10 +++++-----
 Tools/PROCTools/python/RunTier0TestsTools.py           |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index 9881c3ef423..c8bdbaa421b 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
@@ -48,7 +48,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sin(P.y(), sin_a, cos_a);
+    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
 #endif
     // determination of the nearest quarter-wave number
     int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength);
@@ -160,7 +160,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sin(P.y(), sin_a, cos_a);
+    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -251,7 +251,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sin(P.y(), sin_a, cos_a);
+    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
 #endif
 
     int nqwave;
@@ -339,7 +339,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sin(P.y(), sin_a, cos_a);
+    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -434,7 +434,7 @@ namespace LArWheelCalculator_Impl
     // parameterized sine
 #else
     double cos_a, sin_a;
-    lwc()->parameterized_sin(P.y(), sin_a, cos_a);
+    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
 #endif
 
     // determination of the nearest quarter-wave number
diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index 09236596115..95c39de00b0 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -21,7 +21,7 @@ ciRefFileMap = {
                 's3126-21.0'           : 'v1',
                 's3126-21.3'           : 'v1',
                 's3126-21.9'           : 'v1',
-                's3126-22.0'           : 'v2',
+                's3126-22.0'           : 'v3',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
                 'overlay-d1498-22.0'   : 'v9',
-- 
GitLab


From 171301e7675e3ac72993f8e0c516e8f1cafaafd5 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 12:40:44 +0000
Subject: [PATCH 179/404] Rename SiPropertiesSvc package to SiPropertiesTool
 package (ATLASRECTS-4048)

---
 .../PixelConditionsAlgorithms/CMakeLists.txt       |  3 +--
 .../SCT_ConditionsTools/CMakeLists.txt             |  6 +++---
 .../src/SCT_ChargeTrappingTool.cxx                 |  4 ++--
 .../SiLorentzAngleSvc/CMakeLists.txt               |  4 ++--
 .../python/PixelLorentzAngleToolSetup.py           |  4 ++--
 .../src/PixelSiLorentzAngleCondAlg.cxx             |  2 +-
 .../src/PixelSiLorentzAngleCondAlg.h               |  2 +-
 .../src/SCTSiLorentzAngleCondAlg.cxx               |  2 +-
 .../SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx   |  2 +-
 .../CMakeLists.txt                                 | 14 +++++++-------
 .../SiPropertiesTool/ATLAS_CHECK_THREAD_SAFETY     |  1 +
 .../SiPropertiesTool}/ISiPropertiesTool.h          |  2 +-
 .../SiPropertiesTool}/SiliconProperties.h          | 10 +++++-----
 .../SiPropertiesTool}/SiliconPropertiesVector.h    |  8 ++++----
 .../doc/packagedoc.h                               |  4 ++--
 .../python/PixelSiPropertiesToolSetup.py           |  4 ++--
 .../python/SCT_SiPropertiesToolSetup.py            |  4 ++--
 .../python/__init__.py                             |  0
 .../share/testSCTProperties.py                     |  4 ++--
 .../src/PixelSiPropertiesCondAlg.cxx               |  0
 .../src/PixelSiPropertiesCondAlg.h                 |  2 +-
 .../src/SCTSiPropertiesCondAlg.cxx                 |  0
 .../src/SCTSiPropertiesCondAlg.h                   |  2 +-
 .../src/SCTSiPropertiesTestAlg.cxx                 |  0
 .../src/SCTSiPropertiesTestAlg.h                   |  2 +-
 .../src/SiPropertiesTool.cxx                       |  0
 .../src/SiPropertiesTool.h                         |  4 ++--
 .../src/SiliconProperties.cxx                      |  6 +++---
 .../src/SiliconPropertiesVector.cxx                |  2 +-
 .../src/components/SiPropertiesTool_entries.cxx}   |  0
 .../FastSiDigitization/CMakeLists.txt              |  2 +-
 .../python/FastSiDigitizationConfig.py             |  2 +-
 .../share/SiSmearing_jobOptions.py                 |  2 +-
 .../PixelDigitization/CMakeLists.txt               |  4 ++--
 .../python/PixelDigitizationConfig.py              |  4 ++--
 .../PixelDigitization/src/EnergyDepositionTool.cxx |  2 +-
 .../PixelDigitization/src/SensorSim3DTool.cxx      |  2 +-
 .../PixelDigitization/src/SensorSimPlanarTool.cxx  |  2 +-
 .../PixelDigitization/src/SensorSimTool.h          |  2 +-
 .../PixelRadDamDigitization/CMakeLists.txt         |  4 ++--
 .../python/PixelRadDamDigitizationConfig.py        |  6 +++---
 .../src/EnergyDepositionTool.cxx                   |  2 +-
 .../PixelRadDamDigitization/src/RadDamageUtil.cxx  |  2 +-
 .../src/SensorSim3DTool.cxx                        |  2 +-
 .../src/SensorSimPlanarTool.cxx                    |  2 +-
 .../PixelRadDamDigitization/src/SensorSimTool.h    |  2 +-
 .../SCT_Digitization/CMakeLists.txt                |  4 ++--
 .../python/SCT_DigitizationConfig.py               |  2 +-
 .../src/SCT_DetailedSurfaceChargesGenerator.h      |  2 +-
 .../src/SCT_SurfaceChargesGenerator.h              |  2 +-
 .../share/ReadSiDetectorElements_jobOptions.py     |  4 ++--
 .../python/InDetTrigConfigConditions.py            |  4 ++--
 .../share/ReadSiDetectorElements_jobOptions.py     |  4 ++--
 .../G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py |  4 ++--
 .../TrigUpgradeTest/python/InDetConfig.py          |  4 ++--
 55 files changed, 85 insertions(+), 85 deletions(-)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/CMakeLists.txt (86%)
 create mode 100644 InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ATLAS_CHECK_THREAD_SAFETY
 rename InnerDetector/InDetConditions/{SiPropertiesSvc/SiPropertiesSvc => SiPropertiesTool/SiPropertiesTool}/ISiPropertiesTool.h (94%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc/SiPropertiesSvc => SiPropertiesTool/SiPropertiesTool}/SiliconProperties.h (93%)
 mode change 100755 => 100644
 rename InnerDetector/InDetConditions/{SiPropertiesSvc/SiPropertiesSvc => SiPropertiesTool/SiPropertiesTool}/SiliconPropertiesVector.h (83%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/doc/packagedoc.h (81%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/python/PixelSiPropertiesToolSetup.py (94%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/python/SCT_SiPropertiesToolSetup.py (91%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/python/__init__.py (100%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/share/testSCTProperties.py (95%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/PixelSiPropertiesCondAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/PixelSiPropertiesCondAlg.h (96%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SCTSiPropertiesCondAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SCTSiPropertiesCondAlg.h (97%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SCTSiPropertiesTestAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SCTSiPropertiesTestAlg.h (94%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SiPropertiesTool.cxx (100%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SiPropertiesTool.h (91%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SiliconProperties.cxx (97%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc => SiPropertiesTool}/src/SiliconPropertiesVector.cxx (95%)
 rename InnerDetector/InDetConditions/{SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx => SiPropertiesTool/src/components/SiPropertiesTool_entries.cxx} (100%)
 mode change 100755 => 100644 InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
 mode change 100755 => 100644 InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
 mode change 100755 => 100644 Simulation/G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py

diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt
index 9665ffd0f1b..99c4567fd65 100644
--- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt
@@ -16,7 +16,6 @@ atlas_depends_on_subdirs(
    InnerDetector/InDetConditions/InDetConditionsSummaryService
    InnerDetector/InDetConditions/PixelConditionsData
    InnerDetector/InDetConditions/PixelConditionsTools
-   InnerDetector/InDetConditions/SiPropertiesSvc
    PRIVATE
    Control/SGTools
    Control/StoreGate
@@ -53,7 +52,7 @@ atlas_add_component( PixelConditionsAlgorithms
    ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities
    GaudiKernel PixelConditionsData SGTools StoreGateLib CoralDB
    GeoModelUtilities Identifier InDetIdentifier InDetReadoutGeometry
-   PixelCablingLib PixelConditionsAlgorithmsLib SiPropertiesSvcLib PathResolver )
+   PixelCablingLib PixelConditionsAlgorithmsLib PathResolver )
 
 # Install files from the package:
 #atlas_install_joboptions( share/*.py )
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
index 7e8d49449ce..73dc39b601c 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
@@ -21,7 +21,7 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/GeoModel/GeoModelInterfaces
                           DetectorDescription/GeoModel/GeoModelUtilities
                           InnerDetector/InDetConditions/InDetByteStreamErrors
-                          InnerDetector/InDetConditions/SiPropertiesSvc
+                          InnerDetector/InDetConditions/SiPropertiesTool
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetDetDescr/SCT_Cabling
@@ -37,14 +37,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 SiPropertiesSvcLib SCT_ConditionsToolsLib )
+                      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 )
 
 
 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 SiPropertiesSvcLib InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib )
+                   LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaKernel Identifier GeoModelUtilities GaudiKernel AthenaBaseComps StoreGateLib SGtests EventInfo xAODEventInfo SCT_ConditionsData SiPropertiesToolLib InDetByteStreamErrors InDetIdentifier InDetReadoutGeometry SCT_CablingLib )
 
 # Add unit tests
 atlas_add_test( SCT_RODVetoTool_test
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ChargeTrappingTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ChargeTrappingTool.cxx
index bfd2ed57f82..44540a324a9 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ChargeTrappingTool.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ChargeTrappingTool.cxx
@@ -12,7 +12,7 @@
 
 #include "Identifier/IdentifierHash.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 
 #include "GaudiKernel/PhysicalConstants.h"
 #include "GaudiKernel/SystemOfUnits.h"
@@ -168,7 +168,7 @@ SCT_ChargeTrappingCondData SCT_ChargeTrappingTool::calculate(const IdentifierHas
   siProperties.setConditions(temperature, electricField);
 
   // -- Calculate electron and holes drift mobility and velocity for these conditions (temperature, electricField)
-  //    using parametrizations in SiliconProperties (SiPropertiesSvc). These will be used later for the trapping model.
+  //    using parametrizations in SiliconProperties (SiPropertiesTool). These will be used later for the trapping model.
   //    In the SCT we collect holes. 
   double electronDriftMobility{0.};
   double holeDriftMobility{0.};
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt b/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt
index fde0a0873b1..50f42535de4 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/CMakeLists.txt
@@ -13,7 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/GeoPrimitives
                           GaudiKernel
                           InnerDetector/InDetConditions/InDetCondTools
-                          InnerDetector/InDetConditions/SiPropertiesSvc
+                          InnerDetector/InDetConditions/SiPropertiesTool
                           InnerDetector/InDetConditions/PixelConditionsData
                           InnerDetector/InDetConditions/PixelConditionsTools
                           InnerDetector/InDetConditions/SCT_ConditionsData
@@ -33,7 +33,7 @@ atlas_add_component( SiLorentzAngleSvc
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives GaudiKernel SiPropertiesSvcLib MagFieldInterfaces AthenaPoolUtilities Identifier InDetIdentifier InDetReadoutGeometry )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoPrimitives GaudiKernel SiPropertiesToolLib MagFieldInterfaces AthenaPoolUtilities Identifier InDetIdentifier InDetReadoutGeometry )
 
 # Run tests:
 atlas_add_test( TestSCTLorentzAngle
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py
index a025892b339..f6bad11a9b6 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py
@@ -32,12 +32,12 @@ class PixelLorentzAngleToolSetup:
       condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg", ReadKey=tempFolder, UseConditions=True)
 
     if not hasattr(condSeq, "PixelSiPropertiesCondAlg"):
-      from SiPropertiesSvc.SiPropertiesSvcConf import PixelSiPropertiesCondAlg
+      from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
       condSeq += PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")
 
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-      from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesTool
+      from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
       ToolSvc += SiPropertiesTool(name = "PixelSiPropertiesTool",
                                   DetectorName = "Pixel",
                                   ReadKey = "PixelSiliconPropertiesVector")
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx
index 8743c0c9f83..8c19f8eb266 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.cxx
@@ -11,7 +11,7 @@
 #include "InDetReadoutGeometry/PixelDetectorManager.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "InDetReadoutGeometry/PixelModuleDesign.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 
 PixelSiLorentzAngleCondAlg::PixelSiLorentzAngleCondAlg(const std::string& name, ISvcLocator* pSvcLocator):
   ::AthAlgorithm(name, pSvcLocator),
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h
index 79c71168e7e..0537d770ab0 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/PixelSiLorentzAngleCondAlg.h
@@ -12,7 +12,7 @@
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "PixelConditionsData/PixelModuleData.h"
 #include "GaudiKernel/ICondSvc.h"
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 #include "SiLorentzAngleSvc/SiLorentzAngleCondData.h"
 #include "InDetIdentifier/PixelID.h"
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx
index 4a8da1451e5..89ddac68c52 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.cxx
@@ -14,7 +14,7 @@
 #include "InDetIdentifier/SCT_ID.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "MagFieldInterfaces/IMagFieldSvc.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 
 // Gaudi include
 #include "GaudiKernel/PhysicalConstants.h"
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx
index e2ddaf45cca..b118ed3e354 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx
+++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SiLorentzAngleTool.cxx
@@ -12,7 +12,7 @@
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
 #include "Identifier/IdentifierHash.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 
 SiLorentzAngleTool::SiLorentzAngleTool(const std::string& type, const std::string& name, const IInterface* parent):
   base_class(type, name, parent),
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/CMakeLists.txt b/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt
similarity index 86%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/CMakeLists.txt
rename to InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt
index ab70b99627d..c91b4aef25d 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/CMakeLists.txt
@@ -1,9 +1,9 @@
 ################################################################################
-# Package: SiPropertiesSvc
+# Package: SiPropertiesTool
 ################################################################################
 
 # Declare the package name:
-atlas_subdir( SiPropertiesSvc )
+atlas_subdir( SiPropertiesTool )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
@@ -24,22 +24,22 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( CLHEP )
 
 # Component(s) in the package:
-atlas_add_library( SiPropertiesSvcLib
+atlas_add_library( SiPropertiesToolLib
                    src/*.cxx
-                   PUBLIC_HEADERS SiPropertiesSvc
+                   PUBLIC_HEADERS SiPropertiesTool
                    PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
                    LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel InDetReadoutGeometry PixelConditionsData SCT_ConditionsData StoreGateLib SGtests
                    PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} Identifier InDetIdentifier )
 
-atlas_add_component( SiPropertiesSvc
+atlas_add_component( SiPropertiesTool
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel InDetReadoutGeometry PixelConditionsData SCT_ConditionsData StoreGateLib SGtests Identifier InDetIdentifier SiPropertiesSvcLib )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel InDetReadoutGeometry PixelConditionsData SCT_ConditionsData StoreGateLib SGtests Identifier InDetIdentifier SiPropertiesToolLib )
 
 # Run tests:
 atlas_add_test( TestSCTProperties
-                SCRIPT athena.py --threads=5 SiPropertiesSvc/testSCTProperties.py
+                SCRIPT athena.py --threads=5 SiPropertiesTool/testSCTProperties.py
                 PROPERTIES TIMEOUT 300
                 ENVIRONMENT THREADS=5 )
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6980ebf99ac
--- /dev/null
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SiPropertiesTool
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesTool.h b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ISiPropertiesTool.h
similarity index 94%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesTool.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ISiPropertiesTool.h
index f50bd24ecc2..a443861ef24 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesTool.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/ISiPropertiesTool.h
@@ -11,7 +11,7 @@
 
 //Gaudi Includes
 #include "GaudiKernel/IAlgTool.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "Identifier/IdentifierHash.h"
 
 /**
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconProperties.h b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconProperties.h
old mode 100755
new mode 100644
similarity index 93%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconProperties.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconProperties.h
index e9a4901ed06..1ee7771f234
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconProperties.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconProperties.h
@@ -1,9 +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
 */
 
-#ifndef SIPROPERTIESSVC_SILICONPROPERTIES_H
-#define SIPROPERTIESSVC_SILICONPROPERTIES_H
+#ifndef SIPROPERTIESTOOL_SILICONPROPERTIES_H
+#define SIPROPERTIESTOOL_SILICONPROPERTIES_H
 
 ///////////////////////////////////////////////////////////////////
 //   Header file for class SiliconProperties
@@ -85,9 +85,9 @@ private:
 
   bool   m_override; // signal that quantities are overriden and recalculation are disabled.
 
-  static double s_ehPairsPerEnergyDefault;
+  const static double s_ehPairsPerEnergyDefault;
 };
 
 } // namespace InDetDD
 
-#endif // SIPROPERTIESSVC_SILICONPROPERTIES_H
+#endif // SIPROPERTIESTOOL_SILICONPROPERTIES_H
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconPropertiesVector.h
similarity index 83%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconPropertiesVector.h
index ad3019d3be4..d9d610deeb7 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/SiPropertiesTool/SiliconPropertiesVector.h
@@ -2,15 +2,15 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifndef SIPROPERTIESSVC_SILICONPROPERTIESVECTOR_H
-#define SIPROPERTIESSVC_SILICONPROPERTIESVECTOR_H
+#ifndef SIPROPERTIESTOOL_SILICONPROPERTIESVECTOR_H
+#define SIPROPERTIESTOOL_SILICONPROPERTIESVECTOR_H
 
 ///////////////////////////////////////////////////////////////////
 //   Header file for class SiliconPropertiesVector for SiPropertiesTool
 ///////////////////////////////////////////////////////////////////
 
 #include <vector>
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "Identifier/IdentifierHash.h"
 #include "SGTools/CLASS_DEF.h"
 
@@ -39,4 +39,4 @@ CLASS_DEF(InDet::SiliconPropertiesVector, 10146683 , 1)
 #include "AthenaKernel/CondCont.h"
 CONDCONT_DEF(InDet::SiliconPropertiesVector, 246562685);
 
-#endif // SIPROPERTIESSVC_SILICONPROPERTIESVECTOR_H
+#endif // SIPROPERTIESTOOL_SILICONPROPERTIESVECTOR_H
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/doc/packagedoc.h b/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h
similarity index 81%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/doc/packagedoc.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h
index 84851aef587..f7d7578fe65 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/doc/packagedoc.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/doc/packagedoc.h
@@ -4,11 +4,11 @@
 
 /**
 
-@page SiPropertiesSvc_page SiPropertiesSvc Package
+@page SiPropertiesTool_page SiPropertiesTool Package
 
 @authors Grant Gorfine
 
-@section SiPropertiesSvc_SiPropertiesSvcIntro Introduction
+@section SiPropertiesTool_SiPropertiesToolIntro Introduction
 
 Service for providing silicon properties for each detector element.
 The properties are available via the SiliconProperties class from
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py
similarity index 94%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py
rename to InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py
index 4d983c1121e..76531152b44 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesToolSetup.py
@@ -58,14 +58,14 @@ class PixelSiPropertiesToolSetup:
 
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(condSeq, "PixelSiPropertiesCondAlg"):
-      from SiPropertiesSvc.SiPropertiesSvcConf import PixelSiPropertiesCondAlg
+      from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
       condSeq += PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")
     self.alg = getattr(condSeq, "PixelSiPropertiesCondAlg")
 
   def setTool(self):
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-      from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesTool
+      from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
       ToolSvc += SiPropertiesTool(name = "PixelSiPropertiesTool",
                                   DetectorName = "Pixel",
                                   ReadKey = "PixelSiliconPropertiesVector")
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/python/SCT_SiPropertiesToolSetup.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesToolSetup.py
similarity index 91%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/python/SCT_SiPropertiesToolSetup.py
rename to InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesToolSetup.py
index 04d99f5dda6..1b91d9381df 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/python/SCT_SiPropertiesToolSetup.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesToolSetup.py
@@ -36,7 +36,7 @@ class SCT_SiPropertiesToolSetup:
         condSeq = AthSequencer("AthCondSeq")
 
         if not hasattr(condSeq, self.algName):
-            from SiPropertiesSvc.SiPropertiesSvcConf import SCTSiPropertiesCondAlg
+            from SiPropertiesTool.SiPropertiesToolConf import SCTSiPropertiesCondAlg
             if self.siliconTool is None:
                 condSeq += SCTSiPropertiesCondAlg(name = self.algName)
             else:
@@ -46,7 +46,7 @@ class SCT_SiPropertiesToolSetup:
 
     def setTool(self):
         if self.tool is None:
-            from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesTool
+            from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
             self.tool = SiPropertiesTool(name = self.toolName,
                                          DetectorName = "SCT",
                                          ReadKey = "SCTSiliconPropertiesVector")
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/python/__init__.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/__init__.py
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/python/__init__.py
rename to InnerDetector/InDetConditions/SiPropertiesTool/python/__init__.py
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/share/testSCTProperties.py b/InnerDetector/InDetConditions/SiPropertiesTool/share/testSCTProperties.py
similarity index 95%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/share/testSCTProperties.py
rename to InnerDetector/InDetConditions/SiPropertiesTool/share/testSCTProperties.py
index 1a72602fc5b..91d3d114e67 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/share/testSCTProperties.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/share/testSCTProperties.py
@@ -80,13 +80,13 @@ sct_SiliconConditionsToolSetup.setDcsTool(sct_DCSConditionsToolSetup.getTool())
 sct_SiliconConditionsToolSetup.setup()
 
 # Set up SCT_SiPropertiesTool
-from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
 sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
 sct_SiPropertiesToolSetup.setSiliconTool(sct_SiliconConditionsToolSetup.getTool())
 sct_SiPropertiesToolSetup.setup()
 
 # Set up SCTSiPropertiesTestAlg
-from SiPropertiesSvc.SiPropertiesSvcConf import SCTSiPropertiesTestAlg
+from SiPropertiesTool.SiPropertiesToolConf import SCTSiPropertiesTestAlg
 job += SCTSiPropertiesTestAlg(SCTPropertiesTool=sct_SiPropertiesToolSetup.getTool())
 
 # Prepare EventSelector
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.h b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h
similarity index 96%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h
index 3e0be407151..bd38b44fd46 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/PixelSiPropertiesCondAlg.h
@@ -12,7 +12,7 @@
 #include "PixelConditionsData/PixelModuleData.h"
 #include "GaudiKernel/ICondSvc.h"
 
-#include "SiPropertiesSvc/SiliconPropertiesVector.h"
+#include "SiPropertiesTool/SiliconPropertiesVector.h"
 #include "InDetIdentifier/PixelID.h"
 #include "InDetReadoutGeometry/PixelDetectorManager.h"
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesCondAlg.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesCondAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesCondAlg.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesCondAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesCondAlg.h b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesCondAlg.h
similarity index 97%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesCondAlg.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesCondAlg.h
index 5c4d3bdcdf1..ffe41465276 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesCondAlg.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesCondAlg.h
@@ -10,7 +10,7 @@
 #include "InDetConditionsSummaryService/ISiliconConditionsTool.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 #include "SCT_ConditionsData/SCT_DCSFloatCondData.h"
-#include "SiPropertiesSvc/SiliconPropertiesVector.h"
+#include "SiPropertiesTool/SiliconPropertiesVector.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesTestAlg.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesTestAlg.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesTestAlg.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesTestAlg.cxx
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesTestAlg.h b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesTestAlg.h
similarity index 94%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesTestAlg.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesTestAlg.h
index 4a2b3a0b83b..8a82d4f32e6 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SCTSiPropertiesTestAlg.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/SCTSiPropertiesTestAlg.h
@@ -7,7 +7,7 @@
 
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 #include "GaudiKernel/ToolHandle.h"
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesTool.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiPropertiesTool.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesTool.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SiPropertiesTool.cxx
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesTool.h b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiPropertiesTool.h
similarity index 91%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesTool.h
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SiPropertiesTool.h
index aea33f51d03..72c12ac0d38 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesTool.h
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiPropertiesTool.h
@@ -9,10 +9,10 @@
 #ifndef SiPropertiesTool_h
 #define SiPropertiesTool_h
 
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "SiPropertiesSvc/SiliconPropertiesVector.h"
+#include "SiPropertiesTool/SiliconPropertiesVector.h"
 #include "StoreGate/ReadCondHandleKey.h"
 
 /**
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconProperties.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconProperties.cxx
similarity index 97%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconProperties.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconProperties.cxx
index 242d049cec9..b0619a7f134 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconProperties.cxx
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconProperties.cxx
@@ -1,8 +1,8 @@
 /*
-  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 "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "CLHEP/Units/PhysicalConstants.h"
 
 #include <cmath>
@@ -17,7 +17,7 @@ using InDetDD::electrons;
 // This value for the number of eh pairs per deposited energy is fairly standard I think. 
 // In reality there is some temperture dependence but for the temperature ranges we deal with 
 // I don't think variations are too signifcant.
-double SiliconProperties::s_ehPairsPerEnergyDefault = 1. / (3.62 * CLHEP::eV); // 1 eh pair per 3.62 CLHEP::eV.
+const double SiliconProperties::s_ehPairsPerEnergyDefault = 1. / (3.62 * CLHEP::eV); // 1 eh pair per 3.62 CLHEP::eV.
 
 // Constants used in the formula
 const double elecHallFactZero  = 1.13;
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconPropertiesVector.cxx
similarity index 95%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconPropertiesVector.cxx
index ee6bac0fcc7..07802c39a33 100644
--- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/src/SiliconPropertiesVector.cxx
@@ -6,7 +6,7 @@
 //   Source file for class SiliconPropertiesVector for SiPropertiesTool
 ///////////////////////////////////////////////////////////////////
 
-#include "SiPropertiesSvc/SiliconPropertiesVector.h"
+#include "SiPropertiesTool/SiliconPropertiesVector.h"
 
 namespace InDet {
   
diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx b/InnerDetector/InDetConditions/SiPropertiesTool/src/components/SiPropertiesTool_entries.cxx
similarity index 100%
rename from InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx
rename to InnerDetector/InDetConditions/SiPropertiesTool/src/components/SiPropertiesTool_entries.cxx
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt
index f7726b75231..47f99e0ea6a 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt
@@ -52,7 +52,7 @@ atlas_add_component( FastSiDigitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib EventPrimitives xAODEventInfo GaudiKernel SiPropertiesSvcLib InDetReadoutGeometry InDetSimData InDetPrepRawData SiClusterizationToolLib InDetSimEvent HitManagement ISF_FatrasDetDescrModel ISF_FatrasEvent TrkTruthData TrkEventTPCnv CxxUtils StoreGateLib SGtests Identifier GeneratorObjects InDetIdentifier TrkDetDescrInterfaces TrkDigEvent TrkGeometry TrkSurfaces TrkExUtils )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib EventPrimitives xAODEventInfo GaudiKernel InDetReadoutGeometry InDetSimData InDetPrepRawData SiClusterizationToolLib InDetSimEvent HitManagement ISF_FatrasDetDescrModel ISF_FatrasEvent TrkTruthData TrkEventTPCnv CxxUtils StoreGateLib SGtests Identifier GeneratorObjects InDetIdentifier TrkDetDescrInterfaces TrkDigEvent TrkGeometry TrkSurfaces TrkExUtils )
 
 # Install files from the package:
 atlas_install_headers( FastSiDigitization )
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
index daab02627af..f661898dcc5 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
@@ -118,7 +118,7 @@ def commonSCT_FastDigitizationConfig(name,**kwargs):
     sct_SiliconConditionsToolSetup.setDcsTool(sct_DCSConditionsToolSetup.getTool())
     sct_SiliconConditionsToolSetup.setup()
     # Set up SCT_SiPropertiesTool
-    from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+    from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
     sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
     sct_SiPropertiesToolSetup.setSiliconTool(sct_SiliconConditionsToolSetup.getTool())
     sct_SiPropertiesToolSetup.setup()
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py
index 3cfc1ad423c..39583822514 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py
@@ -36,7 +36,7 @@ from AthenaCommon.BeamFlags import jobproperties
 # sct_SiliconConditionsToolSetup.setup()
 
 # # Silicon properties tool
-# from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+# from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
 # sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
 # sct_SiPropertiesToolSetup.setSiliconTool(sct_SiliconConditionsToolSetup.getTool())
 # sct_SiPropertiesToolSetup.setup()
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt
index 596d1a44497..0e5c9d2ed6d 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt
+++ b/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt
@@ -22,7 +22,7 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetConditions/PixelConditionsServices
                           InnerDetector/InDetConditions/PixelConditionsTools
                           InnerDetector/InDetConditions/PixelConditionsData
-                          InnerDetector/InDetConditions/SiPropertiesSvc
+                          InnerDetector/InDetConditions/SiPropertiesTool
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetDigitization/SiDigitization
@@ -42,7 +42,7 @@ atlas_add_component( PixelDigitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel CommissionEvent AthenaKernel PileUpToolsLib StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects PixelConditionsData SiPropertiesSvcLib InDetIdentifier InDetReadoutGeometry SiDigitization InDetRawData InDetSimData InDetSimEvent HitManagement PathResolver )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel CommissionEvent AthenaKernel PileUpToolsLib StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects PixelConditionsData SiPropertiesToolLib InDetIdentifier InDetReadoutGeometry SiDigitization InDetRawData InDetSimData InDetSimEvent HitManagement PathResolver )
 
 # Install files from the package:
 atlas_install_headers( PixelDigitization )
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
index 76f996b721c..f676c1442ae 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py
@@ -43,7 +43,7 @@ def EnergyDepositionTool(name="EnergyDepositionTool", **kwargs):
 def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs):
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-         from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+         from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
          pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
          pixelSiPropertiesToolSetup.setup()
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
@@ -56,7 +56,7 @@ def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs):
 def SensorSim3DTool(name="SensorSim3DTool", **kwargs):
     from AthenaCommon.AppMgr import ToolSvc
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-         from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+         from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
          pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
          pixelSiPropertiesToolSetup.setup()
     if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx
index 6ecdcb7e24f..23e675efd6f 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx
@@ -21,7 +21,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
index 59ca1fe472b..563da6cda3e 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx
@@ -16,7 +16,7 @@
 #include "SiDigitization/SiSurfaceCharge.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx
index b41b58cf6cf..081639f3039 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx
@@ -16,7 +16,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimTool.h b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimTool.h
index f2ffb940f1f..89bb84abbf6 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimTool.h
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimTool.h
@@ -21,7 +21,7 @@
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "SiDigitization/SiChargedDiodeCollection.h"
 #include "InDetReadoutGeometry/PixelModuleDesign.h"
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 static const InterfaceID IID_ISensorSimTool("SensorSimTool", 1, 0);
 
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/PixelRadDamDigitization/CMakeLists.txt
index 1a9b4a94d57..171b4db8364 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/CMakeLists.txt
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/CMakeLists.txt
@@ -21,7 +21,7 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetConditions/InDetCondTools
                           InnerDetector/InDetConditions/PixelConditionsServices
                           InnerDetector/InDetConditions/PixelConditionsTools
-                          InnerDetector/InDetConditions/SiPropertiesSvc
+                          InnerDetector/InDetConditions/SiPropertiesTool
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetDigitization/SiDigitization
@@ -41,7 +41,7 @@ atlas_add_component( PixelRadDamDigitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel CommissionEvent AthenaKernel PileUpToolsLib StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects InDetCondTools PixelConditionsData SiPropertiesSvcLib InDetIdentifier InDetReadoutGeometry SiDigitization InDetRawData InDetSimData InDetSimEvent HitManagement PathResolver )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel CommissionEvent AthenaKernel PileUpToolsLib StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects InDetCondTools PixelConditionsData SiPropertiesToolLib InDetIdentifier InDetReadoutGeometry SiDigitization InDetRawData InDetSimData InDetSimEvent HitManagement PathResolver )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py
index e0a3ea13c57..92af4950a55 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py
@@ -44,7 +44,7 @@ def EnergyDepositionTool(name="EnergyDepositionTool", **kwargs):
 
 def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs):
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-        from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+        from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
         pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
         pixelSiPropertiesToolSetup.setup()
     kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool)
@@ -54,7 +54,7 @@ def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs):
 
 def SensorSim3DTool(name="SensorSim3DTool", **kwargs):
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-        from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+        from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
         pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
         pixelSiPropertiesToolSetup.setup()
     kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool)
@@ -64,7 +64,7 @@ def SensorSim3DTool(name="SensorSim3DTool", **kwargs):
 
 def SensorSimTool(name="SensorSimTool", **kwargs):
     if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
-        from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+        from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
         pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
         pixelSiPropertiesToolSetup.setup()
     kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool)
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/EnergyDepositionTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/EnergyDepositionTool.cxx
index b26ff473a96..27ebbe18a09 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/EnergyDepositionTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/EnergyDepositionTool.cxx
@@ -21,7 +21,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RadDamageUtil.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RadDamageUtil.cxx
index 0ed2793422c..87bae22ae5c 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RadDamageUtil.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RadDamageUtil.cxx
@@ -23,7 +23,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx
index 425f0c882b3..c5db4b438db 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx
@@ -16,7 +16,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx
index 3ac22271ca4..a7152bd2750 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx
@@ -16,7 +16,7 @@
 #include "InDetSimEvent/SiHit.h"
 #include "InDetIdentifier/PixelID.h"
 #include "GeneratorObjects/HepMcParticleLink.h"
-#include "SiPropertiesSvc/SiliconProperties.h"
+#include "SiPropertiesTool/SiliconProperties.h"
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h
index 76b81c1051a..227632be15f 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h
@@ -20,7 +20,7 @@
 
 #include "HitManagement/TimedHitPtr.h"
 #include "SiDigitization/SiChargedDiodeCollection.h"
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "SiDigitization/SiChargedDiodeCollection.h"
 #include "InDetReadoutGeometry/PixelModuleDesign.h"
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt b/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
index fecb6927f58..2b9b8579070 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
@@ -24,7 +24,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Generators/GeneratorObjects
                           InnerDetector/InDetConditions/InDetConditionsSummaryService
                           InnerDetector/InDetConditions/SCT_ConditionsTools
-                          InnerDetector/InDetConditions/SiPropertiesSvc
+                          InnerDetector/InDetConditions/SiPropertiesTool
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
                           InnerDetector/InDetDetDescr/SCT_ModuleDistortions
@@ -40,7 +40,7 @@ atlas_add_component( SCT_Digitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CommissionEvent AthenaBaseComps AthenaKernel PileUpToolsLib Identifier xAODEventInfo GaudiKernel SiDigitization InDetRawData InDetSimEvent HitManagement GeneratorObjects SiPropertiesSvcLib InDetIdentifier InDetReadoutGeometry InDetSimData )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} CommissionEvent AthenaBaseComps AthenaKernel PileUpToolsLib Identifier xAODEventInfo GaudiKernel SiDigitization InDetRawData InDetSimEvent HitManagement GeneratorObjects SiPropertiesToolLib InDetIdentifier InDetReadoutGeometry InDetSimData )
 
 # Install files from the package:
 atlas_install_headers( SCT_Digitization )
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
index f0f684910a1..0f8996f573e 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py
@@ -44,7 +44,7 @@ def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs)
     sct_SiliconConditionsToolSetup.setDcsTool(sct_DCSConditionsToolSetup.getTool())
     sct_SiliconConditionsToolSetup.setup()
     # Set up SCT_SiPropertiesTool
-    from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+    from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
     sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
     sct_SiPropertiesToolSetup.setSiliconTool(sct_SiliconConditionsToolSetup.getTool())
     sct_SiPropertiesToolSetup.setup()
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.h
index cbfc68d0f53..2d9f02c9712 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.h
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.h
@@ -21,7 +21,7 @@
 #include "InDetConditionsSummaryService/ISiliconConditionsTool.h"
 #include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "SCT_ModuleDistortions/ISCT_ModuleDistortionsTool.h"
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 // Gaudi
 #include "GaudiKernel/ServiceHandle.h"
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
index 8805bef34c1..2fd4f3c41fa 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
@@ -39,7 +39,7 @@
 #include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "SCT_ConditionsTools/ISCT_RadDamageSummaryTool.h"
 #include "SCT_ModuleDistortions/ISCT_ModuleDistortionsTool.h"
-#include "SiPropertiesSvc/ISiPropertiesTool.h"
+#include "SiPropertiesTool/ISiPropertiesTool.h"
 
 // Gaudi
 #include "GaudiKernel/ITHistSvc.h" // for ITHistSvc
diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
old mode 100755
new mode 100644
index a390e41f293..f417a79e9e7
--- a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py
@@ -60,7 +60,7 @@ from AthenaCommon.AppMgr import ServiceMgr
 # Pixel
 #
 # Load DCS service
-from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
 pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
 pixelSiPropertiesToolSetup.setup()
 pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool()
@@ -83,7 +83,7 @@ sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
 sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool
 
 # Silicon properties tool
-from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
 sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
 sct_SiPropertiesToolSetup.setSiliconTool(sctSiliconConditionsTool)
 sct_SiPropertiesToolSetup.setup()
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
index 660226db840..dcef2787056 100644
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
@@ -181,10 +181,10 @@ class PixelConditionsServicesSetup:
     # Lorentz Angle Setup #
     #######################
     if not hasattr(condSeq, 'PixelSiPropertiesCondAlg'):
-      from SiPropertiesSvc.SiPropertiesSvcConf import PixelSiPropertiesCondAlg
+      from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
       condSeq += PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")
 
-    from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesTool
+    from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
     TrigSiPropertiesTool = SiPropertiesTool(name="PixelSiPropertiesTool", DetectorName="Pixel", ReadKey="PixelSiliconPropertiesVector")
 
     ToolSvc += TrigSiPropertiesTool
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
old mode 100755
new mode 100644
index 7673748b476..b6702d3e911
--- a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
@@ -64,7 +64,7 @@ from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsT
 pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup()
 pixelDCSConditionsToolSetup.setup()
 pixelDCSConditionsTool = pixelDCSConditionsToolSetup.getTool()
-from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
+from SiPropertiesTool.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup
 pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup()
 pixelSiPropertiesToolSetup.setup()
 pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool()
@@ -87,7 +87,7 @@ sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool
 sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool
 
 # Silicon properties tool
-from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
+from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup
 sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup()
 sct_SiPropertiesToolSetup.setSiliconTool(sctSiliconConditionsTool)
 sct_SiPropertiesToolSetup.setup()
diff --git a/Simulation/G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py b/Simulation/G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py
old mode 100755
new mode 100644
index 61e98d6bc27..1bab65b8ea7
--- a/Simulation/G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py
+++ b/Simulation/G4Atlas/G4AtlasTests/scripts/sim_parse_prof.py
@@ -260,8 +260,8 @@ class LibraryEstimator:
             ('InDetDD::SCT_BarrelModuleSide','InDetReadoutGeometry'),
             ('InDetDD::SCT_ForwardModuleSide','InDetReadoutGeometry'),
             ('InDetDD::SCT_ForwardFrameTransformation','InDetReadoutGeometry'),
-            ('SiPropertiesSvc','SiPropertiesSvc'),
-            ('SiliconProperties','SiPropertiesSvc'),
+            ('SiPropertiesTool','SiPropertiesTool'),
+            ('SiliconProperties','SiPropertiesTool'),
             ('dsfmt','AtlasCLHEP_RandomGenerators'),
             ('CLHEP::dSFMTEngine','AtlasCLHEP_RandomGenerators'),
             ('CLHEP::RandGaussZiggurat','AtlasCLHEP_RandomGenerators'),
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index 1e3a220a165..e8c25f0b688 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
@@ -169,10 +169,10 @@ def TrigInDetCondConfig( flags ):
   from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg
   acc.addCondAlgo(PixelConfigCondAlg(name="PixelConfigCondAlg", UseDeadMap=False, ReadDeadMapKey=PixelDeadMapFolder))
 
-  from SiPropertiesSvc.SiPropertiesSvcConf import PixelSiPropertiesCondAlg
+  from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
   acc.addCondAlgo(PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg"))
 
-  from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesTool
+  from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
   TrigSiPropertiesTool = SiPropertiesTool(name="PixelSiPropertiesTool", DetectorName="Pixel", ReadKey="PixelSiliconPropertiesVector")
 
   acc.addPublicTool(TrigSiPropertiesTool)
-- 
GitLab


From 572f9e0964910b9197c4802cc117f5d369357fff Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Mon, 4 Mar 2019 12:46:51 +0000
Subject: [PATCH 180/404] LAr FEB reader conditions  algo

---
 .../LArCalibTools/LArGainThresholds2Ntuple.h  |   8 +-
 .../share/LArGainThresholds2Ntuple.py         |  67 +++--------
 .../LArCalibTools/src/LArCond2NtupleBase.cxx  |   2 +-
 .../src/LArGainThresholds2Ntuple.cxx          |  51 ++++----
 .../LArRecConditions/CMakeLists.txt           |   3 +-
 .../LArRecConditions/LArFebConfig.h           |  57 +++++++++
 .../LArRecConditions/src/LArFebConfig.cxx     |  39 ++++++
 .../python/LArADC2MeVCondAlgDefault.py        |   4 +-
 .../python/LArADC2MeVToolDefault.py           |   7 +-
 ...efault.py => LArFebConfigCondAlgConfig.py} |  25 ++--
 .../python/LArFebConfigCondAlgDefault.py      |  46 +++++++
 .../LArRecUtils/python/LArRecUtilsConfigDb.py |   1 -
 .../LArRecUtils/src/LArADC2MeVCondAlg.cxx     |  30 +++--
 .../LArRecUtils/src/LArADC2MeVCondAlg.h       |  11 +-
 .../LArRecUtils/src/LArADC2MeVTool.cxx        |  18 ++-
 .../LArRecUtils/src/LArADC2MeVTool.h          |   7 +-
 .../LArRecUtils/src/LArFEBConfigCondAlg.cxx   | 112 ++++++++++++++++++
 .../LArRecUtils/src/LArFEBConfigCondAlg.h     |  35 ++++++
 .../LArRecUtils/src/LArFEBConfigReader.cxx    | 110 -----------------
 .../LArRecUtils/src/LArFEBConfigReader.h      |  63 ----------
 .../src/components/LArRecUtils_entries.cxx    |   4 +-
 21 files changed, 388 insertions(+), 312 deletions(-)
 create mode 100644 LArCalorimeter/LArRecConditions/LArRecConditions/LArFebConfig.h
 create mode 100644 LArCalorimeter/LArRecConditions/src/LArFebConfig.cxx
 rename LArCalorimeter/LArRecUtils/python/{LArFEBConfigReaderDefault.py => LArFebConfigCondAlgConfig.py} (60%)
 create mode 100644 LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py
 create mode 100644 LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.cxx
 create mode 100644 LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.h
 delete mode 100644 LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.cxx
 delete mode 100644 LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.h

diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArGainThresholds2Ntuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArGainThresholds2Ntuple.h
index 3ee4f9cd7b3..6841c9a6c2e 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArGainThresholds2Ntuple.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArGainThresholds2Ntuple.h
@@ -1,14 +1,15 @@
 //Dear emacs, this is -*- 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 LARGAINTHRESHOLDS2NTUPLE
 #define LARGAINTHRESHOLDS2NTUPLE
 #include "LArCalibTools/LArCond2NtupleBase.h"
-#include "LArElecCalib/ILArFEBConfigReader.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "LArRecConditions/LArFebConfig.h"
 
 class LArGainThresholds2Ntuple : public LArCond2NtupleBase
 {
@@ -21,7 +22,8 @@ class LArGainThresholds2Ntuple : public LArCond2NtupleBase
   StatusCode finalize(){return StatusCode::SUCCESS;}
   StatusCode stop();
  private:
-  ToolHandle<ILArFEBConfigReader> m_febConfigReader;
+
+  SG::ReadCondHandleKey<LArFebConfig> m_configKey{this, "inputKey","LArFebConfig", "Input key for FEB config object"};
 
 };
 
diff --git a/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py b/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py
index fadd2ca78c7..44edf30ec9f 100644
--- a/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py
+++ b/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py
@@ -12,7 +12,7 @@ globalflags.DataSource.set_Value_and_Lock('data')
 globalflags.InputFormat.set_Value_and_Lock('bytestream')
 
 from AthenaCommon.JobProperties import jobproperties
-jobproperties.Global.DetDescrVersion = "ATLAS-GEO-20-00-00"
+jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
 
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.Calo_setOff()
@@ -28,61 +28,29 @@ from AtlasGeoModel import GeoModelInit
 
 #Get identifier mapping (needed by LArConditionsContainer)
                            
-svcMgr.IOVDbSvc.GlobalTag="LARCALIB-000-02"
+svcMgr.IOVDbSvc.GlobalTag="LARCALIB-RUN2-02"
 include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" )
 
 theApp.EvtMax = 1
 svcMgr.EventSelector.RunNumber = 500000
 svcMgr.EventSelector.InitialTimeStamp=int(time())
-dbname="<db>COOLOFL_LAR/COMP200</db>"
-
-conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>"+dbname)
-conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>"+dbname)
-#conddb.addFolder("","/LAR/ElecCalibOfl/PhysCaliTdiff<key>input</key>"+dbname)
-
-## LArFebConfigFolders=[
-##     "/LAR/Configuration/FEBConfig/Physics/EMBA1",  
-##     "/LAR/Configuration/FEBConfig/Physics/EMBA2",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBA3",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBA4",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBC1",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBC2",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBC3",
-##     "/LAR/Configuration/FEBConfig/Physics/EMBC4", 
-##     "/LAR/Configuration/FEBConfig/Physics/EMECA1",
-##     "/LAR/Configuration/FEBConfig/Physics/EMECA2",
-##     "/LAR/Configuration/FEBConfig/Physics/EMECA3",
-##     "/LAR/Configuration/FEBConfig/Physics/EMECC1",
-##     "/LAR/Configuration/FEBConfig/Physics/EMECC2",
-##     "/LAR/Configuration/FEBConfig/Physics/EMECC3",
-##     "/LAR/Configuration/FEBConfig/Physics/FCALA", 
-##     "/LAR/Configuration/FEBConfig/Physics/FCALC", 
-##     "/LAR/Configuration/FEBConfig/Physics/HECA", 
-##     "/LAR/Configuration/FEBConfig/Physics/HECC", 
-## ]
-
-
-## for f in LArFebConfigFolders:
-##     conddb.addFolder("LAR_ONL",f)
-
-
-## from LArRecUtils.LArRecUtils import LArFEBConfigReader
-## theLArFebConfigReader=LArFEBConfigReader()
-## theLArFebConfigReader.OutputLevel=DEBUG
-## theLArFebConfigReader.ListOfFolders=LArFebConfigFolders
-
-
-
-from LArRecUtils.LArFEBConfigReaderDefault import LArFEBConfigReaderDefault
-theLArFebConfigReader=LArFEBConfigReaderDefault()
-theLArFebConfigReader.OutputLevel=DEBUG
-ToolSvc+=theLArFebConfigReader
+dbname="<db>COOLOFL_LAR/CONDBR2</db>"
+
+#conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>"+dbname)
+#conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>"+dbname)
+from LArBadChannelTool.LArBadChannelAccess import LArBadChannelAccess
+LArBadChannelAccess()
+#from LArBadChannelTool.LArBadFebAccess import LArBadFebAccess
+#LArBadFebAccess()
+
+from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault
+LArFebConfigCondAlgDefault()
 
 from LArCalibTools.LArCalibToolsConf import LArGainThresholds2Ntuple
 theLArGainThresholds2Ntuple=LArGainThresholds2Ntuple()
 theLArGainThresholds2Ntuple.OutputLevel=DEBUG
 theLArGainThresholds2Ntuple.AddFEBTempInfo=False
-theLArGainThresholds2Ntuple.FebConfigReader=theLArFebConfigReader
+theLArGainThresholds2Ntuple.isSC=False
 
 topSequence+=theLArGainThresholds2Ntuple
 
@@ -96,11 +64,10 @@ svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='thresholds.root' OPT='NEW'" ]
 #svcMgr.MessageSvc.OutputLevel = DEBUG
 
 svcMgr.IOVDbSvc.DBInstance=""
-svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml",
-                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml",
-                               ]
+#svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml",
+#                               "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml",
+#                               ]
 
 
 svcMgr.MessageSvc.debugLimit = 5000000
-
 svcMgr.IOVDbSvc.OutputLevel=DEBUG
diff --git a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
index 03eb8f633ea..5d2a0667156 100644
--- a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
@@ -281,7 +281,7 @@ bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) {
      return false;
  }
  const LArOnOffIdMapping* cabling=nullptr;
- if(m_isSC) {
+ if(!m_isSC) {
     SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
     cabling = *cablingHdl;
  } else {
diff --git a/LArCalorimeter/LArCalibTools/src/LArGainThresholds2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArGainThresholds2Ntuple.cxx
index 168e8399b07..e526bd605f6 100644
--- a/LArCalorimeter/LArCalibTools/src/LArGainThresholds2Ntuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArGainThresholds2Ntuple.cxx
@@ -1,14 +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
 */
 
 #include "LArCalibTools/LArGainThresholds2Ntuple.h"
 #include "LArIdentifier/LArOnlineID.h"
 
 LArGainThresholds2Ntuple::LArGainThresholds2Ntuple(const std::string& name, ISvcLocator* pSvcLocator): 
-  LArCond2NtupleBase(name, pSvcLocator), m_febConfigReader("LArFEBConfigReader") {
+  LArCond2NtupleBase(name, pSvcLocator) {
 
-  declareProperty("FebConfigReader",m_febConfigReader);
   m_ntTitle="Gain Thresholds";
   m_ntpath="/NTUPLES/FILE1/GAINTH";
 }
@@ -16,10 +15,7 @@ LArGainThresholds2Ntuple::LArGainThresholds2Ntuple(const std::string& name, ISvc
 
 StatusCode LArGainThresholds2Ntuple::initialize() {
 
-  if (m_febConfigReader.retrieve().isFailure()) {
-    msg(MSG::ERROR) << "Failed to retrieve tool " << m_febConfigReader << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(m_configKey.initialize());
 
   return LArCond2NtupleBase::initialize();
 }
@@ -28,40 +24,35 @@ LArGainThresholds2Ntuple::~LArGainThresholds2Ntuple()
 {}
 
 StatusCode LArGainThresholds2Ntuple::stop() {
-  StatusCode sc;
-  NTuple::Item<long> lower;
-  NTuple::Item<long> upper;
+
+   ATH_MSG_DEBUG(" trying stop");
+
+   NTuple::Item<long> lower;
+   NTuple::Item<long> upper;
  
-   sc=m_nt->addItem("lower",lower,-1000,5000);
-   if (sc!=StatusCode::SUCCESS) {
-     msg(MSG::ERROR) << "addItem 'lower' failed" << endmsg;
-     return StatusCode::FAILURE;
-   }
-   
-   sc=m_nt->addItem("upper",upper,-1000.,5000.);
-   if (sc!=StatusCode::SUCCESS) {
-     msg(MSG::ERROR) << "addItem 'upper' failed" << endmsg;
+   SG::ReadCondHandle<LArFebConfig> configHdl{m_configKey};
+   const LArFebConfig* febConfig = *configHdl;
+   if (febConfig==nullptr) {
+     ATH_MSG_ERROR( "Unable to retrieve LArFebConfig with key " << m_configKey.key());
      return StatusCode::FAILURE;
    }
+
+   ATH_CHECK(m_nt->addItem("lower",lower,-1000,5000));
+   ATH_CHECK(m_nt->addItem("upper",upper,-1000.,5000.));
    
    std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin();
    std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end();
    for(; itOnId!=itOnIdEnd;++itOnId){
      const HWIdentifier hwid = *itOnId;
-     lower=m_febConfigReader->lowerGainThreshold(hwid);
-     upper=m_febConfigReader->upperGainThreshold(hwid);
-     
+     lower=febConfig->lowerGainThreshold(hwid);
+     upper=febConfig->upperGainThreshold(hwid);
+
      fillFromIdentifier(hwid);
      
-     sc=ntupleSvc()->writeRecord(m_nt);      
-     if (sc!=StatusCode::SUCCESS) {
-       (*m_log) << MSG::ERROR << "writeRecord failed" << endmsg;
-       return StatusCode::FAILURE;
-     }
+     ATH_CHECK(ntupleSvc()->writeRecord(m_nt));      
    }
  
-   msg(MSG::INFO) << "LArGainThresholds2Ntuple has finished." << endmsg;
+   ATH_MSG_INFO("LArGainThresholds2Ntuple has finished.");
    return StatusCode::SUCCESS;
    
-}// end finalize-method.
-   
+}
diff --git a/LArCalorimeter/LArRecConditions/CMakeLists.txt b/LArCalorimeter/LArRecConditions/CMakeLists.txt
index a2a15271ea4..e389bfa4898 100644
--- a/LArCalorimeter/LArRecConditions/CMakeLists.txt
+++ b/LArCalorimeter/LArRecConditions/CMakeLists.txt
@@ -10,6 +10,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Calorimeter/CaloIdentifier
 			  LArCalorimeter/LArIdentifier
                           Control/AthenaKernel
+                          Control/AthenaBaseComps
                           DetectorDescription/Identifier
                           GaudiKernel
                           PRIVATE
@@ -24,7 +25,7 @@ atlas_add_library( LArRecConditions
                    src/*.cxx
                    PUBLIC_HEADERS LArRecConditions
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES CaloIdentifier LArIdentifier AthenaKernel Identifier GaudiKernel
+                   LINK_LIBRARIES CaloIdentifier LArIdentifier AthenaKernel Identifier GaudiKernel AthenaBaseComps
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_dictionary( LArRecConditionsDict
diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebConfig.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebConfig.h
new file mode 100644
index 00000000000..f63cbe0e72c
--- /dev/null
+++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArFebConfig.h
@@ -0,0 +1,57 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARRECCONDITIONS_LARFEBCONFIG_H
+#define LARRECCONDITIONS_LARFEBCONFIG_H
+
+#include "AthenaBaseComps/AthMessaging.h"
+#include "Identifier/HWIdentifier.h"
+#include "CoralBase/AttributeList.h"
+#include "LArElecCalib/LArCalibErrorCode.h"
+#include <vector>
+#include <mutex>
+
+class LArOnlineID;
+
+class LArFebConfig:  public AthMessaging {
+
+  friend class LArFEBConfigCondAlg; //The conditions alg filling this object
+
+ public:
+  LArFebConfig()=delete;
+  LArFebConfig(const LArOnlineID* onlineId); // we do not own this pointer
+
+  //Accessor methods from ILArFEBConfigReader
+  short lowerGainThreshold(const HWIdentifier& id) const;
+  short upperGainThreshold(const HWIdentifier& id) const;
+
+ private:
+  const LArOnlineID* m_onlineID;
+
+  std::map<HWIdentifier,const coral::AttributeList*> m_attrPerFeb;
+  mutable std::map<HWIdentifier,const coral::AttributeList*>::const_iterator m_lastIt;
+  mutable std::mutex m_itMtx;
+
+  short getThreshold(const char* MedLow, const HWIdentifier& chid) const;
+
+  enum {ERRORCODE = LArElecCalib::ERRORCODE};
+
+};
+
+inline short LArFebConfig::lowerGainThreshold(const HWIdentifier& chid) const {
+  return getThreshold("lower",chid);
+}
+
+
+inline short LArFebConfig::upperGainThreshold(const HWIdentifier& chid) const {
+  return getThreshold("upper",chid);
+}
+
+
+#include "AthenaKernel/CLASS_DEF.h"
+CLASS_DEF( LArFebConfig, 155518838 , 1)
+#include "AthenaKernel/CondCont.h"
+CLASS_DEF( CondCont<LArFebConfig>, 148539538 , 1)
+
+#endif
diff --git a/LArCalorimeter/LArRecConditions/src/LArFebConfig.cxx b/LArCalorimeter/LArRecConditions/src/LArFebConfig.cxx
new file mode 100644
index 00000000000..3c597c620c7
--- /dev/null
+++ b/LArCalorimeter/LArRecConditions/src/LArFebConfig.cxx
@@ -0,0 +1,39 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArRecConditions/LArFebConfig.h"
+#include "LArIdentifier/LArOnlineID.h"
+#include "GaudiKernel/ISvcLocator.h"
+#include "GaudiKernel/IMessageSvc.h"
+#include "CoralBase/Attribute.h"
+
+LArFebConfig::LArFebConfig(const LArOnlineID* onlineId) : 
+  AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ),"LArFebConfig"),
+  m_onlineID(onlineId)
+
+{ }
+
+short LArFebConfig::getThreshold(const char* MedLow, const HWIdentifier& chid) const {
+
+  if (m_attrPerFeb.size()==0) {
+    ATH_MSG_WARNING("FEB treshold cache is empty. Callback not fired?");
+    return ERRORCODE;
+  }
+
+  std::lock_guard<std::mutex> lock(m_itMtx); //Makes sure the following isn't executed concurently
+
+  const HWIdentifier fid=m_onlineID->feb_Id(chid);
+  const int channel=m_onlineID->channel(chid); 
+  if (m_lastIt==m_attrPerFeb.end() || m_lastIt->first!=fid)
+    m_lastIt=m_attrPerFeb.find(fid);
+
+  if (m_lastIt==m_attrPerFeb.end()) { 
+    ATH_MSG_DEBUG("Such FEB was not found !");
+    return ERRORCODE;
+  }else {
+     std::string channame(MedLow,5);
+     channame += std::to_string(channel+1);
+    return (short)(*(m_lastIt->second))[channame].data<int32_t>(); //Will throw and exception if channel does not exist
+  } 
+}
diff --git a/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py
index 551b7b98c79..c88ecae5bcd 100644
--- a/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py
+++ b/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py
@@ -40,8 +40,8 @@ def LArADC2MeVCondAlgDefault():
 
         theADC2MeVCondAlg.UseFEBGainTresholds=False
     else: # not MC:
-        from LArRecUtils.LArFEBConfigReaderDefault import LArFEBConfigReaderDefault
-        theADC2MeVCondAlg.FebConfigReader=LArFEBConfigReaderDefault()
+        from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault
+        LArFebConfigCondAlgDefault()
 
 
     condSeq+=theADC2MeVCondAlg
diff --git a/LArCalorimeter/LArRecUtils/python/LArADC2MeVToolDefault.py b/LArCalorimeter/LArRecUtils/python/LArADC2MeVToolDefault.py
index 763d697aaab..d258300fd27 100644
--- a/LArCalorimeter/LArRecUtils/python/LArADC2MeVToolDefault.py
+++ b/LArCalorimeter/LArRecUtils/python/LArADC2MeVToolDefault.py
@@ -32,11 +32,8 @@ def LArADC2MeVToolDefault (name="LArADC2MeVToolDefault", **kw):
         tool.UseHVScaleCorr = True
 
         if larCondFlags.useLArFEBGainThresholds():
-            from LArRecUtils.LArFEBConfigReaderDefault import LArFEBConfigReaderDefault
-            theLArFebConfigReader=LArFEBConfigReaderDefault()
-            #theLArFebConfigReader.OutputLevel=DEBUG
-            ServiceMgr.ToolSvc+=theLArFebConfigReader
-            tool.FebConfigReader=theLArFebConfigReader
+            from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault
+            LArFebConfigCondAlgDefault()
             tool.UseFEBGainTresholds=True
         
 
diff --git a/LArCalorimeter/LArRecUtils/python/LArFEBConfigReaderDefault.py b/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgConfig.py
similarity index 60%
rename from LArCalorimeter/LArRecUtils/python/LArFEBConfigReaderDefault.py
rename to LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgConfig.py
index 2368fea78fd..5a852542359 100644
--- a/LArCalorimeter/LArRecUtils/python/LArFEBConfigReaderDefault.py
+++ b/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgConfig.py
@@ -1,21 +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
 
-from IOVDbSvc.CondDB import conddb
-from AthenaCommon.Logging import logging
-from AthenaCommon.AppMgr import ServiceMgr
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from IOVDbSvc.IOVDbSvcConfig import addFolders
+from LArRecUtils.LArRecUtilsConf import LArFEBConfigCondAlg
 
-def LArFEBConfigReaderDefault (name="LArFEBConfigReaderDefault", **kw): 
-    mlog = logging.getLogger( 'LArFEBConfigReaderDefault::__init__ ' )
 
-    if hasattr(ServiceMgr.ToolSvc,name):
-        mlog.info("LArFEBConfigReader with name" + name + "already known to ToolSvc")
-        return getattr(ServiceMgr.ToolSvc,name)
+def LArFEBConfigCondAlgCfg (configFlags): 
 
-
-    # call base class constructor
-    from AthenaCommon import CfgMgr
-    kw['name'] = name
-    tool = CfgMgr.LArFEBConfigReader (**kw)
+    result=ComponentAccumulator()
 
     LArFebConfigFolders=[
     "/LAR/Configuration/FEBConfig/Physics/EMBA1",  
@@ -41,7 +33,8 @@ def LArFEBConfigReaderDefault (name="LArFEBConfigReaderDefault", **kw):
 
     for f in LArFebConfigFolders:
         conddb.addFolder("LAR_ONL",f)
+        result.merge(addFolders(configFlags,f,"LAR_ONL",className="CondAttrListCollection"))
+
+    result.addCondAlgo(LArFEBConfigCondAlg(ListOfFolders=LArFebConfigFolders,keyOutput="LArFebConfig"))    
 
-    tool.ListOfFolders=LArFebConfigFolders
     return tool
-    
diff --git a/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py
new file mode 100644
index 00000000000..98939d84ad2
--- /dev/null
+++ b/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Include import Include, IncludeError, include
+from IOVDbSvc.CondDB import conddb
+from AthenaCommon.AlgSequence import AthSequencer
+from LArRecUtils.LArRecUtilsConf import LArFEBConfigCondAlg
+
+
+def LArFebConfigCondAlgDefault (): 
+
+    condSeq = AthSequencer("AthCondSeq")
+    if hasattr (condSeq,"LArFEBConfigCondAlg"):
+        return getattr(condSeq,"LArFEBConfigCondAlg")
+
+    theLArFEBConfigCondAlg = LArFEBConfigCondAlg()
+
+    LArFebConfigFolders=[
+    "/LAR/Configuration/FEBConfig/Physics/EMBA1",  
+    "/LAR/Configuration/FEBConfig/Physics/EMBA2",
+    "/LAR/Configuration/FEBConfig/Physics/EMBA3",
+    "/LAR/Configuration/FEBConfig/Physics/EMBA4",
+    "/LAR/Configuration/FEBConfig/Physics/EMBC1",
+    "/LAR/Configuration/FEBConfig/Physics/EMBC2",
+    "/LAR/Configuration/FEBConfig/Physics/EMBC3",
+    "/LAR/Configuration/FEBConfig/Physics/EMBC4", 
+    "/LAR/Configuration/FEBConfig/Physics/EMECA1",
+    "/LAR/Configuration/FEBConfig/Physics/EMECA2",
+    "/LAR/Configuration/FEBConfig/Physics/EMECA3",
+    "/LAR/Configuration/FEBConfig/Physics/EMECC1",
+    "/LAR/Configuration/FEBConfig/Physics/EMECC2",
+    "/LAR/Configuration/FEBConfig/Physics/EMECC3",
+    "/LAR/Configuration/FEBConfig/Physics/FCALA", 
+    "/LAR/Configuration/FEBConfig/Physics/FCALC", 
+    "/LAR/Configuration/FEBConfig/Physics/HECA", 
+    "/LAR/Configuration/FEBConfig/Physics/HECC", 
+    ]
+
+
+    for f in LArFebConfigFolders:
+        conddb.addFolder("LAR_ONL",f,className="CondAttrListCollection")
+
+    theLArFEBConfigCondAlg.ListOfFolders=LArFebConfigFolders
+    theLArFEBConfigCondAlg.keyOutput="LArFebConfig"    
+
+    condSeq+=theLArFEBConfigCondAlg
+    return theLArFEBConfigCondAlg
diff --git a/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py b/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py
index 2c13020f134..ecf2c8f6ae1 100644
--- a/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py
+++ b/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py
@@ -6,6 +6,5 @@ addTool("LArRecUtils.LArOFCToolDefault.LArOFCToolDefault" , "LArOFCToolDefault")
 addTool("LArRecUtils.LArAutoCorrNoiseToolDefault.LArAutoCorrNoiseToolDefault" , "LArAutoCorrNoiseToolDefault")
 addTool("LArRecUtils.LArAutoCorrTotalToolDefault.LArAutoCorrTotalToolDefault","LArAutoCorrTotalToolDefault")
 addTool("LArRecUtils.LArHVCorrToolDefault.LArHVCorrToolDefault","LArHVCorrToolDefault")
-addTool("LArRecUtils.LArFEBConfigReaderDefault.LArFEBConfigReaderDefault","LArFEBConfigReaderDefault")
 addTool("LArRecUtils.LArOFPeakRecoToolDefault.LArOFPeakRecoToolDefault","LArOFPeakRecoToolDefault")
 addTool("LArRecUtils.LArParabolaPeakRecoToolDefault.LArParabolaPeakRecoToolDefault","LArParabolaPeakRecoToolDefault")
diff --git a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx
index 69e4234ac3e..f7241477e33 100644
--- a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.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
 */
 
 
@@ -16,8 +16,6 @@
 #include "LArIdentifier/LArOnline_SuperCellID.h"
 #include "CaloIdentifier/CaloGain.h"
 
-#include "LArElecCalib/ILArFEBConfigReader.h"
-
 #include <memory>
 
 #include "GaudiKernel/EventIDRange.h"
@@ -32,12 +30,10 @@ LArADC2MeVCondAlg::LArADC2MeVCondAlg(const std::string& name, ISvcLocator* pSvcL
   m_lArHVScaleCorrKey("LArHVScaleCorr"),
   m_ADC2MeVKey("LArADC2MeV","LArADC2MeV"),
   m_condSvc("CondSvc",name),
-  m_febCfgReader("LArFEBConfigReader",this),
+  m_configKey("LArFebConfig"),
   m_isSuperCell(false) {
   
 
-  //declareProperty("LArOnlineIDKey",m_larOnlineIDKey,"SG key of LArOnlineID helper obj for regular cells");
-  //declareProperty("LArSCOnlineIDKey",m_larSCOnlineIDKey,"SG key of LArOnlineID helper obj for SuperCells");
   declareProperty("LArOnOffIdMappingKey",m_cablingKey,"SG key of LArOnOffIdMapping object");
   declareProperty("LAruA2MeVKey",m_lAruA2MeVKey,"SG key of uA2MeV object");
   declareProperty("LArDAC2uAKey",m_lArDAC2uAKey,"SG key of DAC2uA object");
@@ -46,8 +42,8 @@ LArADC2MeVCondAlg::LArADC2MeVCondAlg(const std::string& name, ISvcLocator* pSvcL
   declareProperty("LArHVScaleCorrKey",m_lArHVScaleCorrKey,"SG key of HVScaleCorr object (or empty string if no HVScaleCorr)");
   declareProperty("LArADC2MeVKey",m_ADC2MeVKey,"SG key of the resulting LArADC2MeV object");
   declareProperty("isSuperCell",m_isSuperCell,"switch to true to use the SuperCell Identfier helper");
-  declareProperty("FebConfigReader",m_febCfgReader);
   declareProperty("UseFEBGainTresholds",m_useFEBGainThresholds=true);
+  declareProperty("inputKey",m_configKey,"SG key for FEB config object");
 }
 
 LArADC2MeVCondAlg::~LArADC2MeVCondAlg() {}
@@ -92,11 +88,8 @@ StatusCode LArADC2MeVCondAlg::initialize() {
     return StatusCode::FAILURE;
   }
 
-  if (m_useFEBGainThresholds) {
-    ATH_CHECK(m_febCfgReader.retrieve());
-  } else {
-    m_febCfgReader.disable();
-  }
+  if (m_useFEBGainThresholds)  ATH_CHECK(m_configKey.initialize());
+
   return StatusCode::SUCCESS;
 }
 
@@ -166,6 +159,17 @@ StatusCode LArADC2MeVCondAlg::execute() {
     return StatusCode::FAILURE;
   }
 
+  // retrieve LArFebConfig if needed
+  const LArFebConfig *febConfig=nullptr;
+  if(m_useFEBGainThresholds) {
+     SG::ReadCondHandle<LArFebConfig> configHdl{m_configKey};
+     febConfig = *configHdl;
+     if (febConfig==nullptr) {
+        ATH_MSG_ERROR( "Unable to retrieve LArFebConfig with key " << m_configKey.key());
+        return StatusCode::FAILURE;
+     }
+  }
+
   rangeOut=EventIDRange::intersect(rangeOut,rangeIn);
 
   //The following two are optional (not used for MC and/or SuperCells)
@@ -280,7 +284,7 @@ StatusCode LArADC2MeVCondAlg::execute() {
 	}
 
 	//Determine if the intercept is to be used:
-	if (igain==0 || (igain==1 && m_useFEBGainThresholds && m_febCfgReader->lowerGainThreshold(chid)<5)) { 
+	if (igain==0 || (igain==1 && febConfig && febConfig->lowerGainThreshold(chid)<5)) { 
 	  //Don't use ramp intercept in high gain and in medium gain if the no high gain is used
 	  //(eg lowerGainThreshold is ~zero)
 	  ADC2MeV.push_back(0.);
diff --git a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.h
index 2ad45971f32..992d255c6c1 100644
--- a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.h
+++ b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.h
@@ -1,7 +1,7 @@
 //Dear emacs, this is -*- 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
 */
 
 
@@ -13,7 +13,7 @@
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/WriteCondHandleKey.h"
 #include "GaudiKernel/ICondSvc.h"
-#include "GaudiKernel/ToolHandle.h"
+#include "LArRecConditions/LArFebConfig.h"
 
 class LArADC2MeV;
 class ILAruA2MeV;
@@ -23,8 +23,6 @@ class ILArMphysOverMcal;
 class ILArHVScaleCorr;
 class LArOnOffIdMapping;
 
-class ILArFEBConfigReader;
-
 class LArADC2MeVCondAlg: public AthAlgorithm {
  public:
 
@@ -50,10 +48,7 @@ class LArADC2MeVCondAlg: public AthAlgorithm {
   ServiceHandle<ICondSvc> m_condSvc;
 
 
-  //FIXME:
-  //The FEB configurations (gain thresholds) are also conditions
-  //Its stored in 18 COOL folders, so waiting for ReadCondHandleArray for migrating to a cond-algo
-  ToolHandle<ILArFEBConfigReader> m_febCfgReader;
+  SG::ReadCondHandleKey<LArFebConfig> m_configKey;
 
   bool m_useFEBGainThresholds;
   size_t m_nGains;
diff --git a/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.cxx b/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.cxx
index 26c58abe2eb..d0cb9f9ed5f 100644
--- a/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.cxx
@@ -33,8 +33,7 @@ LArADC2MeVTool::LArADC2MeVTool(const std::string& type,
     m_useHVScaleCorr(false),
     m_useFEBGainThresholds(false),
     m_cacheValid(false),
-    m_febConfigReader("LArFEBConfigReader")
-    , m_isSC(false)
+    m_isSC(false)
 
 {
   declareInterface<ILArADC2MeVTool>(this);
@@ -47,7 +46,6 @@ LArADC2MeVTool::LArADC2MeVTool(const std::string& type,
   declareProperty("UseMphysOverMcal",m_useMphysOverMcal);
   declareProperty("UseHVScaleCorr",m_useHVScaleCorr);
   declareProperty("LoadAtBegin",m_loadAtBegin=true);
-  declareProperty("FebConfigReader",m_febConfigReader);
   declareProperty("UseFEBGainTresholds",m_useFEBGainThresholds);
   declareProperty("IsSC",m_isSC);
   m_ADC2MeV=NULL;
@@ -158,7 +156,7 @@ StatusCode LArADC2MeVTool::initialize() {
     }
   }
 
-  ATH_CHECK( m_febConfigReader.retrieve( DisableTool{ !m_useFEBGainThresholds } ));
+  if(m_useFEBGainThresholds) ATH_CHECK(m_configKey.initialize());
 
   if (m_loadAtBegin) {
     ATH_MSG_DEBUG( "Setting callback function to load calibration at begin of run");
@@ -288,6 +286,16 @@ StatusCode LArADC2MeVTool::getADC2MeV() const {
   unsigned int ngains(3);
   if ( m_isSC ) ngains=1;
   
+  // retrieve LArFebConfig if needed
+  const LArFebConfig *febConfig=nullptr;
+  if(m_useFEBGainThresholds) {
+     SG::ReadCondHandle<LArFebConfig> configHdl{m_configKey};
+     febConfig = *configHdl;
+     if (febConfig==nullptr) {
+        ATH_MSG_ERROR( "Unable to retrieve LArFebConfig with key " << m_configKey.key());
+        return StatusCode::FAILURE;
+     }
+  }
   for(;it!=it_e;++it) {
     count ++;
     const HWIdentifier id  = *it;
@@ -361,7 +369,7 @@ StatusCode LArADC2MeVTool::getADC2MeV() const {
         const std::size_t iMax = ADC2DAC.size(); 
         vADC2MeV.reserve(iMax); 
   	for(unsigned int i=0;i<iMax;i++) {
-	  if (m_useFEBGainThresholds && igain==1 && i==0 && m_febConfigReader->lowerGainThreshold(id)<5) {
+	  if (febConfig && igain==1 && i==0 && febConfig->lowerGainThreshold(id)<5) {
 	    //Don't use ramp offset in MED gain offset if HIGH gain is not used
 	    ++count8;
 	    vADC2MeV.push_back(0.);
diff --git a/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.h b/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.h
index 43f2431852b..459bf417422 100644
--- a/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.h
+++ b/LArCalorimeter/LArRecUtils/src/LArADC2MeVTool.h
@@ -28,7 +28,9 @@
 #include "LArElecCalib/ILAruA2MeV.h"
 #include "LArElecCalib/ILArMphysOverMcal.h"
 #include "LArElecCalib/ILArHVScaleCorr.h"
-#include "LArElecCalib/ILArFEBConfigReader.h"
+
+#include "StoreGate/ReadCondHandleKey.h"
+#include "LArRecConditions/LArFebConfig.h"
 
 #include "StoreGate/DataHandle.h"
 #include "LArCabling/LArCablingBase.h"
@@ -104,7 +106,8 @@ class LArADC2MeVTool: public AthAlgTool,
   mutable LArConditionsContainer< std::vector<float> >* m_ADC2MeV;
   mutable std::vector< std::vector < float > > m_ADC2MeV_vec;
 
-  ToolHandle<ILArFEBConfigReader> m_febConfigReader;
+  SG::ReadCondHandleKey<LArFebConfig> m_configKey{this, "inputKey","LArFebConfig", "Input key for FEB config object"};
+
   bool m_isSC;
 };
 
diff --git a/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.cxx
new file mode 100644
index 00000000000..3f533c68a93
--- /dev/null
+++ b/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.cxx
@@ -0,0 +1,112 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArFEBConfigCondAlg.h"
+#include "LArIdentifier/LArOnlineID.h"
+
+
+LArFEBConfigCondAlg::LArFEBConfigCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
+  AthReentrantAlgorithm(name,pSvcLocator),m_onlineID(nullptr) {
+
+  declareProperty("ListOfFolders",m_listOfFolders);
+
+}
+
+
+LArFEBConfigCondAlg::~LArFEBConfigCondAlg() {}
+
+StatusCode LArFEBConfigCondAlg::initialize() {
+  
+  ATH_MSG_DEBUG(" trying initialize");
+
+  ATH_CHECK(detStore()->retrieve(m_onlineID,"LArOnlineID"));
+
+  if (m_listOfFolders.size()==0) {
+    ATH_MSG_WARNING( "List of folders is emtpy, do nothing");
+    return StatusCode::SUCCESS;
+  }
+
+  for (size_t i=0;i<m_listOfFolders.size();++i) {
+     ATH_CHECK(m_listOfFolders[i].initialize());
+  }//end loop over folders
+     
+  ATH_CHECK(m_configKey.initialize());
+
+  ATH_MSG_DEBUG("Successfully initialized LArFEBConfigCondAlg");
+  return StatusCode::SUCCESS;
+} 
+
+
+  
+StatusCode LArFEBConfigCondAlg::execute(const EventContext& ctx) const {
+  ATH_MSG_DEBUG("executing");
+
+  SG::WriteCondHandle<LArFebConfig> writeHandle{m_configKey};
+  if (writeHandle.isValid()) {
+      ATH_MSG_DEBUG("Found valid write LArFebConfig handle");
+      return StatusCode::SUCCESS;
+  }
+
+  // Define validity of the output cond object 
+  const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
+  const EventIDBase stop{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
+  EventIDRange rangeW{start, stop};
+
+  std::vector<const CondAttrListCollection*> attrvec;
+
+  for (auto fldkey: m_listOfFolders) {
+     SG::ReadCondHandle<CondAttrListCollection> cHdl(fldkey, ctx);
+     const CondAttrListCollection* cattr = *cHdl;
+     if(cattr) {
+        ATH_MSG_DEBUG("Folder: "<<cHdl.key()<<" has size: "<<std::distance(cattr->begin(),cattr->end()));
+        attrvec.push_back(cattr);
+        EventIDRange rangeW_tmp;
+        if(!cHdl.range(rangeW_tmp)) {
+          ATH_MSG_ERROR("Failed to retrieve validity range for " << cHdl.key());
+          return StatusCode::FAILURE;
+        }
+        ATH_MSG_DEBUG("and validity range: "<<rangeW_tmp);
+        rangeW.intersect(rangeW,rangeW_tmp);
+     } else {
+         ATH_MSG_WARNING("Why do not have FEB config folder " << fldkey.fullKey());
+     }
+  } 
+
+  // Fill LArFebConfig
+  std::unique_ptr<LArFebConfig> febConfig=std::make_unique<LArFebConfig>(m_onlineID);
+  LArFebConfig* p_febConfig = febConfig.get();
+
+  unsigned nFebs=0;
+  for(auto dh: attrvec){
+    CondAttrListCollection::const_iterator chanit=dh->begin();
+    CondAttrListCollection::const_iterator chanit_e=dh->end();
+    for (;chanit!=chanit_e;++chanit) {
+      if (chanit->first==0) {
+	ATH_MSG_DEBUG("Invalid channel number 0, ignoring...");
+	continue;
+      }  
+      const HWIdentifier fid(chanit->first); //COOL channel number == FEB identifier
+      //const coral::AttributeList& attr = chanit->second;
+      ATH_MSG_DEBUG("Working on FEB 0x" << std::hex << fid.get_compact() << std::dec << "  " << m_onlineID->channel_name(fid));
+      p_febConfig->m_attrPerFeb[fid]=std::move(&(chanit->second));
+      ++nFebs;
+    }//End loop over COOL channels
+    p_febConfig->m_lastIt = p_febConfig->m_attrPerFeb.end();
+  }
+  ATH_MSG_INFO("Read gain thresholds for " << nFebs << " Febs from " << m_listOfFolders.size() << " database folders.");
+
+  // Record output
+  const EventIDRange crangeW(rangeW);
+  if(writeHandle.record(crangeW,febConfig.release()).isFailure()) {
+     ATH_MSG_ERROR("Could not record LArFebConfig object with " << writeHandle.key()
+                      << " with EventRange " << crangeW << " into Conditions Store");
+     return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range " << crangeW << " into Conditions Store");
+
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.h b/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.h
new file mode 100644
index 00000000000..76a6c0d7c93
--- /dev/null
+++ b/LArCalorimeter/LArRecUtils/src/LArFEBConfigCondAlg.h
@@ -0,0 +1,35 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARRECUTILS_LARFEBCONFIGCONDALG
+#define LARRECUTILS_LARFEBCONFIGCONDALG
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "AthenaKernel/IOVSvcDefs.h"
+#include "LArRecConditions/LArFebConfig.h"
+#include "StoreGate/CondHandleKeyArray.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+
+#include <map>
+
+class LArOnlineID;
+
+class LArFEBConfigCondAlg: public AthReentrantAlgorithm {
+
+ public:
+  LArFEBConfigCondAlg(const std::string& name, ISvcLocator* pSvcLocator); 
+  virtual ~LArFEBConfigCondAlg();
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  
+ private:
+
+  const LArOnlineID* m_onlineID;
+  SG::ReadCondHandleKeyArray<CondAttrListCollection> m_listOfFolders;
+  SG::WriteCondHandleKey<LArFebConfig> m_configKey{this, "keyOutput", "LArFebConfig", "Output key for LArFebConfig"};   
+};
+
+#endif
diff --git a/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.cxx b/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.cxx
deleted file mode 100644
index 1baed3e5bf3..00000000000
--- a/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LArFEBConfigReader.h"
-#include "LArIdentifier/LArOnlineID.h"
-
-LArFEBConfigReader::LArFEBConfigReader(const std::string& type, const std::string& name, const IInterface* parent) :
-  AthAlgTool(type,name,parent),m_onlineID(NULL) {
-
-  declareInterface<ILArFEBConfigReader>(this);
-  declareProperty("ListOfFolders",m_listOfFolders);
-  m_lastIt=m_attrPerFeb.end(); 
-}
-
-
-LArFEBConfigReader::~LArFEBConfigReader() {}
-
-StatusCode LArFEBConfigReader::initialize() {
-  
-  if (detStore()->retrieve(m_onlineID,"LArOnlineID").isFailure()) {
-    msg(MSG::ERROR) << "Failed to retrieve LArOnlineID" << endmsg;
-    return StatusCode::FAILURE;
-  }   
-
-  if (m_listOfFolders.size()==0) {
-    msg(MSG::WARNING) << "List of folders is emtpy, do nothing" << endmsg;
-    return StatusCode::SUCCESS;
-  }
-
-  const size_t nFolders=m_listOfFolders.size();
-  m_handles.resize(nFolders);
- 
-  for (size_t i=0;i<nFolders;++i) {
-    const std::string& fn=m_listOfFolders[i];
-    const DataHandle<CondAttrListCollection>& chdl=m_handles[i]; 
-    ATH_MSG_DEBUG("Registering callback for folder " << fn);
-    StatusCode sc=detStore()->regFcn(&ILArFEBConfigReader::loadData,dynamic_cast<ILArFEBConfigReader*>(this),
-				     chdl,fn);
-
-    if (sc.isFailure()) {
-      msg(MSG::ERROR) << "Failed to register callback for DB folder " << fn << endmsg;
-      return StatusCode::FAILURE;
-    }      
-  }//end loop over folders
-     
-  msg(MSG::DEBUG) << "Successfully initialized LArFEBConfigReader" << endmsg;
-  return StatusCode::SUCCESS;
-} 
-
-  
-
-StatusCode LArFEBConfigReader::finalize() {
-  return StatusCode::SUCCESS;
-}
-
-  
-StatusCode LArFEBConfigReader::loadData(IOVSVC_CALLBACK_ARGS) {
-  msg(MSG::INFO) << "In IOV callback method..." << endmsg;
-  m_attrPerFeb.clear();
-  unsigned nFebs=0;
-  const size_t nFolders=m_listOfFolders.size();
-  for (size_t i=0;i<nFolders;++i) {
-    ATH_MSG_DEBUG("Working on folder " << m_listOfFolders[i]);  
-    const DataHandle<CondAttrListCollection> dh;
-    if (detStore()->retrieve(dh,m_listOfFolders[i]).isFailure()) {
-      msg(MSG::ERROR) << "Failed to retrieve DataHandle for folder " << m_listOfFolders[i] << endmsg;
-      return StatusCode::FAILURE;
-    }
-    CondAttrListCollection::const_iterator chanit=dh->begin();
-    CondAttrListCollection::const_iterator chanit_e=dh->end();
-    for (;chanit!=chanit_e;++chanit) {
-      if (chanit->first==0) {
-	ATH_MSG_DEBUG("Invalid channel number 0, ignoring...");
-	continue;
-      }  
-      const HWIdentifier fid(chanit->first); //COOL channel number == FEB identifier
-      //const coral::AttributeList& attr = chanit->second;
-      ATH_MSG_DEBUG("Working on FEB 0x" << std::hex << fid.get_compact() << std::dec << "  " << m_onlineID->channel_name(fid));
-      ++nFebs;
-      m_attrPerFeb[fid]=&(chanit->second);
-    }//End loop over COOL channels
-  }//End loop over folders
-  m_lastIt=m_attrPerFeb.end(); 
-  msg(MSG::INFO) << "Read gain thresholds for " << nFebs << " Febs from " << m_listOfFolders.size() << " database folders." << endmsg;
-  return StatusCode::SUCCESS;
-}
-
-
-short LArFEBConfigReader::getThreshold(const char* MedLow, const HWIdentifier& chid) const {
-
-  if (m_attrPerFeb.size()==0) {
-    msg(MSG::WARNING) << "FEB treshold cache is empty. Callback not fired?" << endmsg;
-    return ERRORCODE;
-  }
-
-  const HWIdentifier fid=m_onlineID->feb_Id(chid);
-  const int channel=m_onlineID->channel(chid); 
-  if (m_lastIt==m_attrPerFeb.end() || m_lastIt->first!=fid)
-    m_lastIt=m_attrPerFeb.find(fid);
-
-  if (m_lastIt==m_attrPerFeb.end()) 
-    return ERRORCODE;
-  else {
-    char channame[16];
-    snprintf(channame,15,"%s%i",MedLow,channel+1);
-    channame[15]='\n';// Just to be sure...
-    return (short)(*(m_lastIt->second))[channame].data<int32_t>(); //Will throw and exception if channel does not exist
-  } 
-}
diff --git a/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.h b/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.h
deleted file mode 100644
index 6ba3a618e3f..00000000000
--- a/LArCalorimeter/LArRecUtils/src/LArFEBConfigReader.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//Dear emacs, this is -*-c++-*-
-#ifndef LARRECUTILS_LARFEBCONFIGREADERTOOL
-#define LARRECUTILS_LARFEBCONFIGREADERTOOL
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "LArElecCalib/ILArFEBConfigReader.h"
-#include "AthenaKernel/IOVSvcDefs.h"
-#include "CoralBase/AttributeList.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-
-#include "LArRawConditions/LArConditionsContainer.h"
-
-#include <map>
-
-class LArOnlineID;
-
-class LArFEBConfigReader: public AthAlgTool, 
-			  virtual public ILArFEBConfigReader {
-
- public:
-  LArFEBConfigReader(const std::string& type, const std::string& name, const IInterface* parent); 
-  virtual ~LArFEBConfigReader();
-
-  StatusCode initialize();
-  StatusCode finalize();
-  
-  //Accessor methods from ILArFEBConfigReader
-  virtual short lowerGainThreshold(const HWIdentifier& id) const; 
-  virtual short upperGainThreshold(const HWIdentifier& id) const;
-  
-  //IOV Callback function
-  virtual StatusCode loadData(IOVSVC_CALLBACK_ARGS);
-
-  static const InterfaceID& interfaceID() { return ILArFEBConfigReader::interfaceID();}
-
- private:
-
-  const LArOnlineID* m_onlineID;
-  std::vector<std::string> m_listOfFolders;
-
-  std::map<HWIdentifier,const coral::AttributeList*> m_attrPerFeb;
-  mutable std::map<HWIdentifier,const coral::AttributeList*>::const_iterator m_lastIt;
-
-  std::vector<DataHandle<CondAttrListCollection> > m_handles;
-
-  short getThreshold(const char* MedLow, const HWIdentifier& chid) const;
-};
-
-
-inline short LArFEBConfigReader::lowerGainThreshold(const HWIdentifier& chid) const {
-  return getThreshold("lower",chid);
-} 
-  
-
-inline short LArFEBConfigReader::upperGainThreshold(const HWIdentifier& chid) const {
-  return getThreshold("upper",chid);
-} 
-
-#endif
diff --git a/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx b/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx
index b90e8dca174..36d0d4769ee 100644
--- a/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx
+++ b/LArCalorimeter/LArRecUtils/src/components/LArRecUtils_entries.cxx
@@ -11,7 +11,6 @@
 #include "LArRecUtils/LArShapePeakRecoTool.h"
 #include "../LArTowerBuilderTool.h"
 #include "../LArFCalTowerBuilderTool.h"
-#include "../LArFEBConfigReader.h"
 #include "../LArFlatConditionSvc.h"
 #include "../LArFCalTowerBuilderToolTestAlg.h"
 #include "../LArFlatConditionsAlg.h"
@@ -29,6 +28,7 @@
 #include "../LArHVCondAlg.h"
 #include "../LArHVScaleCorrCondAlg.h"
 #include "../LArAutoCorrNoiseCondAlg.h"
+#include "../LArFEBConfigCondAlg.h"
 
 
 DECLARE_COMPONENT( LArADC2MeVTool )
@@ -44,7 +44,6 @@ DECLARE_COMPONENT( LArParabolaPeakRecoTool )
 DECLARE_COMPONENT( LArShapePeakRecoTool )
 DECLARE_COMPONENT( LArTowerBuilderTool )
 DECLARE_COMPONENT( LArFCalTowerBuilderTool )
-DECLARE_COMPONENT( LArFEBConfigReader )
 DECLARE_COMPONENT( LArFlatConditionSvc )
 DECLARE_COMPONENT( LArFCalTowerBuilderToolTestAlg )
 DECLARE_COMPONENT( LArCondAlgAutoCorrSC )
@@ -90,3 +89,4 @@ DECLARE_COMPONENT( LArOFCCondAlg )
 DECLARE_COMPONENT( LArHVCondAlg )
 DECLARE_COMPONENT( LArHVScaleCorrCondAlg )
 DECLARE_COMPONENT( LArAutoCorrNoiseCondAlg )
+DECLARE_COMPONENT( LArFEBConfigCondAlg )
-- 
GitLab


From 5d8668ece593d684fc5f3a66b916096c106625a2 Mon Sep 17 00:00:00 2001
From: Catrin Bernius <catrin.bernius@cern.ch>
Date: Mon, 4 Mar 2019 12:48:07 +0000
Subject: [PATCH 181/404] TriggerMenuMT: L1 item in chain name, Test slice
 configuration in place

---
 .../TriggerJobOpts/python/TestSliceFlags.py   | 36 +++++++++++++++
 .../HLTMenuConfig/Menu/DictFromChainName.py   | 40 +++++++++++++---
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      | 32 ++++++++++---
 .../python/HLTMenuConfig/Menu/HLTCFConfig.py  |  2 +-
 .../python/HLTMenuConfig/Menu/LS2_v1.py       | 19 ++++----
 .../python/HLTMenuConfig/Menu/LS2_v1_newJO.py | 26 +++++------
 .../HLTMenuConfig/Menu/TriggerConfigHLT.py    |  4 +-
 .../python/HLTMenuConfig/Test/TestDef.py      | 38 +++++++++++++++
 .../python/HLTMenuConfig/Test/__init__.py     |  1 +
 .../Test/generateTestChainDefs.py             | 46 +++++++++++++++++++
 10 files changed, 204 insertions(+), 40 deletions(-)
 create mode 100644 Trigger/TriggerCommon/TriggerJobOpts/python/TestSliceFlags.py
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/__init__.py
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TestSliceFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TestSliceFlags.py
new file mode 100644
index 00000000000..74512b685aa
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TestSliceFlags.py
@@ -0,0 +1,36 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+""" Test slice specific flags  """
+
+from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
+from TriggerJobOpts.CommonSignatureHelper import CommonSignatureHelper
+
+_flags = [] 
+
+class signatures(JobProperty):
+    """ signatures in Test slice """
+    statusOn=True
+    allowedTypes=['list']
+
+    StoredValue   = [
+        ]
+
+_flags.append(signatures)
+
+# create container
+class TestSlice(JobPropertyContainer, CommonSignatureHelper):
+    """ Test Slice Flags """
+
+from TriggerJobOpts.TriggerFlags import TriggerFlags
+TriggerFlags.add_Container(TestSlice)
+
+# add add common slice flags
+TriggerFlags.TestSlice.import_JobProperties('CommonSignatureFlags')
+
+for flag in _flags:
+    TriggerFlags.TestSlice.add_JobProperty(flag)
+del _flags
+
+# make an alias
+TestSliceFlags = TriggerFlags.TestSlice
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 88662f5a83a..2a2e85080dd 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 """
 Class to obtain the chain configuration dictionary from the short or long name
@@ -40,14 +40,16 @@ class DictFromChainName(object):
 
         elif type(chainInfo) == list:
             m_chainName = chainInfo[0]
-            m_L1item = chainInfo[1]
-            m_L1items_chainParts = chainInfo[2]
-            m_stream = chainInfo[3]
-            m_groups = chainInfo[4]
-            m_EBstep = chainInfo[5]
+            m_L1item = '' 
+            m_L1items_chainParts = chainInfo[1]
+            m_stream = chainInfo[2]
+            m_groups = chainInfo[3]
+            m_EBstep = chainInfo[4]
         else:
             logDict.error("Format of chainInfo passed to genChainDict not known")
 
+        m_L1item = self.getOverallL1item(m_chainName)
+
         logDict.debug("Analysing chain with name: %s", m_chainName)
         chainProp = self.analyseShortName(m_chainName,  m_L1items_chainParts, m_L1item)
         logDict.debug('ChainProperties: %s', chainProp)
@@ -106,6 +108,30 @@ class DictFromChainName(object):
         return chainProp
 
 
+    def checkL1inName(self, m_chainName):
+        if '_L1' in m_chainName:
+            return True
+        else:
+            return False
+
+    def getOverallL1item(self, chainName):
+        mainL1 = ''
+
+        if not self.checkL1inName(chainName):
+            logDict.warning("Chain name not complying with naming convention: L1 item missing! PLEASE FIX THIS!!")
+            return mainL1
+        # this assumes that the last string of a chain name is the overall L1 item
+        cNameParts = chainName.split("_") 
+        mainL1 = cNameParts[-1]
+
+        if "L1" not in mainL1:
+            logDict.warning("Chain name not complying with naming convention: L1 item missing! PLEASE FIX THIS!!")
+            return ''
+        mainL1 = mainL1.replace("L1", "L1_")
+
+        return mainL1
+        
+
     def getChainMultFromDict(self, chainDict):
         allMultis = []
         for cpart in chainDict['chainParts']:
@@ -149,7 +175,7 @@ class DictFromChainName(object):
         for cpart in cNameParts:
             m = pattern.match(cpart)
             if m: 
-                logDict.debug("In getChainMultFromName: Pattern found in this string: %s", cpart)
+                logDict.debug("In getChainThresholdFromName: Pattern found in this string: %s", cpart)
                 m_groupdict = m.groupdict()
                 allThresh.append(m_groupdict['threshold'])
                 trigType.append(m_groupdict['trigType'])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 882b7e405c0..c1230c2ad0b 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -1,10 +1,13 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 from TriggerJobOpts.TriggerFlags              import TriggerFlags
 from TriggerJobOpts.MuonSliceFlags            import MuonSliceFlags
 from TriggerJobOpts.EgammaSliceFlags          import EgammaSliceFlags
 from TriggerJobOpts.JetSliceFlags             import JetSliceFlags
 from TriggerJobOpts.CombinedSliceFlags        import CombinedSliceFlags
+from TriggerJobOpts.TestSliceFlags            import TestSliceFlags
+
+
 
 # Configure the scheduler
 from AthenaCommon.AlgScheduler import AlgScheduler
@@ -50,8 +53,9 @@ class GenerateMenuMT:
         self.doJetChains         = True
         self.doMuonChains        = True
         self.doCombinedChains    = True
+        self.doTestChains   = True
 
-
+        
     def setTriggerConfigHLT(self):
         # setting the hlt menu configuration
         (HLTPrescales) = self.setupMenu()
@@ -68,9 +72,17 @@ class GenerateMenuMT:
             try:
                 import TriggerMenuMT.HLTMenuConfig.Egamma.generateElectronChainDefs                
             except:
-                log.exception('Problems when importing generateElectronChainDefs, disabling egamma chains.')
+                log.exception('Problems when importing generateElectronChainDefs, disabling Egamma chains.')
                 self.doEgammaChains = False
-                        
+
+        if self.doTestChains:
+            try:
+                import TriggerMenuMT.HLTMenuConfig.Egamma.generateTestChainDefs  
+            except:
+                log.exception('Problems when importing generateTestChainDefs, disabling Test chains.')
+                self.doTestChains = False
+              
+
         listOfChainConfigs = []
         chainDicts = splitInterSignatureChainDict(chainDicts)  
       
@@ -79,11 +91,11 @@ class GenerateMenuMT:
             pp = pprint.PrettyPrinter(indent=4, depth=8)
             log.debug('dictionary is: %s', pp.pformat(chainDicts))
 
+        # Loop over all chainDicts and sending them off to their respective assembly code
         for chainDict in chainDicts:
             chainConfigs = None
             log.debug('Checking chainDict for chain %s' , chainDict['chainName'])
             
-
             if chainDict["signature"] == "Electron" and self.doEgammaChains:
                 try:
                     log.debug("Try to get chain config")
@@ -91,8 +103,16 @@ class GenerateMenuMT:
                 except:
                     log.exception( 'Problems creating ChainDef for chain\n %s ' % (chainDict['chainName']) ) 
                     continue
+
+            elif chainDict["signature"] == "Test" and self.doTestChains:
+                try:
+                    chainDefs = TriggerMenuMT.HLTMenuConfig.Test.generateTestChainDefs.generateChainConfigs(chainDict)
+                except:
+                    log.exception('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
+                    continue
+
             else:                
-                log.error('Chain %s ignored - either trigger signature is turned off or the corresponding chain dictionary cannot be read.' %(chainDict['chainName']))
+                log.error('Chain %s ignored - either trigger signature is turned off or chain dictionary cannot be read.' %(chainDict['chainName']))
                 log.debug('Chain dictionary of failed chain is %s.', chainDict)
             
             log.debug('ChainConfigs  %s ' % chainConfigs)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index bece7d71b2d..a58680657da 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 # Classes to configure the CF graph, via Nodes
 from AthenaCommon.CFElements import parOR, seqAND, seqOR
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index ee607522968..92e5492d02c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -18,7 +18,7 @@ def setupMenu():
 
     #---------------------------------------------------------------------
     # INPUT FORMAT FOR CHAINS:
-    # ['chainName',  'L1itemforchain', [L1 items for chainParts], [stream], [groups], EBstep], OPTIONAL: [mergingStrategy, offset,[merginOrder] ]], topoStartsFrom = False
+    # ['chainName', [L1 thresholds for chainParts], [stream], [groups], EBstep], OPTIONAL: [mergingStrategy, offset,[merginOrder] ]], topoStartsFrom = False
     #---------------------------------------------------------------------
 
     #---------------------------------------------------------------------
@@ -32,18 +32,18 @@ def setupMenu():
     TriggerFlags.TestSlice.signatures = []
 
     TriggerFlags.MuonSlice.signatures = [
-        #['mu20',      'L1_MU10',   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
-        #['mu8',	      'L1_MU6',	   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        #['mu20_L1MU10',   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        #['mu8_L1MU6',     [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
 
      ]
     TriggerFlags.EgammaSlice.signatures = [
-        ['HLT_e3_etcut', 'L1_EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
-        ['HLT_e5_etcut', 'L1_EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
-        ['HLT_e7_etcut', 'L1_EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
-        #['e20',	      'L1_EM10',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],        
+        ['HLT_e3_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        ['HLT_e5_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        ['HLT_e7_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        #['e20_L1EM10',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],        
         ]
     TriggerFlags.CombinedSlice.signatures = [
-        #['e8_mu8',    'L1_EM6_MU6',	   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
+        #['e8_mu8_L1EM6_MU6',	   [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
         ]
     TriggerFlags.JetSlice.signatures = [ ]
     TriggerFlags.BjetSlice.signatures = [] 
@@ -61,9 +61,6 @@ def setupMenu():
     # Random Seeded EB chains which select at the HLT based on L1 TBP bits
     TriggerFlags.EnhancedBiasSlice.signatures = [ ]
 
-
-
-
     signatureList=[]
     for prop in dir(TriggerFlags):
         if prop[-5:]=='Slice':
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
index 96c51d7f0f9..6b54839342a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -1,8 +1,8 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-def get_flag_item(chainName, L1itemforchain, groups):
+def get_flag_item(chainName, L1itemsChainParts, groups):
     PhysicsStream = 'Main'
-    return [chainName, L1itemforchain, [], [PhysicsStream], groups, -1]
+    return [chainName, [], [PhysicsStream], groups, -1]
 
 def setupMenu(flags):
     """ 
@@ -14,7 +14,7 @@ def setupMenu(flags):
 
     #---------------------------------------------------------------------
     # INPUT FORMAT FOR CHAINS:
-    # ['chainName',  'L1itemforchain', [L1 items for chainParts], [stream], [groups], EBstep],
+    # ['chainName', [L1 items for chainParts], [stream], [groups], EBstep],
     #   OPTIONAL: [mergingStrategy, offset,[merginOrder] ]], topoStartsFrom = False
     #---------------------------------------------------------------------
 
@@ -26,24 +26,24 @@ def setupMenu(flags):
 
 
     flags.Trigger.menu.muon = [
-        get_flag_item('HLT_mu20', 'L1_MU20', ['RATE:SingleMuon', 'BW:Muon']),
-        get_flag_item('HLT_mu10', 'L1_MU10', ['RATE:SingleMuon', 'BW:Muon']),
-        get_flag_item('HLT_mu8', 'L1_MU6', ['RATE:SingleMuon', 'BW:Muon'])
+        get_flag_item('HLT_mu20_L1MU20', [], ['RATE:SingleMuon', 'BW:Muon']),
+        get_flag_item('HLT_mu10_L1MU10', [], ['RATE:SingleMuon', 'BW:Muon']),
+        get_flag_item('HLT_mu8_L1MU6', [], ['RATE:SingleMuon', 'BW:Muon'])
     ]
 
     flags.Trigger.menu.electron = [
-        get_flag_item('HLT_e3_etcut', 'L1_EM3', ['RATE:SingleElectron', 'BW:Electron']),
-        get_flag_item('HLT_e5_etcut', 'L1_EM3', ['RATE:SingleElectron', 'BW:Electron']),
-        get_flag_item('HLT_e7_etcut', 'L1_EM7', ['RATE:SingleElectron', 'BW:Electron'])
+        get_flag_item('HLT_e3_etcut_L1EM3', [], ['RATE:SingleElectron', 'BW:Electron']),
+        get_flag_item('HLT_e5_etcut_L1EM3', [], ['RATE:SingleElectron', 'BW:Electron']),
+        get_flag_item('HLT_e7_etcut_L1EM7', [], ['RATE:SingleElectron', 'BW:Electron'])
     ]
 
     flags.Trigger.menu.photon = [
-       get_flag_item('HLT_g10_etcut', 'L1_EM7', ['RATE:SinglePhoton', 'BW:Photon']),
-       get_flag_item('HLT_g15_etcut', 'L1_EM12', ['RATE:SinglePhoton', 'BW:Photon'])
+       get_flag_item('HLT_g10_etcut_L1EM7', [], ['RATE:SinglePhoton', 'BW:Photon']),
+       get_flag_item('HLT_g15_etcut_L1EM12', [], ['RATE:SinglePhoton', 'BW:Photon'])
     ]
 
     # flags.Trigger.menu.combined = [
-    #     get_flag_item('e8_mu8', 'L1_EM6_MU6', ['RATE:SingleMuon', 'BW:Muon'])
+    #     get_flag_item('HLT_e8_mu8_L1EM6_MU6', [], ['RATE:SingleMuon', 'BW:Muon'])
     # ]
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
index a05458ebd87..cbf15205d8b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
@@ -1,9 +1,9 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
 #########################################################################################
 #
 # TriggerConfigHLT class, providing basic functionality for assembling the menu
 #
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-#
 #########################################################################################
 
 import sys
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
new file mode 100644
index 00000000000..87a21994502
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Logging import logging
+logging.getLogger().info("Importing %s",__name__)
+log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Test.TestDef")
+
+
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
+from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
+
+
+#----------------------------------------------------------------
+# Class to configure chain
+#----------------------------------------------------------------
+class TestChainConfiguration(ChainConfigurationBase):
+
+    def __init__(self, chainDict):
+        ChainConfigurationBase.__init__(self,chainDict)
+        
+    # ----------------------
+    # Assemble the chain depending on information from chainName
+    # ----------------------
+    def assembleChain(self):                            
+        myStepNames = []
+        chainSteps = []
+        log.debug("Assembling chain for " + self.chainName)
+        # --------------------
+        # define here the names of the steps and obtain the chainStep configuration 
+        # --------------------
+
+        myChain = self.buildChain(chainSteps)
+        return myChain
+        
+            
+
+        
+                
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/__init__.py
new file mode 100644
index 00000000000..10057c2b910
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/__init__.py
@@ -0,0 +1 @@
+#Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py
new file mode 100644
index 00000000000..13291d6bc74
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
+from TriggerMenuMT.HLTMenuConfig.Test.TestDef import TestChainConfiguration as TestChainConfiguration
+
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Test.generateChainConfigs' )
+log.info("Importing %s",__name__)
+
+
+
+def generateChainConfigs( chainDict ):
+    import pprint
+    pprint.pprint( chainDict )
+
+    
+    listOfChainDicts = splitChainDict(chainDict)
+    listOfChainDefs = []
+
+    for subChainDict in listOfChainDicts:
+        
+        Test = TestChainConfiguration(subChainDict).assembleChain() 
+
+        listOfChainDefs += [Test]
+        log.debug('length of chaindefs %s', len(listOfChainDefs) )
+        
+
+    if len(listOfChainDefs)>1:
+        log.warning("Implement case for multiplicity >1  test chain!!") 
+        theChainDef = listOfChainDefs[0] #needs to be implemented properly
+    else:
+        theChainDef = listOfChainDefs[0]
+
+    log.debug("theChainDef.name: %s" , theChainDef.name)
+    log.debug("theChainDef.seed: %s" , theChainDef.seed)
+    log.debug("theChainDef.ChainSteps: %s" , theChainDef.steps)
+
+    return theChainDef
+
+
+
+    
+
+    
-- 
GitLab


From ffa530eb335c4fef1bcdb90040dace629e9c3ec5 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 12:55:57 +0000
Subject: [PATCH 182/404] Add ATLAS_CHECK_THREAD_SAFETY to SCT_Cabling and
 SCT_ModuleDistortions packages

---
 .../SCT_Cabling/ATLAS_CHECK_THREAD_SAFETY     |  1 +
 .../SCT_Cabling/src/SCT_CablingXmlTags.h      | 22 +++++++------------
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 3 files changed, 10 insertions(+), 14 deletions(-)
 create mode 100644 InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetDetDescr/SCT_ModuleDistortions/SCT_ModuleDistortions/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..16a35b51952
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/SCT_Cabling
diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
index 89cde8dc5fd..d6c6d7dd667 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
@@ -12,15 +12,14 @@
  *  @date 14/12/2014.
  *
  */
- 
+
+#include "GaudiKernel/time_r.h" // localtime_r
+
+#include <ctime> // std::time_t, std::tm
+#include <iomanip> // put_time
 #include <iostream>
 #include <string>
 #include <sstream>
-#include <chrono>  // chrono::system_clock
-#include <ctime>   // localtime
-#include <iomanip> // put_time
-
-
  
 namespace SCT_Cabling{
   const std::string XmlHeader("<?xml version=\"1.0\"?>");
@@ -55,14 +54,9 @@ namespace SCT_Cabling{
      
   std::string dateTime(){
     std::stringstream ss;
-    //no 'put_time' in gcc48 or gcc49 :-(
-    //ss << std::put_time(std::localtime(&in_time_t), "%Y-%m-%d %X");
-    std::time_t t = std::time(NULL);
-    char mbstr[100];
-    if (std::strftime(mbstr, sizeof(mbstr), "%Y-%m-%d", std::localtime(&t))) {
-      ss << mbstr;
-    }
-  
+    std::time_t t = std::time(nullptr);
+    std::tm lt;
+    ss << std::put_time(localtime_r(&t, &lt), "%Y-%m-%d %X");
     return ss.str();
   }
   std::string makeCablingFileName(){
diff --git a/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/SCT_ModuleDistortions/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/SCT_ModuleDistortions/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..a4e4664de00
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/SCT_ModuleDistortions/SCT_ModuleDistortions/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/SCT_ModuleDistortions
-- 
GitLab


From 332d8354306e6c6bbf221793255b44d123cb1be9 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 12:59:46 +0000
Subject: [PATCH 183/404] Add ATLAS_CHECK_THREAD_SAFETY to SCT_Digitization
 package

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../SCT_Digitization/src/SCT_Amp.cxx          |  5 ++-
 .../SCT_Digitization/src/SCT_Amp.h            |  4 +--
 .../SCT_Digitization/src/SCT_Digitization.cxx |  4 +--
 .../SCT_Digitization.h                        |  0
 .../src/SCT_DigitizationTool.cxx              |  4 +--
 .../SCT_DigitizationTool.h                    |  0
 .../SCT_Digitization/src/SCT_FrontEnd.cxx     | 36 +++++++++++++------
 .../SCT_Digitization/src/SCT_FrontEnd.h       | 18 +++++-----
 .../src/SCT_SurfaceChargesGenerator.cxx       |  6 ++--
 .../src/SCT_SurfaceChargesGenerator.h         |  2 +-
 .../components/SCT_Digitization_entries.cxx   |  4 +--
 .../share/postInclude.SLHC_Digitization.py    |  1 -
 ...postInclude.SLHC_Digitization_lowthresh.py |  1 -
 14 files changed, 48 insertions(+), 38 deletions(-)
 create mode 100644 InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/ATLAS_CHECK_THREAD_SAFETY
 rename InnerDetector/InDetDigitization/SCT_Digitization/{SCT_Digitization => src}/SCT_Digitization.h (100%)
 rename InnerDetector/InDetDigitization/SCT_Digitization/{SCT_Digitization => src}/SCT_DigitizationTool.h (100%)

diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..ea5a83d0c0e
--- /dev/null
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDigitization/SCT_Digitization
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.cxx
index a183f3637bc..8d1fd17dd81 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.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 "SCT_Amp.h"
@@ -15,11 +15,10 @@
 
 // constructor
 SCT_Amp::SCT_Amp(const std::string& type, const std::string& name, const IInterface* parent) 
-  : AthAlgTool(type, name, parent), 
+  : base_class(type, name, parent), 
     m_NormConstCentral{0.},
     m_NormConstNeigh{0.}
 {
-  declareInterface<ISCT_Amp>(this);
   declareProperty("CrossFactor2sides", m_CrossFactor2sides=0.1); //! <Loss of charge to neighbour strip constant
   declareProperty("CrossFactorBack", m_CrossFactorBack=0.07);    //! <Loss of charge to back plane constant
   declareProperty("PeakTime", m_PeakTime=21.);                   //! <Front End Electronics peaking time
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.h
index d66532145f0..74904fafb6c 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.h
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Amp.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
 */
 
 /**
@@ -22,7 +22,7 @@
 
 #include "InDetSimEvent/SiCharge.h"
 
-class SCT_Amp : public AthAlgTool, virtual public ISCT_Amp {
+class SCT_Amp : public extends<AthAlgTool, ISCT_Amp> {
  public:
 
   /**  constructor */
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.cxx
index e2c405efadd..a75241d32e0 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.cxx
@@ -2,8 +2,8 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "SCT_Digitization/SCT_Digitization.h"
-#include "SCT_Digitization/SCT_DigitizationTool.h"
+#include "SCT_Digitization.h"
+#include "SCT_DigitizationTool.h"
 
 //----------------------------------------------------------------------
 // Constructor with parameters:
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/SCT_Digitization.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.h
similarity index 100%
rename from InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/SCT_Digitization.h
rename to InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_Digitization.h
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
index cf6810a8ef3..2d19f7601a5 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "SCT_Digitization/SCT_DigitizationTool.h"
+#include "SCT_DigitizationTool.h"
 
 // Mother Package includes
 #include "SiDigitization/SiHelper.h"
@@ -47,8 +47,6 @@ SCT_DigitizationTool::SCT_DigitizationTool(const std::string& type,
   m_mergeSvc{"PileUpMergeSvc", name},
   m_thpcsi{nullptr},
   m_vetoThisBarcode{crazyParticleBarcode} {
-    declareInterface<SCT_DigitizationTool>(this);
-
     declareProperty("FixedTime", m_tfix = -999., "Fixed time for Cosmics run selection");
     declareProperty("CosmicsRun", m_cosmicsRun = false, "Cosmics run selection");
     declareProperty("EnableHits", m_enableHits = true, "Enable hits");
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/SCT_DigitizationTool.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.h
similarity index 100%
rename from InnerDetector/InDetDigitization/SCT_Digitization/SCT_Digitization/SCT_DigitizationTool.h
rename to InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.h
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
index cdb3a5401f6..533d2446f14 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
@@ -29,12 +29,11 @@ using namespace InDetDD;
 
 // constructor
 SCT_FrontEnd::SCT_FrontEnd(const std::string& type, const std::string& name, const IInterface* parent)
-  : AthAlgTool(type, name, parent),
-    m_mutex(),
-    m_SCTdetMgr(nullptr),
-    m_sct_id(nullptr) {
-  declareInterface<ISCT_FrontEnd>(this);
-
+  : base_class(type, name, parent),
+    m_strip_max{768},
+    m_mutex{},
+    m_SCTdetMgr{nullptr},
+    m_sct_id{nullptr} {
   declareProperty("NoiseBarrel", m_NoiseBarrel = 1500.0, "NoiseBarrel");
   declareProperty("NoiseBarrel3", m_NoiseBarrel3 = 1541.0, "NoiseBarrel3");
   declareProperty("NoiseInners", m_NoiseInners = 1090.0, "NoiseInners");
@@ -57,7 +56,6 @@ SCT_FrontEnd::SCT_FrontEnd(const std::string& type, const std::string& name, con
   declareProperty("DataCompressionMode", m_data_compression_mode = 1, "Front End Data Compression Mode");
   declareProperty("DataReadOutMode", m_data_readout_mode = 0, "Front End Data Read out mode Mode");
   declareProperty("UseCalibData", m_useCalibData = true, "Flag to use Calib Data");
-  declareProperty("MaxStripsPerSide", m_strip_max = 768, "For SLHC studies");
 }
 
 // ----------------------------------------------------------------------
@@ -123,6 +121,8 @@ StatusCode SCT_FrontEnd::finalize() {
 // Init the class variable  vectors
 // ----------------------------------------------------------------------
 StatusCode SCT_FrontEnd::initVectors(int strips) const {
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   m_Offset.assign(strips, 0.0);
   m_GainFactor.assign(strips, 0.0);
   m_NoiseFactor.assign(strips, 0.0);
@@ -148,6 +148,8 @@ StatusCode SCT_FrontEnd::initVectors(int strips) const {
 // prepare gain and offset for the strips for a given module
 // ----------------------------------------------------------------------
 StatusCode SCT_FrontEnd::prepareGainAndOffset(SiChargedDiodeCollection& collection, const Identifier& moduleId, CLHEP::HepRandomEngine * rndmEngine) const {
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   // now we need to generate gain and offset channel by channel: some algebra
   // for generation of partially correlated random numbers
   float W = m_OGcorr * m_GainRMS * m_Ospread / (m_GainRMS * m_GainRMS - m_Ospread * m_Ospread);
@@ -251,6 +253,8 @@ StatusCode SCT_FrontEnd::prepareGainAndOffset(SiChargedDiodeCollection& collecti
 // Cond Db data to get the chip calibration data
 // ----------------------------------------------------------------------
 StatusCode SCT_FrontEnd::prepareGainAndOffset(SiChargedDiodeCollection& collection, int side, const Identifier& moduleId, CLHEP::HepRandomEngine * rndmEngine) const {
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   // Get chip data from calib DB
   std::vector<float> gainByChipVect = m_ReadCalibChipDataTool->getNPtGainData(moduleId, side, "GainByChip");
   std::vector<float> gainRMSByChipVect = m_ReadCalibChipDataTool->getNPtGainData(moduleId, side, "GainRMSByChip");
@@ -374,6 +378,8 @@ StatusCode SCT_FrontEnd::prepareGainAndOffset(SiChargedDiodeCollection& collecti
 StatusCode SCT_FrontEnd::randomNoise(SiChargedDiodeCollection& collection, const Identifier& moduleId, CLHEP::HepRandomEngine * rndmEngine) const {
   // Add random noise
 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   double occupancy = 0.0;
   double NoiseOccupancy = 0.0;
   float Noise = 0.0;
@@ -492,8 +498,10 @@ StatusCode SCT_FrontEnd::randomNoise(SiChargedDiodeCollection& collection, const
 //
 // ----------------------------------------------------------------------
 StatusCode SCT_FrontEnd::randomNoise(SiChargedDiodeCollection& collection, const Identifier& moduleId, int side, CLHEP::HepRandomEngine * rndmEngine) const {
-  int n_chips = 6;
-  int chipStripmax = m_strip_max / n_chips;
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
+  const int n_chips = 6;
+  const int chipStripmax = m_strip_max / n_chips;
   std::vector<float> NOByChipVect(n_chips, 0.0);
   std::vector<float> ENCByChipVect(n_chips, 0.0);
   std::vector<int> nNoisyStrips(n_chips, 0);
@@ -594,7 +602,7 @@ StatusCode SCT_FrontEnd::randomNoise(SiChargedDiodeCollection& collection, const
 // (this could be moved elsewhere later) apply threshold do clustering
 // ----------------------------------------------------------------------
 void SCT_FrontEnd::process(SiChargedDiodeCollection& collection, CLHEP::HepRandomEngine * rndmEngine) const {
-  std::lock_guard<std::mutex> lock(m_mutex);
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
 
   // get SCT module side design and check it
   const SCT_ModuleSideDesign *p_design = dynamic_cast<const SCT_ModuleSideDesign*>(&(collection.design()));
@@ -693,6 +701,8 @@ void SCT_FrontEnd::process(SiChargedDiodeCollection& collection, CLHEP::HepRando
 StatusCode SCT_FrontEnd::doSignalChargeForHits(SiChargedDiodeCollection& collection) const {
   typedef SiTotalCharge::list_t list_t;
 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   // *****************************************************************************
   // Loop over the diodes (strips ) and for each of them define the total signal
   // *****************************************************************************
@@ -782,6 +792,8 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
   // Flag strips below threshold and flag the threshold check into m_StripHitsOnWafer
   // **********************************************************************************
 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   SiChargedDiodeIterator i_chargedDiode = collection.begin();
   SiChargedDiodeIterator i_chargedDiode_end = collection.end();
 
@@ -873,6 +885,8 @@ StatusCode SCT_FrontEnd::doThresholdCheckForCrosstalkHits(SiChargedDiodeCollecti
   // =0 for free strips or strips with charge to be checked (m_Analogue[1]!=0)
   // Set 2 for crosstalk noise hits and -2 for below ones
 
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   for (int strip = 0; strip < m_strip_max; strip++) {
     // Find strips with m_StripHitsOnWafer[strip] == 0
     if (m_StripHitsOnWafer[strip] != 0) { // real hits already checked
@@ -951,6 +965,8 @@ StatusCode SCT_FrontEnd::doThresholdCheckForCrosstalkHits(SiChargedDiodeCollecti
 }
 
 StatusCode SCT_FrontEnd::doClustering(SiChargedDiodeCollection& collection) const {
+  std::lock_guard<std::recursive_mutex> lock(m_mutex);
+
   // ********************************
   // now do clustering
   // ********************************
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.h
index 9e2e6c60060..5f5a5e584dc 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.h
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.h
@@ -56,7 +56,7 @@ namespace CLHEP {
  * collected charges, also does cross-talk, offset
  * variation and gain variation, in a correlated way
  */
-class  SCT_FrontEnd : public AthAlgTool, virtual public ISCT_FrontEnd {
+class  SCT_FrontEnd : public extends<AthAlgTool, ISCT_FrontEnd> {
 
  public:
 
@@ -114,14 +114,14 @@ class  SCT_FrontEnd : public AthAlgTool, virtual public ISCT_FrontEnd {
   short m_data_compression_mode;            //!< To set the data compression mode
   short m_data_readout_mode;                //!< To set the data read out mode
   bool m_useCalibData;                      //!< Flag to set the use of calibration data for noise, Gain,offset etc.
-  mutable int m_strip_max;                  //!< For SLHC studies
-
-  mutable std::mutex m_mutex;
-  mutable std::vector<float> m_Offset;      //!< generate offset per channel
-  mutable std::vector<float> m_GainFactor;  //!< generate gain per channel  (added to the gain per chip from calib data)
-  mutable std::vector<float> m_NoiseFactor; //!< Kondo: 31/08/07 noise per channel (actually noise per chip from calib data)
-  mutable std::vector<double> m_Analogue[3];  //!< To hold the noise and amplifier response
-  mutable std::vector<int> m_StripHitsOnWafer; //!< Info about which strips are above threshold
+  mutable int m_strip_max ATLAS_THREAD_SAFE; //!< For SLHC studies
+
+  mutable std::recursive_mutex m_mutex;
+  mutable std::vector<float> m_Offset ATLAS_THREAD_SAFE; //!< generate offset per channel
+  mutable std::vector<float> m_GainFactor ATLAS_THREAD_SAFE; //!< generate gain per channel  (added to the gain per chip from calib data)
+  mutable std::vector<float> m_NoiseFactor ATLAS_THREAD_SAFE; //!< Kondo: 31/08/07 noise per channel (actually noise per chip from calib data)
+  mutable std::vector<double> m_Analogue[3] ATLAS_THREAD_SAFE;  //!< To hold the noise and amplifier response
+  mutable std::vector<int> m_StripHitsOnWafer ATLAS_THREAD_SAFE; //!< Info about which strips are above threshold
 
   const InDetDD::SCT_DetectorManager* m_SCTdetMgr;        //!< Handle to SCT detector manager
   const SCT_ID*                       m_sct_id;           //!< Handle to SCT ID helper
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx
index 260ae32a319..e7175a39079 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.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 "SCT_SurfaceChargesGenerator.h"
@@ -40,7 +40,7 @@ using namespace std;
 SCT_SurfaceChargesGenerator::SCT_SurfaceChargesGenerator(const std::string& type,
                                                          const std::string& name,
                                                          const IInterface* parent)
-  : AthAlgTool(type, name, parent),
+  : base_class(type, name, parent),
   m_tHalfwayDrift{0},
   m_distInterStrip{1.0},
   m_distHalfInterStrip{0},
@@ -73,8 +73,6 @@ SCT_SurfaceChargesGenerator::SCT_SurfaceChargesGenerator(const std::string& type
   m_h_velocity_trap{nullptr},
   m_h_mobility_trap{nullptr},
   m_h_trap_pos{nullptr} {
-    declareInterface<ISCT_SurfaceChargesGenerator>(this);
-
     declareProperty("FixedTime", m_tfix = -999.); // !< fixed timing
     declareProperty("SubtractTime", m_tsubtract = -999); // !< substract drift time
     declareProperty("SurfaceDriftTime", m_tSurfaceDrift = 10); // !< max surface drift time
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
index 2fd4f3c41fa..de948fe6a27 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h
@@ -68,7 +68,7 @@ namespace CLHEP {
 
 template <class HIT> class TimedHitPtr;
 
-class SCT_SurfaceChargesGenerator : public AthAlgTool, virtual public ISCT_SurfaceChargesGenerator {
+class SCT_SurfaceChargesGenerator : public extends<AthAlgTool, ISCT_SurfaceChargesGenerator> {
  public:
 
   /**  constructor */
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/components/SCT_Digitization_entries.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/components/SCT_Digitization_entries.cxx
index e1a256d65f0..166a8fc8b3f 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/components/SCT_Digitization_entries.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/components/SCT_Digitization_entries.cxx
@@ -1,7 +1,7 @@
 #include "../SCT_Amp.h"
 #include "../SCT_FrontEnd.h"
-#include "SCT_Digitization/SCT_Digitization.h"
-#include "SCT_Digitization/SCT_DigitizationTool.h"
+#include "../SCT_Digitization.h"
+#include "../SCT_DigitizationTool.h"
 #include "../SCT_SurfaceChargesGenerator.h"
 #include "../SCT_DetailedSurfaceChargesGenerator.h"
 #include "../SCT_RandomDisabledCellGenerator.h"
diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization.py
index 72f9bf87703..e657cc5a076 100644
--- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization.py
+++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization.py
@@ -66,7 +66,6 @@ if DetFlags.digitize.SCT_on():
         from SCT_Digitization.SCT_DigitizationConf import SCT_FrontEnd
         ToolSvc += SCT_FrontEnd("SCT_FrontEnd")
     theSCT_FrontEnd = ToolSvc.SCT_FrontEnd
-    theSCT_FrontEnd.MaxStripsPerSide = 1280
     theSCT_FrontEnd.UseCalibData = False
     ToolSvc += theSCT_FrontEnd
 
diff --git a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization_lowthresh.py b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization_lowthresh.py
index 8e7d41cc427..f1d366b3ed8 100644
--- a/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization_lowthresh.py
+++ b/InnerDetector/InDetExample/InDetSLHC_Example/share/postInclude.SLHC_Digitization_lowthresh.py
@@ -76,7 +76,6 @@ if DetFlags.digitize.SCT_on():
         from SCT_Digitization.SCT_DigitizationConf import SCT_FrontEnd
         ToolSvc += SCT_FrontEnd("SCT_FrontEnd")
     theSCT_FrontEnd = ToolSvc.SCT_FrontEnd
-    theSCT_FrontEnd.MaxStripsPerSide = 1280
     theSCT_FrontEnd.UseCalibData = False
 
     if not digitizationFlags.doXingByXingPileUp():
-- 
GitLab


From d93238e0e4a13ec4f47f98829ef42b1cd60d3e61 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 13:04:44 +0000
Subject: [PATCH 184/404] Add ATLAS_CHECK_THREAD_SAFETY to some SCT packages

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../SCT_ConditionsData/SCT_ReadoutData.h      |  2 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../src/SCT_ByteStreamErrorsTool.cxx          | 22 +++++++------------
 .../src/SCT_ByteStreamErrorsTool.h            | 13 ++++++-----
 .../src/SCT_MonitorConditionsTool.cxx         |  2 +-
 .../src/SCT_MonitorConditionsTool.h           |  2 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../src/SCTRawContByteStreamTool.h            |  4 ++--
 .../src/SCTRawDataProviderTool.h              |  4 ++--
 11 files changed, 26 insertions(+), 27 deletions(-)
 create mode 100644 InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetConditions/SCT_ConditionsTools/SCT_ConditionsTools/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/SCT_RawDataByteStreamCnv/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..aec6896fd8b
--- /dev/null
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SCT_ConditionsAlgorithms
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..2b55036972c
--- /dev/null
+++ b/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SCT_ConditionsData
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/SCT_ReadoutData.h b/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/SCT_ReadoutData.h
index daab2071593..efc44fbfba4 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/SCT_ReadoutData.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsData/SCT_ConditionsData/SCT_ReadoutData.h
@@ -128,7 +128,7 @@ class SCT_ReadoutData {
   std::vector<int>                    m_chipsOnLink0;        //!< The chips read out on link 0
   std::vector<int>                    m_chipsOnLink1;        //! <The chips read out on link 1
 
-  mutable Athena::MsgStreamMember* m_msg;
+  Athena::MsgStreamMember* m_msg;
 };
 
 #endif // SCT_ConditionData_SCT_ReadoutData_h
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/SCT_ConditionsTools/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/SCT_ConditionsTools/SCT_ConditionsTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..f0507f81143
--- /dev/null
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/SCT_ConditionsTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/SCT_ConditionsTools
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx
index 2e7f2c46664..d154ba78994 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.cxx
@@ -31,6 +31,7 @@ SCT_ByteStreamErrorsTool::SCT_ByteStreamErrorsTool(const std::string& type, cons
 /** Initialize */
 StatusCode 
 SCT_ByteStreamErrorsTool::initialize() {
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   StatusCode sc{StatusCode::SUCCESS};
 
   for (int errorType{0}; errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES; errorType++) {
@@ -270,12 +271,10 @@ SCT_ByteStreamErrorsTool::getChip(const Identifier& stripId, const EventContext&
 
 void 
 SCT_ByteStreamErrorsTool::resetSets(const EventContext& ctx) const {
-  // Used in fillData and m_mutex is already locked.
-
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   for (int errType{0}; errType<SCT_ByteStreamErrors::NUM_ERROR_TYPES; errType++) {
     m_bsErrors[errType][ctx.slot()].clear();
   }
-
   return;
 }
 
@@ -288,13 +287,12 @@ SCT_ByteStreamErrorsTool::resetSets(const EventContext& ctx) const {
 
 const std::set<IdentifierHash>*
 SCT_ByteStreamErrorsTool::getErrorSet(int errorType, const EventContext& ctx) const {
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   if (errorType>=0 and errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES) {
     StatusCode sc{fillData(ctx)};
     if (sc.isFailure()) {
       ATH_MSG_ERROR("fillData in getErrorSet fails");
     }
-
-    std::lock_guard<std::mutex> lock{m_mutex};
     return &m_bsErrors[errorType][ctx.slot()];
   }
   return nullptr;
@@ -315,11 +313,10 @@ SCT_ByteStreamErrorsTool::getErrorSet(int errorType) const {
 
 StatusCode
 SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   EventContext::ContextID_t slot{ctx.slot()};
   EventContext::ContextEvt_t evt{ctx.evt()};
   
-  std::lock_guard<std::mutex> lock{m_mutex};
-
   if (slot<m_cache.size() and m_cache[slot]==evt) {
     // Cache isvalid
     return StatusCode::SUCCESS;
@@ -361,7 +358,7 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
    * over it to populate the sets of errors owned by this Tool.
    */
   ATH_MSG_DEBUG("size of error container is " << errCont->size());
-  for (const auto* elt : *errCont) {
+  for (const std::pair<IdentifierHash, int>* elt : *errCont) {
     addError(elt->first, elt->second, ctx);
     Identifier wafer_id{m_sct_id->wafer_id(elt->first)};
     Identifier module_id{m_sct_id->module_id(wafer_id)};
@@ -399,8 +396,7 @@ SCT_ByteStreamErrorsTool::fillData(const EventContext& ctx) const {
 
 void 
 SCT_ByteStreamErrorsTool::addError(const IdentifierHash& id, int errorType, const EventContext& ctx) const {
-  // Used in fillData and m_mutex is already locked.
-
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   if (errorType>=0 and errorType<SCT_ByteStreamErrors::NUM_ERROR_TYPES) {
     m_bsErrors[errorType][ctx.slot()].insert(id);
   }
@@ -478,21 +474,19 @@ const InDetDD::SiDetectorElement* SCT_ByteStreamErrorsTool::getDetectorElement(c
 }
 
 const std::map<Identifier, unsigned int>& SCT_ByteStreamErrorsTool::getTempMaskedChips(const EventContext& ctx) const { 
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   StatusCode sc{fillData(ctx)};
   if (sc.isFailure()) {
     ATH_MSG_ERROR("fillData in getTempMaskedChips fails");
   }
-
-  std::lock_guard<std::mutex> lock{m_mutex};
   return m_tempMaskedChips[ctx.slot()];
 }
 
 const std::map<Identifier, unsigned int>& SCT_ByteStreamErrorsTool::getAbcdErrorChips(const EventContext& ctx) const {
+  std::lock_guard<std::recursive_mutex> lock{m_mutex};
   StatusCode sc{fillData(ctx)};
   if (sc.isFailure()) {
     ATH_MSG_ERROR("fillData in getAbcdErrorChips fails");
   }
-
-  std::lock_guard<std::mutex> lock{m_mutex};
   return m_abcdErrorChips[ctx.slot()];
 }
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h
index 011c7c4fde3..1f5f7d89e97 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ByteStreamErrorsTool.h
@@ -30,6 +30,7 @@
 #include "GaudiKernel/EventContext.h"
 
 ///STL includes
+#include <atomic>
 #include <map>
 #include <mutex>
 #include <vector>
@@ -90,17 +91,17 @@ private:
 
   BooleanProperty m_checkRODSimulatedData{this, "CheckRODSimulatedData", true, "Flag to check RODSimulatedData flag."};
 
-  mutable std::vector<std::set<IdentifierHash> > m_bsErrors[SCT_ByteStreamErrors::NUM_ERROR_TYPES]; // Used by getErrorSet, addError, resetSets
+  mutable std::vector<std::set<IdentifierHash>> m_bsErrors[SCT_ByteStreamErrors::NUM_ERROR_TYPES] ATLAS_THREAD_SAFE; // Used by getErrorSet, addError, resetSets
 
-  mutable std::vector<std::map<Identifier, unsigned int> > m_tempMaskedChips;
-  mutable std::vector<std::map<Identifier, unsigned int> > m_abcdErrorChips;
+  mutable std::vector<std::map<Identifier, unsigned int>> m_tempMaskedChips ATLAS_THREAD_SAFE;
+  mutable std::vector<std::map<Identifier, unsigned int>> m_abcdErrorChips ATLAS_THREAD_SAFE;
 
   // Mutex to protect the contents.
-  mutable std::mutex m_mutex;
+  mutable std::recursive_mutex m_mutex;
   // Cache to store events for slots
-  mutable std::vector<EventContext::ContextEvt_t> m_cache;
+  mutable std::vector<EventContext::ContextEvt_t> m_cache ATLAS_THREAD_SAFE;
 
-  mutable unsigned int m_nRetrievalFailure;
+  mutable std::atomic_uint m_nRetrievalFailure;
 
   StatusCode fillData(const EventContext& ctx) const;
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.cxx
index 0c5091838ca..156444c0d5b 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.cxx
@@ -31,7 +31,7 @@ namespace {
 
 /////////////////////////////////////////////////////////////////////////////
 
-string SCT_MonitorConditionsTool::s_separator{string("-")};
+const string SCT_MonitorConditionsTool::s_separator{"-"};
 
 SCT_MonitorConditionsTool::SCT_MonitorConditionsTool(const std::string& type, const std::string& name, const IInterface* parent):
   base_class(type, name, parent),
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.h b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.h
index 6b2617809b7..2378e0c5adb 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.h
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_MonitorConditionsTool.h
@@ -97,7 +97,7 @@ private:
   // small helper function
   unsigned int computeIstrip4moncond(const Identifier& elementId) const;
 
-  static std::string s_separator;
+  static const std::string s_separator;
 
   IntegerProperty              m_nhits_noisychip{this, "Nnoisychip", 64};
   IntegerProperty              m_nhits_noisywafer{this, "Nnoisywafer", 384};
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/SCT_RawDataByteStreamCnv/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/SCT_RawDataByteStreamCnv/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..36db7789f16
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/SCT_RawDataByteStreamCnv/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamTool.h b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamTool.h
index ef4d265a0e7..130a2a5ae1e 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamTool.h
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamTool.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
 */
 
 /**
@@ -82,7 +82,7 @@ class SCTRawContByteStreamTool : public extends<AthAlgTool, ISCTRawContByteStrea
 
   /** Conversion between Lower level Source ID to higher level source ID, used to assemble
       fragments from ROD fragments to assemble full ATLAS raw events. */ 
-  mutable FullEventAssembler<SrcIdMap> m_fullEventAssembler;
+  mutable FullEventAssembler<SrcIdMap> m_fullEventAssembler ATLAS_THREAD_SAFE;
 
   mutable std::mutex m_mutex;
 };
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawDataProviderTool.h b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawDataProviderTool.h
index 10783674097..55e4dfd0179 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawDataProviderTool.h
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawDataProviderTool.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 SCT_RAWDATABYTESTREAMCNV_SCTRAWDATAPROVIDERTOOL_H
@@ -65,7 +65,7 @@ class SCTRawDataProviderTool : public extends<AthAlgTool, ISCTRawDataProviderToo
   ToolHandle<ISCT_RodDecoder> m_decoder{this, "Decoder", "SCT_RodDecoder", "Decoder"};
   
   /** For bookkeeping of decoded ROBs */
-  mutable std::set<uint32_t> m_robIDSet;
+  mutable std::set<uint32_t> m_robIDSet ATLAS_THREAD_SAFE;
 
   /** Number of decode errors encountered in decoding. 
       Turning off error message after 100 errors are counted */
-- 
GitLab


From 0790e5ab3a6ab64248b5a3107a8522734fafd8d2 Mon Sep 17 00:00:00 2001
From: William Axel Leight <william.axel.leight@cern.ch>
Date: Mon, 4 Mar 2019 13:08:17 +0000
Subject: [PATCH 185/404] Sweep NSW EDM changes to master

---
 .../xAODMuon/Root/MuonAuxContainer_v4.cxx     |   4 +-
 .../Root/MuonTrackSummaryAccessors_v1.cxx     |  45 +-
 .../MuonTrackSummaryHelperTool.h              |   6 +
 .../src/MuonTrackSummaryHelperTool.cxx        |  49 +-
 .../src/MuonTrackScoringTool.cxx              |   4 +
 .../src/MuonDressingTool.cxx                  | 989 ++++++++++--------
 .../TrkTrackSummary/TrackSummary.h            |  11 +-
 .../TrkTrackSummary/src/TrackSummary.cxx      |   9 +
 .../src/TrackParticleCreatorTool.cxx          |  31 +-
 .../src/TrackSummaryTool.cxx                  |  26 +-
 10 files changed, 663 insertions(+), 511 deletions(-)

diff --git a/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx
index 8f091ea8f91..979f5b1c497 100644
--- a/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx
+++ b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx
@@ -114,8 +114,8 @@ namespace xAOD {
         AUX_VARIABLE( etaLayer3TGCHoles );
         AUX_VARIABLE( etaLayer4TGCHoles );
 
-	AUX_VARIABLE( cscEtaHits );
-	AUX_VARIABLE( cscUnspoiledEtaHits );
+        AUX_VARIABLE( cscEtaHits );
+        AUX_VARIABLE( cscUnspoiledEtaHits );
 
         // Isolation
         AUX_VARIABLE( etcone20 );
diff --git a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
index 0059f42e14c..0f948ef4395 100644
--- a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
+++ b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx
@@ -103,37 +103,38 @@ namespace xAOD {
         DEFINE_ACCESSOR( uint8_t, etaLayer3TGCHoles );
         DEFINE_ACCESSOR( uint8_t, etaLayer4TGCHoles );
 
-	// New Small Wheel
+        // New Small Wheel
         // STGC
-	DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHits );
-	DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHits );
+        DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHits );
+        DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHits );
 
         DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHits );
         DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHits );
-
-	DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHoles );
-	DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHoles );
-
-	DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHoles );
-	DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHoles );
-
-	// MM
+        
+        DEFINE_ACCESSOR( uint8_t, phiLayer1STGCHoles );
+        DEFINE_ACCESSOR( uint8_t, phiLayer2STGCHoles );
+        
+        DEFINE_ACCESSOR( uint8_t, etaLayer1STGCHoles );
+        DEFINE_ACCESSOR( uint8_t, etaLayer2STGCHoles );
+
+        // MM
         DEFINE_ACCESSOR( uint8_t, MMHits );
-	DEFINE_ACCESSOR( uint8_t, MMHoles );
-	// Note: there is currently no MuonStationIndex for the two MM layers
-	// In the future it might be needed to add them in order to have
+        DEFINE_ACCESSOR( uint8_t, MMHoles );
+        // Note: there is currently no MuonStationIndex for the two MM layers
+        // In the future it might be needed to add them in order to have 
         // separate counters as follows
         // DEFINE_ACCESSOR( uint8_t, Layer1MMHits );
-	// DEFINE_ACCESSOR( uint8_t, Layer2MMHits );
-	// DEFINE_ACCESSOR( uint8_t, Layer1MMHoles );
-	// DEFINE_ACCESSOR( uint8_t, Layer2MMHoles );
+        // DEFINE_ACCESSOR( uint8_t, Layer2MMHits );
+        // DEFINE_ACCESSOR( uint8_t, Layer1MMHoles );
+        // DEFINE_ACCESSOR( uint8_t, Layer2MMHoles );
+
 
-        DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits );
-        DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits );
-        DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits );
-        DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits );
+	DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits );
+	DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits );
+	DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits );
+	DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits );
 
-        DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits );
+	DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits );
         DEFINE_ACCESSOR( uint8_t, middleOutBoundsPrecisionHits );
         DEFINE_ACCESSOR( uint8_t, outerOutBoundsPrecisionHits );
         DEFINE_ACCESSOR( uint8_t, extendedOutBoundsPrecisionHits );
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool.h
index dd3954b4c07..33b75ecea63 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool.h
@@ -26,6 +26,9 @@ class RpcIdHelper;
 class TgcIdHelper;
 class CscIdHelper;
 class MdtIdHelper;
+// New Small Wheel
+class MmIdHelper;
+class sTgcIdHelper;
 
 class Identifier;
 
@@ -89,6 +92,9 @@ private:
         const TgcIdHelper* m_tgcId;
         const CscIdHelper* m_cscId;
         const MdtIdHelper* m_mdtId;
+        //New Small Wheel
+        const sTgcIdHelper* m_stgcId;
+        const MmIdHelper* m_mmId;
         
         /** tool used to do hole search */
         ToolHandle<Trk::ITrackHoleSearchTool> m_muonTgTool;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
index 21896b4c3f4..d6823fcb0b0 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
@@ -72,6 +72,7 @@ Muon::MuonTrackSummaryHelperTool::MuonTrackSummaryHelperTool(
   declareProperty("CalculateCloseHits", m_calculateCloseHits = false );
   declareProperty("RoadWidth",           m_roadWidth = 135.,"width used to calculate hits within the road (mm)"); 
   declareProperty("Extrapolator",    m_extrapolator);
+  declareProperty("MdtPrepDataContainer", m_mdtKey="MDT_DriftCircles");
   declareProperty("HoleOnTrackTool", m_muonTgTool);	
   declareProperty("TrackingGeometryName", m_trackingGeometryName);
 }
@@ -102,6 +103,20 @@ StatusCode Muon::MuonTrackSummaryHelperTool::initialize()
       muonOkay=false;
     }
 
+  sc = detStore()->retrieve(m_stgcId);
+  if (sc.isFailure())
+    {
+      msg (MSG::WARNING) << "Could not get STGC ID helper !" << endmsg;
+      muonOkay=false;
+    }    
+
+  sc = detStore()->retrieve(m_mmId);
+  if (sc.isFailure())
+    {
+      msg (MSG::WARNING) << "Could not get MM ID helper !" << endmsg;
+      muonOkay=false;
+    }
+
   sc = detStore()->retrieve(m_cscId);
   if (sc.isFailure())
     {
@@ -214,13 +229,13 @@ void Muon::MuonTrackSummaryHelperTool::analyse(
     else                           increment(information[numberOfTgcEtaHits]);
   }else if(m_mdtId->is_mdt(id)){  
     increment(information[numberOfMdtHits]);
-  }else if(m_mdtId->is_mm(id) ){
-    increment(information[numberOfCscUnspoiltEtaHits]);
-  }else if(m_mdtId->is_stgc(id)){  
-    int chType = m_idHelperTool->stgcIdHelper().channelType(id);
-    if( chType == 2 )      increment(information[numberOfCscPhiHits]);
-    else if( chType == 1 ) increment(information[numberOfCscEtaHits]);
-    else                   increment(information[numberOfCscPhiHoles]);
+  }else if(m_stgcId->is_stgc(id) ){
+    // strip = measuresPhi
+    if( m_stgcId->measuresPhi(id) )    increment(information[numberOfStgcPhiHits]);
+    // we do not discriminate between pads or wires
+    else                               increment(information[numberOfStgcEtaHits]);
+  }else if(m_mmId->is_mm(id)){  
+    increment(information[numberOfMmHits]); 
   }else{
     msg (MSG::ERROR) << "Unknown muon detector type " << endmsg;
     msg (MSG::ERROR) << "Dumping TrackStateOnSurface "<<*tsos << endmsg;
@@ -378,11 +393,11 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
         Identifier id = pars->associatedSurface().associatedDetectorElement()->identify();
         bool issTgc = m_idHelperTool->issTgc(id);
         if(issTgc) {
-// get the identifier for phi or eta holes 
+	  // get the identifier for phi or eta holes 
           Identifier idh = pars->associatedSurface().associatedDetectorElementIdentifier();
           if(idh.is_valid()) {
             id = idh;
-//            ATH_MSG_VERBOSE(" For sTGC hole use associatedDetectorElementIdentifier ");
+	    // ATH_MSG_VERBOSE(" For sTGC hole use associatedDetectorElementIdentifier ");
           }
         }
         if( !id.is_valid() || !m_idHelperTool->isMuon(id) ) continue;
@@ -494,6 +509,18 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
 	  goodLayIds.insert(layId);
 	}
       }
+      else if(m_idHelperTool->isCsc(id)){
+	const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
+	if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId);
+      }
+      else if(m_idHelperTool->isMM(id)) {
+	// MM quality requirements to be inserted here if needed
+	goodLayIds.insert(layId);
+      }
+      else if(m_idHelperTool->issTgc(id)) {
+	// sTGC quality requirements to be inserted here if needed
+	goodLayIds.insert(layId);
+      }
     }else{
       const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas);
       if( crot ){
@@ -509,6 +536,10 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track
 	  // get layer Identifier and insert it into set
 	  Identifier layId =  m_idHelperTool->layerId( (*clit)->identify() );
 	  layIds.insert(layId);
+	  if(m_idHelperTool->isCsc(id)){
+	    const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
+	    if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId);
+	  }
 	}
       }else{
 	continue;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx
index 57610a5fd1a..778c34870d2 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx
@@ -58,6 +58,10 @@ namespace Muon {
     m_summaryTypeScore[Trk::numberOfCscEtaHits]	= 5;
     m_summaryTypeScore[Trk::numberOfRpcPhiHits]	= 5;
     m_summaryTypeScore[Trk::numberOfRpcEtaHits]	= 5;
+    // New Small Wheel
+    m_summaryTypeScore[Trk::numberOfStgcPhiHits] = 5;
+    m_summaryTypeScore[Trk::numberOfStgcEtaHits] = 5;    
+    m_summaryTypeScore[Trk::numberOfMmHits] = 5;
   }
 
   MuonTrackScoringTool::~MuonTrackScoringTool()
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx
index f5eabbd88d5..3f754ab3a86 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx
@@ -15,475 +15,550 @@
 #include "TrkTrackSummary/MuonTrackSummary.h"
 
 namespace MuonCombined {
- 
-  //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
-
-  MuonDressingTool::MuonDressingTool (const std::string& type, const std::string& name, const IInterface* parent)
-    :	AthAlgTool(type, name, parent),
-	m_hitSummaryTool("Muon::MuonHitSummaryTool/MuonHitSummaryTool"),
-	m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool")
-
-  {
-    declareInterface<xAOD::IMuonDressingTool>(this);
-    declareProperty("MuonHitSummaryTool",m_hitSummaryTool );
-    declareProperty("MuonIdHelperTool",m_idHelper );
-  }
-
-  MuonDressingTool::~MuonDressingTool()
-  {}
-
-  //<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS                             >>>>>>
 
-  StatusCode MuonDressingTool::initialize() {
-
-    ATH_CHECK(m_hitSummaryTool.retrieve());
-    ATH_CHECK(m_idHelper.retrieve());
-
-    return StatusCode::SUCCESS;
+//<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
+
+MuonDressingTool::MuonDressingTool (const std::string& type, const std::string& name, const IInterface* parent)
+  : AthAlgTool(type, name, parent),
+    m_hitSummaryTool("Muon::MuonHitSummaryTool/MuonHitSummaryTool"),
+    m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool")
+
+{
+  declareInterface<xAOD::IMuonDressingTool>(this);
+  declareProperty("MuonHitSummaryTool", m_hitSummaryTool );
+  declareProperty("MuonIdHelperTool", m_idHelper );
+}
+
+MuonDressingTool::~MuonDressingTool()
+{}
+
+//<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS                             >>>>>>
+
+StatusCode MuonDressingTool::initialize() {
+
+  ATH_CHECK(m_hitSummaryTool.retrieve());
+  ATH_CHECK(m_idHelper.retrieve());
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode MuonDressingTool::finalize() {
+  return StatusCode::SUCCESS;
+}
+
+void MuonDressingTool::addMuonHitSummary( xAOD::Muon& muon, const Trk::TrackSummary* trackSummary ) const {
+
+  uint8_t mainSector = 0;
+  uint8_t secondSector = 0;
+
+  uint8_t innerSmallHits = 0;
+  uint8_t innerLargeHits = 0;
+  uint8_t middleSmallHits = 0;
+  uint8_t middleLargeHits = 0;
+  uint8_t outerSmallHits = 0;
+  uint8_t outerLargeHits = 0;
+  uint8_t extendedSmallHits = 0;
+  uint8_t extendedLargeHits = 0;
+
+  uint8_t innerSmallHoles = 0;
+  uint8_t innerLargeHoles = 0;
+  uint8_t middleSmallHoles = 0;
+  uint8_t middleLargeHoles = 0;
+  uint8_t outerSmallHoles = 0;
+  uint8_t outerLargeHoles = 0;
+  uint8_t extendedSmallHoles = 0;
+  uint8_t extendedLargeHoles = 0;
+
+  uint8_t phiLayer1Hits = 0;
+  uint8_t phiLayer2Hits = 0;
+  uint8_t phiLayer3Hits = 0;
+  uint8_t phiLayer4Hits = 0;
+
+  uint8_t etaLayer1Hits = 0;
+  uint8_t etaLayer2Hits = 0;
+  uint8_t etaLayer3Hits = 0;
+  uint8_t etaLayer4Hits = 0;
+
+  uint8_t phiLayer1Holes = 0;
+  uint8_t phiLayer2Holes = 0;
+  uint8_t phiLayer3Holes = 0;
+  uint8_t phiLayer4Holes = 0;
+
+  uint8_t etaLayer1Holes = 0;
+  uint8_t etaLayer2Holes = 0;
+  uint8_t etaLayer3Holes = 0;
+  uint8_t etaLayer4Holes = 0;
+
+  uint8_t phiLayer1RPCHits = 0;
+  uint8_t phiLayer2RPCHits = 0;
+  uint8_t phiLayer3RPCHits = 0;
+  uint8_t phiLayer4RPCHits = 0;
+
+  uint8_t etaLayer1RPCHits = 0;
+  uint8_t etaLayer2RPCHits = 0;
+  uint8_t etaLayer3RPCHits = 0;
+  uint8_t etaLayer4RPCHits = 0;
+
+  uint8_t phiLayer1RPCHoles = 0;
+  uint8_t phiLayer2RPCHoles = 0;
+  uint8_t phiLayer3RPCHoles = 0;
+  uint8_t phiLayer4RPCHoles = 0;
+
+  uint8_t etaLayer1RPCHoles = 0;
+  uint8_t etaLayer2RPCHoles = 0;
+  uint8_t etaLayer3RPCHoles = 0;
+  uint8_t etaLayer4RPCHoles = 0;
+
+  uint8_t phiLayer1TGCHits = 0;
+  uint8_t phiLayer2TGCHits = 0;
+  uint8_t phiLayer3TGCHits = 0;
+  uint8_t phiLayer4TGCHits = 0;
+
+  uint8_t etaLayer1TGCHits = 0;
+  uint8_t etaLayer2TGCHits = 0;
+  uint8_t etaLayer3TGCHits = 0;
+  uint8_t etaLayer4TGCHits = 0;
+
+  uint8_t phiLayer1TGCHoles = 0;
+  uint8_t phiLayer2TGCHoles = 0;
+  uint8_t phiLayer3TGCHoles = 0;
+  uint8_t phiLayer4TGCHoles = 0;
+
+  uint8_t etaLayer1TGCHoles = 0;
+  uint8_t etaLayer2TGCHoles = 0;
+  uint8_t etaLayer3TGCHoles = 0;
+  uint8_t etaLayer4TGCHoles = 0;
+
+  // New Small Wheel
+  // STGC
+  uint8_t phiLayer1STGCHits = 0;
+  uint8_t phiLayer2STGCHits = 0;
+
+  uint8_t etaLayer1STGCHits = 0;
+  uint8_t etaLayer2STGCHits = 0;
+
+  uint8_t phiLayer1STGCHoles = 0;
+  uint8_t phiLayer2STGCHoles = 0;
+
+  uint8_t etaLayer1STGCHoles = 0;
+  uint8_t etaLayer2STGCHoles = 0;
+
+  // MM
+  uint8_t MMHits = 0;
+  uint8_t MMHoles = 0;
+  // Note: there is currently no MuonStationIndex for the two MM layers
+  // In the future it might be needed to add them in order to have 
+  // separate counters as follows
+  // uint8_t Layer1MMHits = 0;
+  // uint8_t Layer2MMHits = 0;
+  // uint8_t Layer1MMHoles = 0;
+  // uint8_t Layer2MMHoles = 0;
+
+
+  uint8_t innerCloseHits = 0;
+  uint8_t middleCloseHits = 0;
+  uint8_t outerCloseHits = 0;
+  uint8_t extendedCloseHits = 0;
+
+  uint8_t innerOutBoundsHits = 0;
+  uint8_t middleOutBoundsHits = 0;
+  uint8_t outerOutBoundsHits = 0;
+  uint8_t extendedOutBoundsHits = 0;
+
+  uint8_t combinedTrackOutBoundsHits = 0;
+
+  uint8_t numberOfPrecisionLayers = 0;
+  uint8_t numberOfPrecisionHoleLayers = 0;
+  uint8_t numberOfPhiLayers = 0;
+  uint8_t numberOfPhiHoleLayers = 0;
+  uint8_t numberOfTriggerEtaLayers = 0;
+  uint8_t numberOfTriggerEtaHoleLayers = 0;
+  uint8_t numberOfGoodPrecisionLayers = 0;
+
+  uint8_t isEndcap = 0;
+  uint8_t isSmall = 0;
+
+  uint8_t cscEtaHits = 0;
+  uint8_t cscUnspoiledEtaHits = 0;
+
+  const Trk::TrackSummary* mstpTrackSummary = 0;
+
+  if ( !trackSummary ) {
+    // get link to track particle
+    ElementLink< xAOD::TrackParticleContainer > tpLink = muon.combinedTrackParticleLink();
+    if ( !tpLink.isValid() ) tpLink = muon.muonSpectrometerTrackParticleLink();
+    if ( tpLink.isValid() ) {
+
+      // check link to track
+      if ( (*tpLink)->trackLink().isValid() ) trackSummary = (*tpLink)->track()->trackSummary();
+    }
   }
 
-  StatusCode MuonDressingTool::finalize() {
-    return StatusCode::SUCCESS;
-  }
+  if ( trackSummary ) {
 
-  void MuonDressingTool::addMuonHitSummary( xAOD::Muon& muon, const Trk::TrackSummary* trackSummary ) const {
-    
-    uint8_t mainSector = 0;
-    uint8_t secondSector = 0;
-
-    uint8_t innerSmallHits = 0;
-    uint8_t innerLargeHits = 0;
-    uint8_t middleSmallHits = 0;
-    uint8_t middleLargeHits = 0;
-    uint8_t outerSmallHits = 0;
-    uint8_t outerLargeHits = 0;
-    uint8_t extendedSmallHits = 0;
-    uint8_t extendedLargeHits = 0;
-
-    uint8_t innerSmallHoles = 0;
-    uint8_t innerLargeHoles = 0;
-    uint8_t middleSmallHoles = 0;
-    uint8_t middleLargeHoles = 0;
-    uint8_t outerSmallHoles = 0;
-    uint8_t outerLargeHoles = 0;
-    uint8_t extendedSmallHoles = 0;
-    uint8_t extendedLargeHoles = 0;
-
-    uint8_t phiLayer1Hits = 0;
-    uint8_t phiLayer2Hits = 0;
-    uint8_t phiLayer3Hits = 0;
-    uint8_t phiLayer4Hits = 0;
-
-    uint8_t etaLayer1Hits = 0;
-    uint8_t etaLayer2Hits = 0;
-    uint8_t etaLayer3Hits = 0;
-    uint8_t etaLayer4Hits = 0;
-
-    uint8_t phiLayer1Holes = 0;
-    uint8_t phiLayer2Holes = 0;
-    uint8_t phiLayer3Holes = 0;
-    uint8_t phiLayer4Holes = 0;
-
-    uint8_t etaLayer1Holes = 0;
-    uint8_t etaLayer2Holes = 0;
-    uint8_t etaLayer3Holes = 0;
-    uint8_t etaLayer4Holes = 0;
-
-    uint8_t phiLayer1RPCHits = 0;
-    uint8_t phiLayer2RPCHits = 0;
-    uint8_t phiLayer3RPCHits = 0;
-
-    uint8_t etaLayer1RPCHits = 0;
-    uint8_t etaLayer2RPCHits = 0;
-    uint8_t etaLayer3RPCHits = 0;
-
-    uint8_t phiLayer1RPCHoles = 0;
-    uint8_t phiLayer2RPCHoles = 0;
-    uint8_t phiLayer3RPCHoles = 0;
-
-    uint8_t etaLayer1RPCHoles = 0;
-    uint8_t etaLayer2RPCHoles = 0;
-    uint8_t etaLayer3RPCHoles = 0;
-
-    uint8_t phiLayer1TGCHits = 0;
-    uint8_t phiLayer2TGCHits = 0;
-    uint8_t phiLayer3TGCHits = 0;
-    uint8_t phiLayer4TGCHits = 0;
-
-    uint8_t etaLayer1TGCHits = 0;
-    uint8_t etaLayer2TGCHits = 0;
-    uint8_t etaLayer3TGCHits = 0;
-    uint8_t etaLayer4TGCHits = 0;
-
-    uint8_t phiLayer1TGCHoles = 0;
-    uint8_t phiLayer2TGCHoles = 0;
-    uint8_t phiLayer3TGCHoles = 0;
-    uint8_t phiLayer4TGCHoles = 0;
-
-    uint8_t etaLayer1TGCHoles = 0;
-    uint8_t etaLayer2TGCHoles = 0;
-    uint8_t etaLayer3TGCHoles = 0;
-    uint8_t etaLayer4TGCHoles = 0;
-
-    uint8_t innerCloseHits = 0;
-    uint8_t middleCloseHits = 0;
-    uint8_t outerCloseHits = 0;
-    uint8_t extendedCloseHits = 0;
-
-    uint8_t innerOutBoundsHits = 0;
-    uint8_t middleOutBoundsHits = 0;
-    uint8_t outerOutBoundsHits = 0;
-    uint8_t extendedOutBoundsHits = 0;
-
-    uint8_t combinedTrackOutBoundsHits = 0;
-
-    uint8_t numberOfPrecisionLayers = 0;
-    uint8_t numberOfPrecisionHoleLayers = 0;
-    uint8_t numberOfPhiLayers = 0;
-    uint8_t numberOfPhiHoleLayers = 0;
-    uint8_t numberOfTriggerEtaLayers = 0;
-    uint8_t numberOfTriggerEtaHoleLayers = 0;
-    uint8_t numberOfGoodPrecisionLayers = 0;
-
-    uint8_t isEndcap = 0;
-    uint8_t isSmall = 0;
-
-    const Trk::TrackSummary* mstpTrackSummary=0;
-
-    if( !trackSummary ){
-      // get link to track particle
-      ElementLink< xAOD::TrackParticleContainer > tpLink = muon.combinedTrackParticleLink();
-      if( !tpLink.isValid() ) tpLink = muon.muonSpectrometerTrackParticleLink();
-      if( tpLink.isValid() ){
-	
-	// check link to track
-	if( (*tpLink)->trackLink().isValid() ) trackSummary = (*tpLink)->track()->trackSummary();
-      }
+    Muon::IMuonHitSummaryTool::CompactSummary summary = m_hitSummaryTool->summary(*trackSummary);
+    mainSector = summary.mainSector;
+    secondSector = mainSector;
+    for ( auto sec : summary.sectors ) {
+      if ( sec != summary.mainSector ) secondSector = sec;
     }
-    
-    if( trackSummary ) {
-
-      Muon::IMuonHitSummaryTool::CompactSummary summary = m_hitSummaryTool->summary(*trackSummary);
-      mainSector = summary.mainSector;
-      secondSector = mainSector;
-      for( auto sec : summary.sectors ){
-	if( sec != summary.mainSector ) secondSector = sec;
-      }
 
-      numberOfPrecisionLayers = summary.nprecisionLayers;
-      numberOfPrecisionHoleLayers = summary.nprecisionHoleLayers;
-      numberOfPhiLayers = summary.nphiLayers;
-      numberOfPhiHoleLayers = summary.nphiHoleLayers;
-      numberOfTriggerEtaLayers = summary.ntrigEtaLayers;
-      numberOfTriggerEtaHoleLayers = summary.ntrigEtaHoleLayers;
-      numberOfGoodPrecisionLayers = summary.nprecisionGoodLayers;
-      //std::cout<<"isEndcap starts as "<<(int)isEndcap<<" and isSmall as "<<(int)isSmall<<std::endl;
-      if(summary.isEndcap){ isEndcap=1; /*std::cout<<"now, isEndcap is "<<(int)isEndcap<<std::endl;*/}
-      if(summary.isSmall){ isSmall=1; /*std::cout<<"now, isSmall is "<<(int)isSmall<<std::endl;*/}
-
-      for(auto layer : summary.stationLayers){
-	combinedTrackOutBoundsHits+=layer.second.noutBoundsHits;
-	if(layer.first==Muon::MuonStationIndex::BI || layer.first==Muon::MuonStationIndex::EI){
-	  innerCloseHits+=layer.second.nprecisionCloseHits;
-	}
-	if(layer.first==Muon::MuonStationIndex::BM || layer.first==Muon::MuonStationIndex::EM){
-	  middleCloseHits+=layer.second.nprecisionCloseHits;
-	}
-	if(layer.first==Muon::MuonStationIndex::BO || layer.first==Muon::MuonStationIndex::EO){
-	  outerCloseHits+=layer.second.nprecisionCloseHits;
-	}
-	if(layer.first==Muon::MuonStationIndex::BE || layer.first==Muon::MuonStationIndex::EE){
-	  extendedCloseHits+=layer.second.nprecisionCloseHits;
-	}
+    numberOfPrecisionLayers = summary.nprecisionLayers;
+    numberOfPrecisionHoleLayers = summary.nprecisionHoleLayers;
+    numberOfPhiLayers = summary.nphiLayers;
+    numberOfPhiHoleLayers = summary.nphiHoleLayers;
+    numberOfTriggerEtaLayers = summary.ntrigEtaLayers;
+    numberOfTriggerEtaHoleLayers = summary.ntrigEtaHoleLayers;
+    numberOfGoodPrecisionLayers = summary.nprecisionGoodLayers;
+
+    if (summary.isEndcap) isEndcap = 1;
+    if (summary.isSmall) isSmall = 1;
+
+    for (auto layer : summary.stationLayers) {
+      combinedTrackOutBoundsHits += layer.second.noutBoundsHits;
+      if (layer.first == Muon::MuonStationIndex::BI || layer.first == Muon::MuonStationIndex::EI) {
+        innerCloseHits += layer.second.nprecisionCloseHits;
       }
-
-      //get out-of-bounds from ME track, shouldn't be any on combined track anyway
-      ElementLink< xAOD::TrackParticleContainer > mstpLink = muon.muonSpectrometerTrackParticleLink();
-      if(mstpLink.isValid()){
-	if( (*mstpLink)->trackLink().isValid() ) mstpTrackSummary = (*mstpLink)->track()->trackSummary();
-
-	if(mstpTrackSummary){
-	  for(auto layer : m_hitSummaryTool->summary(*mstpTrackSummary).stationLayers){
-	    if(layer.first==Muon::MuonStationIndex::BI || layer.first==Muon::MuonStationIndex::EI){
-	      innerOutBoundsHits+=layer.second.noutBoundsHits;
-	    }
-	    if(layer.first==Muon::MuonStationIndex::BM || layer.first==Muon::MuonStationIndex::EM){
-	      middleOutBoundsHits+=layer.second.noutBoundsHits;
-	    }
-	    if(layer.first==Muon::MuonStationIndex::BO || layer.first==Muon::MuonStationIndex::EO){
-	      outerOutBoundsHits+=layer.second.noutBoundsHits;
-	    }
-	    if(layer.first==Muon::MuonStationIndex::BE || layer.first==Muon::MuonStationIndex::EE){
-	      extendedOutBoundsHits+=layer.second.noutBoundsHits;
-	    }
-	  }
-	}
+      if (layer.first == Muon::MuonStationIndex::BM || layer.first == Muon::MuonStationIndex::EM) {
+        middleCloseHits += layer.second.nprecisionCloseHits;
       }
-
-      // hack for now to get hit counts onto the track particle
-      /*
-      ElementLink< xAOD::TrackParticleContainer > tpLink = muon.combinedTrackParticleLink();
-      if( !tpLink.isValid() ) tpLink = muon.muonSpectrometerTrackParticleLink();
-      if( tpLink.isValid() ){
-	xAOD::TrackParticle* tp = const_cast<xAOD::TrackParticle*>(*tpLink);
-	if( tp ){
-	  uint8_t numberOfPrecisionLayers = summary.nprecisionLayers;
-	  uint8_t numberOfPrecisionHoleLayers = summary.nprecisionHoleLayers;
-	  uint8_t numberOfPhiLayers = summary.nphiLayers;
-	  uint8_t numberOfPhiHoleLayers = summary.nphiHoleLayers;
-	  uint8_t numberOfTriggerEtaLayers = summary.ntrigEtaLayers;
-	  uint8_t numberOfTriggerEtaHoleLayers = summary.ntrigEtaHoleLayers;
-	  tp->setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
-	  tp->setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
-	  tp->setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
-	  tp->setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
-	  tp->setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
-	  tp->setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
-	}
+      if (layer.first == Muon::MuonStationIndex::BO || layer.first == Muon::MuonStationIndex::EO) {
+        outerCloseHits += layer.second.nprecisionCloseHits;
       }
-      */
-
-      if( trackSummary->muonTrackSummary() ){
-	const Trk::MuonTrackSummary& mts = *trackSummary->muonTrackSummary();
-	
-	// loop over chambers
-	std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit = mts.chamberHitSummary().begin();
-	std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit_end = mts.chamberHitSummary().end();
-	for( ;chit!=chit_end;++chit ) {
-	  const Identifier& chId = chit->chamberId();
-	  bool isMdt = m_idHelper->isMdt(chId);
-	  bool isCsc = m_idHelper->isCsc(chId);
-	  bool isMM   = m_idHelper->isMM(chId);
-	  bool issTgc = m_idHelper->issTgc(chId);
-	  if( isMdt || isMM || isCsc || issTgc ){
-	    Muon::MuonStationIndex::ChIndex index = m_idHelper->chamberIndex(chId);
-	    uint8_t* hits = 0;
-	    uint8_t* holes = 0;
-            if( index == Muon::MuonStationIndex::BIS || index == Muon::MuonStationIndex::EIS || index == Muon::MuonStationIndex::CSS ) {
-	      hits = &innerSmallHits;
-	      holes = &innerSmallHoles;
-	    }else if( index == Muon::MuonStationIndex::BIL || index == Muon::MuonStationIndex::EIL || index == Muon::MuonStationIndex::CSL ){
-	      hits = &innerLargeHits;
-	      holes = &innerLargeHoles;
-	    }else if( index == Muon::MuonStationIndex::BMS || index == Muon::MuonStationIndex::EMS ){
-	      hits = &middleSmallHits;
-	      holes = &middleSmallHoles;
-	    }else if( index == Muon::MuonStationIndex::BML || index == Muon::MuonStationIndex::EML ){
-	      hits = &middleLargeHits;
-	      holes = &middleLargeHoles;
-	    }else if( index == Muon::MuonStationIndex::BOS || index == Muon::MuonStationIndex::EOS ){
-	      hits = &outerSmallHits;
-	      holes = &outerSmallHoles;
-	    }else if( index == Muon::MuonStationIndex::BOL || index == Muon::MuonStationIndex::EOL ){
-	      hits = &outerLargeHits;
-	      holes = &outerLargeHoles;
-	    }else if( index == Muon::MuonStationIndex::BEE || index == Muon::MuonStationIndex::EES ){
-	      hits = &extendedSmallHits;
-	      holes = &extendedSmallHoles;
-	    }else if( index == Muon::MuonStationIndex::EEL ){
-	      hits = &extendedLargeHits;
-	      holes = &extendedLargeHoles;
-	    }else{
-	      ATH_MSG_WARNING("Unknown ChamberIndex" << Muon::MuonStationIndex::chName(index) );
-	    }
-	    if( hits ){
-	      if(isMdt){
-		*hits  += chit->nhits();
-		*holes += chit->nholes();
-	      }
-	      else{
-		*hits += chit->netaHits();
-		*holes += chit->etaProjection().nholes;
-	      }
-	    }
-	  }
-	  if( !isMdt && !isMM ){
-
-	    uint8_t* phiHits = 0;
-	    uint8_t* phiHoles = 0;
-	    uint8_t* etaHits = 0;
-	    uint8_t* etaHoles = 0;
-	    Muon::MuonStationIndex::PhiIndex index = m_idHelper->phiIndex(chId);
-	    if( index == Muon::MuonStationIndex::BM1 || index == Muon::MuonStationIndex::T4 || 
-		index == Muon::MuonStationIndex::CSC || index == Muon::MuonStationIndex::STGC1 ||
-		index == Muon::MuonStationIndex::STGC2 ) {
-	      phiHits = &phiLayer1Hits;
-	      phiHoles = &phiLayer1Holes;
-	      etaHits = &etaLayer1Hits;
-	      etaHoles = &etaLayer1Holes;
-	    }else if( index == Muon::MuonStationIndex::BM2 || index == Muon::MuonStationIndex::T1 ){
-	      phiHits = &phiLayer2Hits;
-	      phiHoles = &phiLayer2Holes;
-	      etaHits = &etaLayer2Hits;
-	      etaHoles = &etaLayer2Holes;
-	    }else if( index == Muon::MuonStationIndex::BO1 || index == Muon::MuonStationIndex::T2 ){
-	      phiHits = &phiLayer3Hits;
-	      phiHoles = &phiLayer3Holes;
-	      etaHits = &etaLayer3Hits;
-	      etaHoles = &etaLayer3Holes;
-	    }else if( index == Muon::MuonStationIndex::BO2 || index == Muon::MuonStationIndex::T3 ){
-	      phiHits = &phiLayer4Hits;
-	      phiHoles = &phiLayer4Holes;
-	      etaHits = &etaLayer4Hits;
-	      etaHoles = &etaLayer4Holes;
-	    }else{
-	      ATH_MSG_WARNING("Unknown ChamberIndex" << Muon::MuonStationIndex::phiName(index) );
-	    }
-            // split into RPC and TGC
-            if (index == Muon::MuonStationIndex::BM1){
-              phiLayer1RPCHits  += chit->nphiHits();
-              etaLayer1RPCHits  += chit->netaHits();
-              phiLayer1RPCHoles += chit->phiProjection().nholes;
-              etaLayer1RPCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::BM2){
-              phiLayer2RPCHits  += chit->nphiHits();
-              etaLayer2RPCHits  += chit->netaHits();
-              phiLayer2RPCHoles += chit->phiProjection().nholes;
-              etaLayer2RPCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::BO1){
-              phiLayer3RPCHits  += chit->nphiHits();
-              etaLayer3RPCHits  += chit->netaHits();
-              phiLayer3RPCHoles += chit->phiProjection().nholes;
-              etaLayer3RPCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::T4){
-              phiLayer1TGCHits  += chit->nphiHits();
-              etaLayer1TGCHits  += chit->netaHits();
-              phiLayer1TGCHoles += chit->phiProjection().nholes;
-              etaLayer1TGCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::T1){
-              phiLayer2TGCHits  += chit->nphiHits();
-              etaLayer2TGCHits  += chit->netaHits();
-              phiLayer2TGCHoles += chit->phiProjection().nholes;
-              etaLayer2TGCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::T2){
-              phiLayer3TGCHits  += chit->nphiHits();
-              etaLayer3TGCHits  += chit->netaHits();
-              phiLayer3TGCHoles += chit->phiProjection().nholes;
-              etaLayer3TGCHoles += chit->etaProjection().nholes;
-            }
-            else if (index == Muon::MuonStationIndex::T3){
-              phiLayer4TGCHits  += chit->nphiHits();
-              etaLayer4TGCHits  += chit->netaHits();
-              phiLayer4TGCHoles += chit->phiProjection().nholes;
-              etaLayer4TGCHoles += chit->etaProjection().nholes;
-            }
-	    if( phiHits ){
-	      *phiHits += chit->nphiHits();
-	      *phiHoles += chit->phiProjection().nholes;
-	    }
-	    if( etaHits && !isCsc && !issTgc ){
-	      *etaHits += chit->netaHits();
-	      *etaHoles += chit->etaProjection().nholes;
-	    }
-	  }
-	}
+      if (layer.first == Muon::MuonStationIndex::BE || layer.first == Muon::MuonStationIndex::EE) {
+        extendedCloseHits += layer.second.nprecisionCloseHits;
       }
     }
 
-    muon.setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
-    muon.setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
-    muon.setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
-    muon.setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
-    muon.setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
-    muon.setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
-    muon.setSummaryValue(numberOfGoodPrecisionLayers,xAOD::numberOfGoodPrecisionLayers);
-
-    muon.setSummaryValue(mainSector,xAOD::primarySector);
-    muon.setSummaryValue(secondSector,xAOD::secondarySector);
-    muon.setSummaryValue(innerSmallHits,xAOD::innerSmallHits);
-    muon.setSummaryValue(innerLargeHits,xAOD::innerLargeHits);
-    muon.setSummaryValue(middleSmallHits,xAOD::middleSmallHits);
-    muon.setSummaryValue(middleLargeHits,xAOD::middleLargeHits);
-    muon.setSummaryValue(outerSmallHits,xAOD::outerSmallHits);
-    muon.setSummaryValue(outerLargeHits,xAOD::outerLargeHits);
-    muon.setSummaryValue(extendedSmallHits,xAOD::extendedSmallHits);
-    muon.setSummaryValue(extendedLargeHits,xAOD::extendedLargeHits);
-
-    muon.setSummaryValue(innerSmallHoles,xAOD::innerSmallHoles);
-    muon.setSummaryValue(innerLargeHoles,xAOD::innerLargeHoles);
-    muon.setSummaryValue(middleSmallHoles,xAOD::middleSmallHoles);
-    muon.setSummaryValue(middleLargeHoles,xAOD::middleLargeHoles);
-    muon.setSummaryValue(outerSmallHoles,xAOD::outerSmallHoles);
-    muon.setSummaryValue(outerLargeHoles,xAOD::outerLargeHoles);
-    muon.setSummaryValue(extendedSmallHoles,xAOD::extendedSmallHoles);
-    muon.setSummaryValue(extendedLargeHoles,xAOD::extendedLargeHoles);
-
-    muon.setSummaryValue(phiLayer1Hits,xAOD::phiLayer1Hits);
-    muon.setSummaryValue(phiLayer2Hits,xAOD::phiLayer2Hits);
-    muon.setSummaryValue(phiLayer3Hits,xAOD::phiLayer3Hits);
-    muon.setSummaryValue(phiLayer4Hits,xAOD::phiLayer4Hits);
-
-    muon.setSummaryValue(etaLayer1Hits,xAOD::etaLayer1Hits);
-    muon.setSummaryValue(etaLayer2Hits,xAOD::etaLayer2Hits);
-    muon.setSummaryValue(etaLayer3Hits,xAOD::etaLayer3Hits);
-    muon.setSummaryValue(etaLayer4Hits,xAOD::etaLayer4Hits);
-
-    muon.setSummaryValue(phiLayer1Holes,xAOD::phiLayer1Holes);
-    muon.setSummaryValue(phiLayer2Holes,xAOD::phiLayer2Holes);
-    muon.setSummaryValue(phiLayer3Holes,xAOD::phiLayer3Holes);
-    muon.setSummaryValue(phiLayer4Holes,xAOD::phiLayer4Holes);
-
-    muon.setSummaryValue(etaLayer1Holes,xAOD::etaLayer1Holes);
-    muon.setSummaryValue(etaLayer2Holes,xAOD::etaLayer2Holes);
-    muon.setSummaryValue(etaLayer3Holes,xAOD::etaLayer3Holes);
-    muon.setSummaryValue(etaLayer4Holes,xAOD::etaLayer4Holes);
-
-    muon.setSummaryValue(phiLayer1RPCHits,  xAOD::phiLayer1RPCHits);
-    muon.setSummaryValue(phiLayer2RPCHits,  xAOD::phiLayer2RPCHits);
-    muon.setSummaryValue(phiLayer3RPCHits,  xAOD::phiLayer3RPCHits);
-
-    muon.setSummaryValue(etaLayer1RPCHits,  xAOD::etaLayer1RPCHits);
-    muon.setSummaryValue(etaLayer2RPCHits,  xAOD::etaLayer2RPCHits);
-    muon.setSummaryValue(etaLayer3RPCHits,  xAOD::etaLayer3RPCHits);
-
-    muon.setSummaryValue(phiLayer1RPCHoles, xAOD::phiLayer1RPCHoles);
-    muon.setSummaryValue(phiLayer2RPCHoles, xAOD::phiLayer2RPCHoles);
-    muon.setSummaryValue(phiLayer3RPCHoles, xAOD::phiLayer3RPCHoles);
-
-    muon.setSummaryValue(etaLayer1RPCHoles, xAOD::etaLayer1RPCHoles);
-    muon.setSummaryValue(etaLayer2RPCHoles, xAOD::etaLayer2RPCHoles);
-    muon.setSummaryValue(etaLayer3RPCHoles, xAOD::etaLayer3RPCHoles);
-
-    muon.setSummaryValue(phiLayer1TGCHits,  xAOD::phiLayer1TGCHits);
-    muon.setSummaryValue(phiLayer2TGCHits,  xAOD::phiLayer2TGCHits);
-    muon.setSummaryValue(phiLayer3TGCHits,  xAOD::phiLayer3TGCHits);
-    muon.setSummaryValue(phiLayer4TGCHits,  xAOD::phiLayer4TGCHits);
-
-    muon.setSummaryValue(etaLayer1TGCHits,  xAOD::etaLayer1TGCHits);
-    muon.setSummaryValue(etaLayer2TGCHits,  xAOD::etaLayer2TGCHits);
-    muon.setSummaryValue(etaLayer3TGCHits,  xAOD::etaLayer3TGCHits);
-    muon.setSummaryValue(etaLayer4TGCHits,  xAOD::etaLayer4TGCHits);
-
-    muon.setSummaryValue(phiLayer1TGCHoles, xAOD::phiLayer1TGCHoles);
-    muon.setSummaryValue(phiLayer2TGCHoles, xAOD::phiLayer2TGCHoles);
-    muon.setSummaryValue(phiLayer3TGCHoles, xAOD::phiLayer3TGCHoles);
-    muon.setSummaryValue(phiLayer4TGCHoles, xAOD::phiLayer4TGCHoles);
-
-    muon.setSummaryValue(etaLayer1TGCHoles, xAOD::etaLayer1TGCHoles);
-    muon.setSummaryValue(etaLayer2TGCHoles, xAOD::etaLayer2TGCHoles);
-    muon.setSummaryValue(etaLayer3TGCHoles, xAOD::etaLayer3TGCHoles);
-    muon.setSummaryValue(etaLayer4TGCHoles, xAOD::etaLayer4TGCHoles);
-
-    muon.setSummaryValue(innerCloseHits,xAOD::innerClosePrecisionHits);
-    muon.setSummaryValue(middleCloseHits,xAOD::middleClosePrecisionHits);
-    muon.setSummaryValue(outerCloseHits,xAOD::outerClosePrecisionHits);
-    muon.setSummaryValue(extendedCloseHits,xAOD::extendedClosePrecisionHits);
-
-    muon.setSummaryValue(innerOutBoundsHits,xAOD::innerOutBoundsPrecisionHits);
-    muon.setSummaryValue(middleOutBoundsHits,xAOD::middleOutBoundsPrecisionHits);
-    muon.setSummaryValue(outerOutBoundsHits,xAOD::outerOutBoundsPrecisionHits);
-    muon.setSummaryValue(extendedOutBoundsHits,xAOD::extendedOutBoundsPrecisionHits);
-
-    muon.setSummaryValue(combinedTrackOutBoundsHits,xAOD::combinedTrackOutBoundsPrecisionHits);
-
-    muon.setSummaryValue(isEndcap,xAOD::isEndcapGoodLayers);
-    muon.setSummaryValue(isSmall,xAOD::isSmallGoodSectors);
+    //get out-of-bounds from ME track, shouldn't be any on combined track anyway
+    ElementLink< xAOD::TrackParticleContainer > mstpLink = muon.muonSpectrometerTrackParticleLink();
+    if (mstpLink.isValid()) {
+      if ( (*mstpLink)->trackLink().isValid() ) mstpTrackSummary = (*mstpLink)->track()->trackSummary();
+
+      if (mstpTrackSummary) {
+        for (auto layer : m_hitSummaryTool->summary(*mstpTrackSummary).stationLayers) {
+          if (layer.first == Muon::MuonStationIndex::BI || layer.first == Muon::MuonStationIndex::EI) {
+            innerOutBoundsHits += layer.second.noutBoundsHits;
+          }
+          if (layer.first == Muon::MuonStationIndex::BM || layer.first == Muon::MuonStationIndex::EM) {
+            middleOutBoundsHits += layer.second.noutBoundsHits;
+          }
+          if (layer.first == Muon::MuonStationIndex::BO || layer.first == Muon::MuonStationIndex::EO) {
+            outerOutBoundsHits += layer.second.noutBoundsHits;
+          }
+          if (layer.first == Muon::MuonStationIndex::BE || layer.first == Muon::MuonStationIndex::EE) {
+            extendedOutBoundsHits += layer.second.noutBoundsHits;
+          }
+        }
+      }
+    }
 
+    if ( trackSummary->muonTrackSummary() ) {
+      const Trk::MuonTrackSummary& mts = *trackSummary->muonTrackSummary();
+
+      // loop over chambers
+      std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit = mts.chamberHitSummary().begin();
+      std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit_end = mts.chamberHitSummary().end();
+      for ( ; chit != chit_end; ++chit ) {
+        const Identifier& chId = chit->chamberId();
+        bool isMdt = m_idHelper->isMdt(chId);
+        bool isCsc = m_idHelper->isCsc(chId);
+        bool isMM   = m_idHelper->isMM(chId);
+        bool issTgc = m_idHelper->issTgc(chId);
+        if ( isMdt || isMM || isCsc || issTgc ) {
+          Muon::MuonStationIndex::ChIndex index = m_idHelper->chamberIndex(chId);
+          uint8_t* hits = 0;
+          uint8_t* holes = 0;
+          if ( index == Muon::MuonStationIndex::BIS || index == Muon::MuonStationIndex::EIS || index == Muon::MuonStationIndex::CSS ) {
+            hits = &innerSmallHits;
+            holes = &innerSmallHoles;
+          } else if ( index == Muon::MuonStationIndex::BIL || index == Muon::MuonStationIndex::EIL || index == Muon::MuonStationIndex::CSL ) {
+            hits = &innerLargeHits;
+            holes = &innerLargeHoles;
+          } else if ( index == Muon::MuonStationIndex::BMS || index == Muon::MuonStationIndex::EMS ) {
+            hits = &middleSmallHits;
+            holes = &middleSmallHoles;
+          } else if ( index == Muon::MuonStationIndex::BML || index == Muon::MuonStationIndex::EML ) {
+            hits = &middleLargeHits;
+            holes = &middleLargeHoles;
+          } else if ( index == Muon::MuonStationIndex::BOS || index == Muon::MuonStationIndex::EOS ) {
+            hits = &outerSmallHits;
+            holes = &outerSmallHoles;
+          } else if ( index == Muon::MuonStationIndex::BOL || index == Muon::MuonStationIndex::EOL ) {
+            hits = &outerLargeHits;
+            holes = &outerLargeHoles;
+          } else if ( index == Muon::MuonStationIndex::BEE || index == Muon::MuonStationIndex::EES ) {
+            hits = &extendedSmallHits;
+            holes = &extendedSmallHoles;
+          } else if ( index == Muon::MuonStationIndex::EEL ) {
+            hits = &extendedLargeHits;
+            holes = &extendedLargeHoles;
+          } else {
+            ATH_MSG_WARNING("Unknown ChamberIndex" << Muon::MuonStationIndex::chName(index) );
+          }
+          if ( hits ) {
+            if (isMdt || isMM) {
+              // MM does not have netaHits(), but only nHits() as Mdt
+              *hits  += chit->nhits();
+              *holes += chit->nholes();
+            } else { // any other technology
+              *hits += chit->netaHits();
+              *holes += chit->etaProjection().nholes;
+            }
+          }
+        }
+        // Fill MM hits and holes
+        if (isMM) {
+          MMHits += chit->nhits();
+          MMHoles += chit->nholes();
+        }
+        if (isCsc) {
+          cscEtaHits += chit->etaProjection().nhits;
+          cscUnspoiledEtaHits += chit->etaProjection().ngoodHits;
+        }
+
+        if ( !isMdt && !isMM ) {
+
+          uint8_t* phiHits = 0;
+          uint8_t* phiHoles = 0;
+          uint8_t* etaHits = 0;
+          uint8_t* etaHoles = 0;
+          Muon::MuonStationIndex::PhiIndex index = m_idHelper->phiIndex(chId);
+          if ( index == Muon::MuonStationIndex::BM1 || index == Muon::MuonStationIndex::T4 ||
+               index == Muon::MuonStationIndex::CSC || index == Muon::MuonStationIndex::STGC1 ) {
+            phiHits = &phiLayer1Hits;
+            phiHoles = &phiLayer1Holes;
+            etaHits = &etaLayer1Hits;
+            etaHoles = &etaLayer1Holes;
+          } else if ( index == Muon::MuonStationIndex::BM2 || index == Muon::MuonStationIndex::T1 ||
+                      index == Muon::MuonStationIndex::STGC2  ) {
+            phiHits = &phiLayer2Hits;
+            phiHoles = &phiLayer2Holes;
+            etaHits = &etaLayer2Hits;
+            etaHoles = &etaLayer2Holes;
+          } else if ( index == Muon::MuonStationIndex::BO1 || index == Muon::MuonStationIndex::T2 ) {
+            phiHits = &phiLayer3Hits;
+            phiHoles = &phiLayer3Holes;
+            etaHits = &etaLayer3Hits;
+            etaHoles = &etaLayer3Holes;
+          } else if ( index == Muon::MuonStationIndex::BO2 || index == Muon::MuonStationIndex::T3 ) {
+            phiHits = &phiLayer4Hits;
+            phiHoles = &phiLayer4Holes;
+            etaHits = &etaLayer4Hits;
+            etaHoles = &etaLayer4Holes;
+          } else {
+            ATH_MSG_WARNING("Unknown ChamberIndex" << Muon::MuonStationIndex::phiName(index) );
+          }
+          // split into RPC and TGC
+          // First RPC layer
+          if (index == Muon::MuonStationIndex::BM1) {
+            phiLayer1RPCHits  += chit->nphiHits();
+            etaLayer1RPCHits  += chit->netaHits();
+            phiLayer1RPCHoles += chit->phiProjection().nholes;
+            etaLayer1RPCHoles += chit->etaProjection().nholes;
+          }
+          // Second RPC layer
+          else if (index == Muon::MuonStationIndex::BM2) {
+            phiLayer2RPCHits  += chit->nphiHits();
+            etaLayer2RPCHits  += chit->netaHits();
+            phiLayer2RPCHoles += chit->phiProjection().nholes;
+            etaLayer2RPCHoles += chit->etaProjection().nholes;
+          }
+          // Third RPC layer
+          else if (index == Muon::MuonStationIndex::BO1) {
+            phiLayer3RPCHits  += chit->nphiHits();
+            etaLayer3RPCHits  += chit->netaHits();
+            phiLayer3RPCHoles += chit->phiProjection().nholes;
+            etaLayer3RPCHoles += chit->etaProjection().nholes;
+          }
+          // Fourth RPC layer
+          else if (index == Muon::MuonStationIndex::BO2) {
+            phiLayer4RPCHits  += chit->nphiHits();
+            etaLayer4RPCHits  += chit->netaHits();
+            phiLayer4RPCHoles += chit->phiProjection().nholes;
+            etaLayer4RPCHoles += chit->etaProjection().nholes;
+          }
+          // First TGC layer
+          else if (index == Muon::MuonStationIndex::T4) {
+            phiLayer1TGCHits  += chit->nphiHits();
+            etaLayer1TGCHits  += chit->netaHits();
+            phiLayer1TGCHoles += chit->phiProjection().nholes;
+            etaLayer1TGCHoles += chit->etaProjection().nholes;
+          }
+          // Second TGC layer
+          else if (index == Muon::MuonStationIndex::T1) {
+            phiLayer2TGCHits  += chit->nphiHits();
+            etaLayer2TGCHits  += chit->netaHits();
+            phiLayer2TGCHoles += chit->phiProjection().nholes;
+            etaLayer2TGCHoles += chit->etaProjection().nholes;
+          }
+          // Third TGC layer
+          else if (index == Muon::MuonStationIndex::T2) {
+            phiLayer3TGCHits  += chit->nphiHits();
+            etaLayer3TGCHits  += chit->netaHits();
+            phiLayer3TGCHoles += chit->phiProjection().nholes;
+            etaLayer3TGCHoles += chit->etaProjection().nholes;
+          }
+          // Fourth TGC layer
+          else if (index == Muon::MuonStationIndex::T3) {
+            phiLayer4TGCHits  += chit->nphiHits();
+            etaLayer4TGCHits  += chit->netaHits();
+            phiLayer4TGCHoles += chit->phiProjection().nholes;
+            etaLayer4TGCHoles += chit->etaProjection().nholes;
+          }
+          // First STGC layer
+          else if (index == Muon::MuonStationIndex::STGC1) {
+            phiLayer1STGCHits  += chit->nphiHits();
+            etaLayer1STGCHits  += chit->netaHits();
+            phiLayer1STGCHoles += chit->phiProjection().nholes;
+            etaLayer1STGCHoles += chit->etaProjection().nholes;
+          }
+          // Second STGC layer
+          else if (index == Muon::MuonStationIndex::STGC2) {
+            phiLayer2STGCHits  += chit->nphiHits();
+            etaLayer2STGCHits  += chit->netaHits();
+            phiLayer2STGCHoles += chit->phiProjection().nholes;
+            etaLayer2STGCHoles += chit->etaProjection().nholes;              
+          }
+
+          if ( phiHits ) {
+            *phiHits += chit->nphiHits();
+            *phiHoles += chit->phiProjection().nholes;
+          }
+          if ( etaHits && !isCsc && !issTgc ) {
+            *etaHits += chit->netaHits();
+            *etaHoles += chit->etaProjection().nholes;
+          }
+        }
+      }
+    }
   }
 
-}	// end of namespace
+  muon.setSummaryValue(numberOfPrecisionLayers, xAOD::numberOfPrecisionLayers);
+  muon.setSummaryValue(numberOfPrecisionHoleLayers, xAOD::numberOfPrecisionHoleLayers);
+  muon.setSummaryValue(numberOfPhiLayers, xAOD::numberOfPhiLayers);
+  muon.setSummaryValue(numberOfPhiHoleLayers, xAOD::numberOfPhiHoleLayers);
+  muon.setSummaryValue(numberOfTriggerEtaLayers, xAOD::numberOfTriggerEtaLayers);
+  muon.setSummaryValue(numberOfTriggerEtaHoleLayers, xAOD::numberOfTriggerEtaHoleLayers);
+  muon.setSummaryValue(numberOfGoodPrecisionLayers, xAOD::numberOfGoodPrecisionLayers);
+
+  muon.setSummaryValue(mainSector, xAOD::primarySector);
+  muon.setSummaryValue(secondSector, xAOD::secondarySector);
+  muon.setSummaryValue(innerSmallHits, xAOD::innerSmallHits);
+  muon.setSummaryValue(innerLargeHits, xAOD::innerLargeHits);
+  muon.setSummaryValue(middleSmallHits, xAOD::middleSmallHits);
+  muon.setSummaryValue(middleLargeHits, xAOD::middleLargeHits);
+  muon.setSummaryValue(outerSmallHits, xAOD::outerSmallHits);
+  muon.setSummaryValue(outerLargeHits, xAOD::outerLargeHits);
+  muon.setSummaryValue(extendedSmallHits, xAOD::extendedSmallHits);
+  muon.setSummaryValue(extendedLargeHits, xAOD::extendedLargeHits);
+
+  muon.setSummaryValue(innerSmallHoles, xAOD::innerSmallHoles);
+  muon.setSummaryValue(innerLargeHoles, xAOD::innerLargeHoles);
+  muon.setSummaryValue(middleSmallHoles, xAOD::middleSmallHoles);
+  muon.setSummaryValue(middleLargeHoles, xAOD::middleLargeHoles);
+  muon.setSummaryValue(outerSmallHoles, xAOD::outerSmallHoles);
+  muon.setSummaryValue(outerLargeHoles, xAOD::outerLargeHoles);
+  muon.setSummaryValue(extendedSmallHoles, xAOD::extendedSmallHoles);
+  muon.setSummaryValue(extendedLargeHoles, xAOD::extendedLargeHoles);
+
+  muon.setSummaryValue(phiLayer1Hits, xAOD::phiLayer1Hits);
+  muon.setSummaryValue(phiLayer2Hits, xAOD::phiLayer2Hits);
+  muon.setSummaryValue(phiLayer3Hits, xAOD::phiLayer3Hits);
+  muon.setSummaryValue(phiLayer4Hits, xAOD::phiLayer4Hits);
+
+  muon.setSummaryValue(etaLayer1Hits, xAOD::etaLayer1Hits);
+  muon.setSummaryValue(etaLayer2Hits, xAOD::etaLayer2Hits);
+  muon.setSummaryValue(etaLayer3Hits, xAOD::etaLayer3Hits);
+  muon.setSummaryValue(etaLayer4Hits, xAOD::etaLayer4Hits);
+
+  muon.setSummaryValue(phiLayer1Holes, xAOD::phiLayer1Holes);
+  muon.setSummaryValue(phiLayer2Holes, xAOD::phiLayer2Holes);
+  muon.setSummaryValue(phiLayer3Holes, xAOD::phiLayer3Holes);
+  muon.setSummaryValue(phiLayer4Holes, xAOD::phiLayer4Holes);
+
+  muon.setSummaryValue(etaLayer1Holes, xAOD::etaLayer1Holes);
+  muon.setSummaryValue(etaLayer2Holes, xAOD::etaLayer2Holes);
+  muon.setSummaryValue(etaLayer3Holes, xAOD::etaLayer3Holes);
+  muon.setSummaryValue(etaLayer4Holes, xAOD::etaLayer4Holes);
+
+  muon.setSummaryValue(phiLayer1RPCHits,  xAOD::phiLayer1RPCHits);
+  muon.setSummaryValue(phiLayer2RPCHits,  xAOD::phiLayer2RPCHits);
+  muon.setSummaryValue(phiLayer3RPCHits,  xAOD::phiLayer3RPCHits);
+  muon.setSummaryValue(phiLayer4RPCHits,  xAOD::phiLayer4RPCHits);
+
+  muon.setSummaryValue(etaLayer1RPCHits,  xAOD::etaLayer1RPCHits);
+  muon.setSummaryValue(etaLayer2RPCHits,  xAOD::etaLayer2RPCHits);
+  muon.setSummaryValue(etaLayer3RPCHits,  xAOD::etaLayer3RPCHits);
+  muon.setSummaryValue(etaLayer4RPCHits,  xAOD::etaLayer4RPCHits);
+
+  muon.setSummaryValue(phiLayer1RPCHoles, xAOD::phiLayer1RPCHoles);
+  muon.setSummaryValue(phiLayer2RPCHoles, xAOD::phiLayer2RPCHoles);
+  muon.setSummaryValue(phiLayer3RPCHoles, xAOD::phiLayer3RPCHoles);
+  muon.setSummaryValue(phiLayer4RPCHoles, xAOD::phiLayer4RPCHoles);
+
+  muon.setSummaryValue(etaLayer1RPCHoles, xAOD::etaLayer1RPCHoles);
+  muon.setSummaryValue(etaLayer2RPCHoles, xAOD::etaLayer2RPCHoles);
+  muon.setSummaryValue(etaLayer3RPCHoles, xAOD::etaLayer3RPCHoles);
+  muon.setSummaryValue(etaLayer4RPCHoles, xAOD::etaLayer4RPCHoles);
+
+  muon.setSummaryValue(phiLayer1TGCHits,  xAOD::phiLayer1TGCHits);
+  muon.setSummaryValue(phiLayer2TGCHits,  xAOD::phiLayer2TGCHits);
+  muon.setSummaryValue(phiLayer3TGCHits,  xAOD::phiLayer3TGCHits);
+  muon.setSummaryValue(phiLayer4TGCHits,  xAOD::phiLayer4TGCHits);
+
+  muon.setSummaryValue(etaLayer1TGCHits,  xAOD::etaLayer1TGCHits);
+  muon.setSummaryValue(etaLayer2TGCHits,  xAOD::etaLayer2TGCHits);
+  muon.setSummaryValue(etaLayer3TGCHits,  xAOD::etaLayer3TGCHits);
+  muon.setSummaryValue(etaLayer4TGCHits,  xAOD::etaLayer4TGCHits);
+
+  muon.setSummaryValue(phiLayer1TGCHoles, xAOD::phiLayer1TGCHoles);
+  muon.setSummaryValue(phiLayer2TGCHoles, xAOD::phiLayer2TGCHoles);
+  muon.setSummaryValue(phiLayer3TGCHoles, xAOD::phiLayer3TGCHoles);
+  muon.setSummaryValue(phiLayer4TGCHoles, xAOD::phiLayer4TGCHoles);
+
+  muon.setSummaryValue(etaLayer1TGCHoles, xAOD::etaLayer1TGCHoles);
+  muon.setSummaryValue(etaLayer2TGCHoles, xAOD::etaLayer2TGCHoles);
+  muon.setSummaryValue(etaLayer3TGCHoles, xAOD::etaLayer3TGCHoles);
+  muon.setSummaryValue(etaLayer4TGCHoles, xAOD::etaLayer4TGCHoles);
+
+  // New Small Wheel
+  // STGC
+  muon.setSummaryValue(phiLayer1STGCHits,  xAOD::phiLayer1STGCHits);
+  muon.setSummaryValue(phiLayer2STGCHits,  xAOD::phiLayer2STGCHits);
+
+  muon.setSummaryValue(etaLayer1STGCHits,  xAOD::etaLayer1STGCHits);
+  muon.setSummaryValue(etaLayer2STGCHits,  xAOD::etaLayer2STGCHits);
+
+  muon.setSummaryValue(phiLayer1STGCHoles, xAOD::phiLayer1STGCHoles);
+  muon.setSummaryValue(phiLayer2STGCHoles, xAOD::phiLayer2STGCHoles);
+
+  muon.setSummaryValue(etaLayer1STGCHoles, xAOD::etaLayer1STGCHoles);
+  muon.setSummaryValue(etaLayer2STGCHoles, xAOD::etaLayer2STGCHoles);
+  
+  // MM
+  muon.setSummaryValue(MMHits,  xAOD::MMHits);
+  muon.setSummaryValue(MMHoles,  xAOD::MMHoles);
+  
+
+  muon.setSummaryValue(innerCloseHits, xAOD::innerClosePrecisionHits);
+  muon.setSummaryValue(middleCloseHits, xAOD::middleClosePrecisionHits);
+  muon.setSummaryValue(outerCloseHits, xAOD::outerClosePrecisionHits);
+  muon.setSummaryValue(extendedCloseHits, xAOD::extendedClosePrecisionHits);
+
+  muon.setSummaryValue(innerOutBoundsHits, xAOD::innerOutBoundsPrecisionHits);
+  muon.setSummaryValue(middleOutBoundsHits, xAOD::middleOutBoundsPrecisionHits);
+  muon.setSummaryValue(outerOutBoundsHits, xAOD::outerOutBoundsPrecisionHits);
+  muon.setSummaryValue(extendedOutBoundsHits, xAOD::extendedOutBoundsPrecisionHits);
+
+  muon.setSummaryValue(combinedTrackOutBoundsHits, xAOD::combinedTrackOutBoundsPrecisionHits);
+
+  muon.setSummaryValue(isEndcap, xAOD::isEndcapGoodLayers);
+  muon.setSummaryValue(isSmall, xAOD::isSmallGoodSectors);
+
+  muon.setSummaryValue(cscEtaHits, xAOD::cscEtaHits);
+  muon.setSummaryValue(cscUnspoiledEtaHits, xAOD::cscUnspoiledEtaHits);
+
+}
+
+} // end of namespace
diff --git a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
index 02c652ec12b..a6566b02a90 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
+++ b/Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h
@@ -100,6 +100,15 @@ enum SummaryType {
         numberOfMdtHoles                =25,       //! number of MDT measurements missing from the track
         numberOfTgcEtaHoles             =26,       //! number of TGC Eta measurements missing from the track
         numberOfTgcPhiHoles             =27,       //! number of TGC Phi measurements missing from the track
+
+        // New Small Wheel
+        numberOfStgcEtaHits             =67,       //! number of TGC Eta measurements missing from the track
+        numberOfStgcPhiHits             =68,       //! number of TGC Phi measurements missing from the track
+        numberOfMmHits               =69,       //! number of TGC Eta measurements missing from the track
+        numberOfStgcEtaHoles            =70,       //! number of TGC Eta measurements missing from the track
+        numberOfStgcPhiHoles            =71,       //! number of TGC Phi measurements missing from the track
+        numberOfMmHoles              =72,       //! number of TGC Eta measurements missing from the track
+
         numberOfCscUnspoiltEtaHits      =45,       //! number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt). See Muon::CscClusterStatus for definitions of 'spoiled' hits.
 	numberOfGoodMdtHits             =66,       //!number of non-deweighted MDT hits.  Only here as a placeholder, will be filled only on xAOD::Muon
     // --- all
@@ -115,7 +124,7 @@ enum SummaryType {
 	pixeldEdx_res                       = 51, //!< the dE/dx estimate, calculated using the pixel clusters [?]
 
  // -- numbers...
-        numberOfTrackSummaryTypes = 67
+        numberOfTrackSummaryTypes = 73
     };
 
 // Troels.Petersen@cern.ch:
diff --git a/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx b/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
index 67b6efac6b1..4771af6108a 100755
--- a/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
+++ b/Tracking/TrkEvent/TrkTrackSummary/src/TrackSummary.cxx
@@ -160,6 +160,15 @@ T_out& dumpTrackSummary( T_out& out, const TrackSummary& trackSum )
   out << " * Number of dead TRT straws     : "<<trackSum.get(numberOfTRTDeadStraws)<<"\n";
   out << " * Number of MDT hits            : "<<trackSum.get(numberOfMdtHits)<<"\n";
   out << " * Number of MDT holes           : "<<trackSum.get(numberOfMdtHoles)<<"\n";
+
+  // New Small Wheel
+  out << " * Number of STGC hits           : phi "<<trackSum.get(numberOfStgcPhiHits)
+      << " eta " <<trackSum.get(numberOfStgcEtaHits)<<"\n";
+  out << " * Number of STGC holes          : phi "<<trackSum.get(numberOfStgcPhiHoles)
+      << " eta  "<<trackSum.get(numberOfStgcEtaHoles)<<"\n";
+  out << " * Number of MM hits             : "<<trackSum.get(numberOfMmHits)<<"\n";
+  out << " * Number of MM holes            : "<<trackSum.get(numberOfMmHoles)<<"\n";
+
   out << " * Number of TGC hits            : phi "<<trackSum.get(numberOfTgcPhiHits)
       << " eta " <<trackSum.get(numberOfTgcEtaHits)<<"\n";
   out << " * Number of TGC holes           : phi "<<trackSum.get(numberOfTgcPhiHoles)
diff --git a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx
index 0f715ddce32..06de8dc05b8 100644
--- a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx
+++ b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx
@@ -1026,6 +1026,7 @@ void TrackParticleCreatorTool::setTrackSummary( xAOD::TrackParticle& tp, const T
     if ( i >= offset && i < offset+Trk::numberOfeProbabilityTypes+1){
       continue;
     }
+    if( i >= Trk::numberOfStgcEtaHits && i <= Trk::numberOfMmHoles) continue;
     // coverity[mixed_enums]
     if (i == Trk::numberOfTRTHitsUsedFordEdx ) continue;
 
@@ -1065,21 +1066,21 @@ void TrackParticleCreatorTool::setTrackSummary( xAOD::TrackParticle& tp, const T
 
   //muon hit info
   if(m_useMuonSummaryTool){
-  ATH_MSG_DEBUG("now do muon hit info");
-  Muon::IMuonHitSummaryTool::CompactSummary msSummary = m_hitSummaryTool->summary(summary);
-  uint8_t numberOfPrecisionLayers = msSummary.nprecisionLayers;
-  ATH_MSG_DEBUG("# of prec layers: "<<numberOfPrecisionLayers);
-  uint8_t numberOfPrecisionHoleLayers = msSummary.nprecisionHoleLayers;
-  uint8_t numberOfPhiLayers = msSummary.nphiLayers;
-  uint8_t numberOfPhiHoleLayers = msSummary.nphiHoleLayers;
-  uint8_t numberOfTriggerEtaLayers = msSummary.ntrigEtaLayers;
-  uint8_t numberOfTriggerEtaHoleLayers = msSummary.ntrigEtaHoleLayers;
-  tp.setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
-  tp.setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
-  tp.setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
-  tp.setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
-  tp.setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
-  tp.setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
+    ATH_MSG_DEBUG("now do muon hit info");
+    Muon::IMuonHitSummaryTool::CompactSummary msSummary = m_hitSummaryTool->summary(summary);
+    uint8_t numberOfPrecisionLayers = msSummary.nprecisionLayers;
+    ATH_MSG_DEBUG("# of prec layers: "<<numberOfPrecisionLayers);
+    uint8_t numberOfPrecisionHoleLayers = msSummary.nprecisionHoleLayers;
+    uint8_t numberOfPhiLayers = msSummary.nphiLayers;
+    uint8_t numberOfPhiHoleLayers = msSummary.nphiHoleLayers;
+    uint8_t numberOfTriggerEtaLayers = msSummary.ntrigEtaLayers;
+    uint8_t numberOfTriggerEtaHoleLayers = msSummary.ntrigEtaHoleLayers;
+    tp.setSummaryValue(numberOfPrecisionLayers,xAOD::numberOfPrecisionLayers);
+    tp.setSummaryValue(numberOfPrecisionHoleLayers,xAOD::numberOfPrecisionHoleLayers);
+    tp.setSummaryValue(numberOfPhiLayers,xAOD::numberOfPhiLayers);
+    tp.setSummaryValue(numberOfPhiHoleLayers,xAOD::numberOfPhiHoleLayers);
+    tp.setSummaryValue(numberOfTriggerEtaLayers,xAOD::numberOfTriggerEtaLayers);
+    tp.setSummaryValue(numberOfTriggerEtaHoleLayers,xAOD::numberOfTriggerEtaHoleLayers);
   }
 }
 
diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
index ec1a7de0e13..48dd160c6a9 100755
--- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
+++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx
@@ -272,6 +272,13 @@ Trk::TrackSummaryTool::createSummary( const Track& track,
     information[Trk::numberOfRpcPhiHoles] =0;
     information[Trk::numberOfTgcEtaHoles] =0;
     information[Trk::numberOfTgcPhiHoles] =0;
+    // New Small Wheel
+    information[Trk::numberOfStgcEtaHits] =0;
+    information[Trk::numberOfStgcPhiHits] =0;
+    information[Trk::numberOfMmHits] =0;    
+    information[Trk::numberOfStgcEtaHoles] =0;
+    information[Trk::numberOfStgcPhiHoles] =0;
+    information[Trk::numberOfMmHoles] =0;
   }
 
   std::bitset<numberOfDetectorTypes> hitPattern;
@@ -585,12 +592,17 @@ void Trk::TrackSummaryTool::searchHolesStepWise( const Trk::Track& track,
     information [numberOfSCTDeadSensors]       = -1;
     information [numberOfTRTHoles]             = -1;
     information [numberOfTRTDeadStraws]        = -1;
+    // NOTE: Eta holes was used twice instead of Phi holes
     information [numberOfCscEtaHoles]          = -1;
-    information [numberOfCscEtaHoles]          = -1;    
+    information [numberOfCscPhiHoles]          = -1;    
     information [numberOfRpcEtaHoles]          = -1;
-    information [numberOfRpcEtaHoles]          = -1;    
+    information [numberOfRpcPhiHoles]          = -1;    
     information [numberOfTgcEtaHoles]          = -1;
-    information [numberOfTgcEtaHoles]          = -1;    
+    information [numberOfTgcPhiHoles]          = -1;
+    // New Small Wheel
+    information [numberOfStgcEtaHoles]         = -1;
+    information [numberOfStgcPhiHoles]         = -1; 
+    information [numberOfMmHoles]              = -1;
     return;
   }
   else
@@ -617,13 +629,17 @@ void Trk::TrackSummaryTool::searchHolesStepWise( const Trk::Track& track,
     {
 // now do Muon hole search. It works completely differently to the above, so we need to make this all a bit more general
 // and probably more efficient. But this hopefully works for now! EJWM
-      information [numberOfMdtHoles]          = 0;
+      information [numberOfMdtHoles]             = 0;
       information [numberOfCscEtaHoles]          = 0;
       information [numberOfCscPhiHoles]          = 0;    
       information [numberOfRpcEtaHoles]          = 0;
       information [numberOfRpcPhiHoles]          = 0;    
       information [numberOfTgcEtaHoles]          = 0;
-      information [numberOfTgcPhiHoles]          = 0;    
+      information [numberOfTgcPhiHoles]          = 0;
+      // New Small Wheel
+      information [numberOfStgcEtaHoles]         = 0;
+      information [numberOfStgcPhiHoles]         = 0;  
+      information [numberOfMmHoles] = 0;        
       m_muonTool->searchForHoles(track,information,Trk::muon) ;
     }
   }
-- 
GitLab


From b51670517996a911e2d6f6309609ac42f5ed9952 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 26 Feb 2019 15:59:45 +0100
Subject: [PATCH 186/404] Enable thread checker

---
 .../TrigEgammaHypo/TrigEgammaHypo/ATLAS_CHECK_THREAD_SAFETY      | 1 +
 Trigger/TrigValidation/TrigUpgradeTest/ATLAS_CHECK_THREAD_SAFETY | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigValidation/TrigUpgradeTest/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..cf3f0559794
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigEgammaHypo
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigValidation/TrigUpgradeTest/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3ad59ab2006
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigValidation/TrigUpgradeTest
-- 
GitLab


From 3951bc54b75b2667ccff27068fa58ea663bb0570 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 14:48:56 +0100
Subject: [PATCH 187/404] Thread safety fixes for Hypos

---
 .../TrigAFPHypo/TrigAFPHypo/ATLAS_CHECK_THREAD_SAFETY         | 1 +
 .../TrigBjetHypo/TrigBjetHypo/ATLAS_CHECK_THREAD_SAFETY       | 1 +
 .../TrigBphysHypo/TrigBphysHypo/ATLAS_CHECK_THREAD_SAFETY     | 1 +
 .../TrigCaloHypo/TrigCaloHypo/ATLAS_CHECK_THREAD_SAFETY       | 1 +
 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx  | 4 ++--
 .../TrigEgammaMuonCombHypo/ATLAS_CHECK_THREAD_SAFETY          | 1 +
 Trigger/TrigHypothesis/TrigFTKHypo/ATLAS_CHECK_THREAD_SAFETY  | 1 +
 Trigger/TrigHypothesis/TrigHIHypo/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 .../TrigHLTJetHypo/TrigHLTJetHypo/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx | 4 ++--
 .../TrigHLTJetHypoUnitTests/ATLAS_CHECK_THREAD_SAFETY         | 1 +
 .../TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY             | 1 +
 .../TrigLongLivedParticlesHypo/ATLAS_CHECK_THREAD_SAFETY      | 1 +
 .../TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx        | 4 ++--
 .../src/MuonClusterIsolationHypo.cxx                          | 4 ++--
 .../TrigMissingETHypo/ATLAS_CHECK_THREAD_SAFETY               | 1 +
 .../TrigMultiVarHypo/ATLAS_CHECK_THREAD_SAFETY                | 1 +
 .../TrigMuonHypo/TrigMuonHypo/ATLAS_CHECK_THREAD_SAFETY       | 1 +
 .../TrigHypothesis/TrigMuonHypoMT/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 .../TrigTauHypo/TrigTauHypo/ATLAS_CHECK_THREAD_SAFETY         | 1 +
 20 files changed, 24 insertions(+), 8 deletions(-)
 create mode 100644 Trigger/TrigHypothesis/TrigAFPHypo/TrigAFPHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigBphysHypo/TrigBphysHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigCaloHypo/TrigCaloHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/TrigEgammaMuonCombHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigFTKHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigHIHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigMissingETHypo/TrigMissingETHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigMuonHypoMT/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigHypothesis/TrigAFPHypo/TrigAFPHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigAFPHypo/TrigAFPHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..48422521cac
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigAFPHypo/TrigAFPHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigAFPHypo
diff --git a/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..97f23f5f7b3
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigBjetHypo/TrigBjetHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigBjetHypo
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/TrigBphysHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigBphysHypo/TrigBphysHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..0ea524b8da4
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/TrigBphysHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigBphysHypo
diff --git a/Trigger/TrigHypothesis/TrigCaloHypo/TrigCaloHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigCaloHypo/TrigCaloHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..48e4cf97656
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigCaloHypo/TrigCaloHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigCaloHypo
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx
index 5b796c264b7..ed56a6ea530 100755
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.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
 */
 
 // ********************************************************************
@@ -403,7 +403,7 @@ HLT::ErrorCode TrigEFCaloHypo::hltExecute(const HLT::TriggerElement* outputTE,
       m_PhiCalo.push_back(tmpphi);
       m_ECalib.push_back(clus->e());
       const xAOD::CaloCluster *origClus=nullptr;
-      static SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
+      static const SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
       if (!orig.isAvailable(*clus) || !orig(*clus).isValid()){
           ATH_MSG_DEBUG("Problem with original cluster link");
       }
diff --git a/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/TrigEgammaMuonCombHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/TrigEgammaMuonCombHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..0f49f60aa62
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigEgammaMuonCombHypo/TrigEgammaMuonCombHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigEgammaMuonCombHypo
diff --git a/Trigger/TrigHypothesis/TrigFTKHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigFTKHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..5da676a1343
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigFTKHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigFTKHypo
diff --git a/Trigger/TrigHypothesis/TrigHIHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigHIHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e50dc8e639c
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHIHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigHIHypo
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6c6741eb32c
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigHLTJetHypo
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx
index ede95764fd2..d638e11b2e8 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.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
 */
 
 // ********************************************************************
@@ -55,7 +55,7 @@ using std::chrono::duration_cast;
 using std::chrono::nanoseconds;
 using std::chrono::microseconds;
 
-float GeV = 1000.;
+const float GeV = 1000.;
 
 enum class HypoStrategy{EtaEt, HT, TLA, DijetMassDEta, singlemass};
 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..be841530ba8
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests
diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..91498c164bb
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigHypoCommonTools
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..370789aea8f
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigLongLivedParticlesHypo
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
index 69fb022ba53..99f147e320f 100755
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.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
 */
 
 //
@@ -122,7 +122,7 @@ HLT::ErrorCode MuonClusterHypo::hltExecute(const HLT::TriggerElement* outputTE,
 
         for(const xAOD::TrigComposite * compObj : *compCont) {
             if(msgLvl() <= MSG::DEBUG) {
-                msg() << MSG::DEBUG << "TrigComposite ptr = " << (void*)compObj << endmsg;
+                msg() << MSG::DEBUG << "TrigComposite ptr = " << (const void*)compObj << endmsg;
             }
             for(const std::string & collName : compObj->linkColNames()) {
                 if(msgLvl() <= MSG::DEBUG) {
diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
index 11c4f91f607..cff42da580f 100755
--- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.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
 */
 
 //
@@ -143,7 +143,7 @@ HLT::ErrorCode MuonClusterIsolationHypo::hltExecute(const HLT::TriggerElement* o
 
         for(const xAOD::TrigComposite * compObj : *compCont) {
             if(msgLvl() <= MSG::DEBUG) {
-                msg() << MSG::DEBUG << "TrigComposite ptr = " << (void*)compObj << endmsg;
+                msg() << MSG::DEBUG << "TrigComposite ptr = " << (const void*)compObj << endmsg;
             }
             for(const std::string & collName : compObj->linkColNames()) {
                 if(msgLvl() <= MSG::DEBUG) {
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/TrigMissingETHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigMissingETHypo/TrigMissingETHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..078403c9b66
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigMissingETHypo/TrigMissingETHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigMissingETHypo
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..59df4231d56
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/TrigMultiVarHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigMultiVarHypo
diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..d51ec69725b
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigMuonHypo/TrigMuonHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigMuonHypo
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigMuonHypoMT/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..914af8df095
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigMuonHypoMT
diff --git a/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..f27a46982cf
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigTauHypo/TrigTauHypo/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigHypothesis/TrigTauHypo
-- 
GitLab


From 84f09a2a10e674abc0d3baff6eb280ccf60efa25 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 27 Feb 2019 16:36:22 +0100
Subject: [PATCH 188/404] TrigNavStructure: Minimal fixes for thread-safety
 checker

Mark a few statics as thread-safe. Note that this entire code is legacy
and will never be used in athenaMT. But these minimal fixes allow the
thread-checker to run in client packages that contain mixed MT/non-MT
code.
---
 Trigger/TrigEvent/TrigNavStructure/CMakeLists.txt          | 4 ++--
 .../TrigNavStructure/TrigNavStructure/TrigNavStructure.h   | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigEvent/TrigNavStructure/CMakeLists.txt b/Trigger/TrigEvent/TrigNavStructure/CMakeLists.txt
index ba4ff687e9d..2219f6bee9c 100644
--- a/Trigger/TrigEvent/TrigNavStructure/CMakeLists.txt
+++ b/Trigger/TrigEvent/TrigNavStructure/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 778117 2016-10-12 20:11:14Z krasznaa $
 ################################################################################
 # Package: TrigNavStructure
 ################################################################################
@@ -10,7 +9,8 @@ atlas_subdir( TrigNavStructure )
 atlas_depends_on_subdirs(
    PUBLIC
    Control/AthContainers
-   Control/AthToolSupport/AsgTools )
+   Control/AthToolSupport/AsgTools
+   Control/CxxUtils )
 
 # External dependencies:
 find_package( Boost COMPONENTS regex )
diff --git a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigNavStructure.h b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigNavStructure.h
index 566f82b9aea..675e07a5fe6 100644
--- a/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigNavStructure.h
+++ b/Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/TrigNavStructure.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- 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
 */
 
 
@@ -10,6 +10,7 @@
 
 #include <vector>
 
+#include "CxxUtils/checker_macros.h"
 #include "TrigNavStructure/TriggerElement.h"
 #include "TrigNavStructure/TriggerElementFactory.h"
 #include "TrigNavStructure/BaseHolder.h"
@@ -363,8 +364,8 @@ namespace HLT {
 
     TriggerElementFactory m_factory;                     //!< factory of trigger elements
     TrigHolderStructure m_holderstorage;                 //!< structure for feature holders
-    static const TriggerElement* m_unspecifiedTE;
-    static std::string m_unspecifiedLabel;
+    static const TriggerElement* m_unspecifiedTE ATLAS_THREAD_SAFE;
+    static std::string m_unspecifiedLabel ATLAS_THREAD_SAFE;
 
 
   };
-- 
GitLab


From 55fa313f5166076e80c4b662bd0db9f2a0e14cb6 Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Mon, 4 Mar 2019 13:11:47 +0000
Subject: [PATCH 189/404] static thread checker for TrkParameters and
 TrkParametersBase, avoid const_cast and remove a static.

---
 .../TrkParameters/ATLAS_CHECK_THREAD_SAFETY   |   1 +
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../CurvilinearParametersT.h                  |  21 ++--
 .../CurvilinearParametersT.icc                |  42 +++----
 .../TrkParametersBase/ParametersBase.h        |   4 +
 .../TrkParametersBase/ParametersT.h           |  18 +--
 .../TrkParametersBase/ParametersT.icc         | 116 +++++++++---------
 7 files changed, 102 insertions(+), 101 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkParameters/TrkParameters/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tracking/TrkEvent/TrkParameters/TrkParameters/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkParameters/TrkParameters/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..c2dcfaf739b
--- /dev/null
+++ b/Tracking/TrkEvent/TrkParameters/TrkParameters/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkParameters
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..a71e3c23e29
--- /dev/null
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tracking/TrkEvent/TrkParametersBase
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
index adf5f1be298..c8db11361a0 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -43,7 +43,6 @@ namespace Trk
    @author andreas.salzburger@cern.ch
   */
 
-
   template<int DIM,class T, class S>
   class CurvilinearParametersT : public ParametersT<DIM,T,S>
   {
@@ -80,7 +79,7 @@ namespace Trk
     CurvilinearParametersT(CurvilinearParametersT<DIM,T,S>&&); 
    
     /** Destructor */
-    virtual ~CurvilinearParametersT() = default;
+    virtual ~CurvilinearParametersT()=default;
                  
     /** Assignment operator*/
     CurvilinearParametersT<DIM,T,S> &operator=(const CurvilinearParametersT<DIM,T,S>&);
@@ -89,22 +88,18 @@ namespace Trk
     CurvilinearParametersT<DIM,T,S> &operator=(CurvilinearParametersT<DIM,T,S>&&);
 
     /** equality operator */
-    virtual bool operator==(const ParametersBase<DIM,T>& rhs) const override;
+    virtual bool operator==(const ParametersBase<DIM,T>& rhs) const override final;
 
     /** Pseudo constructor */             
-    virtual CurvilinearParametersT<DIM,T,S>* clone() const override {return new CurvilinearParametersT<DIM,T,S>(*this);}
+    virtual CurvilinearParametersT<DIM,T,S>* clone() const override final 
+    {return new CurvilinearParametersT<DIM,T,S>(*this);}
                  
     /** Return the ParametersType enum */
-    virtual ParametersType type() const override {return Trk::Curvilinear;}
+    virtual ParametersType type() const override
+    {return Trk::Curvilinear;}
     
-    /** Access to the Surface method */
-    virtual const S& associatedSurface() const override;
-
-    /** Test to see if there's a surface there. */
-    virtual bool hasSurface() const override { return true; }
-
     /** Return the measurementFrame of the parameters */
-    virtual const Amg::RotationMatrix3D measurementFrame() const override;
+    virtual const Amg::RotationMatrix3D measurementFrame() const override final;
 
     /**Dumps relevant information about the track parameters into the ostream.*/
     virtual MsgStream& dump(MsgStream& out) const override;
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
index fa633e7b46a..855b690ea1c 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/CurvilinearParametersT.icc
@@ -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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -17,12 +17,13 @@ namespace Trk
   template <int DIM,class T,class S>
   Trk::CurvilinearParametersT<DIM,T,S>::CurvilinearParametersT(const AmgVector(DIM+2)& parameters,
 							       AmgSymMatrix(DIM)* covariance,
-							       unsigned int cIdentifier) :
+							       unsigned int cIdentifier):
     ParametersT<DIM,T,S>(Amg::Vector3D(parameters[x],parameters[y],parameters[z]),
-			 Amg::Vector3D(parameters[3],parameters[4],parameters[5]),
-			 covariance),
+                         Amg::Vector3D(parameters[3],parameters[4],parameters[5]),
+                         covariance),
     m_cIdentifier(cIdentifier)
   {
+   
     // flip the charge according to qOverP
     if (parameters[6] < 0.) this->m_chargeDef.setCharge(-1);
     // assign the parameters
@@ -32,6 +33,9 @@ namespace Trk
     this->m_parameters[phi]    = this->momentum().phi();
     this->m_parameters[theta]  = this->momentum().theta();
     this->m_parameters[qOverP] = parameters[6]/this->momentum().mag();
+
+    /* we need all the above to be there for the surfac*/ 
+    this->m_surface=new S(this->m_position,curvilinearFrame());
   }
   
   // Constructor with TP arguments
@@ -43,11 +47,10 @@ namespace Trk
 							AmgSymMatrix(DIM)* cov,
 							unsigned int cIdentifier):
     ParametersT<DIM,T,S>(),
-    m_cIdentifier(cIdentifier)
+   m_cIdentifier(cIdentifier)
   {
-    this->m_position   = pos;
-    this->m_covariance = cov;
-
+    this->m_covariance =cov;
+    this->m_position=pos;
     // flip the charge according to qOverP
     if(tqOverP < 0.)
       this->m_chargeDef.setCharge(-1.);
@@ -65,6 +68,8 @@ namespace Trk
     double p = fabs(1./tqOverP);
     this->m_momentum = Amg::Vector3D(p*cos(tphi)*sin(ttheta),p*sin(tphi)*sin(ttheta),p*cos(ttheta));
 
+    /* we need all the above for the surface*/
+    this->m_surface=new S(this->m_position,curvilinearFrame());
   }
 
   // full global constructor
@@ -92,6 +97,9 @@ namespace Trk
     this->m_parameters[Trk::qOverP] = charge/mom.mag();
     this->m_position = pos;
     this->m_momentum = mom;
+  
+    /* we need all the above to be there for the surfac*/ 
+    this->m_surface=new S(this->m_position,curvilinearFrame());
   }
 
   // copy constructor
@@ -170,19 +178,7 @@ namespace Trk
     // compare equality of base class parts
     return ParametersT<DIM,T,S>::operator==(rhs);
   }
-  
-  template<int DIM,class T,class S>
-  const S& CurvilinearParametersT<DIM,T,S>::associatedSurface() const
-  {
-    if(!this->m_surface)
-    {
-      // create the surface for global position and global rotation
-      const_cast<S*&>(this->m_surface) = new S(this->position(),curvilinearFrame());
-    }
-
-    return (*this->m_surface);
-  }
-  
+ 
   // Screen output dump
   template<int DIM,class T,class S>
   MsgStream& CurvilinearParametersT<DIM,T,S>::dump(MsgStream& out) const
@@ -208,7 +204,7 @@ namespace Trk
   template <int DIM,class T,class S>
   const Amg::RotationMatrix3D CurvilinearParametersT<DIM,T,S>::measurementFrame() const
   {
-    static Amg::RotationMatrix3D mFrame;
+    Amg::RotationMatrix3D mFrame;
     // the columnes
     CurvilinearUVT local_curvilinearFrame=curvilinearFrame();
     mFrame.col(0) = local_curvilinearFrame.curvU();
@@ -240,7 +236,7 @@ namespace Trk
     if (updatedCovariance)
     {
       if (updatedCovariance != this->m_covariance)
-	delete this->m_covariance;
+        delete this->m_covariance;
       this->m_covariance = updatedCovariance;
     }
     
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
index 51344f3040c..820742cd031 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersBase.h
@@ -118,6 +118,10 @@ namespace Trk
     /** Return the ParametersType enum */
     virtual ParametersType type() const = 0;
     
+    /** Test to see if there's a surface there. */
+    virtual bool hasSurface() const = 0 ;
+
+
     /** Returns charge of concrete type (i.e. must be implemented in inheriting classes) */
     virtual double charge() const = 0;
 
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
index 42b1e854d16..a9cd7677577 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.h
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -108,25 +108,25 @@ namespace Trk
     virtual ParametersType type() const override {return Trk::AtaSurface;}
 
     /** Returns charge of track */
-    virtual double charge() const override {return m_chargeDef.charge();}
+    virtual double charge() const override final {return m_chargeDef.charge();}
 
     /** Access method for the parameters */
-    virtual const AmgVector(DIM)& parameters() const final {return m_parameters;}
+    virtual const AmgVector(DIM)& parameters() const override final {return m_parameters;}
       
     /** Access method for the covariance matrix - 0 if no covariance matrix is given */
-    virtual const AmgSymMatrix(DIM)* covariance() const final {return m_covariance;}
+    virtual const AmgSymMatrix(DIM)* covariance() const override final {return m_covariance;}
     
     /** Access to the Surface method */
-    virtual const S& associatedSurface() const override {return *m_surface;}    
+    virtual const S& associatedSurface() const override final {return *m_surface;}    
   
     /** Test to see if there's a surface there. */
-    virtual bool hasSurface() const { return m_surface != nullptr; }
+    virtual bool hasSurface() const override final { return m_surface != nullptr; }
 
     /** Access method for the position */
-    virtual const Amg::Vector3D& position() const final {return m_position;}
+    virtual const Amg::Vector3D& position() const override final {return m_position;}
       
     /** Access method for the momentum */
-    virtual const Amg::Vector3D& momentum() const final {return m_momentum;}
+    virtual const Amg::Vector3D& momentum() const override final {return m_momentum;}
 
     /** Return the measurementFrame of the parameters */
     const Amg::RotationMatrix3D measurementFrame() const override;
@@ -138,7 +138,7 @@ namespace Trk
     template <class SURFACE_CNV, class ATA_SURFACE>
     friend class ::AtaSurfaceCnv_p1;
     
-    /** --- PRIVATE CONSTRUCTOR : for persistency purpose only */
+    /** --- Protected constructors : for persistency purpose only */
     ParametersT (const AmgVector(DIM)& parameters,
 		 const S* surface,
 		 AmgSymMatrix(DIM)* covariance = 0);
diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
index 5d62f06cc38..1715d16a155 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
@@ -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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -76,8 +76,8 @@ namespace Trk
   // Constructor with local arguments - uses global <-> local for parameters
   template<int DIM,class T,class S>
   ParametersT<DIM,T,S>::ParametersT(const AmgVector(DIM)& parameters,
-				    const S& surface,
-				    AmgSymMatrix(DIM)* cov):
+                                    const S& surface,
+                                    AmgSymMatrix(DIM)* cov):
     ParametersBase<DIM,T>(),
     m_parameters(parameters),
     m_covariance(cov),
@@ -278,52 +278,7 @@ namespace Trk
     }
   }
 
-// PROTECTED Constructor with local arguments - persistency only, ownership of surface given
-  template <int DIM,class T,class S>
-  Trk::ParametersT<DIM,T,S>::ParametersT(const AmgVector(DIM)& pars,
-					 const S* surface,
-					 AmgSymMatrix(DIM)* cov) :
-    ParametersBase<DIM,T>(),
-    m_parameters(pars),
-    m_covariance(cov),
-    m_surface(surface)
-  {
-    float qop = m_parameters[Trk::qOverP];
-    // decide the sign of the charge
-    if (qop<0.) m_chargeDef.setCharge(-1);
-
-    double p=0.0;
-    if (qop!=0.) {
-      p = fabs(1./qop);
-    } else {
-      // qop is unphysical. No momentum measurement.
-      p = INVALID_P;
-      qop = INVALID_QOP;
-    }
-    // fill momentum & then position using the surface
-    m_momentum = Amg::Vector3D(p*cos(m_parameters[Trk::phi])*sin(m_parameters[Trk::theta]),
-			       p*sin(m_parameters[Trk::phi])*sin(m_parameters[Trk::theta]),
-			       p*cos(m_parameters[Trk::theta]));
-    if (m_surface)
-      m_surface->localToGlobal(this->localPosition(),m_momentum,m_position);
-    else {
-      m_momentum.setZero();
-      m_position.setZero();
-    }
-  }
-  
-  template <int DIM,class T,class S>
-  Trk::ParametersT<DIM,T,S>::ParametersT(const Amg::Vector3D& pos,
-					 const Amg::Vector3D& mom,
-					 AmgSymMatrix(DIM)* cov):
-    m_parameters(),
-    m_covariance(cov),
-    m_position(pos),
-    m_momentum(mom),
-    m_surface(0),
-    m_chargeDef()
-  {}
-  
+ 
   /** equality operator */
   template<int DIM,class T,class S>
   bool ParametersT<DIM,T,S>::operator==(const ParametersBase<DIM,T>& rhs) const
@@ -383,17 +338,17 @@ namespace Trk
   ParametersT<DIM,T,S>::ParametersT():
     ParametersBase<DIM,T>(),
     m_parameters(),
-    m_covariance(0),
+    m_covariance(nullptr),
     m_position(),
     m_momentum(),
-    m_surface(0),
+    m_surface(nullptr),
     m_chargeDef()
   {}  
 
   // protected update function
   template<int DIM,class T,class S>
   void ParametersT<DIM,T,S>::updateParameters(const AmgVector(DIM)& updatedParameters,
-					      AmgSymMatrix(DIM)* updatedCovariance)
+                                              AmgSymMatrix(DIM)* updatedCovariance)
   {
     // valid to use != here, because value is either copied or modified,
     bool updatePosition = (updatedParameters[Trk::loc1] != m_parameters[Trk::loc1]) || (updatedParameters[Trk::loc2] != m_parameters[Trk::loc2]);
@@ -406,17 +361,17 @@ namespace Trk
     // update the covariance
     if (updatedCovariance){
       if (updatedCovariance != m_covariance)
-	delete m_covariance;
+        delete m_covariance;
       m_covariance = updatedCovariance;
     }
     //position or momentum update needed
     if (updatePosition){
       if(m_surface)
-	m_surface->localToGlobal(this->localPosition(),m_momentum,m_position);
+        m_surface->localToGlobal(this->localPosition(),m_momentum,m_position);
       else
       {
-	m_momentum.setZero();
-	m_position.setZero();
+        m_momentum.setZero();
+        m_position.setZero();
       }
     } 
     // momentum update is needed    
@@ -429,4 +384,53 @@ namespace Trk
       m_momentum = Amg::Vector3D(p*cos(phi)*sin(theta),p*sin(phi)*sin(theta),p*cos(theta));
     }
   }
+
+//special C-tor used by the curvilinear parameters  
+  template <int DIM,class T,class S>
+  Trk::ParametersT<DIM,T,S>::ParametersT(const Amg::Vector3D& pos,
+					 const Amg::Vector3D& mom,
+					 AmgSymMatrix(DIM)* cov):
+    m_parameters(),
+    m_covariance(cov),
+    m_position(pos),
+    m_momentum(mom),
+    m_surface(nullptr),
+    m_chargeDef()
+  {}
+ 
+  // Protected Constructor with local arguments - persistency only, ownership of surface given
+  template <int DIM,class T,class S>
+  Trk::ParametersT<DIM,T,S>::ParametersT(const AmgVector(DIM)& pars,
+                                         const S* surface,
+                                         AmgSymMatrix(DIM)* cov) :
+    ParametersBase<DIM,T>(),
+    m_parameters(pars),
+    m_covariance(cov),
+    m_surface(surface)
+  {
+    float qop = m_parameters[Trk::qOverP];
+    // decide the sign of the charge
+    if (qop<0.) m_chargeDef.setCharge(-1);
+
+    double p=0.0;
+    if (qop!=0.) {
+      p = fabs(1./qop);
+    } else {
+      // qop is unphysical. No momentum measurement.
+      p = INVALID_P;
+      qop = INVALID_QOP;
+    }
+    // fill momentum & then position using the surface
+    m_momentum = Amg::Vector3D(p*cos(m_parameters[Trk::phi])*sin(m_parameters[Trk::theta]),
+			       p*sin(m_parameters[Trk::phi])*sin(m_parameters[Trk::theta]),
+			       p*cos(m_parameters[Trk::theta]));
+    if (m_surface)
+      m_surface->localToGlobal(this->localPosition(),m_momentum,m_position);
+    else {
+      m_momentum.setZero();
+      m_position.setZero();
+    }
+  }
+ 
+  
 } // end of namespace Trk
-- 
GitLab


From 534c2784e38d18a81b3acd7e8aa49055a4c97e84 Mon Sep 17 00:00:00 2001
From: Daniel Louis Noel <daniel.louis.noel@cern.ch>
Date: Mon, 4 Mar 2019 13:13:05 +0000
Subject: [PATCH 190/404] LAr to ComponentAccumulator style

---
 LArCalorimeter/LArG4/LArG4SD/CMakeLists.txt   |   5 +
 .../LArG4/LArG4SD/python/LArG4SDToolConfig.py | 289 ++++++++++++++++++
 .../LArG4SD/test/LArG4SDToolConfig_test.py    |  66 ++++
 3 files changed, 360 insertions(+)
 create mode 100644 LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
 create mode 100755 LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py

diff --git a/LArCalorimeter/LArG4/LArG4SD/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4SD/CMakeLists.txt
index 6862c144102..a325797ad47 100644
--- a/LArCalorimeter/LArG4/LArG4SD/CMakeLists.txt
+++ b/LArCalorimeter/LArG4/LArG4SD/CMakeLists.txt
@@ -24,6 +24,11 @@ atlas_add_component( LArG4SD
                      INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
                      LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} CaloG4SimLib GaudiKernel LArG4Code )
 
+
+atlas_add_test( LArG4SDToolConfig_test
+                SCRIPT test/LArG4SDToolConfig_test.py
+                PROPERTIES TIMEOUT 300 )
+
 # Install files from the package:
 #atlas_install_headers( LArG4SD )
 atlas_install_python_modules( python/*.py )
diff --git a/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
new file mode 100644
index 00000000000..125467b1d6c
--- /dev/null
+++ b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
@@ -0,0 +1,289 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from ISF_Algorithms.collection_merger_helpersNew import CollectionMergerCfg
+
+from LArG4SD.LArG4SDConf import LArG4__EMBSDTool
+from LArG4SD.LArG4SDConf import LArG4__EMECSDTool
+from LArG4SD.LArG4SDConf import LArG4__FCALSDTool
+
+def getLArActiveSensitiveDetector(name="LArActiveSensitiveDetector", **kwargs):
+    ## Main configuration
+    from G4AtlasApps.SimFlags import simFlags
+    if simFlags.SimLayout.get_Value() not in ["tb_LArH6_2003","tb_LArH6_2002"]:
+        kwargs.setdefault("StacVolumes",["LArMgr::LAr::EMB::STAC"])
+        kwargs.setdefault("PresamplerVolumes",["LArMgr::LAr::Barrel::Presampler::Module"])
+        kwargs.setdefault("NegIWVolumes",["LArMgr::LAr::EMEC::Neg::InnerWheel"])
+        kwargs.setdefault("NegOWVolumes",["LArMgr::LAr::EMEC::Neg::OuterWheel"])
+        kwargs.setdefault("BOBarretteVolumes",["LArMgr::LAr::EMEC::BackOuterBarrette::Module::Phidiv"])
+        kwargs.setdefault("MiniVolumes",["LArMgr::MiniFCAL::Wafer"])
+    if simFlags.SimLayout.get_Value()!="tb_LArH6_2003":
+        kwargs.setdefault("PosIWVolumes",["LArMgr::LAr::EMEC::Pos::InnerWheel"])
+        kwargs.setdefault("PosOWVolumes",["LArMgr::LAr::EMEC::Pos::OuterWheel"])
+        kwargs.setdefault("PresVolumes", ["LArMgr::LAr::Endcap::Presampler::LiquidArgon"])
+        kwargs.setdefault("SliceVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
+    if simFlags.SimLayout.get_Value() not in ["tb_LArH6_2002"]:
+        kwargs.setdefault("FCAL1Volumes",["LArMgr::LAr::FCAL::Module1::Gap"])
+        kwargs.setdefault("FCAL2Volumes",["LArMgr::LAr::FCAL::Module2::Gap"])
+        kwargs.setdefault("FCAL3Volumes",["LArMgr::LAr::FCAL::Module3::Gap"])
+    # Running PID calibration hits?
+    kwargs.setdefault("ParticleID",simFlags.ParticleID())
+    # No effect currently
+    kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitActive"])
+    return CfgMgr.LArG4__ActiveSDTool(name, **kwargs)
+
+def getLArDeadSensitiveDetector(name="LArDeadSensitiveDetector", **kwargs):
+    ## Main configuration
+    kwargs.setdefault("BarrelCryVolumes",   ["LArMgr::LAr::Barrel::Cryostat::InnerWall::Vis",
+                                             "LArMgr::LAr::Barrel::Cryostat::Sector::*",
+                                             "LArMgr::LAr::Barrel::Cryostat::InnerWall",
+                                             "LArMgr::LAr::Barrel::Cryostat::Cylinder::*"])
+    kwargs.setdefault("BarrelCryLArVolumes",["LArMgr::LAr::Barrel::Cryostat::ExtraMat*",
+                                             "LArMgr::LAr::Barrel::Cryostat::HalfLAr*",
+                                             "LArMgr::LAr::Barrel::Cryostat::TotalLAr",
+                                             "LArMgr::LAr::Barrel::Cryostat::MotherVolume"])
+    kwargs.setdefault("BarrelCryMixVolumes",["LArMgr::LAr::Barrel::Cryostat::InnerEndWall",
+                                             "LArMgr::LAr::Barrel::Cryostat::OuterWall",
+                                             "LArMgr::LAr::Barrel::Cryostat::Mixed::Cylinder::*"])
+    kwargs.setdefault("DeadMaterialVolumes",["LArMgr::LAr::DM::*"])
+    kwargs.setdefault("BarrelPresVolumes",  ["LArMgr::LAr::Barrel::Presampler",
+                                             "LArMgr::LAr::Barrel::Presampler::Sector",
+                                             "LArMgr::LAr::Barrel::Presampler::ProtectionShell",
+                                             "LArMgr::LAr::Barrel::Presampler::MotherBoard",
+                                             "LArMgr::LAr::Barrel::Presampler::Connectics",
+                                             "LArMgr::LAr::Barrel::Presampler::Rail",
+                                             "LArMgr::LAr::Barrel::Presampler::ProtectionPlate"])
+    kwargs.setdefault("BarrelVolumes",      ["LArMgr::LAr::EMB::ExtraMat*",
+                                             "LArMgr::LAr::EMB::FrontBack::Absorber",
+                                             "LArMgr::LAr::EMB::FrontBack::Absorber2",
+                                             "LArMgr::LAr::EMB::FrontBack::Steel",
+                                             "LArMgr::LAr::EMB::FrontBack::G10",
+                                             "LArMgr::LAr::EMB::FrontBack::Electrode",
+                                             "LArMgr::LAr::EMB::GTENB",
+                                             "LArMgr::LAr::EMB::GTENF",
+                                             "LArMgr::LAr::EMB::SUMB",
+                                             "LArMgr::LAr::EMB::CAAC",
+                                             "LArMgr::LAr::EMB::MOAC",
+                                             "LArMgr::LAr::EMB::TELB",
+                                             "LArMgr::LAr::EMB::TELF",
+                                             "LArMgr::LAr::EMB::ECAM"])
+    kwargs.setdefault("ECCryVolumes",       ["LArMgr::LAr::Endcap::Cryostat::FcalLAr::Cylinder",
+                                             "LArMgr::LAr::Endcap::Cryostat::EmecHecLAr::Sector",
+                                             "LArMgr::LAr::Endcap::Cryostat::EmecHecLAr::Cylinder",
+                                             "LArMgr::LAr::Endcap::Cryostat::Sector",
+                                             "LArMgr::LAr::Endcap::Cryostat::Cone",
+                                             "LArMgr::LAr::Endcap::Cryostat::Cylinder"])
+    kwargs.setdefault("ECCryLArVolumes",    ["LArMgr::Moderator*",
+                                             "LArMgr::LAr::Endcap::Cryostat::FcalLAr",
+                                             "LArMgr::LAr::Endcap::Cryostat::EmecHecLAr",
+                                             "LArMgr::LAr::Endcap::Cryostat::MotherVolume"])
+    kwargs.setdefault("ECCryMixVolumes",    ["LArMgr::LAr::FCAL::LiquidArgonC",
+                                             "LArMgr::LAr::Endcap::Cryostat::EmecHecLAr::Sector::Mixed",
+                                             "LArMgr::LAr::Endcap::Cryostat::Sector::Mixed",
+                                             "LArMgr::LAr::Endcap::Cryostat::Cone::Mixed",
+                                             "LArMgr::LAr::Endcap::Cryostat::ExtraCyl_beforePS",
+                                             "LArMgr::LAr::Endcap::Cryostat::Cylinder::Mixed"])
+    kwargs.setdefault("ECSupportVolumes",   ["LArMgr::LAr::EMEC::ExtraCyl_afterPS",
+                                             "LArMgr::LAr::EMEC::InnerTransversalBars",
+                                             "LArMgr::LAr::EMEC::InnerAluCone::*",
+                                             "LArMgr::LAr::EMEC::OuterTransversalBars",
+                                             "LArMgr::LAr::EMEC::OuterSupportMother",
+                                             "LArMgr::LAr::EMEC::*Stretchers",
+                                             "LArMgr::LAr::EMEC::Top*",
+                                             "LArMgr::LAr::EMEC::Back*GTen",
+                                             "LArMgr::LAr::EMEC::Back*Hole",
+                                             "LArMgr::LAr::EMEC::Back*Bar",
+                                             "LArMgr::LAr::EMEC::Back*Ring",
+                                             "LArMgr::LAr::EMEC::Back*Ele",
+                                             "LArMgr::LAr::EMEC::Back*Abs",
+                                             "LArMgr::LAr::EMEC::BackInnerBarrette::Module::Phidiv",
+                                             "LArMgr::LAr::EMEC::Back*Barrette::Module",
+                                             "LArMgr::LAr::EMEC::Back*Barrettes",
+                                             "LArMgr::LAr::EMEC::BackSupport*",
+                                             "LArMgr::LAr::EMEC::Front*",
+                                             "LArMgr::LAr::EMEC::Mother*"])
+    kwargs.setdefault("HECWheelVolumes",    ["LArMgr::LAr::HEC::Mother",
+                                             "LArMgr::LAr::HEC::LiquidArgon",
+                                             "LArMgr::LAr::HEC::Clamp",
+                                             "LArMgr::LAr::HEC::Clamp::LiquidArgon",
+                                             "LArMgr::LAr::HEC::Module",
+                                             "LArMgr::LAr::HEC::FrontModule",
+                                             "LArMgr::LAr::HEC::RearModule",
+                                             "LArMgr::LAr::HEC::Module::Depth",
+                                             "LArMgr::LAr::HEC::Module::Depth::FirstAbsorber",
+                                             "LArMgr::LAr::HEC::Module::Depth::FirstAbsorber::TieRod"])
+    # Running PID calibration hits?
+    from G4AtlasApps.SimFlags import simFlags
+    kwargs.setdefault("ParticleID",simFlags.ParticleID())
+    kwargs.setdefault("doEscapedEnergy",simFlags.CalibrationRun.get_Value()!='DeadLAr')
+    # No effect currently
+    outputCollectionName = "LArCalibrationHitDeadMaterial"
+    from G4AtlasApps.SimFlags import simFlags
+    if simFlags.CalibrationRun.get_Value() in ['LAr', 'LAr+Tile']:
+        outputCollectionName = "LArCalibrationHitDeadMaterial_DEAD"
+    kwargs.setdefault("HitCollectionName", outputCollectionName)
+    return CfgMgr.LArG4__DeadSDTool(name, **kwargs)
+
+def LArEMBSensitiveDetectorCfg(ConfigFlags,name="LArEMBSensitiveDetector", **kwargs):
+
+    result = ComponentAccumulator()
+    bare_collection_name = "LArHitEMB"
+    mergeable_collection_suffix = "_G4"
+    merger_input_property = "LArEMBHits"
+    acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name,
+                                                              mergeable_collection_suffix,
+                                                              merger_input_property)
+    ## Main configuration
+    kwargs.setdefault("StacVolumes",["LArMgr::LAr::EMB::STAC"])
+    kwargs.setdefault("PresamplerVolumes",["LArMgr::LAr::Barrel::Presampler::Module"])
+    kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
+
+    # Hook for fast simulation
+    #from G4AtlasApps.SimFlags import simFlags
+    #kwargs.setdefault("UseFrozenShowers", simFlags.LArParameterization()>0)
+
+    #Note - frozen showers to be migrated later
+
+    result.merge(acc)
+    return result, LArG4__EMBSDTool(name, **kwargs)
+
+def LArEMECSensitiveDetectorCfg(ConfigFlags, name="LArEMECSensitiveDetector", **kwargs):
+    result = ComponentAccumulator()
+    bare_collection_name = "LArHitEMEC"
+    mergeable_collection_suffix = "_G4"
+    merger_input_property = "LArEMECHits"
+    acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name,
+                                                              mergeable_collection_suffix,
+                                                              merger_input_property)
+    
+    if ConfigFlags.GeoModel.AtlasVersion not in ["tb_LArH6_2002","tb_LArH6EC_2002"]:
+        kwargs.setdefault("NegIWVolumes",["LArMgr::LAr::EMEC::Neg::InnerWheel"])
+        kwargs.setdefault("NegOWVolumes",["LArMgr::LAr::EMEC::Neg::OuterWheel"])
+        kwargs.setdefault("BOBarretteVolumes",["LArMgr::LAr::EMEC::BackOuterBarrette::Module::Phidiv"])
+    if ConfigFlags.GeoModel.AtlasVersion !="tb_LArH6EC_2002":
+        kwargs.setdefault("PosIWVolumes",["LArMgr::LAr::EMEC::Pos::InnerWheel"])
+        kwargs.setdefault("PosOWVolumes",["LArMgr::LAr::EMEC::Pos::OuterWheel"])
+    kwargs.setdefault("PresVolumes", ["LArMgr::LAr::Endcap::Presampler::LiquidArgon"])
+    kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
+    
+    # Hook for fast simulation
+    #kwargs.setdefault("UseFrozenShowers", simFlags.LArParameterization()>0)
+
+    #Note - frozen showers to be migrated later
+
+    result.merge(acc)
+    return result, LArG4__EMECSDTool(name, **kwargs)
+
+def LArFCALSensitiveDetectorCfg(ConfigFlags, name="LArFCALSensitiveDetector", **kwargs):
+    result = ComponentAccumulator()
+    bare_collection_name = "LArHitFCAL"
+    mergeable_collection_suffix = "_G4"
+    merger_input_property = "LArFCALHits"
+    acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name,
+                                                              mergeable_collection_suffix,
+                                                              merger_input_property)
+    kwargs.setdefault("FCAL1Volumes",["LArMgr::LAr::FCAL::Module1::Gap"])
+    kwargs.setdefault("FCAL2Volumes",["LArMgr::LAr::FCAL::Module2::Gap"])
+    kwargs.setdefault("FCAL3Volumes",["LArMgr::LAr::FCAL::Module3::Gap"])
+    # No effect currently
+    kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
+    
+    # Hook for fast simulation
+    #from G4AtlasApps.SimFlags import simFlags
+    #kwargs.setdefault("UseFrozenShowers", simFlags.LArParameterization()>0)
+
+    #Note - frozen showers to be migrated later
+
+    result.merge(acc)
+    return result, LArG4__FCALSDTool(name, **kwargs)
+
+def getLArHECSensitiveDetector(name="LArHECSensitiveDetector", **kwargs):
+    bare_collection_name = "LArHitHEC"
+    mergeable_collection_suffix = "_G4"
+    merger_input_property = "LArHECHits"
+    hits_collection_name = generate_mergeable_collection_name(bare_collection_name,
+                                                              mergeable_collection_suffix,
+                                                              merger_input_property)
+    #kwargs.setdefault("SliceVolumes",["LAr::HEC::Module::Depth::Slice"])
+    #kwargs.setdefault("LocalVolumes",["LAr::HEC::Module::Depth::Slice::Local"])
+    kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
+    #  You might think this should go here, but we don't think so!  LAr::HEC::Module::Depth::Slice::Wheel"])
+    # No effect currently
+    kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
+    return CfgMgr.LArG4__HECSDTool(name, **kwargs)
+
+def getLArInactiveSensitiveDetector(name="LArInactiveSensitiveDetector", **kwargs):
+    ## Main configuration
+    from G4AtlasApps.SimFlags import simFlags
+    if simFlags.SimLayout.get_Value() not in ["tb_LArH6_2003","tb_LArH6_2002"]:
+        kwargs.setdefault("BarrelPreVolumes",["LArMgr::LAr::Barrel::Presampler::Cathode*",
+                                              "LArMgr::LAr::Barrel::Presampler::Anode*",
+                                              "LArMgr::LAr::Barrel::Presampler::Prep*"])
+        kwargs.setdefault("BarrelVolumes",["LArMgr::LAr::EMB::*::Straight",
+                                           "LArMgr::LAr::EMB::*::*Fold"])
+        kwargs.setdefault("ECPosInVolumes", ["LArMgr::LAr::EMEC::Pos::InnerWheel::Absorber",
+                                             "LArMgr::LAr::EMEC::Pos::InnerWheel::Electrode",
+                                             "LArMgr::LAr::EMEC::Pos::InnerWheel::Glue",
+                                             "LArMgr::LAr::EMEC::Pos::InnerWheel::Lead"])
+        kwargs.setdefault("ECPosOutVolumes",["LArMgr::LAr::EMEC::Pos::OuterWheel::Lead",
+                                             "LArMgr::LAr::EMEC::Pos::OuterWheel::Glue",
+                                             "LArMgr::LAr::EMEC::Pos::OuterWheel::Electrode",
+                                             "LArMgr::LAr::EMEC::Pos::OuterWheel::Absorber"])
+        kwargs.setdefault("ECNegInVolumes", ["LArMgr::LAr::EMEC::Neg::InnerWheel::Absorber",
+                                             "LArMgr::LAr::EMEC::Neg::InnerWheel::Electrode",
+                                             "LArMgr::LAr::EMEC::Neg::InnerWheel::Glue",
+                                             "LArMgr::LAr::EMEC::Neg::InnerWheel::Lead"])
+        kwargs.setdefault("ECNegOutVolumes",["LArMgr::LAr::EMEC::Neg::OuterWheel::Lead",
+                                             "LArMgr::LAr::EMEC::Neg::OuterWheel::Glue",
+                                             "LArMgr::LAr::EMEC::Neg::OuterWheel::Electrode",
+                                             "LArMgr::LAr::EMEC::Neg::OuterWheel::Absorber"])
+        #kwargs.setdefault("HECVolumes",["LAr::HEC::Inactive"])
+        #kwargs.setdefault("HECLocalVolumes",["LAr::HEC::Local::Inactive"])
+        kwargs.setdefault("HECWheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Absorber::TieRod",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::TieRodDead",
+                                             "LArMgr::LAr::HEC::Module::Depth::Absorber",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::TieRod",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::Electrode::Copper",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::Electrode"])
+        kwargs.setdefault("MiniMomVolumes",["LArMgr::MiniFCALMother"])
+        kwargs.setdefault("MiniVolumes",["LArMgr::MiniFCAL"])
+        kwargs.setdefault("MiniLayVolumes",["LArMgr::MiniFCAL::Layer"])
+    if simFlags.SimLayout.get_Value()=="tb_LArH6_2002":
+        kwargs.setdefault("ECPosInVolumes", ["LArMgr::LAr::EMEC::Pos::InnerWheel::Absorber",
+                                             "LArMgr::LAr::EMEC::Pos::InnerWheel::Electrode"])
+        kwargs.setdefault("ECPosOutVolumes",["LArMgr::LAr::EMEC::Pos::OuterWheel::Electrode",
+                                             "LArMgr::LAr::EMEC::Pos::OuterWheel::Absorber"])
+        kwargs.setdefault("HECWheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Absorber",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::Electrode",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::Electrode::Copper",
+                                             "LArMgr::LAr::HEC::Module::Depth::Slice::TieRod"])
+    if simFlags.SimLayout.get_Value()!="tb_LArH6_2002":
+        kwargs.setdefault("FCAL1Volumes",["LArMgr::LAr::FCAL::Module1::CableTrough",
+                                          "LArMgr::LAr::FCAL::Module1::Absorber"])
+        kwargs.setdefault("FCAL2Volumes",["LArMgr::LAr::FCAL::Module2::CableTrough",
+                                          "LArMgr::LAr::FCAL::Module2::Absorber",
+                                          "LArMgr::LAr::FCAL::Module2::Rod"])
+        kwargs.setdefault("FCAL3Volumes",["LArMgr::LAr::FCAL::Module3::CableTrough",
+                                          "LArMgr::LAr::FCAL::Module3::Absorber",
+                                          "LArMgr::LAr::FCAL::Module3::Rod"])
+    # Running PID calibration hits?
+    from G4AtlasApps.SimFlags import simFlags
+    kwargs.setdefault("ParticleID",simFlags.ParticleID())
+    # No effect currently
+    kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitInactive"])
+    return CfgMgr.LArG4__InactiveSDTool(name, **kwargs)
+
+def getLArMiniFCALSensitiveDetector(name="LArMiniFCALSensitiveDetector", **kwargs):
+    kwargs.setdefault("MiniVolumes",["LArMgr::MiniFCAL::Wafer"])
+    # No effect currently
+    kwargs.setdefault("OutputCollectionNames", ["LArHitMiniFCAL"])
+    return CfgMgr.LArG4__MiniFCALSDTool(name, **kwargs)
+
+def getCalibrationDefaultCalculator(name="CalibrationDefaultCalculator", **kwargs):
+    return CfgMgr.LArG4__CalibrationDefaultCalculator(name, **kwargs)
+
+def getDeadMaterialCalibrationHitMerger(name="DeadMaterialCalibrationHitMerger", **kwargs):
+    kwargs.setdefault("InputHits",["LArCalibrationHitDeadMaterial_DEAD","LArCalibrationHitActive_DEAD","LArCalibrationHitInactive_DEAD"])
+    kwargs.setdefault("OutputHits","LArCalibrationHitDeadMaterial")
+    return CfgMgr.LArG4__CalibrationHitMerger(name, **kwargs)
+
diff --git a/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py b/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py
new file mode 100755
index 00000000000..389a87e8601
--- /dev/null
+++ b/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+"""Run tests on LArG4SD configuration
+
+Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+if __name__ == '__main__':
+  
+
+  # Set up logging and config behaviour
+  from AthenaCommon.Logging import log
+  from AthenaCommon.Constants import DEBUG
+  from AthenaCommon.Configurable import Configurable
+  log.setLevel(DEBUG)
+  Configurable.configurableRun3Behavior = 1
+
+
+  #import config flags
+  from AthenaConfiguration.AllConfigFlags import ConfigFlags
+  ConfigFlags.Sim.ISF.Run = True
+
+  #Provide input
+  from AthenaConfiguration.TestDefaults import defaultTestFiles
+  inputDir = defaultTestFiles.d
+  ConfigFlags.Input.Files = defaultTestFiles.EVNT
+  
+  # Finalize 
+  ConfigFlags.lock()
+
+
+  ## Initialize a new component accumulator
+  cfg = ComponentAccumulator()
+
+
+
+  from LArG4SD.LArG4SDToolConfig import LArEMBSensitiveDetectorCfg
+  from LArG4SD.LArG4SDToolConfig import LArEMECSensitiveDetectorCfg
+  from LArG4SD.LArG4SDToolConfig import LArFCALSensitiveDetectorCfg
+
+  #TODO CHECK IF THESE ARE ALL PUBLIC TOOLS!
+  acc1, tool1 = LArEMBSensitiveDetectorCfg(ConfigFlags)
+  acc1.addPublicTool(tool1)
+  cfg.merge(acc1)
+  
+
+  acc2, tool2 = LArEMECSensitiveDetectorCfg(ConfigFlags)
+  acc2.addPublicTool(tool2)
+  cfg.merge(acc2)
+
+  acc3, tool3 = LArFCALSensitiveDetectorCfg(ConfigFlags)
+  acc3.addPublicTool(tool3)
+  cfg.merge(acc3)
+  
+
+  cfg.printConfig(withDetails=True, summariseProps = True)
+  ConfigFlags.dump()
+
+  f=open("test.pkl","w")
+  cfg.store(f) 
+  f.close()
+
+
+
+  print cfg._publicTools
+  print "-----------------finished----------------------"
\ No newline at end of file
-- 
GitLab


From 60436a1d03dc444020c70949b960cd9ecdd00398 Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Mon, 4 Mar 2019 13:27:24 +0000
Subject: [PATCH 191/404] Revert "Merge branch 'master-EventInfoMigration' into
 'master'"

This reverts merge request !21559
---
 .../src/EventInfoNonConstCnvAlg.cxx           | 83 -------------------
 .../src/EventInfoNonConstCnvAlg.h             | 50 -----------
 .../components/xAODEventInfoCnv_entries.cxx   |  2 -
 .../share/RecExCommon_topOptions.py           |  7 --
 4 files changed, 142 deletions(-)
 delete mode 100644 Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
 delete mode 100644 Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h

diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
deleted file mode 100644
index ce9195bc325..00000000000
--- a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.cxx
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-//
-
-// Local include(s).
-#include "EventInfoNonConstCnvAlg.h"
-
-// EDM include(s).
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEventInfo/EventAuxInfo.h"
-
-#include "GaudiKernel/ConcurrencyFlags.h"
-
-// System include(s).
-#include <memory>
-
-namespace xAODMaker {
-
-   EventInfoNonConstCnvAlg::EventInfoNonConstCnvAlg( const std::string& name,
-                                                     ISvcLocator* svcLoc )
-      : AthAlgorithm( name, svcLoc ) {
-
-      // Declare the algorithm's properties.
-      declareProperty( "EventInfoKey", m_key = "EventInfo",
-                       "Event store key for the xAOD::EventInfo object to "
-                       "modify" );
-   }
-
-  StatusCode EventInfoNonConstCnvAlg::initialize()
-  {
-    if(Gaudi::Concurrency::ConcurrencyFlags::numThreads()>0) {
-      ATH_MSG_FATAL("EventInfoNonConstCnvAlg can be used ONLY in serial Athena!");
-      return StatusCode::FAILURE;
-    }
-    return StatusCode::SUCCESS;
-  }
-
-   StatusCode EventInfoNonConstCnvAlg::execute() {
-
-      // Check if xAOD::EventInfo is available.
-      if( ! evtStore()->contains< xAOD::EventInfo >( m_key ) ) {
-         // If not, then let's just stop right away.
-         ATH_MSG_VERBOSE( "No xAOD::EventInfo with key \"" << m_key << "\"" );
-         return StatusCode::SUCCESS;
-      }
-
-      // Retrieve the const object.
-      const xAOD::EventInfo* ei = nullptr;
-      ATH_CHECK( evtStore()->retrieve( ei, m_key ) );
-
-      // Check if it's already set up to be modifiable.
-      if( ei->getStore() ) {
-         // If so, let's assume that SG will also let the object be retrieved
-         // as a non-const pointer.
-         ATH_MSG_VERBOSE( "xAOD::EventInfo with key \"" << m_key
-                          << "\" seems to be modifiable -> not touching it" );
-         return StatusCode::SUCCESS;
-      }
-
-      // Access the aux container as well now.
-      const xAOD::EventAuxInfo* aux = nullptr;
-      ATH_CHECK( evtStore()->retrieve( aux, m_key + "Aux." ) );
-
-      // Make a deep copy of the object.
-      auto newei = std::make_unique< xAOD::EventInfo >();
-      auto newaux = std::make_unique< xAOD::EventAuxInfo >();
-      newei->setStore( newaux.get() );
-      *newei = *ei;
-      ATH_MSG_VERBOSE( "Made a deep copy of \"" << m_key << "\"" );
-
-      // Overwrite the original object with its deep copy.
-      static const bool ALLOW_MODS = true;
-      ATH_CHECK( evtStore()->overwrite( std::move( newei ), m_key,
-                                        ALLOW_MODS ) );
-      ATH_CHECK( evtStore()->overwrite( std::move( newaux ), m_key + "Aux.",
-                                        ALLOW_MODS ) );
-      ATH_MSG_VERBOSE( "Overwrote \"" << m_key << "\" with its deep copy" );
-
-      // Return gracefully.
-      return StatusCode::SUCCESS;
-   }
-
-} // namespace xAODMaker
diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h b/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h
deleted file mode 100644
index 5f12b14746e..00000000000
--- a/Event/xAOD/xAODEventInfoCnv/src/EventInfoNonConstCnvAlg.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-//
-// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-//
-#ifndef XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
-#define XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
-
-// System include(s).
-#include <string>
-
-// Gaudi/Athena include(s).
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-namespace xAODMaker {
-
-   /// Algorithm making a const @c xAOD::EventInfo object non-const
-   ///
-   /// In jobs that process an input file which already has an
-   /// @c xAOD::EventInfo object in it, which itself has information that we
-   /// need to keep, but the job wants to further modify that object, we need
-   /// to make sure that algorithms are able to do those modifications.
-   ///
-   /// This algorithm can be used to make the @c xAOD::EventInfo object in
-   /// StoreGate modifiable.
-   ///
-   /// Note that this implementation is *only* meant for 21.X. For release
-   /// 22.X we will take care of this a bit differently.
-   ///
-   /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-   ///
-   class EventInfoNonConstCnvAlg final : public AthAlgorithm {
-
-   public:
-      /// Algorithm constructor
-      EventInfoNonConstCnvAlg( const std::string& name, ISvcLocator* svcLoc );
-
-      virtual StatusCode initialize() override;
-
-      /// Function executing the algorithm
-      virtual StatusCode execute() override;
-
-   private:
-      /// Key for the xAOD::EventInfo object
-      std::string m_key;
-
-   }; // class EventInfoNonConstCnvAlg
-
-} // namespace xAODMaker
-
-#endif // XAODEVENTINFOCNV_EVENTINFONONCONSTCNVALG_H
diff --git a/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx b/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
index 2386ce9c9bb..81ca4015122 100644
--- a/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
+++ b/Event/xAOD/xAODEventInfoCnv/src/components/xAODEventInfoCnv_entries.cxx
@@ -1,7 +1,6 @@
 #include "../EventInfoCnvTool.h"
 #include "../EventInfoSelectorTool.h"
 #include "../EventInfoCnvAlg.h"
-#include "../EventInfoNonConstCnvAlg.h"
 #include "../EventInfoReaderAlg.h"
 #include "../EventDuplicateFinderAlg.h"
 
@@ -10,7 +9,6 @@
 DECLARE_COMPONENT( xAODMaker::EventInfoCnvTool )
 DECLARE_COMPONENT( xAODMaker::EventInfoSelectorTool )
 DECLARE_COMPONENT( xAODMaker::EventInfoCnvAlg )
-DECLARE_COMPONENT( xAODMaker::EventInfoNonConstCnvAlg )
 DECLARE_COMPONENT( xAODReader::EventInfoReaderAlg )
 DECLARE_COMPONENT( xAODReader::EventDuplicateFinderAlg )
 
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index e706ef8a209..0bd34f4164f 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -463,18 +463,11 @@ topSequence+=EventCounter(Frequency=100)
 from AthenaCommon.AlgSequence import AthSequencer
 condSeq = AthSequencer("AthCondSeq")
 
-from AthenaCommon.ConcurrencyFlags import jobproperties as jpCF
-nThreads = jpCF.ConcurrencyFlags.NumThreads()
-
 if( ( not objKeyStore.isInInput( "xAOD::EventInfo") ) and \
         ( not hasattr( topSequence, "xAODMaker::EventInfoCnvAlg" ) ) ):
     from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
     condSeq+=xAODMaker__EventInfoCnvAlg()
     pass
-else:
-    if( (nThreads == 0) and (not hasattr( topSequence, "xAODMaker::EventInfoNonConstCnvAlg" ) ) ):
-        topSequence += CfgMgr.xAODMaker__EventInfoNonConstCnvAlg()
-        pass
 
 # bytestream reading need to shedule some algorithm
 
-- 
GitLab


From 38434d3cae91096053f5d72f38f3c830fe9c9164 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 14:48:16 +0100
Subject: [PATCH 192/404] Add ATLAS_CHECK_THREAD_SAFETY package

---
 .../SiSpacePointTool/SiSpacePointTool/ATLAS_CHECK_THREAD_SAFETY  | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..5198e477a6f
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiSpacePointTool/SiSpacePointTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/SiSpacePointTool
-- 
GitLab


From 3fc12aa7aa047b9b923cac9d0e9610aceb0b321f Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Fri, 1 Mar 2019 15:23:52 +0000
Subject: [PATCH 193/404] Make tools for PixelDigitization private

---
 .../PixelDigitization/src/PixelDigitization.cxx           | 4 +---
 .../PixelDigitization/src/PixelDigitization.h             | 4 ++--
 .../PixelDigitization/src/PixelDigitizationTool.cxx       | 6 ------
 .../PixelDigitization/src/PixelDigitizationTool.h         | 8 ++++----
 4 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx
index 6b5555b33f1..9c9b73078ee 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx
@@ -16,10 +16,8 @@
 // Constructor with parameters:
 PixelDigitization::PixelDigitization(const std::string &name,
                                      ISvcLocator *pSvcLocator) :
-  AthAlgorithm(name,pSvcLocator),
-  m_pixelDigitizationTool("PixelDigitizationTool")
+  AthAlgorithm(name,pSvcLocator)
 {
-  declareProperty("DigitizationTool",        m_pixelDigitizationTool, "PixelDigitizationTool Name");
 }
 
 PixelDigitization::~PixelDigitization() { }
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h
index 9d557b7db9e..403a54e6f4c 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h
@@ -67,7 +67,7 @@
 #include "GaudiKernel/ToolHandle.h"
 
 #include "PileUpTools/PileUpToolBase.h"
-
+class PixelDigitizationTool;
 class PixelDigitization : public AthAlgorithm {
 
 public:
@@ -88,7 +88,7 @@ public:
   virtual StatusCode finalize();
 
 private:
-  ToolHandle<IPileUpTool> m_pixelDigitizationTool;
+  ToolHandle<PixelDigitizationTool> m_pixelDigitizationTool{this, "DigitizationTool", "PixelDigitizationTool", "PixelDigitizationTool name"};
 };
 	
 #endif // PIXELDIGITIZATION_PIXELDIGITIZATION_H
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx
index 19ccde86887..c229cdb5086 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.cxx
@@ -34,9 +34,6 @@ PixelDigitizationTool::PixelDigitizationTool(const std::string &type,
   m_HardScatterSplittingMode(0),
   m_HardScatterSplittingSkipper(false),
   m_onlyHitElements(false),
-  m_chargeTool(nullptr),
-  m_fesimTool(nullptr),
-  m_energyDepositionTool(nullptr),
   m_detID(nullptr),
   m_vetoThisBarcode(crazyParticleBarcode),
   m_timedHits(nullptr),
@@ -45,9 +42,6 @@ PixelDigitizationTool::PixelDigitizationTool(const std::string &type,
   m_inputObjectName(""),
   m_createNoiseSDO(false)
 {
-  declareProperty("ChargeTools",      m_chargeTool,      "List of charge tools");
-  declareProperty("FrontEndSimTools", m_fesimTool,       "List of Front-End simulation tools");
-  declareProperty("EnergyDepositionTool",   m_energyDepositionTool,       "Energy deposition tool");
   declareProperty("MergeSvc",         m_mergeSvc,        "Merge service used in Pixel digitization");
   declareProperty("InputObjectName",  m_inputObjectName, "Input Object name" );
   declareProperty("CreateNoiseSDO",   m_createNoiseSDO,  "Set create noise SDO flag");
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.h b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.h
index 894b5fdaaba..6ba4f2d88a9 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.h
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitizationTool.h
@@ -67,16 +67,16 @@ class PixelDigitizationTool : public PileUpToolBase {
 
     bool              m_onlyHitElements;
 
-    ToolHandleArray<SensorSimTool>                 m_chargeTool;
-    ToolHandleArray<FrontEndSimTool>               m_fesimTool;
-    ToolHandle<EnergyDepositionTool>               m_energyDepositionTool;
-
     const PixelID            *m_detID;
 
     IntegerProperty           m_vetoThisBarcode;
 
     TimedHitCollection<SiHit> *m_timedHits;
 
+    ToolHandleArray<SensorSimTool> m_chargeTool{this, "ChargeTools", {}, "List of charge tools"};
+    ToolHandleArray<FrontEndSimTool> m_fesimTool{this, "FrontEndSimTools", {}, "List of Front-End simulation tools"};
+    ToolHandle<EnergyDepositionTool> m_energyDepositionTool{this, "EnergyDepositionTool", "EnergyDepositionTool", "Energy deposition tool"};
+
   protected:
 
     ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};  //!< Random number service
-- 
GitLab


From 9ffb70c3419e943e5ca1ed9dd6d1739577f887c8 Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rt500@cam.ac.uk>
Date: Fri, 1 Mar 2019 17:52:29 +0000
Subject: [PATCH 194/404] Update copyright tags to 2019

---
 .../PixelDigitization/src/PixelDigitization.cxx                 | 2 +-
 .../InDetDigitization/PixelDigitization/src/PixelDigitization.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx
index 9c9b73078ee..c5eb6e59f10 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.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
 */
 
 ////////////////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h
index 403a54e6f4c..33c98536842 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.h
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/PixelDigitization.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
 */
 
 ///////////////////////////////////////////////////////////////////
-- 
GitLab


From 644ab77657f2392ae7521f30fd357c548ded7450 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 2 Mar 2019 16:11:00 +0100
Subject: [PATCH 195/404] Cleanup IDC_OverlayBase package

---
 .../IDC_OverlayBase/CMakeLists.txt            |   5 +-
 .../IDC_OverlayBase/IDC_OverlayBase.h         |  72 +-----
 .../IDC_OverlayBase/IDC_OverlayBase.icc       | 235 +++++++-----------
 .../IDC_OverlayBase/IDC_OverlayCommon.h       |  42 ++--
 .../IDC_OverlayBase/IDC_OverlayCommon.icc     | 213 +++++-----------
 5 files changed, 175 insertions(+), 392 deletions(-)

diff --git a/Event/EventOverlay/IDC_OverlayBase/CMakeLists.txt b/Event/EventOverlay/IDC_OverlayBase/CMakeLists.txt
index 99c2cc620c6..f17f9b0b758 100644
--- a/Event/EventOverlay/IDC_OverlayBase/CMakeLists.txt
+++ b/Event/EventOverlay/IDC_OverlayBase/CMakeLists.txt
@@ -7,13 +7,10 @@ atlas_subdir( IDC_OverlayBase )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/AthContainers
                           DetectorDescription/Identifier
                           Event/EventOverlay/OverlayAlgBase )
 
 # Component(s) in the package:
 atlas_add_library( IDC_OverlayBase
                    PUBLIC_HEADERS IDC_OverlayBase
-                   LINK_LIBRARIES AthenaBaseComps AthContainers Identifier OverlayAlgBase )
-
+                   LINK_LIBRARIES Identifier OverlayAlgBase )
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
index ad713366ef1..ec933f9e595 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.h
@@ -10,79 +10,29 @@
  * Common base class and generic overlaying code for boolean-like hits.
  * Factored out from InDetOverlay.
  *
+ * @author Tadej Novak
  * @author Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
- *
  */
 
 #ifndef IDC_OVERLAYBASE_H
 #define IDC_OVERLAYBASE_H
 
-#include <string>
-
-#include "OverlayAlgBase/OverlayAlgBase.h"
-#include "IDC_OverlayBase/IDC_OverlayCommon.h"
-#include "IDC_OverlayBase/IDC_OverlayHelpers.h"
-
-class IDC_OverlayBase;
-
-namespace Overlay {
-
-  /**
-   *  Merging of hits on the same channel.  Modifies the first argument by adding data from the second..
-   *  Implementations can assume that the arguments have the same Id.  (That is, correspond to the same readout channel.)
-   *  
-   *  A generic implementation of this template is provided in this package, 
-   *  but subdetectors can provide specializations suitable for their RDO type.
-   *  A simple example of providing a specialization is in InDetOverlay.cxx (for TRT_RDORawData).
-   *  A more elaborate implementation can be found e.g. in MdtOverlay.cxx
-   *  
-   *  Note that a declaration of a specialized template must occur before it is used
-   *  by overlayContainer()/mergeCollections() [typically from the execute() method of your algorithm].
-   */
-  template<class Datum> void mergeChannelData(Datum& r1, const Datum& r2, IDC_OverlayBase* parent);
-
-  /**
-   *  Adds data and mc from the second collection to the output one merging where necessary.
-   *  After this data and mc collections stay unchanged and output collection contains all information
-   * 
-   *  A generic implementation in the .icc file can be overriden by a
-   *  specialization, see above.
-   */
+#include <OverlayAlgBase/OverlayAlgBase.h>
 
-  template<class Collection> void mergeCollectionsNew(Collection *mc_coll, Collection *data_coll, Collection *out_coll, IDC_OverlayBase* parent);
-}
-
-
-class IDC_OverlayBase : public OverlayAlgBase  {
+class IDC_OverlayBase : public OverlayAlgBase
+{
 public:
-  
   IDC_OverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
-    : OverlayAlgBase(name, pSvcLocator)
-  {}
-
-  /**
-   *  Transfers all collections from the first and second arguments to the output the first merging where necessary.
-   */
-  template<class IDC_Container> void overlayContainer(const IDC_Container* data, const IDC_Container* mc, IDC_Container* out ) {
-    Overlay::overlayContainer(data, mc, out, this);
-  }
-
-  template<class IDC_Container> void overlayContainerNew(const IDC_Container* data, const IDC_Container* mc, IDC_Container* out ) {
-    Overlay::overlayContainerNew(data, mc, out, this);
-  }
-
-  template<class IDC_Container> std::string shortPrint(const IDC_Container *container, unsigned numprint = 25) {
-    return Overlay::debugPrint(container, numprint);
-  }
+    : OverlayAlgBase(name, pSvcLocator) {}
 
-  /**
-   *  Adds data and mc from the second collection to the output one merging where necessary.
-   *  After this data and mc collections stay unchanged and output collection contains all information
-   */
-  template<class Collection> void mergeCollections(Collection *mc_coll, Collection *data_coll, Collection *out_coll);
+protected:
+  template <class IDC_Container>
+  StatusCode overlayContainer(const IDC_Container *bkgContainer,
+                              const IDC_Container *signalContainer,
+                              IDC_Container *outputContainer);
 
 };
 
 #include "IDC_OverlayBase/IDC_OverlayBase.icc"
 
-#endif/*IDC_OVERLAYBASE_H*/
+#endif
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.icc b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.icc
index 711db40f69f..dc932208f95 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.icc
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayBase.icc
@@ -1,172 +1,107 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-// Generic overlaying code for boolean-like hits.
-// Factored out from InDetOverlay.
-//
-// Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
+/// @author Tadej Novak
+/// @author Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
 
-#include "Identifier/Identifier.h"
-#include "Identifier/IdentifierHash.h"
+#include <Identifier/Identifier.h>
+#include <Identifier/IdentifierHash.h>
 
-#include "AthenaBaseComps/AthMsgStreamMacros.h"
+#include "IDC_OverlayCommon.h"
 
-#include "AthContainers/DataVector.h"
-
-#include <sstream>
-#include <typeinfo>
 
+template <class IDC_Container>
+StatusCode IDC_OverlayBase::overlayContainer(const IDC_Container *bkgContainer,
+                                             const IDC_Container *signalContainer,
+                                             IDC_Container *outputContainer)
+{
+  ATH_MSG_DEBUG("overlayContainer<>() begin");
 
-namespace Overlay {
-  
-  //================================================================
-  template<class Datum>
-  void mergeChannelData(Datum& /*r1*/, const Datum& /*r2*/, IDC_OverlayBase* parent) {
-    // this is the default implementation. 
-    // We do not touch the data here, just print a warning.
-    static bool first_time = true;
-    if(first_time) {
-      first_time = false;
-      parent->msg(MSG::WARNING)<<"Overlay::mergeChannelData(): Merging of hits on the same channel is not implemented for "
-			       <<typeid(Datum).name()
-			       <<endmsg;
-    }
-  }
+  typedef typename IDC_Container::base_value_type Collection;
 
+  // Get all the hashes for the signal container
+  const std::vector<IdentifierHash> signalHashes = signalContainer->GetAllCurrentHashes();
 
-  //================================================================
-  template<class Collection>
-  void mergeCollectionsNew(Collection *mc_coll, Collection *data_coll, Collection *out_coll, IDC_OverlayBase *parent) {
-    
-    if(mc_coll->identify() != data_coll->identify()) {
-      std::ostringstream os;
-      os<<"mergeCollectionsNew<generic>(): collection Id mismatch";
-      parent->msg(MSG::FATAL)<<os.str()<<endmsg;
-      throw std::runtime_error(os.str());
-    }
+  // There are some use cases where background is empty
+  if (!bkgContainer) {
+    // Only loop through the signal collections and copy them over
+    for (const IdentifierHash &hashId : signalHashes) {
+      // Copy the signal collection
+      std::unique_ptr<Collection> signalCollection = Overlay::copyCollection(hashId, signalContainer->indexFindPtr(hashId));
 
-    const Identifier idColl = mc_coll->identify();
-
-    // ----------------------------------------------------------------
-    // debug
-    static bool first_time = true;
-    if(first_time) {
-      first_time = false;
-      parent->msg(MSG::INFO)<<"IDC_OverlayBase::mergeCollectionsNew(): "
-			    <<"generic code is called for "
-			    <<typeid(*mc_coll).name() 
-			    <<endmsg;
-    }
-  
-    // ----------------------------------------------------------------
-
-    //DataVector<typename Collection::base_value_type> data(data_coll->identifyHash());
-    Collection data(data_coll->identifyHash());
-    data.setIdentifier(idColl);
-    data_coll->swap(data);
-
-    //DataVector<typename Collection::base_value_type> mc(mc_coll->identifyHash());
-    Collection mc(mc_coll->identifyHash());
-    mc.setIdentifier(idColl);
-    mc_coll->swap(mc);
-
-    //################################################################
-    // Merge by copying ptrs from data and mc to mc_coll
-
-    typename Collection::size_type idata = 0;
-    typename Collection::size_type imc = 0;
-   
-    while( (idata < data.size()) || (imc < mc.size())) {
-
-      // The RDO that goes to the output at the end of this step.
-      typename Collection::base_value_type *p_rdo(0);
-    
-      if(imc == mc.size()) {
-	// just copy the remaining data inputs
-	data.swapElement(idata++, 0, p_rdo);
-      }
-      else if(idata == data.size()) {
-	//just copy the remaining MC digits
-	mc.swapElement(imc++, 0, p_rdo);
-      }
-      else {
-	// Need to decide which one goes first.  
-	// See comments in TRTDigitization.cxx about the assumption that id1<id2 <=> hash1<hash2
-	if( mc[imc]->identify() < data[idata]->identify() ) {
-	  mc.swapElement(imc++, 0, p_rdo);
-	}
-	else if(data[idata]->identify() < mc[imc]->identify()) {
-	  data.swapElement(idata++, 0, p_rdo);
-	}
-	else {
-	  // The hits are on the same channel.
-	  typename Collection::base_value_type *p2(0);
-	  data.swapElement(idata++, 0, p2);
-	  mc.swapElement(imc++, 0, p_rdo);
-	  Overlay::mergeChannelData(*p_rdo, *p2, parent);
-	  delete p2;
-	}
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
       }
+    }
 
-      out_coll->push_back(p_rdo);
-    } // <= while
+    return StatusCode::SUCCESS;
   }
 
-} // namespace Overlay
-
-
-//================================================================
-template<class Collection>
-void IDC_OverlayBase::mergeCollections(Collection *mc_coll, 
-				       Collection *data_coll,
-				       Collection *out_coll)
-{
-  DataVector<typename Collection::base_value_type> data;
-  data_coll->swap(data);
-
-  DataVector<typename Collection::base_value_type> mc;
-  mc_coll->swap(mc);
+  // Get all the hashes for the background container
+  const std::vector<IdentifierHash> bkgHashes = bkgContainer->GetAllCurrentHashes();
   
-  //################################################################
-  // Merge by copying ptrs from data and mc to mc_coll
-
-  typename Collection::size_type idata = 0;
-  typename Collection::size_type imc = 0;
-   
-  while( (idata < data.size()) || (imc < mc.size())) {
-
-    // The RDO that goes to the output at the end of this step.
-    typename Collection::base_value_type *p_rdo(0);
-    
-    if(idata == data.size()) {
-      // just copy the remaining MC inputs
-      mc.swapElement(imc++, 0, p_rdo);
-    }
-    else if(imc == mc.size()) {
-      //just copy the remaining data digits
-      data.swapElement(idata++, 0, p_rdo);
-    }
-    else {
-      // Need to decide which one goes first.  
-      // See comments in TRTDigitization.cxx about the assumption that id1<id2 <=> hash1<hash2
-      if( data[idata]->identify() < mc[imc]->identify() ) {
-	data.swapElement(idata++, 0, p_rdo);
+  // 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);
+  }
+
+  // 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<Collection> bkgCollection = Overlay::copyCollection(hashId, 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 if(mc[imc]->identify() < data[idata]->identify()) {
-	mc.swapElement(imc++, 0, p_rdo);
+    } else {
+      // Flip the overlap flag
+      search->second = true;
+    }
+  }
+
+  // Finally loop through the map and process the signal and overlay if
+  // necessary
+  for (const auto &[hashId, overlap] : overlapMap) {
+    // Copy the signal collection
+    std::unique_ptr<Collection> signalCollection = Overlay::copyCollection(hashId, signalContainer->indexFindPtr(hashId));
+
+    if (overlap) { // Do overlay
+      // Create the output collection, only works for Inner Detector
+      auto outputCollection = std::make_unique<Collection>(hashId);
+      outputCollection->setIdentifier(signalCollection->identify());
+      // Copy the background collection
+      std::unique_ptr<Collection> bkgCollection = Overlay::copyCollection(hashId, bkgContainer->indexFindPtr(hashId));
+
+      // Merge collections
+      Overlay::mergeCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get(), this);
+
+      if (outputContainer->addCollection(outputCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding overlaid Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        outputCollection.release();
       }
-      else {
-	// The hits are on the same channel.
-	typename Collection::base_value_type *p2(0);
-	data.swapElement(idata++, 0, p2);
-	mc.swapElement(imc++, 0, p_rdo);
-	Overlay::mergeChannelData(*p_rdo, *p2, this);
-	delete p2;
+    } else { // Only write signal out
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
       }
     }
+  }
 
-    out_coll->push_back(p_rdo);
-  } // <= while
+  return StatusCode::SUCCESS;
 }
-
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
index fe26915711d..f2913969b88 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.h
@@ -2,46 +2,46 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-// Dear emacs, this is -*-c++-*- 
+// Dear emacs, this is -*-c++-*-
 
 /**
  * @file
- * 
+ *
  * Overlaying of Identifiable Containers.  Functions common to the
  * single-hit-per-readout-channel-in-an-event case and the
  * possible-multiple-hits-on-a-channel case are declared in this file.
  *
+ * @author Tadej Novak
  * @author Andrei Gaponenko <agaponenko@lbl.gov>, 2009
- *
  */
 
 #ifndef IDC_OVERLAYCOMMON_H
 #define IDC_OVERLAYCOMMON_H
 
-#include <string>
-
-#include "OverlayAlgBase/OverlayAlgBase.h"
-
-class IDC_OverlayBase;
+#include <memory>
 
-namespace Overlay {
+#include <Identifier/IdentifierHash.h>
 
-  template<class Collection> void copyCollection(const Collection *input_coll, Collection *copy_coll);
+namespace Overlay
+{
 
-  //Forward decl for compiling ...
-  template<class Collection> void mergeCollectionsNew(Collection*, Collection*, Collection*, IDC_OverlayBase*);
+template <class Collection>
+std::unique_ptr<Collection> copyCollection(const IdentifierHash &hashId,
+                                           const Collection *collection);
 
-  /**
-   *  Transfers all collection from the second argument the first merging where necessary.
-   *  After this call the "data" container contains all information, and the "mc" 
-   *  container is empty.
-   */
-  template<class IDC_Container, class OvlAlg> void overlayContainer(const IDC_Container* data, const IDC_Container* mc,  IDC_Container* out, OvlAlg *parent);
+template<class Datum, class Alg>
+void mergeChannelData(Datum &baseDatum,
+                      const Datum &additionalDatum,
+                      Alg *algorithm);
 
-  template<class IDC_Container, class OvlAlg> void overlayContainerNew(const IDC_Container* dataContainer, const IDC_Container* mcContainer, IDC_Container* outputContainer, OvlAlg *parent);
+template <class Collection, class Alg>
+void mergeCollections(Collection *bkgCollection,
+                      Collection *signalCollection,
+                      Collection *outputCollection,
+                      Alg *algorithm);
 
-}
+} // namespace Overlay
 
 #include "IDC_OverlayBase/IDC_OverlayCommon.icc"
 
-#endif/*IDC_OVERLAYCOMMON_H*/
+#endif
diff --git a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
index c5741622d52..5aaf601297f 100644
--- a/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
+++ b/Event/EventOverlay/IDC_OverlayBase/IDC_OverlayBase/IDC_OverlayCommon.icc
@@ -2,172 +2,73 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-// Generic overlaying code for Identifiable Containers.
-//
-// Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
+/// Generic overlaying code for Identifiable Containers.
 
-#include "Identifier/Identifier.h"
-#include "Identifier/IdentifierHash.h"
+/// @author Tadej Novak
+/// @author Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
 
-#include "StoreGate/ReadHandle.h"
-#include "StoreGate/WriteHandle.h"
- 
+#include <string>
+#include <typeinfo>
 
-#include "AthenaBaseComps/AthMsgStreamMacros.h"
 
-#include "AthContainers/DataVector.h"
+namespace Overlay
+{
 
-#include <sstream>
+template <class Datum, class Alg>
+void mergeChannelData(Datum &/* baseDatum */,
+                      const Datum &/* additionalDatum */,
+                      Alg */* algorithm */)
+{
+  throw std::logic_error("Merging of data on the same channel is not implemented for "
+                 + std::string(typeid(Datum).name()));
+}
 
-namespace Overlay {
 
-  //================================================================
-  template<class IDC_Container, class OvlAlg>
-  void overlayContainerNew(const IDC_Container *dataContainer,
-			const IDC_Container *mcContainer,
-                        IDC_Container *outputContainer,       
-			OvlAlg *parent)
-  {
-   typedef typename IDC_Container::base_value_type Collection;
-   std::cout<<"start overlayContainer"<<std::endl;
-   if(parent->msgLvl(MSG::DEBUG)) { parent->msg(MSG::DEBUG)<<"overlayContainerNew<>() begin"<<endmsg; }
-
-   //There are some use cases where this is empty
-   if(dataContainer != nullptr){
-   /** Add data from the data container to the output one */
-      typename IDC_Container::const_iterator p_data = dataContainer->begin();
-      typename IDC_Container::const_iterator p_data_end = dataContainer->end();
-
-      for(; p_data != p_data_end; ++p_data) {
-         IdentifierHash hashId = p_data.hashId();
-         auto coll_data = std::make_unique<Collection>(hashId); 
-         copyCollection(*p_data,coll_data.get());
-   
-         if ( outputContainer->addCollection(coll_data.release(), p_data.hashId()).isFailure() ) {
-            parent->msg(MSG::WARNING) <<"add data Collection failed for output "<< p_data.hashId   ()<<endmsg; //" collectionNo "<<collectionNo<<endmsg; 
-         } 
-      }
-   }
-
-   /** Add data from the ovl container to the output one */
-   typename IDC_Container::const_iterator p_ovl = mcContainer->begin(); 
-   typename IDC_Container::const_iterator p_ovl_end = mcContainer->end();
-
-   for(; p_ovl != p_ovl_end; ++p_ovl) {
- 
-      IdentifierHash coll_id = p_ovl.hashId();//(*p_ovl)->identify();
-      auto coll_ovl = std::make_unique<Collection>(coll_id);	
-      copyCollection(*p_ovl,coll_ovl.get());
-
-      /** The newly created stuff will go to the output EventStore SG */
-      auto coll_out = std::make_unique<Collection>(coll_id);
-      coll_out->setIdentifier((*p_ovl)->identify());
-
-      /** Look for the same ID in the main StoreGate EventStore */ 
-      typename IDC_Container::const_iterator q = outputContainer->indexFind( coll_id );
-      if( q != outputContainer->end() ) {
-      /**Need to merge the collections
-         Retrieve q */
-         std::unique_ptr <Collection> coll_data ((Collection *) *q);
-         mergeCollectionsNew(coll_data.get(),coll_ovl.get(),coll_out.get(),parent);
-
-         outputContainer->removeCollection(p_ovl.hashId());
-         if (outputContainer->addCollection(coll_out.release(), p_ovl.hashId()).isFailure() ) {
-      	    parent->msg(MSG::WARNING) << "overlay addCollection failed " << endmsg; 
-         }
-      }
-    else {
-       /** Copy the complete collection from ovl to output, 
-           hopefully preserving the "most derived" type of its raw data */ 
-       if ( outputContainer->addCollection(coll_ovl.release(), coll_id).isFailure() ) {
-       	  parent->msg(MSG::WARNING) << "add mc Collection failed " << endmsg; 
-      }
-    }   
-   }
+template <class Collection, class Alg>
+void mergeCollections(Collection *bkgCollection,
+                      Collection *signalCollection,
+                      Collection *outputCollection,
+                      Alg *algorithm)
+{
+  if (bkgCollection->identify() != signalCollection->identify()) {
+    throw std::runtime_error("mergeCollections<>(): collection Id mismatch");
   }
 
-
-  //================================================================
-  template<class IDC_Container, class OvlAlg>
-  void overlayContainer(const IDC_Container *dataContainer,
-			const IDC_Container *mcContainer,
-			IDC_Container *outputContainer,	      
-			OvlAlg *parent)
-  {
-    typedef typename IDC_Container::base_value_type Collection;
-    typedef typename Collection::base_value_type Datum;		
- 
-    if(parent->msgLvl(MSG::DEBUG)) { parent->msg(MSG::DEBUG)<<"overlayContainer<>() begin"<<endmsg; }
-    
-    // The  MC signal container should typically be smaller than
-    // dataContainer, because the latter contains all the noise,
-    // min bias and pile up.   Thus we firstly copy data collection to the 
-    // output and then merge with MC inputs.
-
-    /** Add data from the data container to the output one */
-    typename IDC_Container::const_iterator p_data = dataContainer->begin();
-    typename IDC_Container::const_iterator p_data_end = dataContainer->end();
- 
-    for(; p_data != p_data_end; ++p_data) {
-       IdentifierHash hashId = p_data.hashId();
-       Identifier ident = p_data->identify();	
-       auto coll_data = std::make_unique<Collection>(ident, hashId);	
-      
-       typename Collection::const_iterator firstData = p_data->begin();
-       typename Collection::const_iterator lastData = p_data->end();    
-       for (; firstData != lastData; ++firstData) {		       
-          Datum* newData = new Datum (*(dynamic_cast<const Datum*>(*firstData)));
-          coll_data->push_back(newData);
-       }	
-   
-       if ( outputContainer->addCollection(coll_data.release(), p_data.hashId()).isFailure() ) {
-          parent->msg(MSG::WARNING) <<"add data Collection failed for output "<< p_data.hashId()<<endmsg; 
+  typedef typename Collection::base_value_type Datum;
+  typedef typename Collection::size_type size_type;
+
+  // Merge by copying ptrs from background and signal to output collection
+  size_type ibkg = 0, isig = 0;
+  while ((ibkg < bkgCollection->size()) || (isig < signalCollection->size())) {
+    // The Datum that goes to the output at the end of this step.
+    Datum *tmp{};
+
+    if (isig == signalCollection->size()) {
+      // just copy the remaining background digits
+      bkgCollection->swapElement(ibkg++, nullptr, tmp);
+    } else if (ibkg == bkgCollection->size()) {
+      // just copy the remaining signal digits
+      signalCollection->swapElement(isig++, nullptr, tmp);
+    } else {
+      // Need to decide which one goes first.
+      // See comments in TRTDigitization.cxx about the assumption that id1<id2
+      // <=> hash1<hash2
+      if (signalCollection->at(isig)->identify() < bkgCollection->at(ibkg)->identify()) {
+        signalCollection->swapElement(isig++, nullptr, tmp);
+      } else if (bkgCollection->at(ibkg)->identify() < signalCollection->at(isig)->identify()) {
+        bkgCollection->swapElement(ibkg++, nullptr, tmp);
+      } else {
+        // The hits are on the same channel.
+        Datum *tmpBkg{};
+        bkgCollection->swapElement(ibkg++, nullptr, tmpBkg);
+        signalCollection->swapElement(isig++, nullptr, tmp);
+        Overlay::mergeChannelData(*tmp, *tmpBkg, algorithm);
+        delete tmpBkg;
       }
-    }     
+    }
 
-    /** Add data from the ovl container to the output one */
-    typename IDC_Container::const_iterator p_ovl = mcContainer->begin(); 
-    typename IDC_Container::const_iterator p_ovl_end = mcContainer->end();
-
-    for(; p_ovl != p_ovl_end; ++p_ovl) {
-       IdentifierHash coll_id = p_ovl.hashId();//(*p_ovl)->identify();
-       Identifier elemId = p_ovl->identify();
-       auto coll_ovl = std::make_unique<Collection>(elemId, coll_id);	
-     
-       typename Collection::const_iterator firstData = p_ovl->begin();
-       typename Collection::const_iterator lastData = p_ovl->end();    
-       for (; firstData != lastData; ++firstData) {		       
-          Datum* newData = new Datum (*(dynamic_cast<const Datum*>(*firstData)));
-          coll_ovl->push_back(newData);
-    }	
-   	
-       /** The newly created stuff will go to the output EventStore SG */
-       auto coll_out = std::make_unique<Collection>(elemId, coll_id);	    
-     
-       /** Look for the same ID in the main StoreGate EventStore */ 
-       typename IDC_Container::const_iterator q = outputContainer->indexFind(coll_id);
-       if( q != outputContainer->end() ) {
-       /** Need to merge the collections
-           Retrieve q */
-
-          std::unique_ptr <Collection> coll_data ((Collection *) *q);
-          parent->mergeCollections(coll_data.get(),coll_ovl.get(),coll_out.get());
-
-          outputContainer->removeCollection(p_ovl.hashId());
-          if (outputContainer->addCollection(coll_out.release(), p_ovl.hashId()).isFailure() ) {
-	     parent->msg(MSG::WARNING) << "overlay addCollection failed " << endmsg; 
-          }
-       }
-       else {
-       /** Copy the complete collection from ovl to output, 
-           hopefully preserving the "most derived" type of its raw data */ 
-           if ( outputContainer->addCollection(coll_ovl.release(), coll_id).isFailure() ) {
-              parent->msg(MSG::WARNING) << "add mc Collection failed " << endmsg; 
-           }  
-       }   
-    }  
- }
+    outputCollection->push_back(tmp);
+  } // <= while
+}
 
 } // namespace Overlay
-
-//================================================================
-- 
GitLab


From fa95201ad646ab00abcbb8a4dbae617333df863a Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 2 Mar 2019 16:11:44 +0100
Subject: [PATCH 196/404] Update PixelOverlay for IDC_OverlayBase changes

---
 .../InDetOverlay/src/PixelOverlay.cxx         | 43 ++++++++++++-------
 .../InDetOverlay/test/PixelOverlay_test.cxx   |  8 ++--
 2 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
index 2e53492529d..106215eecf6 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/PixelOverlay.cxx
@@ -11,21 +11,31 @@
 
 namespace Overlay
 {
+  // Specialize mergeChannelData() for the Pixel
+  template <>
+  void mergeChannelData(PixelRDORawData &/* baseDatum */,
+                        const PixelRDORawData &/* additionalDatum */,
+                        IDC_OverlayBase *algorithm)
+  {
+    algorithm->msg(MSG::WARNING) << "Overlay::mergeChannelData<PixelRDORawData>(): "
+      << "Merging of data on the same channel is not implemented for PixelRDORawData" << endmsg;
+  }
+
   // Specialize copyCollection() for the Pixel
   template<>
-  void copyCollection(const InDetRawDataCollection<PixelRDORawData> *input_coll,
-                      InDetRawDataCollection<PixelRDORawData> *copy_coll)
+  std::unique_ptr<PixelRDO_Collection> copyCollection(const IdentifierHash &hashId,
+                                                      const PixelRDO_Collection *collection)
   {
-    copy_coll->setIdentifier(input_coll->identify());
-    InDetRawDataCollection<PixelRDORawData>::const_iterator firstData = input_coll->begin();
-    InDetRawDataCollection<PixelRDORawData>::const_iterator lastData = input_coll->end();	
-    for ( ; firstData != lastData; ++firstData)
-    {	
-      const Identifier ident = (*firstData)->identify();
-      const unsigned int word = (*firstData)->getWord();
-      Pixel1RawData *newData = new Pixel1RawData(ident, word);
-      copy_coll->push_back(newData);
+    auto outputCollection = std::make_unique<PixelRDO_Collection>(hashId);
+    outputCollection->setIdentifier(collection->identify());
+
+    for (const PixelRDORawData *existingDatum : *collection) {
+      // Owned by the collection
+      auto *datumCopy = new Pixel1RawData(existingDatum->identify(), existingDatum->getWord());
+      outputCollection->push_back(datumCopy);
     }
+
+    return outputCollection;
   }
 } // namespace Overlay
 
@@ -86,13 +96,14 @@ StatusCode PixelOverlay::execute()
   // Creating output RDO container
   SG::WriteHandle<PixelRDO_Container> outputContainer(m_outputKey);
   ATH_CHECK(outputContainer.record(std::make_unique<PixelRDO_Container>(signalContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output Pixel RDO container " << outputContainer.name() << " to store " << outputContainer.store());
+    return StatusCode::FAILURE;
+  }
   ATH_MSG_DEBUG("Recorded output Pixel RDO container " << outputContainer.name() << " in store " << outputContainer.store());
 
-  if (outputContainer.isValid()) {
-    overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
-
-    ATH_MSG_DEBUG("Pixel Result   = " << Overlay::debugPrint(outputContainer.ptr()));
-  }
+  ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
+  ATH_MSG_DEBUG("Pixel Result   = " << Overlay::debugPrint(outputContainer.ptr()));
 
   ATH_MSG_DEBUG("execute() end");
   return StatusCode::SUCCESS;
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx
index 91161d7edb1..1a42456d210 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/PixelOverlay_test.cxx
@@ -378,8 +378,8 @@ namespace OverlayTesting {
     ASSERT_TRUE( outputCollection->size()==1 );
     const PixelRDORawData* outputDigit1 = outputCollection->at(0);
     ASSERT_TRUE( outputDigit1!=nullptr );
-    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // Bkg RDO taken in case of matching Identifiers
-    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // Bkg RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getToT()==sigToT ); // Signal RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getBCID()==sigBCID-1 ); // Signal RDO taken in case of matching Identifiers
   }
 
   TEST_F(PixelOverlay_test, two_RDOs_with_matching_id_bkg_first) {
@@ -424,8 +424,8 @@ namespace OverlayTesting {
     ASSERT_TRUE( outputCollection->size()==1 );
     const PixelRDORawData* outputDigit1 = outputCollection->at(0);
     ASSERT_TRUE( outputDigit1!=nullptr );
-    ASSERT_TRUE( outputDigit1->getToT()==bkgToT ); // Bkg RDO taken in case of matching Identifiers
-    ASSERT_TRUE( outputDigit1->getBCID()==bkgBCID-1 ); // Bkg RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getToT()==sigToT ); // Signal RDO taken in case of matching Identifiers
+    ASSERT_TRUE( outputDigit1->getBCID()==sigBCID-1 ); // Signal RDO taken in case of matching Identifiers
   }
 
   TEST_F(PixelOverlay_test, containers_with_matching_collections_one_different_RDO_each_v2) {
-- 
GitLab


From 5d60d9a3cdbe3877b977eaf1f822fc3503c8a0de Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 2 Mar 2019 17:02:19 +0100
Subject: [PATCH 197/404] Update SCTOverlay for IDC_OverlayBase changes

---
 .../InDetOverlay/src/SCTOverlay.cxx           | 100 +++++++-----------
 1 file changed, 38 insertions(+), 62 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
index 23d20575158..a239f2d055a 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/SCTOverlay.cxx
@@ -14,46 +14,35 @@ namespace Overlay
 {
   // Specialize copyCollection() for the SCT
   template<>
-  void copyCollection(const InDetRawDataCollection<SCT_RDORawData> *input_coll,
-                      InDetRawDataCollection<SCT_RDORawData> *copy_coll)
-  {  
-    copy_coll->setIdentifier(input_coll->identify());
-    InDetRawDataCollection<SCT_RDORawData>::const_iterator firstData = input_coll->begin();
-    InDetRawDataCollection<SCT_RDORawData>::const_iterator lastData = input_coll->end();	
-    for ( ; firstData != lastData; ++firstData)
-    {	
-      const Identifier ident = (*firstData)->identify();
-      const unsigned int word = (*firstData)->getWord();
-      const SCT3_RawData* oldData = dynamic_cast<const SCT3_RawData*>(*firstData);	
-      std::vector<int> errorHit=oldData->getErrorCondensedHit();
-      SCT3_RawData *newData=new SCT3_RawData(ident, word, &errorHit);
-      copy_coll->push_back(newData);
+  std::unique_ptr<SCT_RDO_Collection> copyCollection(const IdentifierHash &hashId,
+                                                     const SCT_RDO_Collection *collection)
+  {
+    auto outputCollection = std::make_unique<SCT_RDO_Collection>(hashId);
+    outputCollection->setIdentifier(collection->identify());
+
+    for (const SCT_RDORawData *existingDatum : *collection) {
+      auto *oldDatum = dynamic_cast<const SCT3_RawData *>(existingDatum);
+      // Owned by the collection
+      auto *datumCopy = new SCT3_RawData(oldDatum->identify(),
+                                         oldDatum->getWord(),
+                                         &oldDatum->getErrorCondensedHit());
+      outputCollection->push_back(datumCopy);
     }
+
+    return outputCollection;
   }
 
-  // Specialize mergeCollectionsNew() for the SCT
-  template<> void mergeCollectionsNew(InDetRawDataCollection<SCT_RDORawData> *bkgCollection,
-                                      InDetRawDataCollection<SCT_RDORawData> *signalCollection,
-                                      InDetRawDataCollection<SCT_RDORawData> *outputCollection,
-                                      IDC_OverlayBase *tmp)
+  // Specialize mergeCollections() for the SCT
+  template<>
+  void mergeCollections(SCT_RDO_Collection *bkgCollection,
+                        SCT_RDO_Collection *signalCollection,
+                        SCT_RDO_Collection *outputCollection,
+                        IDC_OverlayBase *algorithm)
   {
     // We want to use the SCT_ID helper provided by SCTOverlay, thus the constraint
-    SCTOverlay *parent = dynamic_cast<SCTOverlay*>(tmp);
+    SCTOverlay *parent = dynamic_cast<SCTOverlay *>(algorithm);
     if (!parent) {
-      std::ostringstream os;
-      os << "mergeCollectionsNew<SCT_RDORawData>() called by a wrong parent algorithm?  Must be SCTOverlay.";
-      throw std::runtime_error(os.str());
-    }
-
-    // ----------------------------------------------------------------
-    // debug
-    static bool first_time = true;
-    if (first_time) {
-      first_time = false;
-      parent->msg(MSG::INFO) << "SCTOverlay::mergeCollectionsNew(): "
-                             << " SCT specific code is called for "
-                             << typeid(*bkgCollection).name()
-                             << endmsg;
+      throw std::runtime_error("mergeCollections<SCT_RDORawData>() called by a wrong parent algorithm? Must be SCTOverlay.");
     }
 
     // ----------------------------------------------------------------
@@ -74,39 +63,25 @@ namespace Overlay
     //
     // http://alxr.usatlas.bnl.gov/lxr/source/atlas/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx
 
-
-    // ----------------------------------------------------------------
     if (bkgCollection->identify() != signalCollection->identify()) {
-      std::ostringstream os;
-      os << "mergeCollectionsNew<SCT_RDORawData>(): collection Id mismatch";
-      parent->msg(MSG::FATAL) << os.str() << endmsg;
-      throw std::runtime_error(os.str());
+      throw std::runtime_error("mergeCollections<SCT_RDO_Collection>(): collection Id mismatch");
     }
 
     const Identifier idColl = parent->get_sct_id()->wafer_id(signalCollection->identifyHash());
 
-    // Empty the input collections and move RDOs to local vectors.
-    InDetRawDataCollection<SCT_RDORawData> bkg(bkgCollection->identifyHash());
-    bkg.setIdentifier(idColl);
-    bkgCollection->swap(bkg);
-
-    InDetRawDataCollection<SCT_RDORawData> sig(signalCollection->identifyHash());
-    sig.setIdentifier(idColl);
-    signalCollection->swap(sig);
-
     // Strip hit timing information for Next, Current, Previous and Any BCs
     // Prepare one more strip to create the last one. The additional strip has no hits.
     std::bitset<SCTOverlay::NumberOfStrips+1> stripInfo[SCTOverlay::NumberOfBitSets];
     // Process background and signal in the wafer
     for (unsigned source = SCTOverlay::BkgSource; source < SCTOverlay::NumberOfSources; source++) {
-      InDetRawDataCollection<SCT_RDORawData>::const_iterator rdo;
-      InDetRawDataCollection<SCT_RDORawData>::const_iterator rdoEnd;
+      SCT_RDO_Collection::const_iterator rdo;
+      SCT_RDO_Collection::const_iterator rdoEnd;
       if (source == SCTOverlay::BkgSource) { // background
-        rdo = bkg.begin();
-        rdoEnd = bkg.end();
+        rdo = bkgCollection->begin();
+        rdoEnd = bkgCollection->end();
       } else { // signal
-        rdo = sig.begin();
-        rdoEnd = sig.end();
+        rdo = signalCollection->begin();
+        rdoEnd = signalCollection->end();
       } 
       // Loop over all RDOs in the wafer
       for (; rdo!=rdoEnd; ++rdo) {
@@ -114,7 +89,7 @@ namespace Overlay
         if (!rdo3) {
           std::ostringstream os;
           const auto& elt = **rdo;
-          os << "mergeCollectionNew<SCT_RDORawData>(): wrong datum format. Only SCT3_RawData are produced by SCT_RodDecoder and supported by overlay."
+          os << "mergeCollection<SCT_RDO_Collection>(): wrong datum format. Only SCT3_RawData are produced by SCT_RodDecoder and supported by overlay."
              << "For the supplied datum  typeid(datum).name() = " << typeid(elt).name();
           throw std::runtime_error(os.str());
         }
@@ -175,7 +150,7 @@ namespace Overlay
         }
       }
     }
-  } // mergeCollectionsNew()
+  } // mergeCollections()
 } // namespace Overlay
 
 
@@ -241,13 +216,14 @@ StatusCode SCTOverlay::execute()
   // Creating output RDO container
   SG::WriteHandle<SCT_RDO_Container> outputContainer(m_outputKey);
   ATH_CHECK(outputContainer.record(std::make_unique<SCT_RDO_Container>(signalContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output SCT RDO container " << outputContainer.name() << " to store " << outputContainer.store());
+    return StatusCode::FAILURE;
+  }
   ATH_MSG_DEBUG("Recorded output SCT RDO container " << outputContainer.name() << " in store " << outputContainer.store());
 
-  if (outputContainer.isValid()) {
-    overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
-
-    ATH_MSG_DEBUG("SCT Result   = " << Overlay::debugPrint(outputContainer.ptr(), 50));
-  }
+  ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
+  ATH_MSG_DEBUG("SCT Result   = " << Overlay::debugPrint(outputContainer.ptr(), 50));
 
   ATH_MSG_DEBUG("execute() end");
   return StatusCode::SUCCESS;
-- 
GitLab


From d576f51f534c4c545c5592224cb2767a34ce38b8 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 2 Mar 2019 17:02:53 +0100
Subject: [PATCH 198/404] Update TRTOverlay for IDC_OverlayBase changes

---
 .../InDetOverlay/src/TRTOverlay.cxx           | 50 ++++++++-----------
 1 file changed, 22 insertions(+), 28 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index 4e15da8f192..38d74e08d09 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
@@ -22,20 +22,10 @@
 namespace Overlay
 {
   // Specialize mergeChannelData() for the TRT
-  template<> void mergeChannelData(TRT_RDORawData &r1, const TRT_RDORawData &r2, IDC_OverlayBase *parent)
+  template<> void mergeChannelData(TRT_RDORawData &r1,
+                                   const TRT_RDORawData &r2,
+                                   TRTOverlay *)
   {
-
-    // ----------------------------------------------------------------
-    // debug
-    static bool first_time = true;
-    if (first_time) {
-      first_time = false;
-      parent->msg(MSG::INFO) << "Overlay::mergeChannelData(): "
-                             << "TRT specific code is called for "
-                             << typeid(TRT_RDORawData).name()
-                             << endmsg;
-    }
-
     // ----------------------------------------------------------------
     // FIXME: That should really be a call to r1.merge(r2);
 
@@ -49,18 +39,24 @@ namespace Overlay
   } // mergeChannelData()
 
   // Specialize copyCollection() for the TRT
-  template<> void copyCollection(const InDetRawDataCollection<TRT_RDORawData> *input_coll, InDetRawDataCollection<TRT_RDORawData> *copy_coll)
+  template<>
+  std::unique_ptr<TRT_RDO_Collection> copyCollection(const IdentifierHash &hashId,
+                                                     const TRT_RDO_Collection *collection)
   {
-    copy_coll->setIdentifier(input_coll->identify());
-    InDetRawDataCollection<TRT_RDORawData>::const_iterator firstData = input_coll->begin();
-    InDetRawDataCollection<TRT_RDORawData>::const_iterator lastData = input_coll->end();
-    for ( ; firstData != lastData; ++firstData)
-    {
-	    const Identifier ident = (*firstData)->identify();
-	    const unsigned int word = (*firstData)->getWord();
-	    TRT_LoLumRawData *newData = new TRT_LoLumRawData(ident, word);
-	    copy_coll->push_back(newData);
+    auto outputCollection = std::make_unique<TRT_RDO_Collection>(hashId);
+    if (!collection) {
+      return outputCollection;
     }
+
+    outputCollection->setIdentifier(collection->identify());
+
+    for (const TRT_RDORawData *existingDatum : *collection) {
+      // Owned by the collection
+      auto *datumCopy = new TRT_LoLumRawData(existingDatum->identify(), existingDatum->getWord());
+      outputCollection->push_back(datumCopy);
+    }
+
+    return outputCollection;
   }
 } // namespace Overlay
 
@@ -166,7 +162,7 @@ StatusCode TRTOverlay::execute() {
       //Merge containers
       overlayTRTContainers(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr(), occupancy, *signalSDOContainer);
     } else {
-      overlayContainerNew(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr());
+      ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
     }
 
     ATH_MSG_DEBUG("TRT Result   = " << Overlay::debugPrint(outputContainer.ptr()));
@@ -189,8 +185,7 @@ void TRTOverlay::overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
 
      for(; p_bkg != p_bkg_end; ++p_bkg) {
        IdentifierHash hashId = p_bkg.hashId();
-       auto coll_bkg = std::make_unique<TRT_RDO_Collection>(hashId);
-       Overlay::copyCollection(*p_bkg, coll_bkg.get());
+       auto coll_bkg = Overlay::copyCollection(hashId, *p_bkg);
 
        if (outputContainer->addCollection(coll_bkg.release(), p_bkg.hashId() ).isFailure()) {
          ATH_MSG_WARNING("add background Collection failed for output " << p_bkg.hashId());
@@ -209,8 +204,7 @@ void TRTOverlay::overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
    for (; p_signal != p_signal_end; ++p_signal) {
 
       IdentifierHash coll_id = p_signal.hashId();
-      auto coll_signal = std::make_unique<TRT_RDO_Collection>(coll_id);
-      Overlay::copyCollection( *p_signal, coll_signal.get() ) ;
+      auto coll_signal = Overlay::copyCollection( coll_id, *p_signal ) ;
 
       /** The newly created stuff will go to the output EventStore SG */
       auto coll_out = std::make_unique<TRT_RDO_Collection>(coll_id);
-- 
GitLab


From 4bd0d0cf8cbb738234ad0270e917ea5cde0bd8fd Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 2 Mar 2019 17:03:40 +0100
Subject: [PATCH 199/404] Cleanup MdtOverlay and remove MuonOverlayBase class

---
 .../MdtOverlay/MdtOverlay/MdtOverlay.h        |  38 ++--
 .../MdtOverlay/python/MdtOverlayConfig.py     |  13 +-
 .../MuonOverlay/MdtOverlay/src/MdtOverlay.cxx | 182 ++++++++----------
 .../MdtOverlay/test/MdtOverlay_test.cxx       | 100 +++++-----
 .../MuonOverlayBase/CMakeLists.txt            |  11 +-
 .../MuonOverlayBase/IDC_MuonOverlayBase.h     |   1 +
 .../MuonOverlayBase/IDC_MuonOverlayBase.icc   |  33 +++-
 .../MuonOverlayBase/MuonOverlayBase.h         |  33 ----
 .../MuonOverlayBase/MuonOverlayBase.icc       |  52 -----
 9 files changed, 175 insertions(+), 288 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.h
 delete mode 100644 MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.icc

diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h b/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
index 5c9753beec3..b5909d1cc32 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/MdtOverlay/MdtOverlay.h
@@ -7,9 +7,7 @@
 // Overlaying MdtDigits from two different events for MDT subdetectors.
 //
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008 
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
 #ifndef MDTOVERLAY_H
@@ -17,35 +15,27 @@
 
 #include <string>
 
-#include "MuonOverlayBase/MuonOverlayBase.h"
-#include "MuonDigitContainer/MdtDigitContainer.h"
-
-class MdtOverlay : public MuonOverlayBase  {
+#include <MuonOverlayBase/IDC_MuonOverlayBase.h>
+#include <MuonDigitContainer/MdtDigitContainer.h>
 
+class MdtOverlay : public IDC_MuonOverlayBase
+{
 public:
-
   MdtOverlay(const std::string &name,ISvcLocator *pSvcLocator);
 
-  /** Framework implemenrtation for the event loop */
-  virtual StatusCode overlayInitialize();
-  virtual StatusCode overlayExecute();
-  virtual StatusCode overlayFinalize();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
-  float adcIntegrationWindow() const { return m_adcIntegrationWindow; }
+  float adcIntegrationWindow() const { return m_adcIntegrationWindow.value(); }
 
 private:
-  // ----------------------------------------------------------------
-
-  // jO controllable properties.
-  // "Main" containers are read, have data from "overlay" containers added,
-  // and written out with the original SG keys.
-  SG::ReadHandleKey<MdtDigitContainer> m_mainInputDigitKey{this,"MainInputDigitKey","OriginalEvent_SG+MDT_DIGITS","ReadHandleKey for Main Input MdtDigitContainer"};
-  SG::ReadHandleKey<MdtDigitContainer> m_overlayInputDigitKey{this,"OverlayInputDigitKey","BkgEvent_0_SG+MDT_DIGITS","ReadHandleKey for Overlay Input MdtDigitContainer"};
-  SG::WriteHandleKey<MdtDigitContainer> m_outputDigitKey{this,"OutputDigitKey","StoreGateSvc+MDT_DIGITS","WriteHandleKey for Output MdtDigitContainer"};
-
-  float m_adcIntegrationWindow{20.0}; // in ns
-  bool m_clean_overlay_data{false};
-  bool m_clean_overlay_signal{false};
+  SG::ReadHandleKey<MdtDigitContainer> m_bkgInputKey{this, "BkgInputKey", "OriginalEvent_SG+MDT_DIGITS", "ReadHandleKey for Background Input MdtDigitContainer"};
+  SG::ReadHandleKey<MdtDigitContainer> m_signalInputKey{this, "SignalInputKey", "BkgEvent_0_SG+MDT_DIGITS", "ReadHandleKey for Signal Input MdtDigitContainer"};
+  SG::WriteHandleKey<MdtDigitContainer> m_outputKey{this, "OutputKey", "StoreGateSvc+MDT_DIGITS", "WriteHandleKey for Output MdtDigitContainer"};
+
+  BooleanProperty m_includeBkg { this, "includeBkg", true, "Include Background RDO Container" };
+  FloatProperty m_adcIntegrationWindow { this, "IntegrationWindow", 20.0, "ADC Integration Window" };
+
 };
 
 #endif/* MDTOVERLAY_H */
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/python/MdtOverlayConfig.py b/MuonSpectrometer/MuonOverlay/MdtOverlay/python/MdtOverlayConfig.py
index ed8d3fd6983..4a83973ea5d 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/python/MdtOverlayConfig.py
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/python/MdtOverlayConfig.py
@@ -1,13 +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
 
 from AthenaCommon import CfgMgr
 
 def getMdtOverlay(name="MdtOverlay", **kwargs):
     from OverlayCommonAlgs.OverlayFlags import overlayFlags
-    kwargs.setdefault("MainInputDigitKey",overlayFlags.dataStore()+"+MDT_DIGITS")
-    kwargs.setdefault("OverlayInputDigitKey",overlayFlags.evtStore()+"+MDT_DIGITS")
-    kwargs.setdefault("OutputDigitKey",overlayFlags.outputStore()+"+MDT_DIGITS")
+
+    kwargs.setdefault("BkgInputKey", overlayFlags.dataStore() + "+MDT_DIGITS")
+    kwargs.setdefault("SignalInputKey", overlayFlags.evtStore() + "+MDT_DIGITS")
+    kwargs.setdefault("OutputKey", overlayFlags.outputStore() + "+MDT_DIGITS")
+
     kwargs.setdefault("IntegrationWindow", 20) # in ns
-    kwargs.setdefault("MCStore",overlayFlags.evtStore())
-    kwargs.setdefault("DataStore", overlayFlags.dataStore())
+
     return CfgMgr.MdtOverlay(name, **kwargs)
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx b/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
index 68d1317bac2..44806dc8a71 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/src/MdtOverlay.cxx
@@ -3,162 +3,132 @@
 */
 
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
-
 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
-
 // Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
 
-#include "MdtOverlay/MdtOverlay.h"
+#include <MdtOverlay/MdtOverlay.h>
 
-#include "StoreGate/StoreGateSvc.h"
-#include "StoreGate/DataHandle.h"
-#include "StoreGate/ReadHandle.h"
-#include "StoreGate/WriteHandle.h"
+#include <StoreGate/ReadHandle.h>
+#include <StoreGate/WriteHandle.h>
 
-#include "MuonDigitContainer/MdtDigitContainer.h"
+#include <IDC_OverlayBase/IDC_OverlayHelpers.h>
 
-#include <iostream>
-#include <typeinfo>
-#include <stdexcept>
 
 //================================================================
-namespace Overlay {
+namespace Overlay
+{
   /** template specialization function to add 2 MDT Digits - basically the operator+=
    * A declaration of the specialization must happen before the template is used from
    * the overlayContainer() method.  So we just put this implementation at the beginning
    * of this file.
    */
-  template<> void mergeChannelData(MdtDigit& mainDigit, const MdtDigit& ovlDigit, IDC_OverlayBase *baseParent) {
-    MdtOverlay* parent = dynamic_cast<MdtOverlay*>(baseParent);
-    if(!parent) {
-      throw std::runtime_error("Overlay::mergeChannelData<MdtDigit>(): ERROR: calling alg is not MdtOverlay.");
+  template<>
+  void mergeChannelData(MdtDigit& signalDigit,
+                        const MdtDigit& bkgDigit,
+                        IDC_MuonOverlayBase *algorithm)
+  {
+    // We want to use the integration window provided by MdtOverlay, thus the constraint
+    MdtOverlay *parent = dynamic_cast<MdtOverlay *>(algorithm);
+    if (!parent) {
+      throw std::runtime_error("mergeChannelData<MdtDigit>() called by a wrong parent algorithm? Must be MdtOverlay.");
     }
 
-    // ----------------------------------------------------------------
-    // confirm that the specialization is being used by printing out...
-    static bool first_time = true;
-    if(first_time) {
-      first_time = false;
-      parent->msg(MSG::INFO)<<"Overlay::mergeChannelData<MdtDigit>(): "
-                            <<"MDT specific code is called for "
-                            <<typeid(MdtDigit).name()
-                            <<endmsg;
-    }
+    int sig_tdc = signalDigit.tdc();
+    int bkg_tdc = bkgDigit.tdc();
 
-    // ----------------------------------------------------------------
-    // the real merging happens here
-    int main_tdc = mainDigit.tdc();
-    int ovl_tdc  = ovlDigit.tdc();
-
-    /** background masks Physics hit - no correction to the ADC
-        FIXME: Probably should return the maksed hit as well */
-    if ( abs(main_tdc-ovl_tdc) > parent->adcIntegrationWindow() && main_tdc < ovl_tdc ) {
-      // do nothing - keep mainDigit.
+    /** signal masks the background - no correction to the ADC
+        FIXME: Probably should return the masked hit as well */
+    if ( abs(sig_tdc - bkg_tdc) > parent->adcIntegrationWindow() && sig_tdc < bkg_tdc ) {
+      // do nothing - keep baseDigit.
     }
     /** Physics hit masks the background hit - no correct to the AOD
         FIXME: Probably should return the masked hit as well */
-    else if ( abs(main_tdc-ovl_tdc) > parent->adcIntegrationWindow() && main_tdc > ovl_tdc ) {
-      // Use ovlDigit as the final answer
-      mainDigit = ovlDigit;
+    else if ( abs(sig_tdc - bkg_tdc) > parent->adcIntegrationWindow() && sig_tdc > bkg_tdc ) {
+      // Use the background digit as the final answer
+      signalDigit = bkgDigit;
     }
     /** the 2 hits overlap withing the ADC integration window
         the ADC will add partially
         the TDC is from the first hit that crosses the threshold
         FIXME: how to add partially for correct - for now just add the ADD total */
-    else if ( abs(main_tdc-ovl_tdc) < parent->adcIntegrationWindow() )  {
-      int tdc = std::min( mainDigit.tdc(), ovlDigit.tdc() );
-      int adc = mainDigit.adc() + ovlDigit.adc();
-      mainDigit =  MdtDigit(mainDigit.identify(), tdc, adc );
+    else if ( abs(sig_tdc - bkg_tdc) < parent->adcIntegrationWindow() )  {
+      int tdc = std::min( signalDigit.tdc(), bkgDigit.tdc() );
+      int adc = signalDigit.adc() + bkgDigit.adc();
+      signalDigit = MdtDigit(signalDigit.identify(), tdc, adc);
     }
   }
+} // namespace Overlay
 
-}
 
 //================================================================
-MdtOverlay::MdtOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
-  MuonOverlayBase(name, pSvcLocator)
+MdtOverlay::MdtOverlay(const std::string &name, ISvcLocator *pSvcLocator)
+  : IDC_MuonOverlayBase(name, pSvcLocator)
 {
-
-  /** modifiable properties in job options */
-  declareProperty("IntegrationWindow", m_adcIntegrationWindow); // in ns
-  declareProperty("CleanOverlayData", m_clean_overlay_data);//clean out the overlay data before doing overlay, so you only get MC hits in the output overlay
-  declareProperty("CleanOverlaySignal", m_clean_overlay_signal);//clean out the signal MC before doing overlay
 }
 
 //================================================================
-StatusCode MdtOverlay::overlayInitialize()
+StatusCode MdtOverlay::initialize()
 {
-  ATH_MSG_INFO("MdtOverlay initialized");
+  ATH_MSG_DEBUG("Initializing...");
 
-  ATH_CHECK(m_mainInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_mainInputDigitKey );
-  ATH_CHECK(m_overlayInputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_overlayInputDigitKey );
-  ATH_CHECK(m_outputDigitKey.initialize());
-  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputDigitKey );
+  if (!m_includeBkg) {
+    ATH_MSG_DEBUG("Disabling use of background RDOs...");
+    ATH_CHECK( m_bkgInputKey.assign("") );
+  }
 
-  return StatusCode::SUCCESS;
-}
+  // Check and initialize keys
+  ATH_CHECK( m_bkgInputKey.initialize(!m_bkgInputKey.key().empty()) );
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_bkgInputKey );
+  ATH_CHECK(m_signalInputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_signalInputKey );
+  ATH_CHECK(m_outputKey.initialize());
+  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey );
 
-//================================================================
-StatusCode MdtOverlay::overlayFinalize()
-{
-  ATH_MSG_INFO("MdtOverlay finalized");
   return StatusCode::SUCCESS;
 }
 
 //================================================================
-StatusCode MdtOverlay::overlayExecute() {
-  ATH_MSG_DEBUG("MdtOverlay::execute() begin");
+StatusCode MdtOverlay::execute() {
+  ATH_MSG_DEBUG("execute() begin");
 
-  //----------------------------------------------------------------
-  ATH_MSG_VERBOSE("Retrieving data input MDT container");
 
-  SG::ReadHandle<MdtDigitContainer> dataContainer (m_mainInputDigitKey);
-  if (!dataContainer.isValid()) {
-    ATH_MSG_ERROR("Could not get data MDT container " << dataContainer.name() << " from store " << dataContainer.store());
-    return StatusCode::FAILURE;
+  const MdtDigitContainer *bkgContainerPtr = nullptr;
+  if (m_includeBkg) {
+    SG::ReadHandle<MdtDigitContainer> bkgContainer (m_bkgInputKey);
+    if (!bkgContainer.isValid()) {
+      ATH_MSG_ERROR("Could not get background MDT container " << bkgContainer.name() << " from store " << bkgContainer.store());
+      return StatusCode::FAILURE;
+    }
+    bkgContainerPtr = bkgContainer.cptr();
+
+    ATH_MSG_DEBUG("Found background MdtDigitContainer called " << bkgContainer.name() << " in store " << bkgContainer.store());
+    ATH_MSG_DEBUG("MDT Background = " << Overlay::debugPrint(bkgContainer.cptr()));
+    ATH_MSG_VERBOSE("MDT background has digit_size " << bkgContainer->digit_size());
   }
-  ATH_MSG_DEBUG("Found data MdtDigitContainer called " << dataContainer.name() << " in store " << dataContainer.store());
-  ATH_MSG_INFO("MDT Data     = "<<shortPrint(dataContainer.cptr()));
 
-  ATH_MSG_VERBOSE("Retrieving MC  input MDT container");
-  SG::ReadHandle<MdtDigitContainer> mcContainer(m_overlayInputDigitKey);
-  if(!mcContainer.isValid() ) {
-    ATH_MSG_ERROR("Could not get overlay MDT container " << mcContainer.name() << " from store " << mcContainer.store());
+  SG::ReadHandle<MdtDigitContainer> signalContainer(m_signalInputKey);
+  if(!signalContainer.isValid() ) {
+    ATH_MSG_ERROR("Could not get signal MDT container " << signalContainer.name() << " from store " << signalContainer.store());
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Found signal MdtDigitContainer called " << signalContainer.name() << " in store " << signalContainer.store());
+  ATH_MSG_DEBUG("MDT Signal     = " << Overlay::debugPrint(signalContainer.cptr()));
+  ATH_MSG_VERBOSE("MDT signal has digit_size " << signalContainer->digit_size());
+
+  SG::WriteHandle<MdtDigitContainer> outputContainer(m_outputKey);
+  ATH_CHECK(outputContainer.record(std::make_unique<MdtDigitContainer>(signalContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output MdtDigitContainer called " << outputContainer.name() << " to store " << outputContainer.store());
     return StatusCode::FAILURE;
   }
-  ATH_MSG_DEBUG("Found overlay MdtDigitContainer called " << mcContainer.name() << " in store " << mcContainer.store());
-  ATH_MSG_INFO("MDT MC       = "<<shortPrint(mcContainer.cptr()));
-
-  ATH_MSG_VERBOSE("MDT data has digit_size "<<dataContainer->digit_size());
-
-  ATH_MSG_VERBOSE("MDT signal data has digit_size "<<mcContainer->digit_size());
-
-  SG::WriteHandle<MdtDigitContainer> outputContainer(m_outputDigitKey);
-  ATH_CHECK(outputContainer.record(std::make_unique<MdtDigitContainer>(dataContainer->size())));
   ATH_MSG_DEBUG("Recorded output MdtDigitContainer called " << outputContainer.name() << " in store " << outputContainer.store());
 
-  if(dataContainer.isValid() && mcContainer.isValid() && outputContainer.isValid()) {
-    if(!m_clean_overlay_data && !m_clean_overlay_signal){
-      //Do the actual overlay
-      this->overlayContainer(dataContainer.cptr(), mcContainer.cptr(), outputContainer.ptr());
-    }
-    else if (m_clean_overlay_data) {
-      MdtDigitContainer nobkg(0);
-      this->overlayContainer(&nobkg , mcContainer.cptr() , outputContainer.ptr());
-    }
-    else if (m_clean_overlay_signal) {
-      MdtDigitContainer nomc(0);
-      this->overlayContainer(dataContainer.cptr(), &nomc , outputContainer.ptr());
-    }
-  }
-  ATH_MSG_INFO("MDT Result   = "<<shortPrint(outputContainer.cptr()));
+  // Do the actual overlay
+  ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
+  ATH_MSG_DEBUG("MDT Result     = " << Overlay::debugPrint(outputContainer.cptr()));
 
-  //----------------------------------------------------------------
-  ATH_MSG_DEBUG("MdtOverlay::execute() end");
+
+  ATH_MSG_DEBUG("execute() end");
 
   return StatusCode::SUCCESS;
 }
-
-//================================================================
diff --git a/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx b/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx
index 8f26e331ad5..60838f8adb3 100644
--- a/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx
+++ b/MuonSpectrometer/MuonOverlay/MdtOverlay/test/MdtOverlay_test.cxx
@@ -53,11 +53,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isFailure() ); //inputs don't exist
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isFailure() ); //inputs don't exist
   }
 
   TEST_F(MdtOverlay_test, empty_containers_alg_execute) {
@@ -71,11 +71,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
   }
 
   TEST_F(MdtOverlay_test, containers_with_matching_empty_collections) {
@@ -97,11 +97,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG1'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG1'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS1'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS1"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -129,11 +129,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG2'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG2'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS2'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS2"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -169,11 +169,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG3'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG3'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS3'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS3"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -216,11 +216,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG4'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG4'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS4'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS4"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -271,11 +271,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG5'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG5'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS5'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS5"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -323,11 +323,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG6'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG6'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS6'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS6"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -370,11 +370,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG7'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG7'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS7'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS7"};
     ASSERT_TRUE( outputDataHandle.isValid() );
@@ -417,11 +417,11 @@ namespace OverlayTesting {
     std::string  inputSigPropertyValue = "'StoreGateSvc+MDT_DIGITS_SIG8'";
     std::string  inputBkgPropertyValue = "'StoreGateSvc+MDT_DIGITS_BKG8'";
     std::string    outputPropertyValue = "'StoreGateSvc+MDT_DIGITS8'";
-    ASSERT_TRUE( m_alg->setProperty( "MainInputDigitKey",   inputSigPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OverlayInputDigitKey",   inputBkgPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->setProperty( "OutputDigitKey", outputPropertyValue).isSuccess() );
-    ASSERT_TRUE( m_alg->overlayInitialize().isSuccess() );
-    ASSERT_TRUE( m_alg->overlayExecute().isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",    inputBkgPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "SignalInputKey", inputSigPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->setProperty( "OutputKey",      outputPropertyValue).isSuccess() );
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
     // check output makes sense
     SG::ReadHandle<MdtDigitContainer> outputDataHandle{"StoreGateSvc+MDT_DIGITS8"};
     ASSERT_TRUE( outputDataHandle.isValid() );
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/CMakeLists.txt b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/CMakeLists.txt
index cbcce39fb69..ad4acd746af 100644
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/CMakeLists.txt
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/CMakeLists.txt
@@ -7,16 +7,9 @@ atlas_subdir( MuonOverlayBase )
 
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaBaseComps
-                          Control/AthContainers
-                          Control/StoreGate
-                          DetectorDescription/Identifier
-                          Event/EventOverlay/IDC_OverlayBase
-                          Event/EventOverlay/OverlayAlgBase
-                          GaudiKernel )
+                          Event/EventOverlay/IDC_OverlayBase )
 
 # Component(s) in the package:
 atlas_add_library( MuonOverlayBase
                    PUBLIC_HEADERS MuonOverlayBase
-                   LINK_LIBRARIES AthenaBaseComps AthContainers Identifier IDC_OverlayBase OverlayAlgBase GaudiKernel StoreGateLib SGtests )
-
+                   LINK_LIBRARIES IDC_OverlayBase )
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
index 27986c5a8e8..0c8d02681eb 100644
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.h
@@ -20,6 +20,7 @@
 #define IDC_MUONOVERLAYCOMMON_H
 
 #include <AthenaBaseComps/AthAlgorithm.h>
+#include <Identifier/IdentifierHash.h>
 
 
 class IDC_MuonOverlayBase : public AthAlgorithm
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc
index 72b9504d794..dbbb840edd2 100644
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc
+++ b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/IDC_MuonOverlayBase.icc
@@ -7,9 +7,9 @@
 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2009
 
 #include <Identifier/Identifier.h>
-#include <Identifier/IdentifierHash.h>
 
-#include "IDC_MultiHitOverlayCommon.h"
+#include <IDC_OverlayBase/IDC_OverlayCommon.h>
+#include <MuonOverlayBase/IDC_MultiHitOverlayCommon.h>
 
 
 template <class Collection>
@@ -38,14 +38,33 @@ StatusCode IDC_MuonOverlayBase::overlayContainerBase(const IDC_Container *bkgCon
                                                      bool isMultiHitCollection)
 {
   typedef typename IDC_Container::base_value_type Collection;
-  typedef typename Collection::base_value_type Datum;
 
   ATH_MSG_DEBUG("overlayContainer<>() begin");
 
-  // Get all the hashes for both signal and background container
-  const std::vector<IdentifierHash> bkgHashes = bkgContainer->GetAllCurrentHashes();
+  // Get all the hashes for the signal container
   const std::vector<IdentifierHash> signalHashes = signalContainer->GetAllCurrentHashes();
 
+  // There are some use cases where background is empty
+  if (!bkgContainer) {
+    // Only loop through the signal collections and copy them over
+    for (const IdentifierHash &hashId : signalHashes) {
+      // Copy the signal collection
+      std::unique_ptr<Collection> signalCollection = copyCollection(hashId, signalContainer->indexFindPtr(hashId));
+
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
+      }
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+  // Get all the hashes for the background container
+  const std::vector<IdentifierHash> bkgHashes = bkgContainer->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.
@@ -89,11 +108,9 @@ StatusCode IDC_MuonOverlayBase::overlayContainerBase(const IDC_Container *bkgCon
       if (isMultiHitCollection) {
         Overlay::mergeMultiHitCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get());
       } else {
-        // TODO: single-hit case not used at the moment
-        // Overlay::mergeCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get());
+        Overlay::mergeCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get(), this);
       }
 
-      outputContainer->removeCollection(hashId);
       if (outputContainer->addCollection(outputCollection.get(), hashId).isFailure()) {
         ATH_MSG_ERROR("Adding overlaid Collection with hashId " << hashId << " failed");
         return StatusCode::FAILURE;
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.h b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.h
deleted file mode 100644
index 697ebb5ec32..00000000000
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Dear emacs, this is -*-c++-*-
-
-// Generic overlaying code for boolean-like hits.
-// Factored out from InDetOverlay.
-//
-// Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2008
-
-// Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
-
-// Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
-
-#ifndef MUONOVERLAYBASE_H
-#define MUONOVERLAYBASE_H
-
-#include <string>
-#include "IDC_OverlayBase/IDC_OverlayBase.h"
-
-class ISvcLocator;
-class StoreGateSvc;
-
-class MuonOverlayBase : public IDC_OverlayBase  {
-public:
-  
-  MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
-    : IDC_OverlayBase(name, pSvcLocator) {}
-
-};
-
-#endif /* MUONOVERLAYBASE_H */
diff --git a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.icc b/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.icc
deleted file mode 100644
index 79036b3d749..00000000000
--- a/MuonSpectrometer/MuonOverlay/MuonOverlayBase/MuonOverlayBase/MuonOverlayBase.icc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// Generic overlaying code for Muon Digits 
-// Factored out from InDetOverlay.
-//
-// Andrei Gaponenko <agaponenko@lbl.gov>, 2006-2008
-
-// Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
-
-// Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
-
-#include "GaudiKernel/MsgStream.h"
-#include "StoreGate/StoreGateSvc.h"
-#include <memory>
-
-//================================================================
-
-template<class TypeToBeCopied, class Datum> 
-TypeToBeCopied* MuonOverlayBase::copyMuonDigitContainer(const TypeToBeCopied* oldObject)
-{
-
-  typedef typename TypeToBeCopied::base_value_type Collection;
-  const std::string templateClassName = typeid(TypeToBeCopied).name();
-
-  if (oldObject == 0) {
-    ATH_MSG_WARNING("copyMuonDigitContainer<"<<templateClassName<<">(): oldObject is a NULL pointer");
-    return 0;
-  }
-
-  TypeToBeCopied *newObject = 0;
-
-  newObject = new TypeToBeCopied (oldObject->size());
-  typename TypeToBeCopied::const_iterator iFirst = oldObject->begin();
-  typename TypeToBeCopied::const_iterator iLast = oldObject->end();
-  for (; iFirst != iLast; ++iFirst ) {
-     Collection *element = new Collection ((*iFirst)->identify(), (*iFirst)->identifierHash());
-     typename TypeToBeCopied::base_value_type::const_iterator firstData = (*iFirst)->begin();
-     typename TypeToBeCopied::base_value_type::const_iterator lastData = (*iFirst)->end();
-     for (; firstData != lastData; ++firstData) {
-        Datum * newData = new Datum (*(dynamic_cast<const Datum*>(*firstData)));
-        element->push_back(newData);
-     }
-     if ( newObject->addCollection ( element, (*iFirst)->identifierHash() ).isFailure() ) {
-        ATH_MSG_WARNING("copyMuonDigitCongtainer<"<<templateClassName<<">(): problem adding collection with "<<"hash="<<(*iFirst)->identifierHash() );
-     }
-  }
-
-  return newObject;
-
-}
-- 
GitLab


From 8c7476ce93c086315976c443c865c6d970f909dd Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 4 Mar 2019 15:14:44 +0100
Subject: [PATCH 200/404] Add ATLAS_CHECK_THREAD_SAFETY to
 SiSpacePointFormation package.

---
 .../SiSpacePointFormation/ATLAS_CHECK_THREAD_SAFETY              | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..fc29e93658b
--- /dev/null
+++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecAlgs/SiSpacePointFormation
-- 
GitLab


From 6081832d7d6e727d539fa24db4b8f7e85fbc122f Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Mon, 4 Mar 2019 15:40:03 +0100
Subject: [PATCH 201/404] remove commented lines in MdtCalibDbAlg.h

---
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h                      | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
index c07fa1b57e9..7da69fc6bbf 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
@@ -48,9 +48,6 @@ namespace coral	{
   class Blob;
 }
 
-//class RtResolutionLookUp;
-//class SamplePoint;
-
 #include "MdtCalibData/RtResolutionLookUp.h"
 #include "MuonCalibMath/SamplePoint.h"
 
-- 
GitLab


From 23659cd4cb5718a2c30b57580a8ce665c75012c3 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Mon, 4 Mar 2019 17:16:42 +0100
Subject: [PATCH 202/404] Regenerate bootstrap pickle files after removal of
 AthFilterSeq

---
 Control/AthenaCommon/share/bootstrap.pkl      | 299 +++++++--------
 .../AthenaCommon/share/bootstrap_threaded.pkl | 351 ++++++++----------
 2 files changed, 298 insertions(+), 352 deletions(-)

diff --git a/Control/AthenaCommon/share/bootstrap.pkl b/Control/AthenaCommon/share/bootstrap.pkl
index 4dad90511cc..be2acce6a70 100644
--- a/Control/AthenaCommon/share/bootstrap.pkl
+++ b/Control/AthenaCommon/share/bootstrap.pkl
@@ -168,7 +168,7 @@ sS'DetStore'
 p88
 S'StoreGateSvc/DetectorStore'
 p89
-ssS'AthFilterSeq'
+ssS'AthMasterSeq'
 p90
 (dp91
 S'ExtraOutputs'
@@ -183,79 +183,79 @@ sS'ExtraInputs'
 p96
 S'[]'
 p97
-sS'Members'
+sS'Sequential'
 p98
-S"['AthSequencer/AthAlgEvtSeq']"
+S'True'
 p99
-sS'NeededResources'
+sS'Members'
 p100
-S'[]'
+S"['AthSequencer/AthAlgEvtSeq', 'AthSequencer/AthOutSeq', 'AthSequencer/AthRegSeq']"
 p101
-sS'DetStore'
+sS'NeededResources'
 p102
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p103
-ssS'AthMasterSeq'
+sS'DetStore'
 p104
-(dp105
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p105
+ssS'AthAlgEvtSeq'
 p106
-S'[]'
-p107
-sS'EvtStore'
+(dp107
+S'ExtraOutputs'
 p108
-S'StoreGateSvc'
+S'[]'
 p109
-sS'ExtraInputs'
+sS'EvtStore'
 p110
-S'[]'
+S'StoreGateSvc'
 p111
-sS'Sequential'
+sS'ExtraInputs'
 p112
-S'True'
+S'[]'
 p113
-sS'StopOverride'
+sS'Sequential'
 p114
 S'True'
 p115
-sS'Members'
+sS'StopOverride'
 p116
-S"['AthSequencer/AthFilterSeq', 'AthSequencer/AthOutSeq', 'AthSequencer/AthRegSeq']"
+S'True'
 p117
-sS'NeededResources'
+sS'Members'
 p118
-S'[]'
+S"['AthSequencer/AthBeginSeq', 'AthSequencer/AthAllAlgSeq', 'AthSequencer/AthEndSeq']"
 p119
-sS'DetStore'
+sS'NeededResources'
 p120
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p121
-ssS'AthAlgEvtSeq'
+sS'DetStore'
 p122
-(dp123
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p123
+ssS'AthEndSeq'
 p124
-S'[]'
-p125
-sS'EvtStore'
+(dp125
+S'ExtraOutputs'
 p126
-S'StoreGateSvc'
+S'[]'
 p127
-sS'ExtraInputs'
+sS'EvtStore'
 p128
-S'[]'
+S'StoreGateSvc'
 p129
-sS'Sequential'
+sS'ExtraInputs'
 p130
-S'True'
+S'[]'
 p131
-sS'StopOverride'
+sS'Sequential'
 p132
 S'True'
 p133
 sS'Members'
 p134
-S"['AthSequencer/AthBeginSeq', 'AthSequencer/AthAllAlgSeq', 'AthSequencer/AthEndSeq']"
+S"['AthIncFirerAlg/EndIncFiringAlg', 'IncidentProcAlg/IncidentProcAlg2']"
 p135
 sS'NeededResources'
 p136
@@ -265,7 +265,7 @@ sS'DetStore'
 p138
 S'StoreGateSvc/DetectorStore'
 p139
-ssS'AthEndSeq'
+ssS'AthRegSeq'
 p140
 (dp141
 S'ExtraOutputs'
@@ -280,40 +280,40 @@ sS'ExtraInputs'
 p146
 S'[]'
 p147
-sS'Sequential'
+sS'Members'
 p148
-S'True'
+S'[]'
 p149
-sS'Members'
+sS'NeededResources'
 p150
-S"['AthIncFirerAlg/EndIncFiringAlg', 'IncidentProcAlg/IncidentProcAlg2']"
+S'[]'
 p151
-sS'NeededResources'
+sS'DetStore'
 p152
-S'[]'
+S'StoreGateSvc/DetectorStore'
 p153
-sS'DetStore'
+ssS'EndIncFiringAlg'
 p154
-S'StoreGateSvc/DetectorStore'
-p155
-ssS'AthRegSeq'
-p156
-(dp157
+(dp155
 S'ExtraOutputs'
-p158
+p156
 S'[]'
-p159
+p157
 sS'EvtStore'
-p160
+p158
 S'StoreGateSvc'
-p161
+p159
 sS'ExtraInputs'
-p162
+p160
 S'[]'
+p161
+sS'FireSerial'
+p162
+S'False'
 p163
-sS'Members'
+sS'Incidents'
 p164
-S'[]'
+S"['EndEvent']"
 p165
 sS'NeededResources'
 p166
@@ -323,7 +323,7 @@ sS'DetStore'
 p168
 S'StoreGateSvc/DetectorStore'
 p169
-ssS'EndIncFiringAlg'
+ssS'Streams'
 p170
 (dp171
 S'ExtraOutputs'
@@ -338,93 +338,93 @@ sS'ExtraInputs'
 p176
 S'[]'
 p177
-sS'FireSerial'
+sS'Members'
 p178
-S'False'
+S'[]'
 p179
-sS'Incidents'
+sS'NeededResources'
 p180
-S"['EndEvent']"
+S'[]'
 p181
-sS'NeededResources'
+sS'DetStore'
 p182
-S'[]'
+S'StoreGateSvc/DetectorStore'
 p183
-sS'DetStore'
+ssS'NTupleSvc'
 p184
-S'StoreGateSvc/DetectorStore'
-p185
-ssS'Streams'
+(dp185
+S'InhibitPathes'
 p186
-(dp187
-S'ExtraOutputs'
+S'[]'
+p187
+sS'Input'
 p188
 S'[]'
 p189
-sS'EvtStore'
+sS'Output'
 p190
-S'StoreGateSvc'
+S'[]'
 p191
-sS'ExtraInputs'
+ssS'EventPersistencySvc'
 p192
-S'[]'
-p193
-sS'Members'
+(dp193
+S'CnvServices'
 p194
 S'[]'
 p195
-sS'NeededResources'
+ssS'AthAlgSeq'
 p196
-S'[]'
-p197
-sS'DetStore'
+(dp197
+S'ExtraOutputs'
 p198
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p199
-ssS'NTupleSvc'
+sS'IgnoreFilterPassed'
 p200
-(dp201
-S'InhibitPathes'
+S'True'
+p201
+sS'EvtStore'
 p202
-S'[]'
+S'StoreGateSvc'
 p203
-sS'Input'
+sS'ExtraInputs'
 p204
 S'[]'
 p205
-sS'Output'
+sS'StopOverride'
 p206
-S'[]'
+S'True'
 p207
-ssS'EventPersistencySvc'
+sS'Members'
 p208
-(dp209
-S'CnvServices'
+S'[]'
+p209
+sS'NeededResources'
 p210
 S'[]'
 p211
-ssS'AthAlgSeq'
+sS'DetStore'
 p212
-(dp213
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p213
+ssS'AthAllAlgSeq'
 p214
-S'[]'
-p215
-sS'EvtStore'
+(dp215
+S'ExtraOutputs'
 p216
-S'StoreGateSvc'
+S'[]'
 p217
-sS'ExtraInputs'
+sS'EvtStore'
 p218
-S'[]'
+S'StoreGateSvc'
 p219
-sS'StopOverride'
+sS'ExtraInputs'
 p220
-S'True'
+S'[]'
 p221
 sS'Members'
 p222
-S'[]'
+S"['AthSequencer/AthCondSeq', 'AthSequencer/AthAlgSeq']"
 p223
 sS'NeededResources'
 p224
@@ -434,49 +434,48 @@ sS'DetStore'
 p226
 S'StoreGateSvc/DetectorStore'
 p227
-ssS'AthAllAlgSeq'
+ssS'AthenaSealSvc'
 p228
 (dp229
-S'ExtraOutputs'
+S'DictNames'
 p230
 S'[]'
 p231
-sS'EvtStore'
+sS'IgnoreDicts'
 p232
-S'StoreGateSvc'
+S"['libSealCLHEPDict']"
 p233
-sS'ExtraInputs'
+sS'IgnoreNames'
 p234
-S'[]'
+S"['Gaudi', 'GaudiPython::Interface', 'GaudiPython::Helper', 'FactoryTable', 'IInterface', 'IFactory', 'IAlgFactory', 'ISvcFactory', 'IToolFactory', 'InterfaceID', 'StatusCode', 'IAppMgrUI', 'IProperty', 'Property', 'std::vector<Property*>', 'std::vector<const Property*>', 'std::list<IAlgorithm*>', 'std::list<IService*>', 'std::list<const IFactory*>', 'std::vector<IRegistry*>', 'SimpleProperty', 'SimplePropertyRef', 'IService', 'IAlgorithm', 'ISvcManager', 'IAlgManager', 'IJobOptionsSvc', 'ISvcLocator', 'IEventProcessor', 'IDataProviderSvc', 'IDataManagerSvc', 'IRegistry', 'ContainedObject', 'std::vector<const ContainedObject*>', 'DataObject', 'IHistogramSvc', 'AIDA::I', 'Algorithm', 'Service', 'GaudiPython::PyAlgorithm', 'GaudiPython::PyAlgorithmWrap', 'IParticlePropertySvc', 'ParticleProperty', 'StoreGateSvc', 'IStoragePolicy', 'CharDbArray', 'DoubleDbArray', 'FloatDbArray', 'IntDbArray', 'LongDbArray', 'ShortDbArray', 'AthenaEventLoopMgr', 'MinimalEventLoopMgr', 'PyAthenaEventLoopMgr', 'NTuple::Directory', 'NTuple::File ', 'NTuple::Tuple', 'INTuple', 'NTuple::Tuple', 'greater<int>', 'allocator<', 'string']"
 p235
-sS'Members'
+ssS'IncidentProcAlg2'
 p236
-S"['AthSequencer/AthCondSeq', 'AthSequencer/AthAlgSeq']"
-p237
-sS'NeededResources'
+(dp237
+S'ExtraOutputs'
 p238
 S'[]'
 p239
-sS'DetStore'
+sS'NeededResources'
 p240
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p241
-ssS'AthenaSealSvc'
+sS'ExtraInputs'
 p242
-(dp243
-S'DictNames'
-p244
 S'[]'
-p245
-sS'IgnoreDicts'
+p243
+ssS'DetectorStore'
+p244
+(dp245
+S'IncidentSvc'
 p246
-S"['libSealCLHEPDict']"
+S'IncidentSvc'
 p247
-sS'IgnoreNames'
+sS'ProxyProviderSvc'
 p248
-S"['Gaudi', 'GaudiPython::Interface', 'GaudiPython::Helper', 'FactoryTable', 'IInterface', 'IFactory', 'IAlgFactory', 'ISvcFactory', 'IToolFactory', 'InterfaceID', 'StatusCode', 'IAppMgrUI', 'IProperty', 'Property', 'std::vector<Property*>', 'std::vector<const Property*>', 'std::list<IAlgorithm*>', 'std::list<IService*>', 'std::list<const IFactory*>', 'std::vector<IRegistry*>', 'SimpleProperty', 'SimplePropertyRef', 'IService', 'IAlgorithm', 'ISvcManager', 'IAlgManager', 'IJobOptionsSvc', 'ISvcLocator', 'IEventProcessor', 'IDataProviderSvc', 'IDataManagerSvc', 'IRegistry', 'ContainedObject', 'std::vector<const ContainedObject*>', 'DataObject', 'IHistogramSvc', 'AIDA::I', 'Algorithm', 'Service', 'GaudiPython::PyAlgorithm', 'GaudiPython::PyAlgorithmWrap', 'IParticlePropertySvc', 'ParticleProperty', 'StoreGateSvc', 'IStoragePolicy', 'CharDbArray', 'DoubleDbArray', 'FloatDbArray', 'IntDbArray', 'LongDbArray', 'ShortDbArray', 'AthenaEventLoopMgr', 'MinimalEventLoopMgr', 'PyAthenaEventLoopMgr', 'NTuple::Directory', 'NTuple::File ', 'NTuple::Tuple', 'INTuple', 'NTuple::Tuple', 'greater<int>', 'allocator<', 'string']"
+S'ProxyProviderSvc'
 p249
-ssS'IncidentProcAlg2'
+ssS'IncidentProcAlg1'
 p250
 (dp251
 S'ExtraOutputs'
@@ -491,54 +490,28 @@ sS'ExtraInputs'
 p256
 S'[]'
 p257
-ssS'DetectorStore'
+ssS'HistogramDataSvc'
 p258
 (dp259
-S'IncidentSvc'
+S'Input'
 p260
-S'IncidentSvc'
+S'[]'
 p261
-sS'ProxyProviderSvc'
+sS'InhibitPathes'
 p262
-S'ProxyProviderSvc'
+S'[]'
 p263
-ssS'IncidentProcAlg1'
+ssS'HistoryStore'
 p264
 (dp265
-S'ExtraOutputs'
-p266
-S'[]'
-p267
-sS'NeededResources'
-p268
-S'[]'
-p269
-sS'ExtraInputs'
-p270
-S'[]'
-p271
-ssS'HistogramDataSvc'
-p272
-(dp273
-S'Input'
-p274
-S'[]'
-p275
-sS'InhibitPathes'
-p276
-S'[]'
-p277
-ssS'HistoryStore'
-p278
-(dp279
 S'IncidentSvc'
-p280
+p266
 S'IncidentSvc'
-p281
+p267
 sS'ProxyProviderSvc'
-p282
+p268
 S'ProxyProviderSvc'
-p283
+p269
 ss.ccollections
 defaultdict
 p1
@@ -797,7 +770,7 @@ p112
 g7
 sS'SEARCHPATH'
 p113
-S'.:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/AthenaExternals/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/GAUDI/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions'
+S'.:/afs/cern.ch/work/s/smh/MR_21423/bld/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/GAUDI/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/afs/cern.ch/work/s/smh/MR_21423/bld:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/AthenaExternals/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions'
 p114
 sS'AuditInitialize'
 p115
diff --git a/Control/AthenaCommon/share/bootstrap_threaded.pkl b/Control/AthenaCommon/share/bootstrap_threaded.pkl
index 8c0a42c81d0..23052604a78 100644
--- a/Control/AthenaCommon/share/bootstrap_threaded.pkl
+++ b/Control/AthenaCommon/share/bootstrap_threaded.pkl
@@ -259,7 +259,7 @@ sS'AbortOnError'
 p134
 S'False'
 p135
-ssS'AthFilterSeq'
+ssS'AthMasterSeq'
 p136
 (dp137
 S'ExtraOutputs'
@@ -274,79 +274,79 @@ sS'ExtraInputs'
 p142
 S'[]'
 p143
-sS'Members'
+sS'Sequential'
 p144
-S"['AthSequencer/AthAlgEvtSeq']"
+S'True'
 p145
-sS'NeededResources'
+sS'Members'
 p146
-S'[]'
+S"['AthSequencer/AthAlgEvtSeq', 'AthSequencer/AthOutSeq', 'AthSequencer/AthRegSeq']"
 p147
-sS'DetStore'
+sS'NeededResources'
 p148
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p149
-ssS'AthMasterSeq'
+sS'DetStore'
 p150
-(dp151
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p151
+ssS'AthAlgEvtSeq'
 p152
-S'[]'
-p153
-sS'EvtStore'
+(dp153
+S'ExtraOutputs'
 p154
-S'StoreGateSvc'
+S'[]'
 p155
-sS'ExtraInputs'
+sS'EvtStore'
 p156
-S'[]'
+S'StoreGateSvc'
 p157
-sS'Sequential'
+sS'ExtraInputs'
 p158
-S'True'
+S'[]'
 p159
-sS'StopOverride'
+sS'Sequential'
 p160
 S'True'
 p161
-sS'Members'
+sS'StopOverride'
 p162
-S"['AthSequencer/AthFilterSeq', 'AthSequencer/AthOutSeq', 'AthSequencer/AthRegSeq']"
+S'True'
 p163
-sS'NeededResources'
+sS'Members'
 p164
-S'[]'
+S"['AthSequencer/AthBeginSeq', 'AthSequencer/AthAllAlgSeq', 'AthSequencer/AthEndSeq']"
 p165
-sS'DetStore'
+sS'NeededResources'
 p166
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p167
-ssS'AthAlgEvtSeq'
+sS'DetStore'
 p168
-(dp169
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p169
+ssS'AthEndSeq'
 p170
-S'[]'
-p171
-sS'EvtStore'
+(dp171
+S'ExtraOutputs'
 p172
-S'StoreGateSvc'
+S'[]'
 p173
-sS'ExtraInputs'
+sS'EvtStore'
 p174
-S'[]'
+S'StoreGateSvc'
 p175
-sS'Sequential'
+sS'ExtraInputs'
 p176
-S'True'
+S'[]'
 p177
-sS'StopOverride'
+sS'Sequential'
 p178
 S'True'
 p179
 sS'Members'
 p180
-S"['AthSequencer/AthBeginSeq', 'AthSequencer/AthAllAlgSeq', 'AthSequencer/AthEndSeq']"
+S"['AthIncFirerAlg/EndIncFiringAlg', 'IncidentProcAlg/IncidentProcAlg2']"
 p181
 sS'NeededResources'
 p182
@@ -356,65 +356,65 @@ sS'DetStore'
 p184
 S'StoreGateSvc/DetectorStore'
 p185
-ssS'AthEndSeq'
+ssS'AlgResourcePool'
 p186
 (dp187
-S'ExtraOutputs'
+S'OutputLevel'
 p188
-S'[]'
+S'3'
+sS'TopAlg'
 p189
-sS'EvtStore'
+S"['AthMasterSeq']"
 p190
-S'StoreGateSvc'
+ssS'AthRegSeq'
 p191
-sS'ExtraInputs'
-p192
-S'[]'
+(dp192
+S'ExtraOutputs'
 p193
-sS'Sequential'
+S'[]'
 p194
-S'True'
+sS'EvtStore'
 p195
-sS'Members'
+S'StoreGateSvc'
 p196
-S"['AthIncFirerAlg/EndIncFiringAlg', 'IncidentProcAlg/IncidentProcAlg2']"
+sS'ExtraInputs'
 p197
-sS'NeededResources'
-p198
 S'[]'
+p198
+sS'Members'
 p199
-sS'DetStore'
+S'[]'
 p200
-S'StoreGateSvc/DetectorStore'
+sS'NeededResources'
 p201
-ssS'AlgResourcePool'
+S'[]'
 p202
-(dp203
-S'OutputLevel'
+sS'DetStore'
+p203
+S'StoreGateSvc/DetectorStore'
 p204
-S'3'
-sS'TopAlg'
+ssS'EndIncFiringAlg'
 p205
-S"['AthMasterSeq']"
-p206
-ssS'AthRegSeq'
-p207
-(dp208
+(dp206
 S'ExtraOutputs'
-p209
+p207
 S'[]'
-p210
+p208
 sS'EvtStore'
-p211
+p209
 S'StoreGateSvc'
-p212
+p210
 sS'ExtraInputs'
-p213
+p211
 S'[]'
+p212
+sS'FireSerial'
+p213
+S'False'
 p214
-sS'Members'
+sS'Incidents'
 p215
-S'[]'
+S"['EndEvent']"
 p216
 sS'NeededResources'
 p217
@@ -424,7 +424,7 @@ sS'DetStore'
 p219
 S'StoreGateSvc/DetectorStore'
 p220
-ssS'EndIncFiringAlg'
+ssS'Streams'
 p221
 (dp222
 S'ExtraOutputs'
@@ -439,93 +439,93 @@ sS'ExtraInputs'
 p227
 S'[]'
 p228
-sS'FireSerial'
+sS'Members'
 p229
-S'False'
+S'[]'
 p230
-sS'Incidents'
+sS'NeededResources'
 p231
-S"['EndEvent']"
+S'[]'
 p232
-sS'NeededResources'
+sS'DetStore'
 p233
-S'[]'
+S'StoreGateSvc/DetectorStore'
 p234
-sS'DetStore'
+ssS'NTupleSvc'
 p235
-S'StoreGateSvc/DetectorStore'
-p236
-ssS'Streams'
+(dp236
+S'InhibitPathes'
 p237
-(dp238
-S'ExtraOutputs'
+S'[]'
+p238
+sS'Input'
 p239
 S'[]'
 p240
-sS'EvtStore'
+sS'Output'
 p241
-S'StoreGateSvc'
+S'[]'
 p242
-sS'ExtraInputs'
+ssS'EventPersistencySvc'
 p243
-S'[]'
-p244
-sS'Members'
+(dp244
+S'CnvServices'
 p245
 S'[]'
 p246
-sS'NeededResources'
+ssS'AthAlgSeq'
 p247
-S'[]'
-p248
-sS'DetStore'
+(dp248
+S'ExtraOutputs'
 p249
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p250
-ssS'NTupleSvc'
+sS'IgnoreFilterPassed'
 p251
-(dp252
-S'InhibitPathes'
+S'True'
+p252
+sS'EvtStore'
 p253
-S'[]'
+S'StoreGateSvc'
 p254
-sS'Input'
+sS'ExtraInputs'
 p255
 S'[]'
 p256
-sS'Output'
+sS'StopOverride'
 p257
-S'[]'
+S'True'
 p258
-ssS'EventPersistencySvc'
+sS'Members'
 p259
-(dp260
-S'CnvServices'
+S"['SGInputLoader/SGInputLoader']"
+p260
+sS'NeededResources'
 p261
 S'[]'
 p262
-ssS'AthAlgSeq'
+sS'DetStore'
 p263
-(dp264
-S'ExtraOutputs'
+S'StoreGateSvc/DetectorStore'
+p264
+ssS'AthAllAlgSeq'
 p265
-S'[]'
-p266
-sS'EvtStore'
+(dp266
+S'ExtraOutputs'
 p267
-S'StoreGateSvc'
+S'[]'
 p268
-sS'ExtraInputs'
+sS'EvtStore'
 p269
-S'[]'
+S'StoreGateSvc'
 p270
-sS'StopOverride'
+sS'ExtraInputs'
 p271
-S'True'
+S'[]'
 p272
 sS'Members'
 p273
-S"['SGInputLoader/SGInputLoader']"
+S"['AthSequencer/AthAlgSeq', 'AthSequencer/AthCondSeq']"
 p274
 sS'NeededResources'
 p275
@@ -535,122 +535,95 @@ sS'DetStore'
 p277
 S'StoreGateSvc/DetectorStore'
 p278
-ssS'AthAllAlgSeq'
+ssS'AthenaSealSvc'
 p279
 (dp280
-S'ExtraOutputs'
+S'DictNames'
 p281
 S'[]'
 p282
-sS'EvtStore'
+sS'IgnoreDicts'
 p283
-S'StoreGateSvc'
+S"['libSealCLHEPDict']"
 p284
-sS'ExtraInputs'
+sS'IgnoreNames'
 p285
-S'[]'
+S"['Gaudi', 'GaudiPython::Interface', 'GaudiPython::Helper', 'FactoryTable', 'IInterface', 'IFactory', 'IAlgFactory', 'ISvcFactory', 'IToolFactory', 'InterfaceID', 'StatusCode', 'IAppMgrUI', 'IProperty', 'Property', 'std::vector<Property*>', 'std::vector<const Property*>', 'std::list<IAlgorithm*>', 'std::list<IService*>', 'std::list<const IFactory*>', 'std::vector<IRegistry*>', 'SimpleProperty', 'SimplePropertyRef', 'IService', 'IAlgorithm', 'ISvcManager', 'IAlgManager', 'IJobOptionsSvc', 'ISvcLocator', 'IEventProcessor', 'IDataProviderSvc', 'IDataManagerSvc', 'IRegistry', 'ContainedObject', 'std::vector<const ContainedObject*>', 'DataObject', 'IHistogramSvc', 'AIDA::I', 'Algorithm', 'Service', 'GaudiPython::PyAlgorithm', 'GaudiPython::PyAlgorithmWrap', 'IParticlePropertySvc', 'ParticleProperty', 'StoreGateSvc', 'IStoragePolicy', 'CharDbArray', 'DoubleDbArray', 'FloatDbArray', 'IntDbArray', 'LongDbArray', 'ShortDbArray', 'AthenaEventLoopMgr', 'MinimalEventLoopMgr', 'PyAthenaEventLoopMgr', 'NTuple::Directory', 'NTuple::File ', 'NTuple::Tuple', 'INTuple', 'NTuple::Tuple', 'greater<int>', 'allocator<', 'string']"
 p286
-sS'Members'
+ssS'IncidentProcAlg2'
 p287
-S"['AthSequencer/AthAlgSeq', 'AthSequencer/AthCondSeq']"
-p288
-sS'NeededResources'
+(dp288
+S'ExtraOutputs'
 p289
 S'[]'
 p290
-sS'DetStore'
+sS'NeededResources'
 p291
-S'StoreGateSvc/DetectorStore'
+S'[]'
 p292
-ssS'AthenaSealSvc'
+sS'ExtraInputs'
 p293
-(dp294
-S'DictNames'
-p295
 S'[]'
-p296
-sS'IgnoreDicts'
+p294
+ssS'DetectorStore'
+p295
+(dp296
+S'IncidentSvc'
 p297
-S"['libSealCLHEPDict']"
+S'IncidentSvc'
 p298
-sS'IgnoreNames'
+sS'ProxyProviderSvc'
 p299
-S"['Gaudi', 'GaudiPython::Interface', 'GaudiPython::Helper', 'FactoryTable', 'IInterface', 'IFactory', 'IAlgFactory', 'ISvcFactory', 'IToolFactory', 'InterfaceID', 'StatusCode', 'IAppMgrUI', 'IProperty', 'Property', 'std::vector<Property*>', 'std::vector<const Property*>', 'std::list<IAlgorithm*>', 'std::list<IService*>', 'std::list<const IFactory*>', 'std::vector<IRegistry*>', 'SimpleProperty', 'SimplePropertyRef', 'IService', 'IAlgorithm', 'ISvcManager', 'IAlgManager', 'IJobOptionsSvc', 'ISvcLocator', 'IEventProcessor', 'IDataProviderSvc', 'IDataManagerSvc', 'IRegistry', 'ContainedObject', 'std::vector<const ContainedObject*>', 'DataObject', 'IHistogramSvc', 'AIDA::I', 'Algorithm', 'Service', 'GaudiPython::PyAlgorithm', 'GaudiPython::PyAlgorithmWrap', 'IParticlePropertySvc', 'ParticleProperty', 'StoreGateSvc', 'IStoragePolicy', 'CharDbArray', 'DoubleDbArray', 'FloatDbArray', 'IntDbArray', 'LongDbArray', 'ShortDbArray', 'AthenaEventLoopMgr', 'MinimalEventLoopMgr', 'PyAthenaEventLoopMgr', 'NTuple::Directory', 'NTuple::File ', 'NTuple::Tuple', 'INTuple', 'NTuple::Tuple', 'greater<int>', 'allocator<', 'string']"
+S'ProxyProviderSvc'
 p300
-ssS'IncidentProcAlg2'
+ssS'ConditionStore'
 p301
 (dp302
-S'ExtraOutputs'
+S'IncidentSvc'
 p303
-S'[]'
+S'IncidentSvc'
 p304
-sS'NeededResources'
+sS'ProxyProviderSvc'
 p305
-S'[]'
+S'ProxyProviderSvc'
 p306
-sS'ExtraInputs'
+ssS'IncidentProcAlg1'
 p307
-S'[]'
-p308
-ssS'DetectorStore'
+(dp308
+S'ExtraOutputs'
 p309
-(dp310
-S'IncidentSvc'
+S'[]'
+p310
+sS'NeededResources'
 p311
-S'IncidentSvc'
+S'[]'
 p312
-sS'ProxyProviderSvc'
+sS'ExtraInputs'
 p313
-S'ProxyProviderSvc'
+S'[]'
 p314
-ssS'ConditionStore'
+ssS'HistogramDataSvc'
 p315
 (dp316
-S'IncidentSvc'
+S'Input'
 p317
-S'IncidentSvc'
+S'[]'
 p318
-sS'ProxyProviderSvc'
+sS'InhibitPathes'
 p319
-S'ProxyProviderSvc'
+S'[]'
 p320
-ssS'IncidentProcAlg1'
+ssS'HistoryStore'
 p321
 (dp322
-S'ExtraOutputs'
-p323
-S'[]'
-p324
-sS'NeededResources'
-p325
-S'[]'
-p326
-sS'ExtraInputs'
-p327
-S'[]'
-p328
-ssS'HistogramDataSvc'
-p329
-(dp330
-S'Input'
-p331
-S'[]'
-p332
-sS'InhibitPathes'
-p333
-S'[]'
-p334
-ssS'HistoryStore'
-p335
-(dp336
 S'IncidentSvc'
-p337
+p323
 S'IncidentSvc'
-p338
+p324
 sS'ProxyProviderSvc'
-p339
+p325
 S'ProxyProviderSvc'
-p340
+p326
 ss.ccollections
 defaultdict
 p1
@@ -902,7 +875,7 @@ p105
 g7
 sS'SEARCHPATH'
 p106
-S'.:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/AthenaExternals/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-02-20T2138/GAUDI/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions'
+S'.:/afs/cern.ch/work/s/smh/MR_21423/bld/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/GAUDI/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/afs/cern.ch/work/s/smh/MR_21423/bld:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-03-03T2138/AthenaExternals/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/jobOptions'
 p107
 sS'AuditInitialize'
 p108
-- 
GitLab


From 876fbe8fe703419bdfbc9af687253b6b432e5423 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 4 Mar 2019 17:46:38 +0100
Subject: [PATCH 203/404] Thread-safety fixes for muon trigger algorithms

Enable thread-safety checker for TrigMuonEF and TrigMuSuperEF. Mark the
following classes as not thread-safe (legacy trigger):
- TrigMuonEFCaloIsolation
- TrigMuonEFStandaloneTrackTool
---
 .../TrigAlgorithms/TrigMuSuperEF/ATLAS_CHECK_THREAD_SAFETY | 1 +
 .../TrigAlgorithms/TrigMuonEF/ATLAS_CHECK_THREAD_SAFETY    | 1 +
 Trigger/TrigAlgorithms/TrigMuonEF/CMakeLists.txt           | 1 +
 Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.cxx | 7 +------
 Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.h   | 4 ++--
 .../TrigMuonEF/src/TrigMuonEFCaloIsolation.cxx             | 2 ++
 .../TrigMuonEF/src/TrigMuonEFCaloIsolation.h               | 3 +++
 .../TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx       | 2 ++
 .../TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h         | 3 +++
 9 files changed, 16 insertions(+), 8 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigMuSuperEF/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigAlgorithms/TrigMuonEF/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigAlgorithms/TrigMuSuperEF/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigMuSuperEF/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..b3ed46b4372
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigMuSuperEF/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigMuSuperEF
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigMuonEF/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..ff684a30c12
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigMuonEF
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigMuonEF/CMakeLists.txt
index 7f51581ec6b..aee4a3328bc 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/CMakeLists.txt
@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Calorimeter/CaloEvent
                           Control/AthenaBaseComps
                           Control/AthenaKernel
+                          Control/CxxUtils
                           Control/StoreGate
                           DetectorDescription/IRegionSelector
                           Event/EventPrimitives
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.cxx
index c390b495519..1d2d43fdfc1 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.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 <cstdlib>
@@ -8,16 +8,11 @@
 #include "InDetTrkRoiMaker.h"
 
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
-// can use standard TrigRoiDescriptor for this now
-// #include "TrigSteeringEvent/TrigSuperRoi.h"
-// #include "IRegionSelector/IRoiDescriptor.h"
 #include "TrigNavigation/TriggerElement.h"
 
 #include "TrigInDetEvent/TrigInDetTrackCollection.h"
 #include "EventPrimitives/EventPrimitivesHelpers.h"
 
-const char* InDetTrkRoiMaker::s_scanModeNames[InDetTrkRoiMaker::kNumberOfModes] = { "FullScan", "SeededScan", "HybridScan" };
-
 namespace {
   inline std::string quote( const std::string& s ) { return "\"" + s + "\""; }
 }
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.h
index 329fb32e13c..84c04b71042 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.h
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/InDetTrkRoiMaker.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 TRIGMUONEF_INDETTRKROIMAKER_H
@@ -51,7 +51,7 @@ class InDetTrkRoiMaker : public HLT::FexAlgo {
   //
   // static data
   //
-  static const char* s_scanModeNames[kNumberOfModes];
+  static constexpr const char* s_scanModeNames[kNumberOfModes]{ "FullScan", "SeededScan", "HybridScan" };
   
   //
   // static functions
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.cxx
index b49840fbaed..ea1f2011c0a 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.cxx
@@ -14,6 +14,8 @@
 #include <iostream>
 #include <deque>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 // ------------------------------------------------------------------------------------------------------
 /**
  * Standard constructor for the calo isolation algo.
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.h
index 6585fbb8dd0..f7038dc2037 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.h
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFCaloIsolation.h
@@ -13,6 +13,9 @@
 #include "xAODCaloEvent/CaloClusterContainer.h"
 #include "CaloEvent/CaloCellContainer.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class StoreGateSvc;
 class IsoMuonFeature;
 
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
index 26f19d9abd6..ff1e1da6aec 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.cxx
@@ -66,6 +66,8 @@
 
 #include "TrigMuonEFUtils.icc"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 #if DEBUG_ROI_VS_FULL
 #include <set> //used in the method sanity_check
 #endif
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
index 3bad6a625fd..a8a7a2660ce 100644
--- a/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/TrigMuonEFStandaloneTrackTool.h
@@ -36,6 +36,9 @@
 #include "MuonCombinedEvent/MuonCandidateCollection.h"
 #include <fstream>
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 #define DEBUG_ROI_VS_FULL false
 
 /**
-- 
GitLab


From 405f1d658d9bb54cbf87c7f27e0a2b1ad5916e2a Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Mon, 4 Mar 2019 18:16:00 +0100
Subject: [PATCH 204/404] Fix sequences

---
 Control/AthenaConfiguration/python/MainServicesConfig.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py
index fa8ddfe57d0..e230efaf380 100644
--- a/Control/AthenaConfiguration/python/MainServicesConfig.py
+++ b/Control/AthenaConfiguration/python/MainServicesConfig.py
@@ -24,12 +24,12 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
 
     #Build standard sequences:
     cfg.addSequence(AthSequencer('AthAlgEvtSeq',Sequential=True, StopOverride=True),parentName="AthMasterSeq") 
-    cfg.addSequence(AthSequencer('AthOutSeq',Prompt=False),parentName="AthMasterSeq")
+    cfg.addSequence(AthSequencer('AthOutSeq',StopOverride=True),parentName="AthMasterSeq")
     cfg.addSequence(AthSequencer('AthRegSeq'),parentName="AthMasterSeq")
 
     cfg.addSequence(AthSequencer('AthBeginSeq',Sequential=True),parentName='AthAlgEvtSeq')
     cfg.addSequence(AthSequencer('AthAllAlgSeq'),parentName='AthAlgEvtSeq') 
-    cfg.addSequence(AthSequencer('AthAlgSeq',Sequential=False,IgnoreFilterPassed=True),parentName='AthAllAlgSeq')
+    cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq')
     cfg.addSequence(AthSequencer('AthEndSeq',Sequential=True),parentName='AthAlgEvtSeq') 
     cfg.addSequence(AthSequencer('AthCondSeq'),parentName='AthAllAlgSeq')
 
@@ -37,10 +37,10 @@ def MainServicesSerialCfg(LoopMgr='AthenaEventLoopMgr'):
     from AthenaServices.AthenaServicesConf import AthIncFirerAlg
     from GaudiCoreSvc.GaudiCoreSvcConf import IncidentProcAlg
 
-    cfg.addEventAlgo(AthIncFirerAlg("BeginIncFiringAlg",Incidents=['BeginEvent']),sequenceName='AthBeginSeq')
+    cfg.addEventAlgo(AthIncFirerAlg("BeginIncFiringAlg",FireSerial=False,Incidents=['BeginEvent']),sequenceName='AthBeginSeq')
     cfg.addEventAlgo(IncidentProcAlg('IncidentProcAlg1'),sequenceName='AthBeginSeq')
 
-    cfg.addEventAlgo(AthIncFirerAlg('EndIncFiringAlg',Incidents=['EndEvent']), sequenceName="AthEndSeq")
+    cfg.addEventAlgo(AthIncFirerAlg('EndIncFiringAlg',FireSerial=False,Incidents=['EndEvent']), sequenceName="AthEndSeq")
     cfg.addEventAlgo(IncidentProcAlg('IncidentProcAlg2'),sequenceName="AthEndSeq")
 
     #Basic services:
-- 
GitLab


From 1cb33a5f44eb4bc2083f80e4eb204f78bb1f0930 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Mon, 4 Mar 2019 18:16:34 +0100
Subject: [PATCH 205/404] New bootstrap-generating test, to compare CA and
 athena

---
 Control/AthenaConfiguration/python/testEmpty.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 Control/AthenaConfiguration/python/testEmpty.py

diff --git a/Control/AthenaConfiguration/python/testEmpty.py b/Control/AthenaConfiguration/python/testEmpty.py
new file mode 100644
index 00000000000..e3a40667340
--- /dev/null
+++ b/Control/AthenaConfiguration/python/testEmpty.py
@@ -0,0 +1,14 @@
+#Generate CA pickle files from athena and CA
+from AthenaCommon.Configurable import Configurable
+Configurable.configurableRun3Behavior=1
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+acc = ComponentAccumulator()
+print "bootstrap_test.pkl"
+with file("bootstrap_test.pkl", "w") as p:
+    acc.store( p, nEvents=10, useBootStrapFile=True, threaded=False )
+    p.close()
+
+print "bootstrap_CA_test.pkl"
+with file("bootstrap_CA_test.pkl", "w") as p:
+    acc.store( p, nEvents=10, useBootStrapFile=False, threaded=False )
+    p.close()
-- 
GitLab


From b372cdd8e753ac0a45a189045fc8e39655320c77 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Mon, 4 Mar 2019 18:21:18 +0100
Subject: [PATCH 206/404] using unique_ptr for m_decompression_buffer in
 MdtCalibDbAlg

---
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h     |  2 +-
 .../src/MdtCalibDbAlg.cxx                     | 24 +++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
index 7da69fc6bbf..5b960727eea 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
@@ -118,7 +118,7 @@ class MdtCalibDbAlg: public AthAlgorithm {
 
   //decompression buffer and length of buffer
   uLongf m_buffer_length;
-  Bytef *m_decompression_buffer;
+  std::unique_ptr<Bytef> m_decompression_buffer;
   
   //wrapper function for the zlib uncompress, 
   //that automatically creates or increases the buffer if needed.    
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
index a72837d9787..f1be8322d46 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
@@ -80,7 +80,7 @@ MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator)
   m_speed_of_light(299.792458),
   m_AtRndmGenSvc ("AtRndmGenSvc", name),
   m_buffer_length(0),
-  m_decompression_buffer(NULL),
+  m_decompression_buffer(nullptr),
   m_readKeyRt("/MDT/RTBLOB"),
   m_readKeyTube("/MDT/T0BLOB"),
   m_writeKeyRt("MdtRtRelationCollection"),
@@ -410,7 +410,7 @@ StatusCode MdtCalibDbAlg::loadRt(){
 	ATH_MSG_FATAL( "Cannot uncompress buffer" );
 	return StatusCode::FAILURE;
       }
-      std::string istr(reinterpret_cast<char*>(m_decompression_buffer));
+      std::string istr(reinterpret_cast<char*>(m_decompression_buffer.get()));
       ATH_CHECK( extractString(istr, header, "\n") );
       ATH_CHECK( extractString(istr, payload, "\n") );
       if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
@@ -780,7 +780,7 @@ StatusCode MdtCalibDbAlg::loadTube(){
 	ATH_MSG_FATAL( "Cannot uncompress buffer" );
 	return StatusCode::FAILURE;
       }
-      std::string istr(reinterpret_cast<char*>(m_decompression_buffer));
+      std::string istr(reinterpret_cast<char*>(m_decompression_buffer.get()));
       ATH_CHECK( extractString(istr, header, "\n") );
       ATH_CHECK( extractString(istr, payload, "\n") );
       if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
@@ -998,19 +998,19 @@ MuonCalib::MdtTubeCalibContainer* MdtCalibDbAlg::buildMdtTubeCalibContainer(cons
 inline bool MdtCalibDbAlg::uncompressInMyBuffer(const coral::Blob &blob) {
   if (!m_decompression_buffer) {
     m_buffer_length= 50000;
-    m_decompression_buffer = new Bytef[m_buffer_length];
+    m_decompression_buffer.reset(new Bytef[m_buffer_length]);
   }
   uLongf actual_length;	
   while(1) {
     actual_length=m_buffer_length;
-    int res(uncompress(m_decompression_buffer, &actual_length, reinterpret_cast<const Bytef *>(blob.startingAddress()), static_cast<uLongf>(blob.size())));
+    int res(uncompress(m_decompression_buffer.get(), &actual_length, reinterpret_cast<const Bytef *>(blob.startingAddress()), static_cast<uLongf>(blob.size())));
     if (res == Z_OK) break;
     //double buffer if it was not big enough
     if( res == Z_BUF_ERROR) {
       m_buffer_length*=2;
       ATH_MSG_VERBOSE(  "Increasing buffer to " << m_buffer_length);
-      delete [] m_decompression_buffer;
-      m_decompression_buffer = new Bytef[m_buffer_length];
+      m_decompression_buffer.reset();
+      m_decompression_buffer.reset(new Bytef[m_buffer_length]);
       continue;
     }
     //something else is wrong
@@ -1018,14 +1018,14 @@ inline bool MdtCalibDbAlg::uncompressInMyBuffer(const coral::Blob &blob) {
   }
   //append 0 to terminate string, increase buffer if it is not big enough
   if (actual_length >= m_buffer_length)	{
-    Bytef * old_buffer=m_decompression_buffer;
+    std::unique_ptr<Bytef> old_buffer(std::move(m_decompression_buffer));
     size_t old_length=m_buffer_length;
     m_buffer_length*=2;
-    m_decompression_buffer = new Bytef[m_buffer_length];
-    memcpy(m_decompression_buffer, old_buffer, old_length);
-    delete [] old_buffer;
+    m_decompression_buffer.reset(new Bytef[m_buffer_length]);
+    memcpy(m_decompression_buffer.get(), old_buffer.get(), old_length);
+    old_buffer.reset();
   }
-  m_decompression_buffer[actual_length]=0;
+  m_decompression_buffer.get()[actual_length]=0;
   return true;
 }
 
-- 
GitLab


From d3958c2498e9b2df9730070fdcbae935dd014172 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Wed, 20 Feb 2019 18:50:44 +0100
Subject: [PATCH 207/404] Interface TrigUpgradeTest to ART and TrigValTools

Adding exec scripts similar to those in TriggerTest and adapting the fullMenu and NewJO tests to use them.
The two tests are also adapted to be still included in ctest, but with a custom trigger post-exec.
---
 .../TrigUpgradeTest/CMakeLists.txt            | 13 +--
 .../share/checklogTrigUpgradeTest.conf        |  2 +
 .../test/exec_TrigUpgradeTest_art_athenaMT.sh | 82 +++++++++++++++++++
 .../test/exec_TrigUpgradeTest_art_post.sh     | 71 ++++++++++++++++
 .../TrigUpgradeTest/test/test_full_menu.sh    |  5 --
 .../test/test_full_menu_build.sh              | 19 +++++
 .../TrigUpgradeTest/test/test_newJO.sh        | 30 -------
 .../TrigUpgradeTest/test/test_newJO_build.sh  | 48 +++++++++++
 8 files changed, 229 insertions(+), 41 deletions(-)
 create mode 100644 Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
 create mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
 create mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
 delete mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu.sh
 create mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
 delete mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
 create mode 100755 Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 54d8c8d0d79..1812e23ad02 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
@@ -138,8 +138,8 @@ atlas_add_test( jetMenu
 
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_fullMenu )
 atlas_add_test( fullMenu
-   SCRIPT test/test_full_menu.sh
-   EXTRA_PATTERNS "-s TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*|TrigSignatureMoniMT.*HLT_.*"
+   SCRIPT test/test_full_menu_build.sh
+   POST_EXEC_SCRIPT "trig-art-result-parser.sh fullMenu.log \"athena CheckLog RegTest RootComp\""
    PROPERTIES TIMEOUT 1000
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_fullMenu
    )
@@ -174,8 +174,8 @@ atlas_add_test( EmuStepProcessing
 
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO )
 atlas_add_test( NewJO
-   SCRIPT test/test_newJO.sh
-   EXTRA_PATTERNS "-s .*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMoniMT .*INFO.*"
+   SCRIPT test/test_newJO_build.sh
+   POST_EXEC_SCRIPT "trig-art-result-parser.sh NewJO.log \"Configuration athena CheckLog RegTest RootComp\""
    PROPERTIES TIMEOUT 1000
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO
    )
@@ -243,7 +243,8 @@ atlas_add_test( met_menu
    	EXTRA_PATTERNS "-s TrigSignatureMoniMT.*HLT_.*" 	   
     PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_menu 
     )
+
 atlas_install_joboptions( share/*.py )
-atlas_install_data( share/*.ref )
+atlas_install_data( share/*.ref share/*.conf )
 atlas_install_python_modules( python/*.py )
-atlas_install_scripts( test/test* )
+atlas_install_scripts( test/exec*.sh test/test*.sh )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf b/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
new file mode 100644
index 00000000000..8df1e27a9e1
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/checklogTrigUpgradeTest.conf
@@ -0,0 +1,2 @@
+ignore 'xxx Flagged ABCD ERROR*'
+ignore 'DEBUG     Trailer: xxx Trailer*'
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
new file mode 100755
index 00000000000..1a08a195f62
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+#
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+# Trigger ART test execution script based on TriggerTest/test/exec_athena_art_trigger_validation.sh
+#
+echo $(date "+%FT%H:%M %Z")"     Execute Athena test ${NAME}"
+
+### DEFAULTS
+
+if [ -z ${EVENTS} ]; then
+  export EVENTS="1000"
+fi
+
+if [ -z ${SKIPEVENTS} ]; then
+  export SKIPEVENTS="0"
+fi
+
+if [ -z ${JOBOPTION} ]; then
+  export JOBOPTION="TriggerRelease/runHLT_standalone.py"
+fi
+
+if [ -z ${JOB_LOG} ]; then
+  export JOB_LOG="athena.log"
+fi
+
+if [ -z ${INPUT} ]; then
+  export INPUT="run2data"
+fi
+
+if [ -z ${THREADS} ]; then
+  export THREADS="1"
+fi
+
+if [ -z ${SLOTS} ]; then
+  export SLOTS="1"
+fi
+
+###
+
+if [[ $INPUT == "run2data" ]]; then
+  export DS="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"
+elif [[ $INPUT == "run2mc_ttbar" ]]; then
+  export DS="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1,/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000002.pool.root.1"
+else
+  echo "ERROR: input not defined, cannot run"
+  echo "art-result: 1"
+  exit 1
+fi
+
+trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
+
+######################################
+
+if [[ ${FROMPICKLE} == "1" ]]; then
+  echo "Running athena from pickle file ${JOBOPTION}"
+  athena.py \
+  ${JOBOPTION} &> ${JOB_LOG}
+else
+  athena.py \
+  --threads ${THREADS} \
+  --concurrent-events ${SLOTS} \
+  --filesInput ${DS} \
+  --evtMax ${EVENTS} \
+  --skipEvents ${SKIPEVENTS} \
+  -c "${EXTRA}" \
+  ${JOBOPTION} &> ${JOB_LOG}
+fi
+
+######################################
+
+COMMAND=$PREVIOUS_COMMAND ATH_RETURN=$?
+echo ${COMMAND} > command.txt
+echo "Command to reproduce:"
+envsubst < command.txt
+echo "art-result: ${ATH_RETURN} ${JOB_LOG%%.*}"
+echo  $(date "+%FT%H:%M %Z")"     Done executing Athena test ${NAME} with result ${ATH_RETURN}"
+if [ "${ATH_RETURN}" -ne "0" ]; then
+  exit ${ATH_RETURN}
+fi
+
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
new file mode 100755
index 00000000000..fe234cabdd2
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+#
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+# Trigger ART test script with post-exec checks based on TriggerTest/test/exec_art_triggertest_post.sh
+#
+
+echo  $(date "+%FT%H:%M %Z")"     Execute TrigUpgradeTest post processing for test ${NAME}"
+
+### DEFAULTS
+
+if [ -z ${JOB_LOG} ]; then
+  export JOB_LOG="athena.log"
+fi
+
+if [ -z ${TEST} ]; then
+  export TEST="TrigUpgradeTest"
+fi
+
+if [ -z ${REF_FOLDER} ]; then
+  export REF_FOLDER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/${TEST}/ref/${AtlasBuildBranch}/test_${NAME}"
+fi
+
+# Note REGTESTEXP is a GNU grep regexp, not perl regexp
+if [ -z "${REGTESTEXP}" ]; then
+  export REGTESTEXP="REGTEST"
+fi
+
+###
+
+echo $(date "+%FT%H:%M %Z")"     Running checklog"
+timeout 1m check_log.pl --config checklogTrigUpgradeTest.conf --showexcludestats ${JOB_LOG} | tee checklog.log
+
+echo "art-result: ${PIPESTATUS[0]} CheckLog"
+
+###
+
+export JOB_LOG_TAIL=${JOB_LOG%%.*}.tail.${JOB_LOG#*.}
+tail -10000  ${JOB_LOG} > ${JOB_LOG_TAIL}
+
+###
+
+grep -E "${REGTESTEXP}" ${JOB_LOG} > athena.regtest
+
+if [ -f ${REF_FOLDER}/athena.regtest ]; then
+  echo $(date "+%FT%H:%M %Z")"     Running regtest"
+  timeout 1m regtest.pl --inputfile athena.regtest --reffile ${REF_FOLDER}/athena.regtest --linematch ".*" | tee regtest.log
+  echo "art-result: ${PIPESTATUS[0]} RegTest"
+else
+  echo $(date "+%FT%H:%M %Z")"     No reference athena.regtest found in ${REF_FOLDER}"
+  echo "art-result: 999 RegTest"
+fi
+
+mv athena.regtest athena.regtest.new
+
+if [ -f ${REF_FOLDER}/expert-monitoring.root ]; then
+  echo $(date "+%FT%H:%M %Z")"     Running rootcomp"
+  timeout 10m rootcomp.py --skip="TIME_" ${REF_FOLDER}/expert-monitoring.root expert-monitoring.root | tee rootcompout.log
+  echo "art-result: ${PIPESTATUS[0]} RootComp"
+else
+  echo $(date "+%FT%H:%M %Z")"     No reference expert-monitoring.root found in ${REF_FOLDER}"
+  echo "art-result:  999 RootComp"
+fi
+
+###
+
+echo  $(date "+%FT%H:%M %Z")"     Files in directory:"
+ls -lh
+
+echo  $(date "+%FT%H:%M %Z")"     Finished TrigUpgradeTest post processing for test ${NAME}"
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu.sh
deleted file mode 100755
index 4c8037990f9..00000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# art-type: build
-# art-include: master/Athena
-
-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/fullMenu.py
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
new file mode 100755
index 00000000000..fbc058bd459
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# art-description: athenaMT trigger test using the full menu from TrigUpgradeTest job options
+# art-type: build
+# art-include: master/Athena
+# art-output: *.log
+# art-output: *.root
+# art-output: *.regtest.new
+
+export NAME="TrigUpgradeTest_fullMenu_build"
+export SKIPEVENTS=10
+export EVENTS=20
+export THREADS=1
+export SLOTS=1
+export JOBOPTION="TrigUpgradeTest/fullMenu.py"
+export REGTESTEXP="REGTEST|TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*|TrigSignatureMoniMT.*HLT_.*"
+
+source exec_TrigUpgradeTest_art_athenaMT.sh
+source exec_TrigUpgradeTest_art_post.sh
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
deleted file mode 100755
index 88a15a401b9..00000000000
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# art-type: build
-# art-include: master/Athena
-
-rm -rf newJOtest.py bootstrap.pkl bootstrap.py
-
-# this is a hack to pre-confgure scheduler and other MT services, 
-#will be taken away once NEW system has better means to influence the bootstrap content
-cat <<EOF >> bootstrap.py
-from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
-svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True
-svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True
-EOF
-
-athena --threads=1 --config-only=bootstrap.pkl bootstrap.py
-
-
-get_files -jo TrigUpgradeTest/newJOtest.py
-python newJOtest.py # generate pickle
-status=$?
-if [ ${status} -ne 0 ] 
-then
-    echo "ERROR in configuration generation stage, stopping"
-    exit -1
-else
-    echo
-    echo "JOs reading stage finished, launching Athena from pickle file"
-    echo 
-    athena --skipEvents=30 --evtMax=20 newJOtest.pkl
-fi
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
new file mode 100755
index 00000000000..3322b9a0dc0
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# art-description: athenaMT trigger test running the new-style job options from TrigUpgradeTest
+# art-type: build
+# art-include: master/Athena
+# art-output: *.log
+# art-output: *.root
+# art-output: *.regtest.new
+
+export NAME="TrigUpgradeTest_newJO_build"
+export SKIPEVENTS=30
+export EVENTS=20
+export THREADS=1
+export SLOTS=1
+export JOBOPTION="newJOtest.pkl"
+export FROMPICKLE=1
+export REGTESTEXP="REGTEST|.*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMoniMT .*INFO.*"
+
+rm -rf newJOtest.py bootstrap.pkl bootstrap.py
+
+# this is a hack to pre-confgure scheduler and other MT services, 
+#will be taken away once NEW system has better means to influence the bootstrap content
+cat <<EOF >> bootstrap.py
+from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
+svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True
+svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True
+EOF
+
+echo $(date "+%FT%H:%M %Z")"     Execute Athena config-only bootstrap for test ${NAME}"
+athena --threads=${THREADS} --concurrent-events=${SLOTS} --config-only=bootstrap.pkl bootstrap.py &> athena.bootstrap.log
+
+get_files -jo TrigUpgradeTest/newJOtest.py
+
+echo $(date "+%FT%H:%M %Z")"     Generate pickle file for test ${NAME}"
+python newJOtest.py &> athena.pickle.log # generate pickle
+status=$?
+
+if [ ${status} -ne 0 ]; then
+    echo "ERROR in configuration generation stage, stopping"
+    echo "art-result 1 Configuration"
+    exit 1
+else
+    echo
+    echo "JOs reading stage finished, launching Athena from pickle file"
+    echo "art-result 0 Configuration"
+    echo 
+    source exec_TrigUpgradeTest_art_athenaMT.sh
+    source exec_TrigUpgradeTest_art_post.sh
+fi
-- 
GitLab


From d65859b3bd070c5a56e3e8d1076ab237d05e9782 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Wed, 20 Feb 2019 19:07:20 +0100
Subject: [PATCH 208/404] Fix REGTEST message

Remove the print-out of memory address which is different in every execution
---
 .../TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
index efeb806ec18..c8643bc2628 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFexMT.cxx
@@ -203,7 +203,7 @@ StatusCode TrigL2ElectronFexMT::execute() {
 	}
           else{
               ATH_MSG_VERBOSE("REGTEST: TrigElectron: cluster index = " << clusEL.index() <<
-				      " track = "     << trkIter << " eta = " << etaAtCalo << " phi = " << phiAtCalo); 
+				      " eta = " << etaAtCalo << " phi = " << phiAtCalo);
  
 
               xAOD::TrigElectron* trigElec = new xAOD::TrigElectron();
-- 
GitLab


From f4ad4550669da1fc863d8bd338ca1f8aeee29ef0 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Tue, 26 Feb 2019 14:32:31 +0100
Subject: [PATCH 209/404] Update reference path

Try eos first and if not available, try cvmfs. This is a more robust solution because the cvmfs mirror of the eos directory is currently updated only once a day.
---
 .../test/exec_TrigUpgradeTest_art_post.sh          | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
index fe234cabdd2..4059158a66e 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
@@ -18,7 +18,19 @@ if [ -z ${TEST} ]; then
 fi
 
 if [ -z ${REF_FOLDER} ]; then
-  export REF_FOLDER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/${TEST}/ref/${AtlasBuildBranch}/test_${NAME}"
+  # Try eos first
+  export REF_FOLDER="/eos/atlas/atlascerngroupdisk/data-art/grid-input/${TEST}/ref/${AtlasBuildBranch}/test_${NAME}"
+  # If not available, try cvmfs
+  if [ -d ${REF_FOLDER} ]; then
+    echo "Using reference directory from eos: ${REF_FOLDER}"
+  else
+    export REF_FOLDER="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/${TEST}/ref/${AtlasBuildBranch}/test_${NAME}"
+    if [ -d ${REF_FOLDER} ]; then
+      echo "Reference from eos unavailable, using one from cvmfs: ${REF_FOLDER}"
+    else
+      echo "Reference directory for test ${NAME} not available from eos or cvmfs"
+    fi
+  fi
 fi
 
 # Note REGTESTEXP is a GNU grep regexp, not perl regexp
-- 
GitLab


From 22ec4734bf66ec25c463df27b93d14a9ba2c3cb6 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Tue, 26 Feb 2019 15:00:43 +0100
Subject: [PATCH 210/404] fix typo

---
 .../TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
index 3322b9a0dc0..983b250a9c8 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
@@ -36,12 +36,12 @@ status=$?
 
 if [ ${status} -ne 0 ]; then
     echo "ERROR in configuration generation stage, stopping"
-    echo "art-result 1 Configuration"
+    echo "art-result: 1 Configuration"
     exit 1
 else
     echo
     echo "JOs reading stage finished, launching Athena from pickle file"
-    echo "art-result 0 Configuration"
+    echo "art-result: 0 Configuration"
     echo 
     source exec_TrigUpgradeTest_art_athenaMT.sh
     source exec_TrigUpgradeTest_art_post.sh
-- 
GitLab


From 94f5c3f35c7c719fb8630124419282ab6cb12ff9 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Wed, 27 Feb 2019 17:07:14 +0100
Subject: [PATCH 211/404] use IMF math library by default

---
 .../test/exec_TrigUpgradeTest_art_athenaMT.sh             | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
index 1a08a195f62..d58a5565b16 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_athenaMT.sh
@@ -36,6 +36,12 @@ if [ -z ${SLOTS} ]; then
   export SLOTS="1"
 fi
 
+if [ -z ${STDCMATH} ] || [ ${STDCMATH} -eq 0 ]; then
+  export MATHLIBOPT="--imf"
+else
+  export MATHLIBOPT="--stdcmath"
+fi
+
 ###
 
 if [[ $INPUT == "run2data" ]]; then
@@ -55,9 +61,11 @@ trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
 if [[ ${FROMPICKLE} == "1" ]]; then
   echo "Running athena from pickle file ${JOBOPTION}"
   athena.py \
+  ${MATHLIBOPT} \
   ${JOBOPTION} &> ${JOB_LOG}
 else
   athena.py \
+  ${MATHLIBOPT} \
   --threads ${THREADS} \
   --concurrent-events ${SLOTS} \
   --filesInput ${DS} \
-- 
GitLab


From 7b3925def9cb14e605aa1d77e058fefe88498ca4 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sun, 3 Mar 2019 17:09:34 +0100
Subject: [PATCH 212/404] xAODEventInfo: Don't try to write event flags if
 there's no change.

When updating event flags, don't actually write to the aux item
if all the bits we're asking for are already set.
Avoids crashes on rerunning an algorithm if the EventInfo flags
word has been locked.
---
 .../xAOD/xAODEventInfo/Root/EventInfo_v1.cxx  | 41 ++++++++++++++-----
 .../xAODEventInfo/versions/EventInfo_v1.h     |  2 +-
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx b/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
index d60fe19eeb1..bdcb443c26c 100644
--- a/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
+++ b/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
@@ -653,14 +653,20 @@ namespace xAOD {
 
    bool EventInfo_v1::updateEventFlagBit( EventFlagSubDet subDet, size_t bit) const
    {
-      // Get the accessor:
-      const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
-      if( ! acc ) {
+      // Check if the bit makes sense:
+      if( bit >= EF_ERROR_SHIFT ) {
          return false;
       }
 
-      // Check if the bit makes sense:
-      if( bit >= EF_ERROR_SHIFT ) {
+      // Don't try to write if the requested flag is already set.
+      uint32_t existingFlags = (*eventFlagsConstAccessorsV1( subDet ))( *this );
+      if (existingFlags & (1u << bit)) {
+        return true;
+      }
+
+      // Get the accessor:
+      const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
+      if( ! acc ) {
          return false;
       }
 
@@ -692,8 +698,16 @@ namespace xAOD {
    }
 
    bool EventInfo_v1::updateEventFlags( const EventFlagSubDet subDet,
-                                        const uint32_t flags) const
+                                        const uint32_t flags_in) const
    {
+      uint32_t flags = flags_in & EF_BITS;
+
+      // Don't try to write if all requested flags are already set.
+      uint32_t existingFlags = (*eventFlagsConstAccessorsV1( subDet ))( *this );
+      if ((existingFlags | flags) ==  existingFlags) {
+        return true;
+      }
+
       // Get the accessor:
       const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
       if( ! acc ) {
@@ -750,6 +764,16 @@ namespace xAOD {
    bool EventInfo_v1::updateErrorState( const EventFlagSubDet subDet,
                                         const EventFlagErrorState state ) const
    {
+      // Check its value:
+      if( ( state != NotSet ) && ( state != Warning ) && ( state != Error ) ) {
+         return false;
+      }
+
+      // Return without trying to write if the desired state is
+      // already set.
+      if (errorState (subDet) == state) {
+        return true;
+      }
 
       // Get the accessor:
       const SG::AtomicDecorator< uint32_t >* acc = eventFlagsAccessorsV1( subDet );
@@ -757,11 +781,6 @@ namespace xAOD {
          return false;
       }
 
-      // Check its value:
-      if( ( state != NotSet ) && ( state != Warning ) && ( state != Error ) ) {
-         return false;
-      }
-
       // Construct the new value:
       std::atomic<uint32_t>& a = (*acc)(*this);
       uint32_t orig = a;
diff --git a/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
index 918c44d7b0d..42d592eba80 100644
--- a/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
+++ b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
@@ -411,7 +411,7 @@ namespace xAOD {
       /// Turn on a set of event flags for one particular sub-detector.
       /// This does a logical OR of the exising flags and FLAGS.
       bool updateEventFlags( const EventFlagSubDet subDet,
-                             const uint32_t flags ) const;
+                             const uint32_t flags_in ) const;
       /// Update the error state for one particular sub-detector.
       /// The error state may only be increased by this method.
       /// If STATE is less than the current error state, then this method
-- 
GitLab


From 7c132e446ae00d9361f6704612545b4f1a973a47 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sun, 3 Mar 2019 17:12:17 +0100
Subject: [PATCH 213/404] AthenaPoolMultiTest: Finish handle migration.

HandleKey members need to be declared as properties in order
for the scheduler to see them.
---
 .../share/AthenaPoolMultiTestEventNoSplit.ref   |  4 ++--
 .../share/AthenaPoolMultiTestEventSplit.ref     |  4 ++--
 .../AthenaPoolMultiTest/src/AddTrigMap.cxx      |  7 ++-----
 .../AthenaPoolMultiTest/src/AddTrigMap.h        | 17 ++++++++++-------
 .../src/DummyLumirangeTool.cxx                  |  6 +++---
 .../src/DummyLumirangeTool.h                    | 11 ++++++-----
 .../AthenaPoolMultiTest/src/EventSplit.cxx      |  6 ++----
 .../AthenaPoolMultiTest/src/EventSplit.h        | 14 ++++++++------
 .../AthenaPoolMultiTest/src/EventTagWriter.cxx  |  3 +--
 .../AthenaPoolMultiTest/src/EventTagWriter.h    | 11 ++++++-----
 .../src/RunEventTagWriter.cxx                   |  4 +---
 .../AthenaPoolMultiTest/src/RunEventTagWriter.h | 14 ++++++++------
 .../src/TagEventTagWriter.cxx                   |  3 +--
 .../AthenaPoolMultiTest/src/TagEventTagWriter.h | 11 ++++++-----
 14 files changed, 58 insertions(+), 57 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
index 8fa9bc3a1d2..78bb5124f76 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 1
+Splitter1           DEBUG input handles: 3
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 1
+Splitter3           DEBUG input handles: 3
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 Triggered            INFO in initialize()
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
index c738c3a7fc0..eed3760f5f5 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplit.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 1
+Splitter1           DEBUG input handles: 3
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 1
+Splitter3           DEBUG input handles: 3
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 Triggered            INFO in initialize()
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.cxx
index 963ce7ee5fb..ab2ae6d4080 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.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
 */
 
 /**
@@ -17,10 +17,7 @@
     
 AddTrigMap::AddTrigMap(const std::string& name, 
 			ISvcLocator* pSvcLocator) :
-              AthAlgorithm(name, pSvcLocator),
-              m_evt("EventInfo"),
-              m_wftm("MultiTestTrigMap"),
-              m_wftm2("ExcludeTestTrigMap")
+              AthAlgorithm(name, pSvcLocator)
 {}
 
 AddTrigMap::~AddTrigMap() 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.h
index c8ede031e51..65fe68392fe 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/AddTrigMap.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
 */
 
 // AddTrigMap.h
@@ -42,14 +42,17 @@ public:
   AddTrigMap(const std::string& name, ISvcLocator* pSvcLocator);
   virtual ~AddTrigMap();
   
-  virtual StatusCode initialize(); 
-  virtual StatusCode execute();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
 
 private:
-  SG::ReadHandleKey<xAOD::EventInfo> m_evt;
-  SG::WriteHandleKey<FauxTriggerMap> m_wftm;
-  SG::WriteHandleKey<FauxTriggerMap> m_wftm2;
+  SG::ReadHandleKey<xAOD::EventInfo> m_evt
+  { this, "EventInfo", "EventInfo", "" };
+  SG::WriteHandleKey<FauxTriggerMap> m_wftm
+  { this, "MultiTestTrigMap", "MultiTestTrigMap", "" };
+  SG::WriteHandleKey<FauxTriggerMap> m_wftm2
+  { this, "ExcludeTestTrigMap", "ExcludeTestTrigMap", "" };
 
 };
 #endif
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.cxx
index 91cd3ff46e6..c28eccf1201 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.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
 */
 
 /**
@@ -52,9 +52,9 @@ DummyLumirangeTool::DummyLumirangeTool(const std::string& name,
     m_firstrun(0),
     m_rangesize(40),
     m_blocksperrun(200),
-    m_lumitot(1000),
-    m_wcmd(name)
+    m_lumitot(1000)
 {
+    m_wcmd = name;
     declareProperty("StoreName",    m_storeName, "Store to find input metadata during finalize");
     declareProperty("Granularity",  m_lumigran,  "skip size");
     declareProperty("FirstRun",     m_firstrun,  "beginning run number");
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.h
index d76695b0b21..83f641dc1a9 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/DummyLumirangeTool.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 ATHENAPOOLMULTITEST_DUMMYLUMIRANGETOOL_H
@@ -50,11 +50,11 @@ public:
                             ISvcLocator* pSvcLocator);
 
   /// Initialize DummyLumirangeTool
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
 
   /// Terminate DummyLumirangeTool
-  virtual StatusCode finalize();
+  virtual StatusCode finalize() override;
 
 protected:
 
@@ -64,7 +64,8 @@ protected:
   IntegerProperty  m_rangesize, m_blocksperrun, m_lumitot;
 
 private:
-  SG::WriteHandleKey<CollectionMetadataContainer> m_wcmd;
+  SG::WriteHandleKey<CollectionMetadataContainer> m_wcmd
+  { this, "WCmd", "", "" };
 
 };
 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.cxx
index a548b3fc0eb..ce63682ddc8 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.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
 */
 
 /**
@@ -25,9 +25,7 @@
 EventSplit::EventSplit(const std::string& name, ISvcLocator* pSvcLocator) : 
    AthFilterAlgorithm(name, pSvcLocator), 
    m_l1bits(0),
-   m_l2bits(0),
-   m_evt("EventInfo"),
-   m_rftm("MultiTestTrigMap")
+   m_l2bits(0)
 {
    // Declare the properties
    declareProperty("L1bitmask", m_l1bits);
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.h
index f8c40cd7b4f..faf6f58275f 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventSplit.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
 */
 
 // EventSplit.h
@@ -38,14 +38,16 @@ public:
   EventSplit(const std::string& name, ISvcLocator* pSvcLocator);
   virtual ~EventSplit();
   
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
   
 private:
   unsigned int m_l1bits;    /// level 1 bit mask 
   unsigned int m_l2bits;    /// level 2 bit mask 
-  SG::ReadHandleKey<xAOD::EventInfo> m_evt;
-  SG::ReadHandleKey<FauxTriggerMap> m_rftm;
+  SG::ReadHandleKey<xAOD::EventInfo> m_evt
+  { this, "EventInfo", "EventInfo", "" };
+  SG::ReadHandleKey<FauxTriggerMap> m_rftm
+  { this, "MultiTestTrigMap", "MultiTestTrigMap", "" };
 };
 #endif
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.cxx
index 154e76db42f..4f8fc693a13 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.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
 */
 
 /**
@@ -27,7 +27,6 @@
 EventTagWriter::EventTagWriter(const std::string& name, 
                                ISvcLocator* pSvcLocator) 
     : AthAlgorithm(name, pSvcLocator),
-      m_evt("EventInfo"),
       m_attribListSpec(0),
       m_maxNum(5)
 {
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.h
index 47628c812c9..092411d8928 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/EventTagWriter.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 ATHENAPOOLMULTITEST_EVENTTAGWRITER_H
@@ -50,22 +50,23 @@ class EventTagWriter : public AthAlgorithm
      * @brief Defines event tag metadata schema
      * @return Status of method execution success
      */
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /**
      * @brief Stores dummy event tag metadata in attribute list object
      * @return Status of method execution success
      */
-    virtual StatusCode execute();
+    virtual StatusCode execute() override;
 
     /**
      * @brief Prints confirmation message
      * @return Status of method execution success
      */
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
 
   private:
-    SG::ReadHandleKey<xAOD::EventInfo> m_evt;
+    SG::ReadHandleKey<xAOD::EventInfo> m_evt
+    { this, "EventInfo", "EventInfo", "" };
 
     /// Specification of event tag metadata schema
     coral::AttributeListSpecification* m_attribListSpec;
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.cxx
index d6ce95284a6..ad7600a61dd 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.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
 */
 
 /**
@@ -25,8 +25,6 @@
 RunEventTagWriter::RunEventTagWriter(const std::string& name, 
                                      ISvcLocator* pSvcLocator) 
     : AthAlgorithm(name, pSvcLocator),
-      m_evt("EventInfo"),
-      m_attribList("RunEventTag"),
       m_attribListSpec(0)
 {}
 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.h
index 20e9e51ff3e..36f76214358 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/RunEventTagWriter.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 ATHENAPOOLMULTITEST_RUNEVENTTAGWRITER_H
@@ -59,26 +59,28 @@ class RunEventTagWriter : public AthAlgorithm
      * @brief Defines attribute list specification object
      * @return Status of method execution success
      */
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /** 
      * @brief Stores dummy event tag metadata in attribute list object
      * @return Status of method execution success
      */
-    virtual StatusCode execute();
+    virtual StatusCode execute() override;
 
     /**
      * @brief Prints confirmation message
      * @return Status of method execution success
      */
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
 
   private:
 
     StatusCode fillTag(const xAOD::EventInfo*, AthenaAttributeList*);
 
-    SG::ReadHandleKey<xAOD::EventInfo> m_evt;
-    SG::WriteHandleKey<AthenaAttributeList> m_attribList;
+    SG::ReadHandleKey<xAOD::EventInfo> m_evt
+    { this, "EventInfo", "EventInfo", "" };
+    SG::WriteHandleKey<AthenaAttributeList> m_attribList
+    { this, "RunEventTag", "RunEventTag", "" };
 
     /// Specification of the event tag metadata schema
     coral::AttributeListSpecification* m_attribListSpec;
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.cxx b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.cxx
index 0e0e502190b..403e07ada34 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.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
 */
 
 /**
@@ -31,7 +31,6 @@
 TagEventTagWriter::TagEventTagWriter(const std::string& name, 
                                ISvcLocator* pSvcLocator) 
     : AthAlgorithm(name, pSvcLocator),
-      m_evt("EventInfo"),
       m_attribListSpec(0),
       m_maxNum(5)
 {
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.h b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.h
index 2ba35f2e396..9f59cade785 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/src/TagEventTagWriter.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 ATHENAPOOLMULTITEST_TAGEVENTTAGWRITER_H
@@ -49,22 +49,23 @@ class TagEventTagWriter : public AthAlgorithm
      * @brief Defines event tag metadata schema
      * @return Status of method execution success
      */
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /**
      * @brief Stores dummy event tag metadata in attribute list object
      * @return Status of method execution success
      */
-    virtual StatusCode execute();
+    virtual StatusCode execute() override;
 
     /**
      * @brief Prints confirmation message
      * @return Status of method execution success
      */
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
 
   private:
-    SG::ReadHandleKey<xAOD::EventInfo> m_evt;
+    SG::ReadHandleKey<xAOD::EventInfo> m_evt
+    { this, "EventInfo", "EventInfo", "" };
 
     /// Specification of event tag metadata schema
     AthenaAttributeListSpecification* m_attribListSpec;
-- 
GitLab


From 58338229cbbb36f9776139dc6f34c3a815b4e59a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sun, 3 Mar 2019 17:19:48 +0100
Subject: [PATCH 214/404] IdDictParser: Enable thread-safety checker.

Enable thread-safety static checker.  Fix identified issues.
---
 .../IdDictParser/ATLAS_CHECK_THREAD_SAFETY    |   1 +
 .../IdDictParser/IdDictParser/IdDictParser.h  |   6 +-
 .../IdDictParser/src/IdDictParser.cxx         | 148 ++++++++----------
 .../IdDictParser/test/test_indet_id.cxx       |   4 +-
 4 files changed, 73 insertions(+), 86 deletions(-)
 create mode 100644 DetectorDescription/IdDictParser/IdDictParser/ATLAS_CHECK_THREAD_SAFETY

diff --git a/DetectorDescription/IdDictParser/IdDictParser/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/IdDictParser/IdDictParser/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6eadd1bd71a
--- /dev/null
+++ b/DetectorDescription/IdDictParser/IdDictParser/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/IdDictParser
diff --git a/DetectorDescription/IdDictParser/IdDictParser/IdDictParser.h b/DetectorDescription/IdDictParser/IdDictParser/IdDictParser.h
index 9f60b01da0d..1f856bdbede 100755
--- a/DetectorDescription/IdDictParser/IdDictParser/IdDictParser.h
+++ b/DetectorDescription/IdDictParser/IdDictParser/IdDictParser.h
@@ -1,9 +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
 */
 
-#ifndef __IdDictParser_h__  
-#define __IdDictParser_h__  
+#ifndef IDDICTPARSER_IDDICTPARSER_H
+#define IDDICTPARSER_IDDICTPARSER_H
   
 #include "XMLCoreParser/XMLCoreParser.h"  
 #include "IdDict/IdDictDefs.h"  
diff --git a/DetectorDescription/IdDictParser/src/IdDictParser.cxx b/DetectorDescription/IdDictParser/src/IdDictParser.cxx
index 7a4b0e9cc1c..128cdcab8d3 100755
--- a/DetectorDescription/IdDictParser/src/IdDictParser.cxx
+++ b/DetectorDescription/IdDictParser/src/IdDictParser.cxx
@@ -15,58 +15,23 @@ namespace IdDictParserNS
   class Debugger 
   { 
   public: 
-    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 void up () 
-    { 
-      level (1); 
-    } 
-    
-    static void down () 
-    { 
-      level (-1); 
-    } 
+    static bool get_debug_state()
+    {
+      return ::getenv ("XMLDEBUG") != 0;
+    }
+    static bool debug ()
+    {
+      static const bool debug_state = get_debug_state();
+      return debug_state;
+    }
     
-    static void tab () 
-    { 
-      int n = level (); 
-      
+    static void tab (int n) 
+    {
       for (int i = 0; i < n; ++i) 
 	{ 
 	  std::cout << " "; 
 	} 
     } 
-    
-  private: 
-    
-    static int level (int d = 0) 
-    { 
-      static int n = 0; 
-      
-      n += d; 
-      
-      return (n); 
-    } 
-    
   }; 
   
   class IdDictBaseFactory : public XMLCoreFactory  
@@ -185,21 +150,21 @@ IdDictMgr& IdDictParser::parse (const std::string& file_name, std::string tag)
  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictParser::parse1>" << std::endl; 
+      std::cout << "IdDictParser::parse1>" << std::endl; 
     } 
  
   m_idd.resolve_references (); 
  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictParser::parse2>" << std::endl; 
+      std::cout << "IdDictParser::parse2>" << std::endl; 
     } 
  
   m_idd.generate_implementation (tag); 
  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictParser::parse3>" << std::endl; 
+      std::cout << "IdDictParser::parse3>" << std::endl; 
     } 
  
   return (m_idd); 
@@ -208,14 +173,14 @@ IdDictMgr& IdDictParser::parse (const std::string& file_name, std::string tag)
 void IdDictBaseFactory::do_start (XMLCoreParser& parser,   
 				  const XMLCoreNode& node)  
 {  
-  Debugger::up (); 
+  parser.up (); 
   idd_start ((IdDictParser&) parser, node);  
 }  
   
 void IdDictBaseFactory::do_end (XMLCoreParser& parser, const XMLCoreNode& node)  
 {  
   idd_end ((IdDictParser&) parser, node);  
-  Debugger::down (); 
+  parser.down (); 
 }  
   
 void IdDictBaseFactory::idd_start (IdDictParser& /*parser*/,   
@@ -240,17 +205,19 @@ void IdDictMgrFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictMgrFactoryFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "IdDictMgrFactoryFactory::idd_start>" << std::endl; 
     } 
   parser.m_idd.set_DTD_version(get_value (node, "DTD_version"));
 }  
   
-void IdDictMgrFactory::idd_end (IdDictParser& /*parser*/,   
+void IdDictMgrFactory::idd_end (IdDictParser& parser,   
 				const XMLCoreNode& /*node*/)  
 { 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "IdDictMgrFactoryFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "IdDictMgrFactoryFactory::idd_end>" << std::endl; 
     } 
 } 
   
@@ -258,7 +225,8 @@ void DictionaryFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "DictionaryFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "DictionaryFactory::idd_start>" << std::endl; 
     } 
  
   parser.m_dictionary = new IdDictDictionary; 
@@ -273,7 +241,8 @@ void DictionaryFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node
 { 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "DictionaryFactory::idd_end> d=" << parser.m_dictionary << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "DictionaryFactory::idd_end> d=" << parser.m_dictionary << std::endl; 
     } 
  
   if (parser.m_dictionary != 0) 
@@ -288,7 +257,8 @@ void FieldFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "FieldFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "FieldFactory::idd_start>" << std::endl; 
     } 
  
   IdDictField* field = new IdDictField; 
@@ -310,7 +280,8 @@ void FieldFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node*/)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "FieldFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "FieldFactory::idd_end>" << std::endl; 
     } 
 
   if (parser.m_field != 0) 
@@ -326,7 +297,8 @@ void LabelFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "LabelFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "LabelFactory::idd_start>" << std::endl; 
     } 
  
   IdDictLabel* label = new IdDictLabel; 
@@ -346,11 +318,12 @@ void LabelFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
   else delete label; 
 }  
   
-void LabelFactory::idd_end (IdDictParser& /*parser*/, const XMLCoreNode& /*node*/)  
+void LabelFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node*/)  
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "LabelFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "LabelFactory::idd_end>" << std::endl; 
     } 
 }  
   
@@ -358,16 +331,18 @@ void AltRegionsFactory::idd_start (IdDictParser& parser, const XMLCoreNode& /*no
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "AltRegionsFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "AltRegionsFactory::idd_start>" << std::endl; 
     } 
 
   IdDictAltRegions* altregions = new IdDictAltRegions;
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "AltRegionsFactory::idd_start> previous=" << parser.m_altregions
-				  << " new=" << altregions
-				  << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "AltRegionsFactory::idd_start> previous=" << parser.m_altregions
+                << " new=" << altregions
+                << std::endl; 
     } 
 
   parser.m_altregions = altregions;
@@ -377,7 +352,8 @@ void AltRegionsFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "AltRegionsFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "AltRegionsFactory::idd_end>" << std::endl; 
     } 
  
   if (parser.m_altregions != 0) 
@@ -417,7 +393,8 @@ void RegionFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RegionFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "RegionFactory::idd_start>" << std::endl; 
     } 
  
   parser.m_region = new IdDictRegion; 
@@ -606,11 +583,12 @@ void RegionFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RegionFactory::idd_start> name, group, tag, next eta, prev/next samp, prev/next subdet "
-				  << parser.m_region->m_name << " " 
-				  << parser.m_region->m_group << " " 
-				  << parser.m_region->m_tag << " " 
-				  << parser.m_region->m_next_abs_eta << " ";
+      Debugger::tab (parser.level());
+      std::cout << "RegionFactory::idd_start> name, group, tag, next eta, prev/next samp, prev/next subdet "
+                << parser.m_region->m_name << " " 
+                << parser.m_region->m_group << " " 
+                << parser.m_region->m_tag << " " 
+                << parser.m_region->m_next_abs_eta << " ";
       for (unsigned int i = 0; i < parser.m_region->m_prev_samp_names.size(); ++i) {
 	  std::cout << parser.m_region->m_prev_samp_names[i] << " ";
       }
@@ -636,7 +614,8 @@ void RegionFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node*/)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RegionFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "RegionFactory::idd_end>" << std::endl; 
     } 
  
   if (parser.m_region != 0) 
@@ -682,7 +661,8 @@ void SubRegionFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "SubRegionFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "SubRegionFactory::idd_start>" << std::endl; 
     } 
  
   parser.m_subregion = new IdDictSubRegion; 
@@ -693,7 +673,8 @@ void SubRegionFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node*
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "SubRegionFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "SubRegionFactory::idd_end>" << std::endl; 
     } 
  
   if (parser.m_subregion != 0) 
@@ -705,11 +686,12 @@ void SubRegionFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*node*
     } 
 }  
   
-void RegionEntryFactory::idd_start (IdDictParser& /*parser*/, const XMLCoreNode& /*node*/)  
+void RegionEntryFactory::idd_start (IdDictParser& parser, const XMLCoreNode& /*node*/)  
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RegionEntryFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "RegionEntryFactory::idd_start>" << std::endl; 
     } 
 } 
  
@@ -717,7 +699,8 @@ void RegionEntryFactory::idd_end (IdDictParser& parser, const XMLCoreNode& /*nod
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RegionEntryFactory::idd_end>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "RegionEntryFactory::idd_end>" << std::endl; 
     } 
  
   if (parser.m_regionentry != 0) 
@@ -734,7 +717,8 @@ void RangeFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "RangeFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "RangeFactory::idd_start>" << std::endl; 
     } 
  
   IdDictRange* range = new IdDictRange; 
@@ -855,7 +839,8 @@ void ReferenceFactory::idd_start (IdDictParser& parser, const XMLCoreNode& node)
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "ReferenceFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "ReferenceFactory::idd_start>" << std::endl; 
     } 
  
   IdDictReference* reference = new IdDictReference; 
@@ -871,7 +856,8 @@ void DictionaryRefFactory::idd_start (IdDictParser& parser, const XMLCoreNode& n
 {  
   if (Debugger::debug ()) 
     { 
-      Debugger::tab (); std::cout << "DictionaryRefFactory::idd_start>" << std::endl; 
+      Debugger::tab (parser.level());
+      std::cout << "DictionaryRefFactory::idd_start>" << std::endl; 
     } 
  
   IdDictDictionaryRef* dictionaryref = new IdDictDictionaryRef; 
diff --git a/DetectorDescription/IdDictParser/test/test_indet_id.cxx b/DetectorDescription/IdDictParser/test/test_indet_id.cxx
index 9893d37f568..e818057081d 100755
--- a/DetectorDescription/IdDictParser/test/test_indet_id.cxx
+++ b/DetectorDescription/IdDictParser/test/test_indet_id.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
 */
 
 
@@ -822,7 +822,7 @@ int main (int argc, char* argv[])
 	    std::cout << "Could not find 'part' field"
 		      << " in dictionary " << atlasDict->m_name
 		      << std::endl;
-	    exit (1);
+	    return 1;
 	}
     
 	std::vector <IdDictLabel*>::const_iterator itLabels = partField->m_labels.begin();
-- 
GitLab


From 378698ad5950a0537b71aa484e0979e844d9a077 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sun, 3 Mar 2019 17:13:51 +0100
Subject: [PATCH 215/404] XMLCoreParser: Enabling thread-safety checker for
 IdDictParser.

Keep track of element nesting in XMLCoreParser, to allow getting rid
of some statics in IdDictParser.
---
 .../XMLCoreParser/XMLCoreParser.h             |  5 +++++
 Tools/XMLCoreParser/src/XMLCoreParser.cxx     | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h b/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
index d7f242ae916..b7dd74a0088 100755
--- a/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
+++ b/Tools/XMLCoreParser/XMLCoreParser/XMLCoreParser.h
@@ -122,6 +122,10 @@ public:
                          std::unique_ptr<XMLCoreFactory> factory); 
   void register_external_entity (const std::string& name, const std::string& file_name); 
   void register_text_entity (const std::string& name, const std::string& text);
+
+  void up();
+  void down();
+  int level() const;
  
   
 private: 
@@ -134,6 +138,7 @@ private:
   typedef std::map <std::string, std::unique_ptr<XMLCoreFactory> > FactoryMap; 
   FactoryMap m_factories;
   std::unique_ptr<XMLCoreFactory> m_default_factory;
+  int m_level = 0;
 }; 
  
 #endif 
diff --git a/Tools/XMLCoreParser/src/XMLCoreParser.cxx b/Tools/XMLCoreParser/src/XMLCoreParser.cxx
index bdeeea33a25..140d0d93017 100755
--- a/Tools/XMLCoreParser/src/XMLCoreParser.cxx
+++ b/Tools/XMLCoreParser/src/XMLCoreParser.cxx
@@ -370,6 +370,7 @@ void XMLCoreParser::set_create_entity_reference_nodes ()
  
 XMLCoreNode XMLCoreParser::parse (const std::string& file_name) 
 {
+  m_level = 0;
   std::unique_ptr<CoreParser::DOMNode> doc = ExpatCoreParser::parse (file_name);
   if (XMLCoreParserDebugger::debug ())
   {
@@ -535,3 +536,21 @@ XMLCoreFactory* XMLCoreParser::find_factory (const std::string& name)
   }
   return m_default_factory.get();
 } 
+
+
+void XMLCoreParser::up()
+{
+  m_level += 1;
+}
+
+
+void XMLCoreParser::down()
+{
+  m_level -= 1;
+}
+
+
+int XMLCoreParser::level() const
+{
+  return m_level;
+}
-- 
GitLab


From 45fedca9372b81ddc55a3902abae6e8e3bd8a4c1 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sun, 3 Mar 2019 17:11:11 +0100
Subject: [PATCH 216/404] TrigEgammaEmulationTool: Add missing component
 declaration.

Add missing component declaration for TrigEgammaIsolationSelectorTool.
---
 .../src/components/TrigEgammaEmulationTool_entries.cxx           | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/src/components/TrigEgammaEmulationTool_entries.cxx b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/src/components/TrigEgammaEmulationTool_entries.cxx
index 48096f245b9..34ac185a9d3 100644
--- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/src/components/TrigEgammaEmulationTool_entries.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/src/components/TrigEgammaEmulationTool_entries.cxx
@@ -24,4 +24,5 @@ DECLARE_COMPONENT( Trig::TrigEgammaEFElectronSelectorTool )
 DECLARE_COMPONENT( Trig::TrigEgammaEFPhotonSelectorTool )   
 DECLARE_COMPONENT( Trig::TrigEgammaEmulationToolTest ) 
 DECLARE_COMPONENT( Trig::TrigEgammaEmulationToolAlg ) 
+DECLARE_COMPONENT( Trig::TrigEgammaIsolationSelectorTool ) 
 
-- 
GitLab


From 88bc1b025649998b43e53e86119d151ece929e10 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sun, 3 Mar 2019 17:22:52 +0100
Subject: [PATCH 217/404] CaloSysD3PDMaker: Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../CaloSysD3PDMaker/src/LArDigitFillerTool.cxx   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/LArDigitFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/LArDigitFillerTool.cxx
index 54007c6d6d6..4a91ecf984f 100644
--- a/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/LArDigitFillerTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/CaloSysD3PDMaker/src/LArDigitFillerTool.cxx
@@ -17,10 +17,10 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "LArRawEvent/LArDigit.h"
 #include "GaudiKernel/IToolSvc.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "LArRawEvent/LArFebHeaderContainer.h"
 #include "LArRawEvent/LArOFIterResultsContainer.h"
 #include "LArIdentifier/LArOnlineID.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
@@ -115,17 +115,16 @@ StatusCode LArDigitFillerTool::book()
 {
   ATH_MSG_DEBUG( "in book()" );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_hecId=idHelper->hec_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
 
 
   CHECK( m_cablingKey.initialize() );
-  StoreGateSvc* detStore = 0;
-  CHECK( service("DetectorStore", detStore) );
 
-  CHECK( detStore->retrieve(m_onlineHelper, "LArOnlineID") );
+  CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
 
 
   // CHECK(addVariable ("icell",m_cellIndex));
-- 
GitLab


From 1eac850d17cfa1d16248ded1dd6060ed44d3eea5 Mon Sep 17 00:00:00 2001
From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>
Date: Tue, 5 Mar 2019 00:42:15 +0100
Subject: [PATCH 218/404] Throw error if CA in sequence is missing

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index d3a7a8d3e75..b822a7f1312 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -518,8 +518,9 @@ def generateDecisionTree(chains, allChainDicts):
 
             for chain in chainsInCell:
                 for seq in chain.steps[nstep].sequences:
-                    if seq.ca:
-                        stepsAcc.merge( seq.ca )
+                    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)
 
-- 
GitLab


From a70786a0df86487bec54b211a541995416cd1b0d Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Mon, 4 Mar 2019 23:03:16 +0100
Subject: [PATCH 219/404] use installed reference file for regtest

also remove the word REGTEST from the test regexp to avoid irreproducibility issues
---
 .../test/exec_TrigUpgradeTest_art_post.sh      | 18 ++++++++++++------
 .../test/test_full_menu_build.sh               |  5 ++++-
 .../TrigUpgradeTest/test/test_newJO_build.sh   |  6 +++++-
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
index 4059158a66e..f2bb1f19ac1 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/exec_TrigUpgradeTest_art_post.sh
@@ -38,6 +38,11 @@ if [ -z "${REGTESTEXP}" ]; then
   export REGTESTEXP="REGTEST"
 fi
 
+# Option to override the regtest reference location
+if [ -z "${REGTESTREF}" ]; then
+  export REGTESTREF=${REF_FOLDER}/athena.regtest
+fi
+
 ###
 
 echo $(date "+%FT%H:%M %Z")"     Running checklog"
@@ -52,18 +57,19 @@ tail -10000  ${JOB_LOG} > ${JOB_LOG_TAIL}
 
 ###
 
-grep -E "${REGTESTEXP}" ${JOB_LOG} > athena.regtest
+REGTESTREF_BASENAME=$(basename -- "${REGTESTREF}")
+grep -E "${REGTESTEXP}" ${JOB_LOG} > "${REGTESTREF_BASENAME}"
 
-if [ -f ${REF_FOLDER}/athena.regtest ]; then
-  echo $(date "+%FT%H:%M %Z")"     Running regtest"
-  timeout 1m regtest.pl --inputfile athena.regtest --reffile ${REF_FOLDER}/athena.regtest --linematch ".*" | tee regtest.log
+if [ -f ${REGTESTREF} ]; then
+  echo $(date "+%FT%H:%M %Z")"     Running regtest using reference file ${REGTESTREF}"
+  timeout 1m regtest.pl --inputfile ${REGTESTREF_BASENAME} --reffile ${REGTESTREF} --linematch ".*" | tee regtest.log
   echo "art-result: ${PIPESTATUS[0]} RegTest"
 else
-  echo $(date "+%FT%H:%M %Z")"     No reference athena.regtest found in ${REF_FOLDER}"
+  echo $(date "+%FT%H:%M %Z")"     The reference file does not exist: ${REGTESTREF}"
   echo "art-result: 999 RegTest"
 fi
 
-mv athena.regtest athena.regtest.new
+mv ${REGTESTREF_BASENAME} ${REGTESTREF_BASENAME}.new
 
 if [ -f ${REF_FOLDER}/expert-monitoring.root ]; then
   echo $(date "+%FT%H:%M %Z")"     Running rootcomp"
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
index fbc058bd459..8e24ee48886 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_full_menu_build.sh
@@ -12,7 +12,10 @@ export EVENTS=20
 export THREADS=1
 export SLOTS=1
 export JOBOPTION="TrigUpgradeTest/fullMenu.py"
-export REGTESTEXP="REGTEST|TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*|TrigSignatureMoniMT.*HLT_.*"
+export REGTESTEXP="TriggerSummaryStep.*HLT_.*|TriggerMonitorFinal.*HLT_.*|TrigSignatureMoniMT.*HLT_.*"
+
+# Find the regtest reference installed with the release
+export REGTESTREF=`find_data.py TrigUpgradeTest/fullMenu.ref`
 
 source exec_TrigUpgradeTest_art_athenaMT.sh
 source exec_TrigUpgradeTest_art_post.sh
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
index 983b250a9c8..2b44718b600 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
@@ -13,7 +13,11 @@ export THREADS=1
 export SLOTS=1
 export JOBOPTION="newJOtest.pkl"
 export FROMPICKLE=1
-export REGTESTEXP="REGTEST|.*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMoniMT .*INFO.*"
+export REGTESTEXP=".*ERROR (?\!attempt to add a duplicate).*|.*FATAL.*|.*newJOtest.pkl.*|TrigSignatureMoniMT .*INFO.*"
+
+# Find the regtest reference installed with the release
+export REGTESTREF=`find_data.py TrigUpgradeTest/NewJO.ref`
+
 
 rm -rf newJOtest.py bootstrap.pkl bootstrap.py
 
-- 
GitLab


From b3e959e701dd1bbbde7dad8624e41d3d6e9a3b06 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 5 Mar 2019 03:55:10 +0100
Subject: [PATCH 220/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetSimEvent
 package

---
 InnerDetector/InDetSimEvent/CMakeLists.txt                  | 5 +++--
 .../InDetSimEvent/InDetSimEvent/ATLAS_CHECK_THREAD_SAFETY   | 1 +
 InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h   | 5 ++++-
 InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h  | 6 +++++-
 InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx           | 5 ++++-
 InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx          | 5 ++++-
 6 files changed, 21 insertions(+), 6 deletions(-)
 create mode 100644 InnerDetector/InDetSimEvent/InDetSimEvent/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetSimEvent/CMakeLists.txt b/InnerDetector/InDetSimEvent/CMakeLists.txt
index 4370c1aee81..9598958e42e 100644
--- a/InnerDetector/InDetSimEvent/CMakeLists.txt
+++ b/InnerDetector/InDetSimEvent/CMakeLists.txt
@@ -9,6 +9,7 @@ atlas_subdir( InDetSimEvent )
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaKernel
                           Control/AthAllocators
+                          Control/CxxUtils
                           Generators/GeneratorObjects
                           Simulation/HitManagement
                           
@@ -27,12 +28,12 @@ atlas_add_library( InDetSimEvent
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} AthAllocators AthenaKernel GeneratorObjects HitManagement StoreGateLib SGtests
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} AthAllocators AthenaKernel CxxUtils GeneratorObjects HitManagement StoreGateLib SGtests
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} InDetIdentifier )
 
 atlas_add_dictionary( InDetSimEventDict
                       InDetSimEvent/InDetSimEventDict.h
                       InDetSimEvent/selection.xml
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthAllocators GeneratorObjects HitManagement StoreGateLib SGtests InDetIdentifier InDetSimEvent )
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthAllocators CxxUtils GeneratorObjects HitManagement StoreGateLib SGtests InDetIdentifier InDetSimEvent )
 
diff --git a/InnerDetector/InDetSimEvent/InDetSimEvent/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetSimEvent/InDetSimEvent/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..ca9adb57d42
--- /dev/null
+++ b/InnerDetector/InDetSimEvent/InDetSimEvent/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetSimEvent
diff --git a/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h b/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h
index f9843b7d7ce..1e93a436c45 100755
--- a/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h
+++ b/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.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 INDETSIMEVENT_SIHITIDHELPER
@@ -21,6 +21,9 @@
 // Base Class
 #include "HitManagement/HitIdHelper.h"
 
+// This class is singleton and static method and variable are used.
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
 
 class SiHitIdHelper : HitIdHelper {
  public:
diff --git a/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h b/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h
index 21ca9cfc3bb..18f3c381c72 100755
--- a/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h
+++ b/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.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 INDETSIMEVENT_TRTHITIDHELPER
@@ -21,6 +21,10 @@
 // Base Class
 #include "HitManagement/HitIdHelper.h"
 
+// This class is singleton and static method and variable are used.
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
+
 
 class TRTHitIdHelper : HitIdHelper {
  public:
diff --git a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx
index 25506a70acc..a04ef8f6a65 100755
--- a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx
+++ b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.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 <mutex>
@@ -15,6 +15,9 @@
 
 static std::mutex sgMutex;
 
+// This class is singleton and static method and variable are used.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
+
 //
 // private constructor
 SiHitIdHelper::SiHitIdHelper() :HitIdHelper() {
diff --git a/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx b/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
index d424031d8f4..4926b00e3b7 100755
--- a/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
+++ b/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
@@ -1,9 +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
 */
 
 #include "InDetSimEvent/TRTHitIdHelper.h"
 
+// This class is singleton and static method and variable are used.
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
+
 //
 // private constructor
 TRTHitIdHelper::TRTHitIdHelper() :HitIdHelper() {
-- 
GitLab


From b718b28e8f95b4bce87649bc57ed772bbf4fb646 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 5 Mar 2019 08:42:18 +0100
Subject: [PATCH 221/404] Fail when import of signatures code fails

---
 .../HLTMenuConfig/Menu/GenerateMenuMT_newJO.py | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index aea1926e3c4..4c47e67a740 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -11,7 +11,7 @@ _log.setLevel( VERBOSE )
 
 def fillGeneratorsMap( sigMap, signature ):
     """ Fill the mapping from the flag container name to the function responsible for generating the Chain objects
-    
+
     Here the files naming convention is employed: the chains mentioned in Trigger.menu.XYZ are served by the function in HLTMenuConfig.XYZ.generateChains"""
 
     if signature in sigMap:
@@ -20,14 +20,11 @@ def fillGeneratorsMap( sigMap, signature ):
     capitalizedSignature = signature.capitalize()
     importString = 'TriggerMenuMT.HLTMenuConfig.{}.generate{}'.format(capitalizedSignature, capitalizedSignature)
 
-    try:
-        gen = __import__(importString, globals(), locals(), ['generateChains'])
-        sigMap[signature] = gen.generateChains
-        _log.info( 'Imported generator for %s' % signature )
-    except Exception as ex:
-        _log.warning( 'Cant import {} {}'.format(signature, ex) )
 
-    
+    gen = __import__(importString, globals(), locals(), ['generateChains'])
+    sigMap[signature] = gen.generateChains
+    _log.info( 'Imported generator for %s' % signature )
+
 
 def generateMenu( flags ):
     """
@@ -52,8 +49,13 @@ def generateMenu( flags ):
     for name, cfgFlag in list(flags._flagdict.iteritems()):
         if not 'Trigger.menu.' in name:
             continue
+        value = flags._get(name)
+        if len(value) == 0:
+            continue
+
 
         # fill the map[signature, generating function]
+
         signature = name.split('.')[-1]
         fillGeneratorsMap( signatureToGenerator, signature )
 
-- 
GitLab


From 09e033ec4851c5e77dd6dd8a38e1aa885f95e25c Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 5 Mar 2019 11:24:02 +0100
Subject: [PATCH 222/404] Patch Simulation RunTier0Test job, so that it works
 in AthSimulation builds

---
 Tools/PROCTools/python/RunTier0Tests.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Tools/PROCTools/python/RunTier0Tests.py b/Tools/PROCTools/python/RunTier0Tests.py
index f2a4701eec0..9909377f77b 100755
--- a/Tools/PROCTools/python/RunTier0Tests.py
+++ b/Tools/PROCTools/python/RunTier0Tests.py
@@ -83,7 +83,7 @@ def RunCleanSTest(stest,input_file,pwd,release,extraArg,CleanRunHeadDir,UniqID):
 
     s=stest 
     logging.info("Running clean in rel "+release)
-    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --imf False " + extraArg+"\"")
+    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " + extraArg+"\"")
 
     CleanDirName="clean_run_"+s+"_"+UniqID
 
@@ -92,11 +92,11 @@ def RunCleanSTest(stest,input_file,pwd,release,extraArg,CleanRunHeadDir,UniqID):
             " mkdir -p " + CleanDirName    +" ;" + 
             " cd "       + CleanDirName    +" ;" + 
             " source $AtlasSetup/scripts/asetup.sh "+release+" >& /dev/null ;" +
-            " Sim_tf.py --AMIConfig="+s+" --inputEVNTFile "+input_file + " --outputHITSFile myHITS.pool.root --imf False " +extraArg+" > "+s+".log 2>&1" )
+            " Sim_tf.py --AMIConfig="+s+" --inputEVNTFile "+input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " +extraArg+" > "+s+".log 2>&1" )
     subprocess.call(cmd,shell=True)
 
     logging.info("Finished clean in rel "+release)
-    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --imf False " + extraArg+"\"")
+    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " + extraArg+"\"")
     pass
 
 def RunPatchedSTest(stest,input_file,pwd,release,extraArg,nosetup=False):
@@ -106,7 +106,7 @@ def RunPatchedSTest(stest,input_file,pwd,release,extraArg,nosetup=False):
 
     s=stest 
     logging.info("Running patched in rel "+release)
-    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --imf False " + extraArg+"\"")
+    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " + extraArg+"\"")
 
     cmd = " cd "+pwd+" ;"
     if nosetup:
@@ -118,12 +118,12 @@ def RunPatchedSTest(stest,input_file,pwd,release,extraArg,nosetup=False):
     else :
         cmd = ( " source $AtlasSetup/scripts/asetup.sh "+release+"  >& /dev/null;" )
     cmd += " mkdir -p run_"+s+"; cd run_"+s+";"
-    cmd += " Sim_tf.py --AMIConfig="+s+" --inputEVNTFile "+input_file + " --outputHITSFile myHITS.pool.root --imf False " +extraArg+" > "+s+".log 2>&1" 
+    cmd += " Sim_tf.py --AMIConfig="+s+" --inputEVNTFile "+input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " +extraArg+" > "+s+".log 2>&1" 
     
     subprocess.call(cmd,shell=True)
 
     logging.info("Finished patched in rel "+release)
-    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --imf False " + extraArg+"\"")
+    logging.info("\"Sim_tf.py --AMIConfig "+s+" --inputEVNTFile "+ input_file + " --outputHITSFile myHITS.pool.root --postInclude 'EVNTtoHITS:PyJobTransforms/UseFrontier.py' --imf False " + extraArg+"\"")
     pass
 
 def RunCleanQTest(qtest,pwd,release,extraArg,CleanRunHeadDir,UniqID, doR2A=False, trigConfig="2017"):
-- 
GitLab


From b38693676cf72e1c8b24818cfc0bd304688f4825 Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Tue, 5 Mar 2019 13:31:23 +0100
Subject: [PATCH 223/404] Update RunMenuTest.ref with new naming convention
 including L1 item. Fix python typo in GenerateMenuMT.py

---
 .../TrigUpgradeTest/share/RunMenuTest.ref            | 12 ++++++------
 .../python/HLTMenuConfig/Menu/GenerateMenuMT.py      |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
index 739e534823a..e3e3846fd41 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
@@ -1,9 +1,9 @@
 TrigSignatureMoniMT                                INFO Chains passing step (1st row events & 2nd row decision counts
 TrigSignatureMoniMT                                INFO Chain name                   L1,      AfterPS, [... steps ...], Output
 TrigSignatureMoniMT                                INFO All                           20        20        0         0         17        
-TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        20        18        17        17        
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            54        262       
-TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        17        16        16        
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            50        251       
-TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        15        14        14        
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        205       
+TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3            20        20        18        17        17        
+TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3 decisions                      54        262       
+TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3            20        20        17        16        16        
+TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3 decisions                      50        251       
+TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM3            20        20        15        14        14        
+TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM3 decisions                      36        205       
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index c1230c2ad0b..e22da473228 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -77,7 +77,7 @@ class GenerateMenuMT:
 
         if self.doTestChains:
             try:
-                import TriggerMenuMT.HLTMenuConfig.Egamma.generateTestChainDefs  
+                import TriggerMenuMT.HLTMenuConfig.Test.generateTestChainDefs  
             except:
                 log.exception('Problems when importing generateTestChainDefs, disabling Test chains.')
                 self.doTestChains = False
-- 
GitLab


From c6dbce2eb7985f15c8e7997886f07261784ccdd1 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Fri, 1 Mar 2019 14:57:58 +0100
Subject: [PATCH 224/404] Initial version of SCTOverlay unit test

---
 .../InDetRawAlgs/InDetOverlay/CMakeLists.txt  |  17 +-
 .../share/StoreGateTestCommon.txt             |  11 +
 .../InDetOverlay/test/SCTOverlay_test.cxx     | 413 ++++++++++++++++++
 3 files changed, 440 insertions(+), 1 deletion(-)
 create mode 100644 InnerDetector/InDetRawAlgs/InDetOverlay/share/StoreGateTestCommon.txt
 create mode 100644 InnerDetector/InDetRawAlgs/InDetOverlay/test/SCTOverlay_test.cxx

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
index 60235ef57bd..1a7443086f9 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetRawEvent/InDetRawData
                           PRIVATE
                           Control/StoreGate
+                          DetectorDescription/IdDictParser
                           Generators/GeneratorObjects
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetRawEvent/InDetSimData
@@ -24,12 +25,25 @@ atlas_depends_on_subdirs( PUBLIC
 find_package( CLHEP )
 find_package( GTest )
 
+# Helper variable(s):
+set( _jobOPath
+    "${CMAKE_CURRENT_SOURCE_DIR}/share:${CMAKE_JOBOPT_OUTPUT_DIRECTORY}" )
+set( _jobOPath "${_jobOPath}:$ENV{JOBOPTSEARCHPATH}" )
+
+# Unit Tests
 atlas_add_test( PixelOverlay_test
                 SOURCES src/PixelOverlay.cxx test/PixelOverlay_test.cxx
                 INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
-                LINK_LIBRARIES  ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack ${GTEST_LIBRARIES}
+                LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack ${GTEST_LIBRARIES}
                 EXTRA_PATTERNS "[0-9]+ ms")
 
+atlas_add_test( SCTOverlay_test
+                SOURCES src/SCTOverlay.cxx test/SCTOverlay_test.cxx
+                INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
+                LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack IdDictParser ${GTEST_LIBRARIES}
+                EXTRA_PATTERNS "[0-9]+ ms"
+                ENVIRONMENT "JOBOPTSEARCHPATH=${_jobOPath}" )
+
 
 # Component(s) in the package:
 atlas_add_component( InDetOverlay
@@ -41,3 +55,4 @@ atlas_add_component( InDetOverlay
 # Install files from the package:
 atlas_install_headers( InDetOverlay )
 atlas_install_python_modules( python/*.py )
+atlas_install_joboptions( share/StoreGateTestCommon.txt )
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/share/StoreGateTestCommon.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/share/StoreGateTestCommon.txt
new file mode 100644
index 00000000000..db097fe9514
--- /dev/null
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/share/StoreGateTestCommon.txt
@@ -0,0 +1,11 @@
+// common job opts for athena SG-based unit tests
+
+// $Id: StoreGateTestCommon.txt,v 1.2 2008-05-30 22:53:11 calaf Exp $
+
+ApplicationMgr.ExtSvc += { "StoreGateSvc/DetectorStore", "StoreGateSvc/HistoryStore", "StoreGateSvc/ConditionStore"};
+AuditorSvc.Auditors  += { "AlgContextAuditor"};
+//StoreGateSvc.OutputLevel = 1;
+//StoreGateSvc.ActivateHistory = false;
+CLIDSvc.OutputLevel = 2;
+MessageSvc.useColors        = true;
+//MessageSvc.setVerbose  += { "DataProxy"} ;
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/SCTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/SCTOverlay_test.cxx
new file mode 100644
index 00000000000..7c5f9245b9e
--- /dev/null
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/SCTOverlay_test.cxx
@@ -0,0 +1,413 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @author John Chapman
+ * @brief Tests for SCTOverlay.
+ */
+
+#undef NDEBUG
+
+// Framework
+#include "TestTools/initGaudi.h"
+
+// Google Test
+#include "gtest/gtest.h"
+
+#include <vector>
+
+// Tested AthAlgorithm
+#include "../InDetOverlay/SCTOverlay.h"
+#include "InDetIdentifier/SCT_ID.h"
+#include "IdDictParser/IdDictParser.h"
+#include "GaudiKernel/MsgStream.h"
+
+namespace OverlayTesting {
+
+  // needed every time an AthAlgorithm, AthAlgTool or AthService is instantiated
+  ISvcLocator* g_svcLoc = nullptr;
+
+  // global test environment takes care of setting up Gaudi
+  class GaudiEnvironment : public ::testing::Environment {
+  protected:
+    virtual void SetUp() override {
+      Athena_test::initGaudi("StoreGateTestCommon.txt", OverlayTesting::g_svcLoc);
+    }
+  };
+
+  class SCTOverlay_test : public ::testing::Test {
+
+  protected:
+    virtual void SetUp() override {
+      m_alg = new SCTOverlay{"SCTOverlay", g_svcLoc};
+      ASSERT_TRUE( m_alg->setProperties().isSuccess() );
+
+      StoreGateSvc *detStore(nullptr);
+      ASSERT_TRUE( OverlayTesting::g_svcLoc->service("DetectorStore", detStore, true).isSuccess() );
+      if (detStore) {
+        if (not detStore->contains<SCT_ID>("SCT_ID")) {
+          auto sct_id = std::make_unique<SCT_ID>();
+          IdDictParser parser;
+          parser.register_external_entity ("InnerDetector",
+                                           "IdDictInnerDetector.xml");
+          IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml");
+          sct_id->initialize_from_dictionary (idd);
+          ASSERT_TRUE( detStore->record (std::move (sct_id), "SCT_ID").isSuccess() );
+        }
+      }
+    }
+
+    virtual void TearDown() override {
+      StoreGateSvc *evtStore(nullptr);
+      ASSERT_TRUE( OverlayTesting::g_svcLoc->service("StoreGateSvc", evtStore, true).isSuccess() );
+      evtStore->clearStore(true);
+      ASSERT_TRUE( m_alg->finalize().isSuccess() );
+      delete m_alg;
+    }
+
+    void configureSCTOverlay() {
+      // ordering C, A, B is on purpose to test for unintended alphabetic ordering
+      std::string  inputSigPropertyValue = "'StoreGateSvc+SCT_RDOs_SIG'";
+      std::string  inputBkgPropertyValue = "'StoreGateSvc+SCT_RDOs_BKG'";
+      std::string    outputPropertyValue = "'StoreGateSvc+SCT_RDOs'";
+      ASSERT_TRUE( m_alg->setProperty( "SignalInputKey",   inputSigPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "BkgInputKey",   inputBkgPropertyValue).isSuccess() );
+      ASSERT_TRUE( m_alg->setProperty( "OutputKey", outputPropertyValue).isSuccess() );
+    }
+    SCTOverlay* m_alg;
+  };   // SCTOverlay_test fixture
+
+
+  TEST_F(SCTOverlay_test, set_properties) {
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isFailure() ); //inputs don't exist
+  }
+
+  TEST_F(SCTOverlay_test, empty_containers_alg_execute) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_matching_empty_collections) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(1);
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->empty() );
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_different_empty_collections) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    IdentifierHash sigElementHash(1);
+    IdentifierHash bkgElementHash(2);
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->empty() );
+    const SCT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->empty() );
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_matching_collections_one_with_an_RDO) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigGroupSize(1);
+    const int sigTimeBin(1 << SCTOverlay::CurrentBC);
+    const int sigStrip(10);
+    const int sigErrors(0);
+    const unsigned int sigWord(sigGroupSize | (sigStrip << 11) | (sigTimeBin << 22) | (sigErrors << 25));
+    std::vector<int> sigErrorVect{};
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> sigDigit = std::make_unique<SCT3_RawData>(Identifier(12),sigWord, &sigErrorVect);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const SCT3_RawData* outputDigit1 = dynamic_cast<const SCT3_RawData*>(outputCollection1->at(0));
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getGroupSize()==sigGroupSize );
+    ASSERT_TRUE( outputDigit1->getTimeBin()==sigTimeBin );
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_different_collections_one_RDO_each) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(2);
+    const int sigGroupSize(1);
+    const int sigTimeBin(1 << SCTOverlay::CurrentBC);
+    const int sigStrip(10);
+    const int sigErrors(0);
+    const unsigned int sigWord(sigGroupSize | (sigStrip << 11) | (sigTimeBin << 22) | (sigErrors << 25));
+    std::vector<int> sigErrorVect{};
+    const int bkgGroupSize(1);
+    const int bkgTimeBin(1 << SCTOverlay::CurrentBC );
+    const int bkgStrip(10);
+    const int bkgErrors(0);
+    const unsigned int bkgWord(bkgGroupSize | (bkgStrip << 11) | (bkgTimeBin << 22) | (bkgErrors << 25));
+    std::vector<int> bkgErrorVect{};
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> sigDigit = std::make_unique<SCT3_RawData>(Identifier(12),sigWord, &sigErrorVect);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> bkgDigit = std::make_unique<SCT3_RawData>(Identifier(12),bkgWord,&bkgErrorVect);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection1 = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection1!=nullptr );
+    ASSERT_TRUE( outputCollection1->size()==1 );
+    const SCT3_RawData* outputDigit1 = dynamic_cast<const SCT3_RawData*>(outputCollection1->at(0));
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getGroupSize()==sigGroupSize );
+    ASSERT_TRUE( outputDigit1->getTimeBin()==sigTimeBin );
+    const SCT_RDO_Collection *outputCollection2 = outputDataHandle->indexFindPtr(bkgElementHash);
+    ASSERT_TRUE( outputCollection2!=nullptr );
+    ASSERT_TRUE( outputCollection2->size()==1 );
+    const SCT3_RawData* outputDigit2 = dynamic_cast<const SCT3_RawData*>(outputCollection2->at(0));
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getGroupSize()==bkgGroupSize );
+    ASSERT_TRUE( outputDigit2->getTimeBin()==bkgTimeBin );
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_matching_collections_with_adjecent_RDOs) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigGroupSize(1);
+    const int sigTimeBin(1 << SCTOverlay::CurrentBC);
+    const int sigStrip(10);
+    const int sigErrors(0);
+    const unsigned int sigWord(sigGroupSize | (sigStrip << 11) | (sigTimeBin << 22) | (sigErrors << 25));
+    std::vector<int> sigErrorVect{};
+    const int bkgGroupSize(2);
+    const int bkgTimeBin(1 << SCTOverlay::CurrentBC);
+    const int bkgStrip(11);
+    const int bkgErrors(0);
+    const unsigned int bkgWord(bkgGroupSize | (bkgStrip << 11) | (bkgTimeBin << 22) | (bkgErrors << 25));
+    std::vector<int> bkgErrorVect{};
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> sigDigit = std::make_unique<SCT3_RawData>(Identifier(12),sigWord,&sigErrorVect);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> bkgDigit = std::make_unique<SCT3_RawData>(Identifier(13),bkgWord,&bkgErrorVect);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==1 );
+    const SCT3_RawData* outputDigit1 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(0));
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getGroupSize()==sigGroupSize+bkgGroupSize ); // adjacent RDOs combined
+    ASSERT_TRUE( outputDigit1->getTimeBin()==sigTimeBin ); // TimeBin matches signal RDO
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_matching_collections_signal_overlapping_with_early_bkg) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigGroupSize(3);
+    const int sigTimeBin(1 << SCTOverlay::CurrentBC);
+    const int sigStrip(10);
+    const int sigErrors(0);
+    const unsigned int sigWord(sigGroupSize | (sigStrip << 11) | (sigTimeBin << 22) | (sigErrors << 25));
+    std::vector<int> sigErrorVect{};
+    const int bkgGroupSize(1);
+    const int bkgTimeBin(1 << SCTOverlay::PreviousBC);
+    const int bkgStrip(11);
+    const int bkgErrors(0);
+    const unsigned int bkgWord(bkgGroupSize | (bkgStrip << 11) | (bkgTimeBin << 22) | (bkgErrors << 25));
+    std::vector<int> bkgErrorVect{};
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> sigDigit = std::make_unique<SCT3_RawData>(Identifier(12),sigWord,&sigErrorVect);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> bkgDigit = std::make_unique<SCT3_RawData>(Identifier(13),bkgWord,&bkgErrorVect);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==3 );
+    const SCT3_RawData* outputDigit1 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(0));
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getGroupSize()==1 ); // Signal RDO split by overlapping RDO with different TimeBin
+    ASSERT_TRUE( outputDigit1->getTimeBin()==sigTimeBin ); // TimeBin matches signal RDO
+    const SCT3_RawData* outputDigit2 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(1));
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getGroupSize()==1 ); // Signal RDO split by overlapping RDO with different TimeBin
+    ASSERT_TRUE( outputDigit2->getTimeBin()==bkgTimeBin+sigTimeBin ); // TimeBin is a sum of signal and background TimeBins
+    const SCT3_RawData* outputDigit3 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(2));
+    ASSERT_TRUE( outputDigit3!=nullptr );
+    ASSERT_TRUE( outputDigit3->getGroupSize()==1 ); // Signal RDO split by overlapping RDO with different TimeBin
+    ASSERT_TRUE( outputDigit3->getTimeBin()==sigTimeBin ); // TimeBin matches background RDO
+  }
+
+  TEST_F(SCTOverlay_test, containers_with_matching_collections_monkey) {
+    SG::WriteHandle<SCT_RDO_Container> inputSigDataHandle{"StoreGateSvc+SCT_RDOs_SIG"};
+    const unsigned int containerSize(1188);
+    const IdentifierHash sigElementHash(1);
+    const IdentifierHash bkgElementHash(1);
+    const int sigGroupSize(1);
+    const int sigTimeBin(1 << SCTOverlay::CurrentBC);
+    const int sigStrip(10);
+    const int sigErrors(0);
+    const unsigned int sigWord(sigGroupSize | (sigStrip << 11) | (sigTimeBin << 22) | (sigErrors << 25));
+    std::vector<int> sigErrorVect{};
+    const int bkgGroupSize(1);
+    const int bkgTimeBin(1 << SCTOverlay::CurrentBC);
+    const int bkgStrip(40);
+    const int bkgErrors(0);
+    const unsigned int bkgWord(bkgGroupSize | (bkgStrip << 11) | (bkgTimeBin << 22) | (bkgErrors << 25));
+    std::vector<int> bkgErrorVect{};
+    inputSigDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> sigCollection = std::make_unique<SCT_RDO_Collection>(sigElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> sigDigit = std::make_unique<SCT3_RawData>(Identifier(12),sigWord,&sigErrorVect);
+    sigCollection->push_back(sigDigit.release());
+    ASSERT_TRUE(inputSigDataHandle->addCollection(sigCollection.get(),sigElementHash).isSuccess());
+    sigCollection.release(); // Now owned by inputSigDataHandle
+    SG::WriteHandle<SCT_RDO_Container> inputBkgDataHandle{"StoreGateSvc+SCT_RDOs_BKG"};
+    inputBkgDataHandle = std::make_unique<SCT_RDO_Container>(containerSize);
+    std::unique_ptr<SCT_RDO_Collection> bkgCollection = std::make_unique<SCT_RDO_Collection>(bkgElementHash);
+    //Add a SCT3_RawData object
+    std::unique_ptr<SCT3_RawData> bkgDigit = std::make_unique<SCT3_RawData>(Identifier(40),bkgWord,&bkgErrorVect);
+    bkgCollection->push_back(bkgDigit.release());
+    ASSERT_TRUE(inputBkgDataHandle->addCollection(bkgCollection.get(),bkgElementHash).isSuccess());
+    bkgCollection.release(); // Now owned by inputBkgDataHandle
+
+    configureSCTOverlay();
+    ASSERT_TRUE( m_alg->initialize().isSuccess() );
+    ASSERT_TRUE( m_alg->execute().isSuccess() );
+    // check output makes sense
+    SG::ReadHandle<SCT_RDO_Container> outputDataHandle{"StoreGateSvc+SCT_RDOs"};
+    ASSERT_TRUE( outputDataHandle.isValid() );
+    const SCT_RDO_Collection *outputCollection = outputDataHandle->indexFindPtr(sigElementHash);
+    ASSERT_TRUE( outputCollection!=nullptr );
+    ASSERT_TRUE( outputCollection->size()==2 );
+    const SCT3_RawData* outputDigit1 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(0));
+    ASSERT_TRUE( outputDigit1!=nullptr );
+    ASSERT_TRUE( outputDigit1->getGroupSize()==sigGroupSize ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit1->getTimeBin()==sigTimeBin ); // TimeBin matches signal RDO
+    const SCT3_RawData* outputDigit2 = dynamic_cast<const SCT3_RawData*>(outputCollection->at(1));
+    ASSERT_TRUE( outputDigit2!=nullptr );
+    ASSERT_TRUE( outputDigit2->getGroupSize()==bkgGroupSize ); // RDOs in same collection sorted according to Identifier
+    ASSERT_TRUE( outputDigit2->getTimeBin()==bkgTimeBin ); // TimeBin matches background RDO
+  }
+
+} // <-- namespace OverlayTesting
+
+
+int main(int argc, char *argv[])
+{
+  ::testing::InitGoogleTest( &argc, argv );
+  ::testing::AddGlobalTestEnvironment( new OverlayTesting::GaudiEnvironment );
+  return RUN_ALL_TESTS();
+}
-- 
GitLab


From f956b35067a0fb544e895a402b7b701109204b9e Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 30 Mar 2017 17:43:23 +0200
Subject: [PATCH 225/404] Add new High Pt Minimum Bias PileUpType

Having a separate PileUpType for high pt minbias allows
us to distinguish it from the low pt minbias. This will
be used for the new McEventCollection structure. ATLASSIM-2430

Using the new PileUpTimeEventIndex constructor, which takes the
PileUpType, in the PileUpMergeSvc will allow us to query the
PileUpType of SimHits within the PileUpTools. ATLASSIM-2430
---
 Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc | 4 ++--
 Event/EventInfo/EventInfo/PileUpTimeEventIndex.h   | 3 ++-
 Event/EventInfo/src/PileUpTimeEventIndex.cxx       | 7 ++++---
 Simulation/Digitization/python/PileUpConfig.py     | 2 +-
 Simulation/Digitization/python/PileUpEventType.py  | 5 +++--
 5 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
index 4da2d1a66af..f406d2bdf7d 100755
--- a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
+++ b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
@@ -87,7 +87,7 @@ PileUpMergeSvc::retrieveSubEvtsData(const KEY& dataKey, //orig evt key
 	    if (!m_pITriggerTime.empty()) sigTime-= m_pITriggerTime->time();
 	    evtIndex = subEv.index();
 	  }
-	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex), dLink);
+	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,iEvt->type()), dLink);
 	  numberOfSimHits+=tData.second->size();
 	  timedData.push_back(tData);
 	  ATH_MSG_DEBUG ( "added entry from store " <<  pSubEvtSG->name()
@@ -237,7 +237,7 @@ PileUpMergeSvc::retrieveSubEvtsData(const KEY& dataKey, //orig evt key
 	    if (!m_pITriggerTime.empty()) sigTime-= m_pITriggerTime->time();
 	    evtIndex = subEv.index();
 	  }
-	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex), dLink);
+	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,iEvt->type()), dLink);
 	  timedData.push_back(tData);
 	  ATH_MSG_DEBUG ( "added entry from store " << pSubEvtSG->name()
 			  << " for object of type " << System::typeinfoName(typeid(data_t)) 
diff --git a/Event/EventInfo/EventInfo/PileUpTimeEventIndex.h b/Event/EventInfo/EventInfo/PileUpTimeEventIndex.h
index e3c55cd3050..cf01c5d900d 100755
--- a/Event/EventInfo/EventInfo/PileUpTimeEventIndex.h
+++ b/Event/EventInfo/EventInfo/PileUpTimeEventIndex.h
@@ -16,7 +16,8 @@ public:
 		    MinimumBias=1, 
 		    Cavern=2, 
 		    HaloGas=3, 
-		    ZeroBias=4,
+                    HighPtMinimumBias=4,
+		    ZeroBias=5,
 		    NTYPES };
   typedef long time_type;
   typedef unsigned long index_type;
diff --git a/Event/EventInfo/src/PileUpTimeEventIndex.cxx b/Event/EventInfo/src/PileUpTimeEventIndex.cxx
index f995baf8ec2..0a4d63fdda6 100755
--- a/Event/EventInfo/src/PileUpTimeEventIndex.cxx
+++ b/Event/EventInfo/src/PileUpTimeEventIndex.cxx
@@ -11,9 +11,9 @@
 
 const std::string&
 PileUpTimeEventIndex::typeName(PileUpTimeEventIndex::PileUpType typ) {
-  static std::string typNam[PileUpTimeEventIndex::NTYPES+1] = 
+  static std::string typNam[PileUpTimeEventIndex::NTYPES+1] =
     {"Unknown" /*-1*/, "Signal" /*0*/, "MinimumBias" /*1*/, "Cavern" /*2*/,
-     "HaloGas"/*3*/, "ZeroBias"/*4*/ };
+     "HaloGas"/*3*/, "HighPtMinimumBias" /*4*/, "ZeroBias"/*5*/ };
   assert(typ < PileUpTimeEventIndex::NTYPES);
   return typNam[typ+1];
 } 
@@ -25,7 +25,8 @@ PileUpTimeEventIndex::ushortToType(unsigned short uType) {
   case 1: puType = PileUpTimeEventIndex::MinimumBias; break;
   case 2: puType = PileUpTimeEventIndex::Cavern; break;
   case 3: puType = PileUpTimeEventIndex::HaloGas; break;
-  case 4: puType = PileUpTimeEventIndex::ZeroBias; break;
+  case 4: puType = PileUpTimeEventIndex::HighPtMinimumBias; break;
+  case 5: puType = PileUpTimeEventIndex::ZeroBias; break;
   default: 
     std::ostringstream merr;
     merr << 
diff --git a/Simulation/Digitization/python/PileUpConfig.py b/Simulation/Digitization/python/PileUpConfig.py
index 710bae408a6..411a89a702c 100644
--- a/Simulation/Digitization/python/PileUpConfig.py
+++ b/Simulation/Digitization/python/PileUpConfig.py
@@ -116,7 +116,7 @@ def getHighPtMinBiasCache(name="HighPtMinBiasCache", **kwargs):
     from AthenaCommon.BeamFlags import jobproperties
     kwargs.setdefault('CollPerXing', digitizationFlags.numberOfHighPtMinBias() )
     from Digitization import PileUpEventType
-    kwargs.setdefault('PileUpEventType', PileUpEventType.MinimumBias ) # may need to have a separate type in the future
+    kwargs.setdefault('PileUpEventType', PileUpEventType.HighPtMinimumBias ) # may need to have a separate type in the future
     kwargs.setdefault('ReadDownscaleFactor', 1 )
     kwargs.setdefault('EventSelector', getService('HighPtMinBiasEventSelector') )
     kwargs.setdefault('OccupationFraction', float(digitizationFlags.bunchSpacing.get_Value())/float(jobproperties.Beam.bunchSpacing.get_Value()) )
diff --git a/Simulation/Digitization/python/PileUpEventType.py b/Simulation/Digitization/python/PileUpEventType.py
index 604475194b9..b4534b4cab1 100644
--- a/Simulation/Digitization/python/PileUpEventType.py
+++ b/Simulation/Digitization/python/PileUpEventType.py
@@ -2,6 +2,7 @@
 
 Signal=0
 MinimumBias=1
-Cavern=2 
+Cavern=2
 HaloGas=3
-ZeroBias=4
+HighPtMinimumBias=4
+ZeroBias=5
-- 
GitLab


From 991f5ac5f37627dd76b70dba380dff66fbd9c5c7 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 11 Sep 2017 12:33:23 +0200
Subject: [PATCH 226/404] Add HighPtMinBias to xAOD::EventInfo::PileUpType enum

This commit extends the `xAOD::EventInfo::PileUpType` by adding an
entry for `HighPtMinBias` bringing it into line with the enums
in `PileUpTimeEventIndex` and elsewhere. This update also adds a helper
function to convert the xAOD version of the enum into the
`PileUpTimeEventIndex` version, this will be needed until all of the
core digitization code has been updated to use xAOD types.
These changes are not present in the SVN version of the `HepMcParticleLink`
migration as the xAOD types are not used in the 20.20 branch.
This is part of the changes for ATLASSIM-2430.
---
 .../PileUpTools/PileUpTypeHelper.h            | 36 +++++++++++++++++++
 .../xAOD/xAODEventInfo/Root/EventInfo_v1.cxx  |  3 ++
 .../xAODEventInfo/versions/EventInfo_v1.h     |  5 +--
 .../xAODEventInfoCnv/src/EventInfoCnvAlg.cxx  |  3 ++
 .../xAODEventInfoCnv/src/EventInfoCnvTool.cxx |  3 ++
 5 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 Control/PileUpTools/PileUpTools/PileUpTypeHelper.h

diff --git a/Control/PileUpTools/PileUpTools/PileUpTypeHelper.h b/Control/PileUpTools/PileUpTools/PileUpTypeHelper.h
new file mode 100644
index 00000000000..68b231054d5
--- /dev/null
+++ b/Control/PileUpTools/PileUpTools/PileUpTypeHelper.h
@@ -0,0 +1,36 @@
+#ifndef PILEUPTOOLS_PILEUPTYPEHELPER_H
+#define PILEUPTOOLS_PILEUPTYPEHELPER_H
+
+#include "EventInfo/PileUpEventInfo.h"
+#include "xAODEventInfo/EventInfo.h"
+#include <map>
+
+namespace {
+   PileUpEventInfo::SubEvent::pileup_type pileupTypeMapper(xAOD::EventInfo::PileUpType inType) {
+
+    // A map translating between the AOD and xAOD pileup event types:
+    static std::map< xAOD::EventInfo::PileUpType,
+                     PileUpEventInfo::SubEvent::pileup_type > pileupTypeMap;
+    if( ! pileupTypeMap.size() ) {
+#define DECLARE_SE_TYPE( TYPE )                                         \
+      pileupTypeMap[ xAOD::EventInfo::TYPE ] = PileUpEventInfo::SubEvent::pileup_type::TYPE
+
+      DECLARE_SE_TYPE( Unknown );
+      DECLARE_SE_TYPE( Signal );
+      DECLARE_SE_TYPE( MinimumBias );
+      DECLARE_SE_TYPE( Cavern );
+      DECLARE_SE_TYPE( HaloGas );
+      DECLARE_SE_TYPE( HighPtMinimumBias );
+      DECLARE_SE_TYPE( ZeroBias );
+#undef DECLARE_SE_TYPE
+    }
+    // And now add a sub-event to the temporary list:
+    auto typeItr = pileupTypeMap.find( inType );
+    PileUpEventInfo::SubEvent::pileup_type type = PileUpEventInfo::SubEvent::pileup_type::Unknown;
+    if( typeItr != pileupTypeMap.end() ) {
+      type = typeItr->second;
+    }
+    return type;
+  }
+}
+#endif //PILEUPTOOLS_PILEUPTYPEHELPER_H
diff --git a/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx b/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
index d60fe19eeb1..838b288cf88 100644
--- a/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
+++ b/Event/xAOD/xAODEventInfo/Root/EventInfo_v1.cxx
@@ -391,6 +391,9 @@ namespace xAOD {
       } else if( m_type == HaloGas ) {
          static const std::string name = "HaloGas";
          return name;
+      } else if( m_type == HighPtMinimumBias ) {
+         static const std::string name = "HighPtMinimumBias";
+         return name;
       } else if( m_type == ZeroBias ) {
          static const std::string name = "ZeroBias";
          return name;
diff --git a/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
index 918c44d7b0d..6831f200e96 100644
--- a/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
+++ b/Event/xAOD/xAODEventInfo/xAODEventInfo/versions/EventInfo_v1.h
@@ -249,10 +249,11 @@ namespace xAOD {
       enum PileUpType {
          Unknown     = 99, ///< Type not known/specified
          Signal      =  0, ///< The signal event
-         MinimumBias =  1, ///< Minimum bias pileup event
+         MinimumBias =  1, ///< (Low pT) Minimum bias pileup event
          Cavern      =  2, ///< Cavern background pileup event
          HaloGas     =  3, ///< Halo-gas non-collision background
-         ZeroBias    =  4, ///< Zero bias pileup event
+         HighPtMinimumBias = 4, ///< High pT Minimum bias pileup event
+         ZeroBias    = 5,  ///< Zero bias pileup event
          PileUp_NTYPES
       }; // enum PileUpType
 
diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvAlg.cxx b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvAlg.cxx
index 16db2676d82..e3a065da7cf 100644
--- a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvAlg.cxx
+++ b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvAlg.cxx
@@ -135,6 +135,9 @@ namespace xAODMaker {
          case PileUpTimeEventIndex::HaloGas:
            type = xAOD::EventInfo::HaloGas;
            break;
+         case PileUpTimeEventIndex::HighPtMinimumBias:
+           type = xAOD::EventInfo::HighPtMinimumBias;
+           break;
          case PileUpTimeEventIndex::ZeroBias:
            type = xAOD::EventInfo::ZeroBias;
            break;
diff --git a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
index 6a017fd2adf..79f8d6e6b25 100644
--- a/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
+++ b/Event/xAOD/xAODEventInfoCnv/src/EventInfoCnvTool.cxx
@@ -289,6 +289,9 @@ namespace xAODMaker {
             case PileUpTimeEventIndex::HaloGas:
               type = xAOD::EventInfo::HaloGas;
               break;
+            case PileUpTimeEventIndex::HighPtMinimumBias:
+              type = xAOD::EventInfo::HighPtMinimumBias;
+              break;
             case PileUpTimeEventIndex::ZeroBias:
               type = xAOD::EventInfo::ZeroBias;
               break;
-- 
GitLab


From 163036cb01cae8d7065070437e882cb782f7a354 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 15 Feb 2019 15:28:58 -0500
Subject: [PATCH 227/404] GeneratorObjects: Update HepMcParticleLink for
 multiple McEventCollections.

Allow HepMcParticleLink to point at one of several
McEventCollections.  See !20486.
---
 Generators/GeneratorObjects/CMakeLists.txt    |   5 +
 .../GeneratorObjects/CachedParticlePtr.h      | 149 ++++
 .../GeneratorObjects/CachedParticlePtr.icc    | 167 ++++
 .../GeneratorObjects/HepMcParticleLink.h      | 713 ++++++++++++++----
 .../GeneratorObjects/HepMcParticleLink.icc    | 602 +++++++++++++++
 .../share/CachedParticlePtr_test.ref          |   3 +
 .../share/HepMcParticleLink_test.ref          |  31 +
 .../src/HepMcParticleLink.cxx                 | 429 +++++++++--
 .../test/CachedParticlePtr_test.cxx           | 174 +++++
 .../test/HepMcParticleLink_test.cxx           |  70 +-
 10 files changed, 2098 insertions(+), 245 deletions(-)
 create mode 100644 Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.h
 create mode 100644 Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.icc
 create mode 100644 Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc
 create mode 100644 Generators/GeneratorObjects/share/CachedParticlePtr_test.ref
 create mode 100644 Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
 create mode 100644 Generators/GeneratorObjects/test/CachedParticlePtr_test.cxx
 mode change 100755 => 100644 Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx

diff --git a/Generators/GeneratorObjects/CMakeLists.txt b/Generators/GeneratorObjects/CMakeLists.txt
index d8f8588d541..501a878e6e6 100644
--- a/Generators/GeneratorObjects/CMakeLists.txt
+++ b/Generators/GeneratorObjects/CMakeLists.txt
@@ -48,3 +48,8 @@ atlas_add_test( HepMcParticleLink_test
                 INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
                 LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthContainers CxxUtils AthLinks SGTools xAODTruth GaudiKernel TestTools AthenaKernel RootUtils RootUtilsPyROOT StoreGateLib SGtests GeneratorObjects ${GTEST_LIBRARIES} )
 
+
+atlas_add_test( CachedParticlePtr_test
+                SOURCES test/CachedParticlePtr_test.cxx
+                LINK_LIBRARIES GeneratorObjects )
+
diff --git a/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.h b/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.h
new file mode 100644
index 00000000000..06e5390eb32
--- /dev/null
+++ b/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.h
@@ -0,0 +1,149 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file GeneratorObjects/CachedParticlePtr.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Feb, 2019
+ * @brief Hold overloaded store/particle pointer.
+ */
+
+
+#ifndef GENERATOROBJECTS_CACHEDPARTICLEPTR_H
+#define GENERATOROBJECTS_CACHEDPARTICLEPTR_H
+
+
+#include "SGTools/CurrentEventStore.h"
+#include <atomic>
+#include <cassert>
+
+
+namespace HepMC {
+  class GenParticle;
+}
+class IProxyDict;
+
+
+namespace GeneratorObjects {
+
+
+/** 
+ * @brief Hold overloaded store/particle pointer.
+ *
+ * When we initialize a HepMcParticleLink, we need to save a reference
+ * to the current event store.  We use this to look up the particle container
+ * when the link is dereferenced.  After that, we no longer need
+ * the store pointer.  So to save space, we overload a single pointer
+ * to store both of them.  We distinguish the two by setting the low bit
+ * if an IProxyDict* is stored.  We allow the value to be atomically
+ * changed from an IProxyDict* to a GenParticle*.  This is safe to do
+ * concurrently as long as we always get the same GenParticle*.
+ */     
+class CachedParticlePtr
+{
+public:
+  /**
+   * @brief Default constructor.
+   * Initializes to a reference the current event store.
+   */
+  CachedParticlePtr();
+
+
+  /**
+   * @brief Constructor referencing a specific event store.
+   * @param sg The store to reference, as an IProxyDict*.
+   */
+  CachedParticlePtr (const IProxyDict* sg);
+
+
+  /**
+   * @brief Constructor referencing a specific particle.
+   * @param part The particle to reference.
+   */
+  CachedParticlePtr (const HepMC::GenParticle* part);
+
+
+  /**
+   * @brief Copy constructor.  (Can't be defaulted due to the atomic member.)
+   */
+  CachedParticlePtr (const CachedParticlePtr& other);
+
+
+  /**
+   * @brief Assignment.  (Can't be defaulted due to the atomic member.)
+   */
+  CachedParticlePtr& operator= (const CachedParticlePtr& other);
+
+
+  /**
+   * @brief Reset to reference a new event store.
+   * @param sg The store to reference, as an IProxyDict*.
+   *
+   * Not compatible with any other concurrent access.
+   */
+  void store (const IProxyDict* sg);
+
+
+  /**
+   * @brief Retrieve the current value.
+   * @param sg[out] Referenced event store.
+   *
+   * If this pointer is referencing an event store, set @c sg to that 
+   * and return nullptr.
+   * Otherwise, we're referencing a particular particle.
+   * Return that and set @c sg to nullptr.
+   */
+  const HepMC::GenParticle* get (IProxyDict const* & sg) const;
+
+
+  /**
+   * @brief Change the pointer to refer to a particle rather than a store.
+   * @param sg Store the pointer is currently referencing.
+   * @param part Particle the pointer should be referencing.
+   *
+   * It is ok to call this concurrently, as long as each call uses
+   * the same parameters.
+   */
+  void set (const IProxyDict* sg, const HepMC::GenParticle* part) const;
+
+
+private:
+  /**
+   * @brief Convert a store pointer to a void* stored value.
+   * @param sg IProxyDict* to reference.
+   *
+   * Sets the low bit and converts to void*.
+   */
+  static const void* storedict (const IProxyDict* sg);
+
+
+  /**
+   * @brief Test if a stored value references an event store.
+   * @param p The value to test.
+   *
+   * Tests if the low bit is set.
+   */
+  static bool isdict (const void* p);
+
+
+  /** 
+   * @brief Convert a stored value void* to an IProxyDict*.
+   * @param Clears the low bit and does pointer conversion.
+   */
+  static const IProxyDict* getdict (const void* p);
+
+
+  /// The stored pointer: either an IProxyDict* or a GenParticle*.
+  /// They are distinguished by setting the low bit for an IProxyDict*.
+  mutable std::atomic<const void*> m_ptr;
+};
+
+
+} // namespace GeneratorObjects
+
+
+#include "GeneratorObjects/CachedParticlePtr.icc"
+
+
+#endif // not GENERATOROBJECTS_CACHEDPARTICLEPTR_H
diff --git a/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.icc b/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.icc
new file mode 100644
index 00000000000..aeb89370e87
--- /dev/null
+++ b/Generators/GeneratorObjects/GeneratorObjects/CachedParticlePtr.icc
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file GeneratorObjects/CachedParticlePtr.icc
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Feb, 2019
+ * @brief Hold overloaded store/particle pointer.
+ */
+
+
+namespace GeneratorObjects {
+
+
+/**
+ * @brief Default constructor.
+ * Initializes to a reference the current event store.
+ */
+inline
+CachedParticlePtr::CachedParticlePtr()
+  : CachedParticlePtr (SG::CurrentEventStore::store())
+{
+}
+
+
+/**
+ * @brief Constructor referencing a specific event store.
+ * @param sg The store to reference, as an IProxyDict*.
+ */
+inline
+CachedParticlePtr::CachedParticlePtr (const IProxyDict* sg)
+  : m_ptr (storedict (sg))
+{
+}
+
+/**
+ * @brief Constructor referencing a specific particle.
+ * @param part The particle to reference.
+ */
+inline
+CachedParticlePtr::CachedParticlePtr (const HepMC::GenParticle* part)
+  : m_ptr (part)
+{
+  assert (!isdict (part));
+}
+
+
+/**
+ * @brief Copy constructor.  (Can't be defaulted due to the atomic member.)
+ */
+inline
+CachedParticlePtr::CachedParticlePtr (const CachedParticlePtr& other)
+  : m_ptr (static_cast<const void*>(other.m_ptr))
+{
+}
+
+
+/**
+ * @brief Assignment.  (Can't be defaulted due to the atomic member.)
+ */
+inline
+CachedParticlePtr& CachedParticlePtr::operator= (const CachedParticlePtr& other)
+{
+  if (this != &other) {
+    m_ptr = static_cast<const void*> (other.m_ptr);
+  }
+  return *this;
+}
+
+
+/**
+ * @brief Reset to reference a new event store.
+ * @param sg The store to reference, as an IProxyDict*.
+ *
+ * Not compatible with any other concurrent access.
+ */
+inline
+void CachedParticlePtr::store (const IProxyDict* sg)
+{
+  m_ptr = storedict (sg);
+}
+
+
+/**
+ * @brief Retrieve the current value.
+ * @param sg[out] Referenced event store.
+ *
+ * If this pointer is referencing an event store, set @c sg to that 
+ * and return nullptr.
+ * Otherwise, we're referencing a particular particle.
+ * Return that and set @c sg to nullptr.
+ */
+inline
+const HepMC::GenParticle*
+CachedParticlePtr::get (IProxyDict const* & sg) const
+{
+  const void* p = m_ptr;
+  if (isdict (p)) {
+    sg = getdict (p);
+    return nullptr;
+  }
+  else {
+    sg = nullptr;
+    return reinterpret_cast<const HepMC::GenParticle*> (p);
+  }
+}
+
+
+/**
+ * @brief Change the pointer to refer to a particle rather than a store.
+ * @param sg Store the pointer is currently referencing.
+ * @param part Particle the pointer should be referencing.
+ *
+ * It is ok to call this concurrently, as long as each call uses
+ * the same parameters.
+ */
+inline
+void CachedParticlePtr::set (const IProxyDict* sg,
+                             const HepMC::GenParticle* part) const
+{
+  assert (!isdict (part));
+  const void* p = storedict (sg);
+  m_ptr.compare_exchange_strong (p, part);
+  assert (p == part || p == storedict (sg));
+}
+
+
+/**
+ * @brief Convert a store pointer to a void* to store.
+ * @param sg IProxyDict* to reference.
+ *
+ * Sets the low bit and converts to void*.
+ */
+inline
+const void* CachedParticlePtr::storedict (const IProxyDict* sg)
+{
+  assert ((reinterpret_cast<unsigned long>(sg) & 1) == 0);
+  return reinterpret_cast<const void*>(reinterpret_cast<unsigned long>(sg) | 1);
+}
+
+
+/**
+ * @brief Test if a stored value references an event store.
+ * @param p The value to test.
+ *
+ * Tests if the low bit is set.
+ */
+inline
+bool CachedParticlePtr::isdict (const void* p)
+{
+  return (reinterpret_cast<unsigned long>(p)&1) != 0;
+}
+
+
+/** 
+ * @brief Convert a stored value void* to an IProxyDict*.
+ * @param Clears the low bit and does pointer conversion.
+ */
+inline
+const IProxyDict* CachedParticlePtr::getdict (const void* p)
+{
+  assert ((reinterpret_cast<unsigned long>(p)&1) != 0);
+  return reinterpret_cast<const IProxyDict*>(reinterpret_cast<unsigned long>(p)&~1UL);
+}
+
+
+} // namespace GeneratorObjects
diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h
index c4a53781620..03f23289188 100644
--- a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h
+++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h
@@ -1,20 +1,25 @@
 /*
-  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 GENERATOROBJECTS_HEPMCPARTICLELINK_H
 #define GENERATOROBJECTS_HEPMCPARTICLELINK_H
 /** @class HepMcParticleLink
- * @brief a link optimized in size for a GenParticle in a McEventCollection 
+ * @brief a link optimized in size for a GenParticle in a McEventCollection
  *
  * @see McEventCollection, GenEvent, ElementLink
  * @author Paolo Calafiura
  * $Id: HepMcParticleLink.h,v 1.11 2007-09-13 05:53:34 dquarrie Exp $
  **/
+
+#include "GeneratorObjects/CachedParticlePtr.h"
+#include "SGTools/DataProxy.h"
+#include "AthenaKernel/ExtendedEventContext.h"
+#include "GaudiKernel/MsgStream.h"
+#include "GaudiKernel/EventContext.h"
 #include <cassert>
 #include <cstdint> /*int32_t etc*/
 #include <iostream>
-#include "GaudiKernel/MsgStream.h"
 #include <limits>  /* numeric_limits */
 #include <string>
 
@@ -23,161 +28,593 @@ namespace HepMC {
   class GenEvent;
 }
 class IProxyDict;
+class McEventCollection;
+
+enum EBC_EVCOLL{
+  EBC_MAINEVCOLL=0,   //Usually contains the HS GenEvent
+  EBC_FIRSTPUEVCOLL,  //Low pt minbias PU, or full PU collection where applicable (i.e. Fast Chain)
+  EBC_SECONDPUEVCOLL, //High pt minbias PU
+  EBC_THIRDPUEVCOLL,  //Reserved for cavern background
+  EBC_NCOLLKINDS      //Just contains the maximum of the enum (for loops)
+};
 
+
+/**
+ * @brief a link optimized in size for a GenParticle in a McEventCollection
+ * 
+ * A link is defined by three items:
+ *  - A target McEventCollection;
+ *  - A particlular GenEvent within this collection; and
+ *  - A particular particle within the GenEvent.
+ *
+ * The target McEventCollection is identified by an enum of type EBC_EVCOLL.
+ * These enums may also be represented as the characters 'a'..'d'.
+ * Each of these enums has an associated list of StoreGate keys (see
+ * the initialization of @c s_keys).  When we want to dereference the link,
+ * we try to look up each possible key in turn until we find one that works.
+ * (The position of that key in the list is then remembered as a hint
+ * for where to start searching next time.)
+ *
+ * The particular GenEvent within the collection can be represented as either
+ * an event number (as returned by GenEvent::event_number()) or by a position
+ * within the collection.  Which case is desired is indicated by the value
+ * of the isIndexEventPosition argument to the constructors (defaulting
+ * to the event number case).  In order to convert between these, we need
+ * to retrieve the McEventCollection from the store, but we don't have
+ * the store pointer once the link has been dereferenced.  Therefore,
+ * when a position-based link is dereferenced, it is automatically changed
+ * to be event-number-based.  This also happens when a link is constructed
+ * with an explicit GenParticle* and a position-based GenEvent.
+ *
+ * As a special case, a GenEvent number of 0 is interpreted as the first
+ * GenEvent in the collection.
+ *
+ * The particle within the GenEvent is represented by a barcode.
+ * A barcode of 0 implies a null link.
+ *
+ * In order to dereference a link, we need to reference a particular
+ * event store.  By default, the current store (as defined by
+ * SG::CurrentEventStore::store()) is stored when the link is constructed;
+ * however, an explicit IProxyDict* or EventContext may also be specified.
+ * We don't need the store once the link has been dereferenced; therefore,
+ * to keep the size of the links small, the same pointer field is overloaded
+ * to store either an IProxyDict* or a GenParticle* (see CachedParticlePtr).
+ */
 class HepMcParticleLink {
-public:  
+public:
   typedef uint32_t barcode_type;
   typedef uint16_t index_type;
 
-  /// \name structors
-  //@{
-  HepMcParticleLink() { init_dict(); }
-  HepMcParticleLink(IProxyDict* sg)
-    : m_have_particle(false)
-  {
-    m_ptrs.m_dict = sg;
-  }
-  HepMcParticleLink(barcode_type barCode, uint32_t eventIndex = 0) :
-    m_extBarcode(barCode, eventIndex) { init_dict(); }
-  HepMcParticleLink(barcode_type barCode, uint32_t eventIndex,
-                    IProxyDict* sg)
-    : m_extBarcode(barCode, eventIndex),
-      m_have_particle(false)
-  {
-    m_ptrs.m_dict = sg;
-  }
-  HepMcParticleLink(const HepMC::GenParticle* p, uint32_t eventIndex = 0);
-  HepMcParticleLink(const HepMcParticleLink& rhs) : 
-    m_ptrs(rhs.m_ptrs),
-    m_extBarcode(rhs.m_extBarcode),
-    m_have_particle (rhs.m_have_particle){  }
-
-  HepMcParticleLink& operator= (const HepMcParticleLink& rhs)
-  {
-    if (this != &rhs) {
-      m_ptrs = rhs.m_ptrs;
-      m_extBarcode = rhs.m_extBarcode;
-      m_have_particle = rhs.m_have_particle;
-    }
-    return *this;
-  }
-////  HepMcParticleLink(const HepMC::GenParticle* part, 
-////		    const HepMC::GenEvent* pevt); //FIXME NOT YET 
-  //@}
-  
+
+  enum PositionFlag {
+    IS_INDEX = 0,
+    IS_POSITION = 1,
+  };
+
+
+  /**
+   * @brief Persistent representation of a link.
+   *        See @c HepMcParticleLink for details.
+   */
+  class ExtendedBarCode {
+  public:
+    /// All 1's.  Used to represent an undefined index/position.
+    constexpr static index_type UNDEFINED = ~static_cast<index_type>(0);
+
+
+    /** 
+     * @brief Default constructor.  Makes a null link (barcode 0).
+     */
+    ExtendedBarCode();
+
+
+    /** 
+     * @brief Constructor.
+     * @param barcode Barcode of target particle.
+     * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+     *        as either the number if @c isIndexEventPosition is IS_INDEX,
+     *        or the position in the container
+     *        if isIndexEventPosition is IS_POSITION.
+     *        0 always means the first event in the collection.
+     * @param evtColl Identifies which McEventCollection to use.
+     * @param isIndexEventPosition: See @c eventIndex.
+     */
+    ExtendedBarCode (barcode_type barcode,
+                     index_type eventIndex,
+                     EBC_EVCOLL evtColl=EBC_MAINEVCOLL,
+                     PositionFlag isIndexEventPosition = IS_INDEX);
+
+                    
+    /** 
+     * @brief Constructor.
+     * @param barcode Barcode of target particle.
+     * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+     *        as either the number if @c isIndexEventPosition is IS_INDEX,
+     *        or the position in the container
+     *        if isIndexEventPosition is IS_POSITION.
+     *        0 always means the first event in the collection.
+     * @param evtColl Identifies which McEventCollection to use,
+     *        as a character ('a'..'d').
+     * @param isIndexEventPosition: See @c eventIndex.
+     */
+    ExtendedBarCode (barcode_type barcode,
+                     index_type eventIndex,
+                     char evtColl,
+                     PositionFlag isIndexEventPosition = IS_INDEX);
+
+
+    /**
+     * @brief Copy constructor.  (Can't be defaulted due to the atomic member.)
+     */
+    ExtendedBarCode(const ExtendedBarCode& rhs);
+
+
+    /**
+     * @brief Assignment.  (Can't be defaulted due to the atomic member.)
+     */
+    ExtendedBarCode& operator= (const ExtendedBarCode& rhs);
+
+
+    /**
+     * @brief Barcode of target variable (0 for a null link).
+     */
+    barcode_type barcode() const;
+
+
+    /**
+     * @brief Return the event index/position.
+     * @param index[out] Event index (number), or @c UNDEFINED.
+     * @param position[out] Event position, or @c UNDEFINED.
+     *
+     * The GenEvent within the McEventCollection is identified either by
+     * the GenEvent number or by the position within the collection.
+     * This method will return this by setting either @c index or @c position;
+     * the other one is set to @c UNDEFINED.
+     */
+    void eventIndex (index_type& index, index_type& position) const;
+
+
+    /**
+     * @brief Return which collection we're targeting, as an enum.
+     */
+    EBC_EVCOLL getEventCollection() const;
+
+
+    /**
+     * @brief Return which collection we're targeting, as a char ('a'..'d').
+     */
+    char getEventCollectionAsChar() const;
+
+
+    /**
+     * @brief Translate event collection enum to a char ('a'..'d').
+     */
+    static char eventCollectionAsChar (EBC_EVCOLL evtColl);
+
+
+    /**
+     * @brief Translate event char ('a'..'d') to an enum.
+     */
+    static EBC_EVCOLL eventCollectionFromChar (char evtColl);
+
+
+    /**
+     * @brief Equality test.
+     *
+     * Be aware: if one EBC holds the target GenEvent by number and the
+     * other by position, then this will always return false, even if they
+     * reference the same GenEvent.
+     * To avoid this, use HepMcParticleLink::operator=.
+     */
+    bool operator == (const ExtendedBarCode& rhs ) const;
+
+
+    /**
+     * @brief Inequality test.
+     *
+     * Be aware: if one EBC holds the target GenEvent by number and the
+     * other by position, then this will always return true, even if they
+     * reference the same GenEvent.
+     * To avoid this, use HepMcParticleLink::operator=.
+     */
+    bool operator != (const ExtendedBarCode& rhs ) const;
+
+
+    /**
+     * @brief Ordering test.
+     *
+     * Be aware: if one EBC holds the target GenEvent by number and the
+     * other by position, then this will not work as expected.
+     * To avoid this, use HepMcParticleLink::operator=.
+     */
+    bool operator < (const ExtendedBarCode& rhs ) const;
+
+
+    /**
+     * @brief Compare the event index part of two links.
+     * @param lhs First link to compare.
+     * @param rhs Second link to compare.
+     * @returns -1, 0, or 1, depending on the result of the comparison.
+     *
+     * The event index part of the link can be represented as either
+     * an event number or the position within the container.
+     * If necessary, the links will be normalized so that they
+     * both refer to an event number.
+     */
+    static
+    int compareIndex (const HepMcParticleLink& lhs,
+                      const HepMcParticleLink& rhs);
+
+
+    /**
+     * @brief Dump in textual format to a stream.
+     */
+    void print(std::ostream& os) const;
+
+
+    /**
+     * @brief Dump in textual format to a MsgStream.
+     */
+    void print(MsgStream& os) const;
+
+
+    /**
+     * @brief Change index from position to number.
+     * @param index Event number to set.
+     * @param position Existing event position.
+     *
+     * If the link is currently referencing the GenEvent at @c position,
+     * update it so that it instead references the GenEvent
+     * with number @c index.
+     *
+     * This may be called concurrently, as long as all such concurrent
+     * calls have the same arguments.
+     */
+    void makeIndex (index_type index, index_type position) const;
+
+
+  private:
+    /// Flag marking that an index refers to an event position.
+    constexpr static index_type POSITION_MASK = UNDEFINED ^ (UNDEFINED>>1);
+
+
+    /**
+     * @brief Initialize the event index part of the link.
+     * @param idx The index or position.
+     * @param positionFlag If IS_POSITION, @c idx represents a position
+     *        in the collection; otherwise, it represents an event number.
+     */
+    void setIndex (index_type idx, PositionFlag isPosition);
+
+
+    /// Barcode of the target particle.  0 means a null link.
+    barcode_type m_BC;
+
+    /// Identifies the target GenEvent within the event collection.
+    /// If the high bit is set, then this (with the high bit clear)
+    /// is a position within the collection; otherwise, it is the
+    /// target GenEvent number.
+    mutable std::atomic<index_type> m_evtIndex;
+
+    /// Identifies which event collection is targeted.
+    EBC_EVCOLL m_evtColl;
+  };
+
+
+  /**
+   * @brief Default constructor.  Makes a null link.
+   * @param sg Optional specification of a specific store to reference.
+   */
+  HepMcParticleLink (IProxyDict* sg = SG::CurrentEventStore::store());
+
+
+  /**
+   * @brief Default constructor.  Makes a null link.
+   * @param ctx Context of the store to reference.
+   */
+  HepMcParticleLink (const EventContext& ctx);
+
+
+  /**
+   * @brief Constructor.
+   * @param barCode Barcode of the target particle.  0 means a null link.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evColl The targeted event collection, as an enum.
+   * @param positionFlag: See @c eventIndex.
+   * @param sg Optional specification of a specific store to reference.
+   */
+  HepMcParticleLink (barcode_type barCode,
+                     uint32_t eventIndex = 0,
+                     EBC_EVCOLL evColl = EBC_MAINEVCOLL,
+                     PositionFlag positionFlag = IS_INDEX,
+                     IProxyDict* sg = SG::CurrentEventStore::store());
+
+
+  /**
+   * @brief Constructor.
+   * @param barCode Barcode of the target particle.  0 means a null link.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evColl The targeted event collection, as an enum.
+   * @param positionFlag: See @c eventIndex.
+   * @param ctx Context of the store to reference.
+   */
+  HepMcParticleLink (barcode_type barCode,
+                     uint32_t eventIndex,
+                     EBC_EVCOLL evColl,
+                     PositionFlag positionFlag,
+                     const EventContext& ctx);
+
+
+ /**
+   * @brief Constructor.
+   * @param barCode Barcode of the target particle.  0 means a null link.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evCollName The name of the targeted event collection.
+   * @param positionFlag: See @c eventIndex.
+   * @param sg Optional specification of a specific store to reference.
+   */
+  HepMcParticleLink (barcode_type barCode,
+                     uint32_t eventIndex,
+                     const std::string& evCollName,
+                     PositionFlag positionFlag = IS_INDEX,
+                     IProxyDict* sg = SG::CurrentEventStore::store());
+
+
+ /**
+   * @brief Constructor.
+   * @param p Particle to reference.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evColl The targeted event collection, as an enum.
+   * @param positionFlag: See @c eventIndex.
+   * @param sg Optional specification of a specific store to reference.
+   */
+  HepMcParticleLink (const HepMC::GenParticle* p,
+                     uint32_t eventIndex = 0,
+                     EBC_EVCOLL evColl=EBC_MAINEVCOLL,
+                     PositionFlag positionFlag = IS_INDEX,
+                     IProxyDict* sg = SG::CurrentEventStore::store());
+
+
+ /**
+   * @brief Constructor.
+   * @param p Particle to reference.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evCollName The name of the targeted event collection.
+   * @param positionFlag: See @c eventIndex.
+   * @param sg Optional specification of a specific store to reference.
+   */
+  HepMcParticleLink (const HepMC::GenParticle* part,
+                     uint32_t eventIndex,
+                     const std::string& evCollName,
+                     PositionFlag positionFlag = IS_INDEX,
+                     IProxyDict* sg = SG::CurrentEventStore::store());
+
+
+ /**
+   * @brief Constructor.
+   * @param p Particle to reference.
+   * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+   *        as either the number if @c isIndexEventPosition is IS_INDEX,
+   *        or the position in the container
+   *        if isIndexEventPosition is IS_POSITION.
+   *        0 always means the first event in the collection.
+   * @param evColl The targeted event collection, as an enum.
+   * @param positionFlag: See @c eventIndex.
+   * @param ctx Context of the store to reference.
+   */
+  HepMcParticleLink (const HepMC::GenParticle* part,
+                     uint32_t eventIndex,
+                     EBC_EVCOLL evColl,
+                     PositionFlag positionFlag,
+                     const EventContext& ctx);
+
+
+  /**
+   * @brief Copy constructor.
+   */
+  HepMcParticleLink(const HepMcParticleLink& rhs);
+
+
+  /**
+   * @brief Assignment.
+   */
+  HepMcParticleLink& operator= (const HepMcParticleLink& rhs);
+
+
   /// \name pointer interface
   //@{
-  /// @throws std::runtime_error when the element is not found
-  const HepMC::GenParticle& operator* () const { return *cptr(); }//FIXME
-  const HepMC::GenParticle* operator->() const { return cptr(); }
-  operator const HepMC::GenParticle* () const { return cptr(); }
-  bool operator!() const {return !isValid();}
-  bool operator == (const HepMcParticleLink& rhs) const { 
-    return ( m_extBarcode== rhs.m_extBarcode ); }
-  bool operator != (const HepMcParticleLink& rhs) const { 
-    return !(operator==(rhs)); }
-  bool operator < (const HepMcParticleLink& rhs) const {
-    return ( m_extBarcode < rhs.m_extBarcode ); }
-  friend std::ostream& operator << (std::ostream&, const HepMcParticleLink&);
-  friend MsgStream& operator << (MsgStream&, const HepMcParticleLink&);
+
+
+  /**
+   * @brief Dereference.
+   */
+  const HepMC::GenParticle& operator* () const;
+
+
+  /**
+   * @brief Dereference.
+   */
+  const HepMC::GenParticle* operator->() const;
+
+
+  /**
+   * @brief Dereference.
+   */
+  operator const HepMC::GenParticle* () const;
+
+
+  /**
+   * @brief Dereference.
+   */
+  const HepMC::GenParticle* cptr() const;
+
+
+  /** 
+   * @brief Validity check.  Dereference and check for null.
+   */
+  bool isValid() const;
+
+
+  /** 
+   * @brief Validity check.  Dereference and check for null.
+   */
+  bool operator!() const;
 
   //@}
 
-  /// \name indexing accessors (e.g. for writing)
+  /// \name Comparison operators.
   //@{
-  int barcode() const { return int(m_extBarcode.barcode()); } //FIXME ret type
-  index_type eventIndex() const { return index_type(m_extBarcode.eventIndex()); }
-  ///hash the 32 bit barcode and 16 bit eventindex into a 32bit int
-  barcode_type compress() const { 
-    return ( ((m_extBarcode.barcode()&0xFFFF) << 16) | 
-	     m_extBarcode.eventIndex() ); 
-  };
+
+
+  /**
+   * @brief Equality comparison.
+   */
+  bool operator == (const HepMcParticleLink& rhs) const;
+
+
+  /**
+   * @brief Inequality comparison.
+   */
+  bool operator != (const HepMcParticleLink& rhs) const;
+
+
+  /**
+   * @brief Ordering comparison.
+   */
+  bool operator < (const HepMcParticleLink& rhs) const;
+
+
   //@}
-  
-  static const std::string s_DEFAULTKEY;
-  static const std::string s_DC2DEFAULTKEY;
-  static const std::string s_AODKEY;
 
-  bool isValid() const { return (0 != cptr()); }
-  const HepMC::GenParticle* cptr() const;
+  /// \name ParticleLink-specific methods.
+  //@{
 
-  class ExtendedBarCode {
-  public:
-    ExtendedBarCode() : m_BC(0), m_evtIndex(0) {}
-    ExtendedBarCode(barcode_type barcode, index_type eventIndex) :
-      m_BC(barcode), m_evtIndex(eventIndex)
-    {
-      assert(eventIndex < std::numeric_limits<unsigned short>::max()); 
-    }
-
-    barcode_type barcode() const { return m_BC; }
-    index_type eventIndex() const { return m_evtIndex; }
-    bool operator == (const ExtendedBarCode& rhs ) const
-    { 
-      return ( (this->m_BC)==(rhs.m_BC) && (this->m_evtIndex)==(rhs.m_evtIndex) ) ;
-    }
-    bool operator != (const ExtendedBarCode& rhs ) const {
-      return !(operator==(rhs));
-    }
-    bool operator < (const ExtendedBarCode& rhs ) const
-    { 
-      return ((m_evtIndex < rhs.m_evtIndex)  ||
-	      ((m_evtIndex == rhs.m_evtIndex) && (m_BC < rhs.m_BC)) ) ;
-    }
-    void print(std::ostream& os) const {
-      os << "Event index " << m_evtIndex
-	 << ", Barcode " << m_BC;
-    }
-    void print(MsgStream& os) const {
-      os << "Event index " << m_evtIndex
-	 << ", Barcode " << m_BC;
-    }
-    
-  private:
-    barcode_type m_BC;
-    index_type m_evtIndex;
-  }
-#ifdef __GNUC__
-  __attribute__ ((packed))
-#endif
-;
+
+  /**
+   * @brief Return the barcode of the target particle.  0 for a null link.
+   * FIXME: return type.
+   */
+  int barcode() const;
+
+
+  /**
+   * @brief Return the event number of the referenced GenEvent.
+   *        0 means the first GenEvent in the collection.
+   */
+  index_type eventIndex() const;
+
+
+  index_type getEventPositionInCollection (const IProxyDict* sg) const;
+
+
+  /**
+   * @brief Return which collection we're targeting, as an enum.
+   */
+  EBC_EVCOLL getEventCollection() const;
+
+
+  /**
+   * @brief Return which collection we're targeting, as a char ('a'..'d').
+   */
+  char getEventCollectionAsChar() const;
+
+
+  /**
+   * @brief Hash the 32 bit barcode and 16 bit eventindex into a 32bit int.
+   */
+  barcode_type compress() const;
+
+
+  /** 
+   * @brief Return the corresponding enum from a McEventCollection name.
+   */
+  static EBC_EVCOLL find_enumFromKey (const std::string& evCollName);
+
+
+  /** 
+   * @brief Alter the persistent part of the link.
+   */
+  void setExtendedBarCode (const ExtendedBarCode& extBarcode);
+
+
+  //@}
 
 
  private:
-  friend class HepMcParticleLinkCnv_p1;
-  friend class HepMcParticleLinkCnv_p2;
-
-  static std::string s_HOSTKEY;
-
-  // We need to remember the default data source when we're constructed.
-  // But once we have the particle pointer, we don't need it any more.
-  // Thus, we can put them in a union.  If m_have_particle is true,
-  // then m_particle is valid; otherwise, m_dict.  Note that adding
-  // m_have_particle doesn't add to the aligned size of this structure
-  // due to the trailing short in ExtendedBarCode.  But we have to use
-  // the __packed__ attribute on ExtendedBarCode above to prevent
-  // it from being padded out.
-  mutable union {
-    HepMC::GenParticle* m_particle;
-    IProxyDict* m_dict;
-  } m_ptrs; /* transient */
-  ExtendedBarCode m_extBarcode;
-  mutable bool m_have_particle; /* transient */
+  friend std::ostream& operator << (std::ostream&, const HepMcParticleLink&);
+  friend MsgStream& operator << (MsgStream&, const HepMcParticleLink&);
+
+
+  /**
+   * @brief Look up the event collection we're targeting.
+   * @param sg Target event store.
+   * May return nullptr if the collection is not found.
+   */
+  const McEventCollection*
+  retrieveMcEventCollection (const IProxyDict* sg) const;
+
+
+  /**
+   * @brief Find the proxy for the target event collection.
+   * @param sg Target event store.
+   * May return nullptr if the collection is not found.
+   */
+  SG::DataProxy* find_proxy (const IProxyDict* sg) const;
+
+
+  /**
+   * @brief Return the most recent SG key used for a particular collection type.
+   * @param evColl The targeted event collection, as an enum.
+   */
+  static std::string getLastEventCollectionName (EBC_EVCOLL evColl);
+
+
+  /// Transient part.  Either a GenParticle* or an IProxyDict*.
+  GeneratorObjects::CachedParticlePtr m_ptrs;
 
-  void init_dict();
-  bool find_hostkey() const;
+
+  /// Persistent part: barcode and location of target GenEvent.
+  ExtendedBarCode m_extBarcode;
 };
 
-inline
-std::ostream& 
-operator << (std::ostream& os, const HepMcParticleLink& link) {
-  link.m_extBarcode.print(os); return os; 
-}
 
-inline
-MsgStream& 
-operator << (MsgStream& os, const HepMcParticleLink& link) {
-  link.m_extBarcode.print(os); return os; 
-}
+/**
+ * @brief Output operator.
+ * @param os Stream to which to output.
+ * @param link Link to dump.
+ */
+std::ostream& operator<< (std::ostream& os, const HepMcParticleLink& link);
+
+
+/**
+ * @brief Output operator.
+ * @param os MsgStream to which to output.
+ * @param link Link to dump.
+ */
+MsgStream& operator<< (MsgStream& os, const HepMcParticleLink& link);
+
+
+#include "GeneratorObjects/HepMcParticleLink.icc"
+
 
 #endif
diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc
new file mode 100644
index 00000000000..62342578d61
--- /dev/null
+++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc
@@ -0,0 +1,602 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file GeneratorObjects/HepMcParticleLink.icc
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Feb, 2019
+ * @brief a link optimized in size for a GenParticle in a McEventCollection
+ */
+
+
+//**************************************************************************
+// ExtendedBarCode
+//
+
+inline
+HepMcParticleLink::ExtendedBarCode::ExtendedBarCode()
+  : m_BC(0),
+    m_evtIndex(0),
+    m_evtColl(EBC_MAINEVCOLL)
+{
+}
+
+
+/** 
+ * @brief Constructor.
+ * @param barcode Barcode of target particle.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evtColl Identifies which McEventCollection to use.
+ * @param isIndexEventPosition: See @c eventIndex.
+ */
+inline
+HepMcParticleLink::ExtendedBarCode::ExtendedBarCode
+  (barcode_type barcode,
+   index_type eventIndex,
+   EBC_EVCOLL evtColl /*=EBC_MAINEVCOLL*/,
+   PositionFlag isIndexEventPosition /*=IS_INDEX*/)
+    : m_BC(barcode),
+      m_evtColl (evtColl)
+{
+  setIndex (eventIndex, isIndexEventPosition);
+}
+
+
+/** 
+ * @brief Constructor.
+ * @param barcode Barcode of target particle.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evtColl Identifies which McEventCollection to use,
+ *        as a character ('a'..'d').
+ * @param isIndexEventPosition: See @c eventIndex.
+ */
+inline
+HepMcParticleLink::ExtendedBarCode::ExtendedBarCode
+  (barcode_type barcode,
+   index_type eventIndex,
+   char evtColl,
+   PositionFlag isIndexEventPosition /*=IS_INDEX*/)
+    : ExtendedBarCode (barcode,
+                       eventIndex,
+                       eventCollectionFromChar (evtColl),
+                       isIndexEventPosition)
+{
+}
+
+
+/**
+ * @brief Copy constructor.  (Can't be defaulted due to the atomic member.)
+ */
+inline
+HepMcParticleLink::ExtendedBarCode::ExtendedBarCode (const ExtendedBarCode& rhs)
+  : m_BC (rhs.m_BC),
+    m_evtIndex (static_cast<index_type> (rhs.m_evtIndex)),
+    m_evtColl (rhs.m_evtColl)
+{
+}
+
+
+/**
+ * @brief Assignment.  (Can't be defaulted due to the atomic member.)
+ */
+inline
+HepMcParticleLink::ExtendedBarCode&
+HepMcParticleLink::ExtendedBarCode::operator= (const ExtendedBarCode& rhs)
+{
+  if (this != &rhs) {
+    m_BC = rhs.m_BC;
+    m_evtIndex = static_cast<index_type> (rhs.m_evtIndex);
+    m_evtColl=rhs.m_evtColl;
+  }
+  return *this;
+}
+
+
+/**
+ * @brief Barcode of target variable (0 for a null link).
+ */
+inline
+HepMcParticleLink::barcode_type
+HepMcParticleLink::ExtendedBarCode::barcode() const
+{
+  return m_BC;
+}
+
+
+/**
+ * @brief Return the event index/position.
+ * @param index[out] Event index (number), or @c UNDEFINED.
+ * @param position[out] Event position, or @c UNDEFINED.
+ *
+ * The GenEvent within the McEventCollection is identified either by
+ * the GenEvent number or by the position within the collection.
+ * This method will return this by setting either @c index or @c position;
+ * the other one is set to @c UNDEFINED.
+ */
+inline
+void HepMcParticleLink::ExtendedBarCode::eventIndex (index_type& index,
+                                                     index_type& position) const
+{
+  index_type idx = m_evtIndex;
+  if (idx & POSITION_MASK) {
+    index = UNDEFINED;
+    position = idx & ~POSITION_MASK;
+  }
+  else {
+    index = idx;
+    position = UNDEFINED;
+  }
+}
+
+
+/**
+ * @brief Return which collection we're targeting, as an enum.
+ */
+inline
+EBC_EVCOLL HepMcParticleLink::ExtendedBarCode::getEventCollection() const
+{
+  return m_evtColl;
+}
+
+
+/**
+ * @brief Return which collection we're targeting, as a char ('a'..'d').
+ */
+inline
+char HepMcParticleLink::ExtendedBarCode::getEventCollectionAsChar() const
+{
+  return eventCollectionAsChar (m_evtColl);
+}
+
+
+/**
+ * @brief Equality test.
+ *
+ * Be aware: if one EBC holds the target GenEvent by number and the
+ * other by position, then this will always return false, even if they
+ * reference the same GenEvent.
+ * To avoid this, use HepMcParticleLink::operator=.
+ */
+inline
+bool
+HepMcParticleLink::ExtendedBarCode::operator==(const ExtendedBarCode& rhs) const
+{
+  return (this->m_BC == rhs.m_BC &&
+          this->m_evtColl == rhs.m_evtColl &&
+          this->m_evtIndex == rhs.m_evtIndex);
+}
+
+
+/**
+ * @brief Inequality test.
+ *
+ * Be aware: if one EBC holds the target GenEvent by number and the
+ * other by position, then this will always return true, even if they
+ * reference the same GenEvent.
+ * To avoid this, use HepMcParticleLink::operator=.
+ */
+inline
+bool
+HepMcParticleLink::ExtendedBarCode::operator!= (const ExtendedBarCode& rhs) const
+{
+  return !(operator==(rhs));
+}
+
+
+/**
+ * @brief Ordering test.
+ *
+ * Be aware: if one EBC holds the target GenEvent by number and the
+ * other by position, then this will not work as expected.
+ * To avoid this, use HepMcParticleLink::operator=.
+ */
+inline
+bool
+HepMcParticleLink::ExtendedBarCode::operator< (const ExtendedBarCode& rhs) const
+{
+  return (m_evtColl < rhs.m_evtColl ||
+          (m_evtColl == rhs.m_evtColl && m_evtIndex < rhs.m_evtIndex)  ||
+          (m_evtColl == rhs.m_evtColl && m_evtIndex == rhs.m_evtIndex && m_BC < rhs.m_BC) ) ;
+}
+
+
+/**
+ * @brief Compare the event index part of two links.
+ * @param lhs First link to compare.
+ * @param rhs Second link to compare.
+ * @returns -1, 0, or 1, depending on the result of the comparison.
+ *
+ * The event index part of the link can be represented as either
+ * an event number or the position within the container.
+ * If necessary, the links will be normalized so that they
+ * both refer to an event number.
+ */
+inline
+int
+HepMcParticleLink::ExtendedBarCode::compareIndex (const HepMcParticleLink& lhs,
+                                                  const HepMcParticleLink& rhs)
+{
+  // Get the stored indices.  The high bit will be set of they
+  // represent a position.  Do a quick test for equality.
+  index_type idx1 = lhs.m_extBarcode.m_evtIndex;
+  index_type idx2 = rhs.m_extBarcode.m_evtIndex;
+  if (idx1 == idx2) return 0;
+
+  // Normalize the values so that they both refer to event number;
+  // this happens as a side-effect of calling cptr().
+  if (idx1 & POSITION_MASK) {
+    lhs.cptr();
+    idx1 = lhs.m_extBarcode.m_evtIndex;
+  }
+  if (idx2 & POSITION_MASK) {
+    rhs.cptr();
+    idx2 = rhs.m_extBarcode.m_evtIndex;
+  }
+
+  // Compare.
+  if (idx1 == idx2) {
+    return 0;
+  }
+  else if (idx1 < idx2) {
+    return -1;
+  }
+  else {
+    return 1;
+  }
+}
+
+
+/**
+ * @brief Change index from position to number.
+ * @param index Event number to set.
+ * @param position Existing event position.
+ *
+ * If the link is currently referencing the GenEvent at @c position,
+ * update it so that it instead references the GenEvent
+ * with number @c index.
+ *
+ * This may be called concurrently, as long as all such concurrent
+ * calls have the same arguments.
+ */
+inline
+void HepMcParticleLink::ExtendedBarCode::makeIndex (index_type index,
+                                                    index_type position) const
+{
+  assert ((index & POSITION_MASK) == 0);
+  index_type old = position | POSITION_MASK;
+  m_evtIndex.compare_exchange_strong (old, index);
+  assert (old == (position|POSITION_MASK) || old == index);
+}
+
+
+/**
+ * @brief Initialize the event index part of the link.
+ * @param idx The index or position.
+ * @param positionFlag If IS_POSITION, @c idx represents a position
+ *        in the collection; otherwise, it represents an event number.
+ */
+inline
+void
+HepMcParticleLink::ExtendedBarCode::setIndex (index_type idx,
+                                              PositionFlag positionFlag)
+{
+  assert ((idx & POSITION_MASK) == 0);
+  if (positionFlag == IS_POSITION) {
+    idx |= POSITION_MASK;
+  }
+  m_evtIndex = idx;
+}
+
+
+//**************************************************************************
+// HepMcParticleLink
+//
+
+
+/**
+ * @brief Default constructor.  Makes a null link.
+ * @param sg Optional specification of a specific store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (IProxyDict* sg /*= SG::CurrentEventStore::store()*/)
+  : m_ptrs (sg)
+{
+}
+
+
+/**
+ * @brief Default constructor.  Makes a null link.
+ * @param ctx Context of the store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (const EventContext& ctx)
+  : HepMcParticleLink (ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
+{
+}
+
+                       
+/**
+ * @brief Constructor.
+ * @param barCode Barcode of the target particle.  0 means a null link.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evColl The targeted event collection, as an enum.
+ * @param positionFlag: See @c eventIndex.
+ * @param sg Optional specification of a specific store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (barcode_type barCode,
+                                      uint32_t eventIndex /*= 0*/,
+                                      EBC_EVCOLL evColl /*= EBC_MAINEVCOLL*/,
+                                      PositionFlag positionFlag /*= IS_INDEX*/,
+                                      IProxyDict* sg /*= SG::CurrentEventStore::store()*/)
+  : m_ptrs (sg),
+    m_extBarcode (barCode, eventIndex, evColl, positionFlag)
+{
+}
+
+                      
+/**
+ * @brief Constructor.
+ * @param barCode Barcode of the target particle.  0 means a null link.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evCollName The name of the targeted event collection.
+ * @param positionFlag: See @c eventIndex.
+ * @param sg Optional specification of a specific store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (barcode_type barCode,
+                                      uint32_t eventIndex /*= 0*/,
+                                      const std::string& evCollName,
+                                      PositionFlag positionFlag /*= IS_INDEX*/,
+                                      IProxyDict* sg /*= SG::CurrentEventStore::store()*/)
+  : HepMcParticleLink (barCode, eventIndex,
+                       find_enumFromKey (evCollName),
+                       positionFlag, sg)
+{
+}
+
+
+/**
+ * @brief Constructor.
+ * @param barCode Barcode of the target particle.  0 means a null link.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evColl The targeted event collection, as an enum.
+ * @param positionFlag: See @c eventIndex.
+ * @param ctx Context of the store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (barcode_type barCode,
+                                      uint32_t eventIndex,
+                                      EBC_EVCOLL evColl,
+                                      PositionFlag positionFlag,
+                                      const EventContext& ctx)
+  : HepMcParticleLink (barCode, eventIndex, evColl, positionFlag,
+                       ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
+{
+}
+
+
+/**
+ * @brief Constructor.
+ * @param p Particle to reference.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evCollName The name of the targeted event collection.
+ * @param positionFlag: See @c eventIndex.
+ * @param sg Optional specification of a specific store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (const HepMC::GenParticle* part,
+                                      uint32_t eventIndex,
+                                      const std::string& evCollName,
+                                      PositionFlag positionFlag /*= IS_INDEX*/,
+                                      IProxyDict* sg /*= SG::CurrentEventStore::store()*/)
+  : HepMcParticleLink (part, eventIndex,
+                       find_enumFromKey (evCollName),
+                       positionFlag, sg)
+{
+}
+
+
+/**
+ * @brief Constructor.
+ * @param p Particle to reference.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evColl The targeted event collection, as an enum.
+ * @param positionFlag: See @c eventIndex.
+ * @param ctx Context of the store to reference.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (const HepMC::GenParticle* part,
+                                      uint32_t eventIndex,
+                                      EBC_EVCOLL evColl,
+                                      PositionFlag positionFlag,
+                                      const EventContext& ctx)
+  : HepMcParticleLink (part, eventIndex, evColl, positionFlag,
+                       ctx.getExtension<Atlas::ExtendedEventContext>().proxy())
+{
+}
+
+
+/**
+ * @brief Copy constructor.
+ */
+inline
+HepMcParticleLink::HepMcParticleLink (const HepMcParticleLink& rhs)
+  : m_ptrs(rhs.m_ptrs),
+    m_extBarcode(rhs.m_extBarcode)
+{
+}
+
+
+/**
+ * @brief Assignment.
+ */
+inline
+HepMcParticleLink& HepMcParticleLink::operator= (const HepMcParticleLink& rhs)
+{
+  if (this != &rhs) {
+    m_ptrs = rhs.m_ptrs;
+    m_extBarcode = rhs.m_extBarcode;
+  }
+  return *this;
+}
+
+
+/**
+ * @brief Dereference.
+ */
+inline
+const HepMC::GenParticle& HepMcParticleLink::operator* () const
+{
+  return *cptr();
+}
+
+
+/**
+ * @brief Dereference.
+ */
+inline
+const HepMC::GenParticle* HepMcParticleLink::operator->() const
+{
+  return cptr();
+}
+
+
+/**
+ * @brief Dereference.
+ */
+inline
+HepMcParticleLink::operator const HepMC::GenParticle* () const
+{
+  return cptr();
+}
+
+
+/** 
+ * @brief Validity check.  Dereference and check for null.
+ */
+inline
+bool HepMcParticleLink::isValid() const
+{
+  return (0 != cptr());
+}
+
+
+/** 
+ * @brief Validity check.  Dereference and check for null.
+ */
+inline
+bool HepMcParticleLink::operator!() const
+{
+  return !isValid();
+}
+
+
+/**
+ * @brief Equality comparison.
+ */
+inline
+bool HepMcParticleLink::operator== (const HepMcParticleLink& rhs) const
+{
+  return  (m_extBarcode.barcode()==rhs.m_extBarcode.barcode() &&
+           m_extBarcode.getEventCollection()==rhs.m_extBarcode.getEventCollection() &&
+           ExtendedBarCode::compareIndex (*this, rhs) == 0);
+}
+
+
+/**
+ * @brief Inequality comparison.
+ */
+inline
+bool HepMcParticleLink::operator!= (const HepMcParticleLink& rhs) const
+{
+  return !(operator==(rhs));
+}
+
+
+/**
+ * @brief Ordering comparison.
+ */
+inline
+bool HepMcParticleLink::operator< (const HepMcParticleLink& rhs) const
+{
+  if (m_extBarcode.getEventCollection() < rhs.m_extBarcode.getEventCollection()) return true;
+  if (m_extBarcode.getEventCollection() == rhs.m_extBarcode.getEventCollection()) {
+    int cmpIndex = ExtendedBarCode::compareIndex (*this, rhs);
+    if (cmpIndex < 0) return true;
+    if (cmpIndex == 0) {
+      return m_extBarcode.barcode() < rhs.m_extBarcode.barcode();
+    }
+  }
+  return false;
+}
+
+
+/**
+ * @brief Return the barcode of the target particle.  0 for a null link.
+ * FIXME: return type.
+ */
+inline
+int HepMcParticleLink::barcode() const
+{
+  return int(m_extBarcode.barcode());
+}
+
+
+/**
+ * @brief Return which collection we're targeting, as an enum.
+ */
+inline
+EBC_EVCOLL HepMcParticleLink::getEventCollection() const
+{
+  return m_extBarcode.getEventCollection();
+}
+
+
+/**
+ * @brief Return which collection we're targeting, as a char ('a'..'d').
+ */
+inline
+char HepMcParticleLink::getEventCollectionAsChar() const
+{
+  return m_extBarcode.getEventCollectionAsChar();
+}
+
+
+/**
+ * @brief Hash the 32-bit barcode and 16-bit eventindex into a 32bit int.
+ */
+inline
+HepMcParticleLink::barcode_type HepMcParticleLink::compress() const
+{
+  return ( ((m_extBarcode.barcode()&0xFFFF) << 16) |
+           eventIndex() );
+}
diff --git a/Generators/GeneratorObjects/share/CachedParticlePtr_test.ref b/Generators/GeneratorObjects/share/CachedParticlePtr_test.ref
new file mode 100644
index 00000000000..3f554989732
--- /dev/null
+++ b/Generators/GeneratorObjects/share/CachedParticlePtr_test.ref
@@ -0,0 +1,3 @@
+CachedParticlePtr_test
+test1
+test2
diff --git a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
new file mode 100644
index 00000000000..3b5c108c78e
--- /dev/null
+++ b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref
@@ -0,0 +1,31 @@
+[==========] Running 3 tests from 1 test case.
+[----------] Global test environment set-up.
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Tue Feb 19 16:13:51 2019
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+EventLoopMgr      WARNING Unable to locate service "EventSelector" 
+EventLoopMgr      WARNING No events will be processed from external input.
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr Ready
+[----------] 3 tests from HepMcParticleLink_test
+[ RUN      ] HepMcParticleLink_test.old_test
+*** HepMcParticleLink_test starts ***
+ClassIDSvc           INFO  getRegistryEntries: read 896 CLIDRegistry entries for module ALL
+Testing HepMcParticleLink streamer Event index 0, Barcode 10005, McEventCollection CollectionNotSet(a) --- Event index 1, Barcode 10005, McEventCollection CollectionNotSet(a)
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
+*** HepMcParticleLink_test OK ***
+[       OK ] HepMcParticleLink_test.old_test (63 ms)
+[ RUN      ] HepMcParticleLink_test.broken_event_link
+ClassIDSvc           INFO  getRegistryEntries: read 1024 CLIDRegistry entries for module ALL
+[       OK ] HepMcParticleLink_test.broken_event_link (5 ms)
+[ RUN      ] HepMcParticleLink_test.truth_event_link
+[       OK ] HepMcParticleLink_test.truth_event_link (0 ms)
+[----------] 3 tests from HepMcParticleLink_test (68 ms total)
+
+[----------] Global test environment tear-down
+[==========] 3 tests from 1 test case ran. (113 ms total)
+[  PASSED  ] 3 tests.
diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
index 286ad928861..bdf672d83ed 100644
--- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
+++ b/Generators/GeneratorObjects/src/HepMcParticleLink.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 @@
 // Don't use the StoreGateSvc interface here, so that this code
 // will work in root too.
 
-#include <cassert>
+#include "GeneratorObjects/HepMcParticleLink.h"
 #include "GeneratorObjects/McEventCollection.h"
 #include "StoreGate/StoreGate.h"
 #include "HepMC/GenParticle.h"
@@ -16,116 +16,387 @@
 #include "GaudiKernel/MsgStream.h"
 #include "SGTools/CurrentEventStore.h"
 #include "SGTools/DataProxy.h"
+#include <sstream>
+#include <cassert>
 
-#include "GeneratorObjects/HepMcParticleLink.h"
-
-const std::string HepMcParticleLink::s_DEFAULTKEY("TruthEvent");
-const std::string HepMcParticleLink::s_DC2DEFAULTKEY("G4Truth");
-const std::string HepMcParticleLink::s_AODKEY("GEN_AOD");
-std::string HepMcParticleLink::s_HOSTKEY;
 
 namespace {
-  MsgStream& mlog() {
-    static MsgStream s_log(Athena::getMessageSvc(), "HepMcParticleLink");     
-    return s_log;
+
+
+/**
+ * @brief StoreGate keys to try for each EBC_EVCOLL enum.
+ */
+constexpr static int NKEYS = 4;
+const
+std::string s_keys[EBC_NCOLLKINDS][NKEYS] =
+  {
+   {"TruthEvent","G4Truth","GEN_AOD","GEN_EVENT"},
+   {"TruthEvent_PU","G4Truth_PU","GEN_AOD_PU","GEN_EVENT_PU"},
+   {"TruthEvent_HighPtPU","G4Truth_HighPtPU","GEN_AOD_HighPtPU","GEN_EVENT_HighPtPU"},
+   {"TruthEvent_Cavern","G4Truth_Cavern","GEN_AOD_Cavern","GEN_EVENT_Cavern"},
+  };
+
+
+/**
+ * @brief Hint about where to start searching.
+ *
+ * On a successful SG lookup of a McEventCollection, we store here the index
+ * in the s_keys array of the key that worked.  We can that start the
+ * search at that position the next time.
+ */
+std::atomic<unsigned> s_hints[EBC_NCOLLKINDS] = {NKEYS, NKEYS, NKEYS, NKEYS};
+
+
+const unsigned short CPTRMAXMSGCOUNT = 100;
+
+
+} // anonymous namespace
+
+
+//**************************************************************************
+// ExtendedBarCode
+//
+
+
+/**
+ * @brief Translate event collection enum to a char ('a'..'d').
+ */
+char
+HepMcParticleLink::ExtendedBarCode::eventCollectionAsChar (EBC_EVCOLL evtColl)
+{
+  static const char codes[EBC_NCOLLKINDS] = {'a', 'b', 'c', 'd'};
+  assert (evtColl < EBC_NCOLLKINDS);
+  return codes[evtColl];
+}
+
+
+/**
+ * @brief Translate event char ('a'..'d') to an enum.
+ */
+EBC_EVCOLL
+HepMcParticleLink::ExtendedBarCode::eventCollectionFromChar (char evtColl)
+{
+  switch (evtColl) {
+  case 'a': return EBC_MAINEVCOLL;
+  case 'b': return EBC_FIRSTPUEVCOLL;
+  case 'c': return EBC_SECONDPUEVCOLL;
+  case 'd': return EBC_THIRDPUEVCOLL;
+  default:
+    // Should not reach this
+    MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+    log << MSG::ERROR << " Wrong event collection (" << std::string(&evtColl,1) << ") set in HepMcParticleLink ExtendedBarCode object !!!" << endmsg;
   }
-  const unsigned short CPTRMAXMSGCOUNT(100);
+  return EBC_MAINEVCOLL;
 }
 
-HepMcParticleLink::HepMcParticleLink(const HepMC::GenParticle* part, 
-				     uint32_t eventIndex) :
-    m_extBarcode((0 != part) ? part->barcode() : 0, eventIndex),
-    m_have_particle (true)
+
+/**
+ * @brief Dump in textual format to a stream.
+ */
+void HepMcParticleLink::ExtendedBarCode::print (std::ostream& os) const
+{
+  os << "Event index " ;
+  index_type index, position;
+  eventIndex (index, position);
+  if (position != UNDEFINED) {
+    os << position << " (position in collection) ";
+  }
+  else {
+    os << index;
+  }
+  os << ", Barcode " << m_BC
+     << ", McEventCollection "
+     << HepMcParticleLink::getLastEventCollectionName(this->getEventCollection())
+     << "(" << eventCollectionAsChar (m_evtColl) << ")";
+}
+
+
+/**
+ * @brief Dump in textual format to a MsgStream.
+ */
+void HepMcParticleLink::ExtendedBarCode::print (MsgStream& os) const
+{
+  std::ostringstream ss;
+  print (ss);
+  os << ss.str();
+}
+
+
+//**************************************************************************
+// HepMcParticleLink
+//
+
+
+/**
+ * @brief Constructor.
+ * @param p Particle to reference.
+ * @param eventIndex Identifies the target GenEvent in a McEventCollection,
+ *        as either the number if @c isIndexEventPosition is IS_INDEX,
+ *        or the position in the container
+ *        if isIndexEventPosition is IS_POSITION.
+ *        0 always means the first event in the collection.
+ * @param evColl The targeted event collection, as an enum.
+ * @param positionFlag: See @c eventIndex.
+ * @param sg Optional specification of a specific store to reference.
+ */
+HepMcParticleLink::HepMcParticleLink (const HepMC::GenParticle* part,
+                                      uint32_t eventIndex,
+                                      EBC_EVCOLL evColl,
+                                      PositionFlag positionFlag /*= IS_INDEX*/,
+                                      IProxyDict* sg /*= SG::CurrentEventStore::store()*/)
+  : m_ptrs (part),
+    m_extBarcode((0 != part) ? part->barcode() : 0, eventIndex, evColl, positionFlag)
 {
-  m_ptrs.m_particle = const_cast<HepMC::GenParticle*>(part);
   assert(part);
+
+  if (part != 0 && positionFlag == IS_POSITION) {
+    if (const McEventCollection* pEvtColl = retrieveMcEventCollection(sg)) {
+      const HepMC::GenEvent *pEvt = pEvtColl->at (eventIndex);
+      m_extBarcode.makeIndex (pEvt->event_number(), eventIndex);
+    }
+    else {
+      MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+      log << MSG::WARNING << "cptr: McEventCollection not found" << endmsg;
+    }
+  }
 }
 
-const HepMC::GenParticle* HepMcParticleLink::cptr() const {
-  if (!m_have_particle) {
+
+/**
+ * @brief Dereference.
+ */
+const HepMC::GenParticle* HepMcParticleLink::cptr() const
+{
+  const IProxyDict* sg = nullptr;
+  const HepMC::GenParticle* p = m_ptrs.get (sg);
+  if (!p) {
     if (0 == barcode()) {
 #if 0
       mlog() << MSG::DEBUG
-	     << "cptr: no truth particle associated with this hit (barcode==0)."
-	     << " Probably this is a noise hit" << endmsg;
+             << "cptr: no truth particle associated with this hit (barcode==0)."
+             << " Probably this is a noise hit" << endmsg;
 #endif
-      return 0;
-    }
-    CLID clid = ClassID_traits<McEventCollection>::ID();
-    const McEventCollection* pEvtColl(0);
-    if(s_HOSTKEY.empty() ) {
-      if (!find_hostkey()) return 0;
-    }
-    SG::DataProxy* proxy = m_ptrs.m_dict->proxy (clid, s_HOSTKEY);
-    if (!proxy) {
-      if (!find_hostkey()) return 0;
-      proxy = m_ptrs.m_dict->proxy (clid, s_HOSTKEY);
+      return nullptr;
     }
-    if (proxy && 
-	(0 != (pEvtColl = SG::DataProxy_cast<McEventCollection> (proxy)))) {
-      const HepMC::GenEvent *pEvt((0 == eventIndex()) ?
-				  pEvtColl->at(0) : //original event is at EvtColl[0]
-				  pEvtColl->find(eventIndex()));
+    if (const McEventCollection* pEvtColl = retrieveMcEventCollection(sg)) {
+      const HepMC::GenEvent *pEvt = nullptr;
+      index_type index, position;
+      m_extBarcode.eventIndex (index, position);
+      if (index == 0) {
+        pEvt = pEvtColl->at(0);
+      }
+      else if (position != ExtendedBarCode::UNDEFINED) {
+        pEvt = pEvtColl->at (position);
+      }
+      else {
+        pEvt = pEvtColl->find (index);
+      }
+
       if (0 != pEvt) {
-	m_ptrs.m_particle = pEvt->barcode_to_particle(barcode());
-        m_have_particle = true;
+        p = pEvt->barcode_to_particle(barcode());
+        m_ptrs.set (sg, p);
+        if (position != ExtendedBarCode::UNDEFINED) {
+          m_extBarcode.makeIndex (pEvt->event_number(), position);
+        }
       } else {
-	mlog() << MSG::WARNING 
-	       << "cptr: Mc Truth not stored for event " << eventIndex() 
-	       << endmsg;
+        MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+        log << MSG::WARNING
+            << "cptr: Mc Truth not stored for event " << eventIndex()
+            << endmsg;
       }
     } else {
-      mlog() << MSG::WARNING << "cptr: McEventCollection not found" << endmsg;
+      MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+      log << MSG::WARNING << "cptr: McEventCollection not found" << endmsg;
+    }
+  }
+  return p;
+}
+
+
+/**
+ * @brief Return the event number of the referenced GenEvent.
+ *        0 means the first GenEvent in the collection.
+ */
+HepMcParticleLink::index_type HepMcParticleLink::eventIndex() const
+{
+  index_type index, position;
+  m_extBarcode.eventIndex (index, position);
+  if (index == ExtendedBarCode::UNDEFINED) {
+    cptr();
+    m_extBarcode.eventIndex (index, position);
+    assert (index != ExtendedBarCode::UNDEFINED);
+  }
+  return index;
+}
+
+
+HepMcParticleLink::index_type
+HepMcParticleLink::getEventPositionInCollection (const IProxyDict* sg) const
+{
+  index_type index, position;
+  m_extBarcode.eventIndex (index, position);
+  if (position != ExtendedBarCode::UNDEFINED) {
+    return position;
+  }
+  if (index == 0) {
+    return 0;
+  }
+
+  const McEventCollection* coll = retrieveMcEventCollection (sg);
+  size_t sz = coll->size();
+  for (size_t i = 0; i < sz; i++) {
+    if ((*coll)[i]->event_number() == index) {
+      return i;
     }
   }
 
-  if (m_have_particle)
-    return m_ptrs.m_particle;
-  return 0;
+  return ExtendedBarCode::UNDEFINED;
+}
+
+
+/** 
+ * @brief Return the corresponding enum from a McEventCollection name.
+ */
+EBC_EVCOLL HepMcParticleLink::find_enumFromKey (const std::string& evCollName)
+{
+  for (unsigned int iEnum=0; iEnum<EBC_NCOLLKINDS; ++iEnum) {
+    for (unsigned int iName=0;iName<NKEYS;iName++)
+      if (evCollName==s_keys[iEnum][iName]) {
+        return static_cast<EBC_EVCOLL>(iEnum);
+      }
+  }
+
+  MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+  log << MSG::WARNING << "HepMcParticleLink::find_enumFromKey(" << evCollName << "): trying to find enum for unknown McEventCollection, returning " << EBC_MAINEVCOLL << endmsg;
+  return EBC_MAINEVCOLL;
 }
 
 
+/** 
+ * @brief Alter the persistent part of the link.
+ */
+void HepMcParticleLink::setExtendedBarCode (const ExtendedBarCode& extBarcode)
+{
+  m_extBarcode = extBarcode;
+  m_ptrs.store (SG::CurrentEventStore::store());
+}
+
 
-// This is a bit overly complicated at the moment in order to work
-// with both the old and new DataModel.
-void HepMcParticleLink::init_dict()
+/**
+ * @brief Look up the event collection we're targeting.
+ * @param sg Target event store.
+ * May return nullptr if the collection is not found.
+ */
+const McEventCollection*
+HepMcParticleLink::retrieveMcEventCollection (const IProxyDict* sg) const
 {
-  m_have_particle = false;
-  m_ptrs.m_dict = SG::CurrentEventStore::store();
+  const McEventCollection* pEvtColl = nullptr;
+  SG::DataProxy* proxy = find_proxy (sg);
+  if (proxy) {
+    pEvtColl = SG::DataProxy_cast<McEventCollection> (proxy);
+    if (!pEvtColl) {
+      MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+      log << MSG::WARNING << "cptr: McEventCollection not found" << endmsg;
+    }
+  }
+  return pEvtColl;
 }
 
 
-bool HepMcParticleLink::find_hostkey() const
+/**
+ * @brief Find the proxy for the target event collection.
+ * @param sg Target event store.
+ * May return nullptr if the collection is not found.
+ */
+SG::DataProxy* HepMcParticleLink::find_proxy (const IProxyDict* sg) const
 {
-  static unsigned short msgCount(0);
-  assert (!m_have_particle);
-  CLID clid = ClassID_traits<McEventCollection>::ID();
-  s_HOSTKEY.clear();
-  if (m_ptrs.m_dict->proxy (clid, s_DEFAULTKEY))
-    s_HOSTKEY=s_DEFAULTKEY;
-  else if (m_ptrs.m_dict->proxy (clid, s_DC2DEFAULTKEY))
-    s_HOSTKEY=s_DC2DEFAULTKEY;
-  else if (m_ptrs.m_dict->proxy (clid, s_AODKEY))
-    s_HOSTKEY=s_AODKEY;
-  if (!s_HOSTKEY.empty()) {
-    mlog() << MSG::INFO << "find_hostkey: Using " << s_HOSTKEY
-        <<" as McEventCollection key for this job " << endmsg;
-    return true;
+  const CLID clid = ClassID_traits<McEventCollection>::ID();
+  EBC_EVCOLL evColl = getEventCollection();
+  assert (evColl < EBC_NCOLLKINDS);
+  unsigned int hint_orig = s_hints[evColl];
+  unsigned int hint = hint_orig;
+  if (hint >= NKEYS) hint = 0;
+  do {
+    SG::DataProxy* proxy = sg->proxy (clid, s_keys[evColl][hint]);
+    if (proxy) {
+      if (hint != s_hints[evColl]) {
+        s_hints[evColl] = hint;
+      }
+      static std::atomic<unsigned> findCount {0};
+      if(++findCount == 1) {
+        MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+        log << MSG::INFO << "find_proxy: Using " << s_keys[evColl][hint]
+            <<" as McEventCollection key for this job " << endmsg;
+      }
+      return proxy;
+    }
+    ++hint;
+    if (hint >= NKEYS) hint = 0;
+  } while (hint != hint_orig);
+
+  MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+  static std::atomic<unsigned long> msgCount {0};
+  unsigned int count = ++msgCount;
+  if (count <= CPTRMAXMSGCOUNT) {
+    log << MSG::WARNING << "find_proxy: No Valid MC event Collection found "
+        <<   endmsg;
+  }
+  if (count == CPTRMAXMSGCOUNT) {
+    log << MSG::WARNING <<"find_proxy: suppressing further messages about valid MC event Collection. Use \n"
+        << "  msgSvc.setVerbose += [HepMcParticleLink]\n"
+        << "to see all messages" << endmsg;
   }
-  if (msgCount<CPTRMAXMSGCOUNT) {
-    mlog() << MSG::WARNING << "find_hostkey: No Valid MC event Collection found "
-	   <<   endmsg;
-    ++msgCount;
-  } else if (msgCount==CPTRMAXMSGCOUNT) {
-    mlog() << MSG::WARNING <<"find_hostkey: suppressing further messages about valid MC event Collection. Use \n"
-	   << "  msgSvc.setVerbose += [HepMcParticleLink]\n"
-	   << "to see all messages" << endmsg;
-    ++msgCount;
-  } else {
-    mlog() << MSG::VERBOSE << "find_hostkey: No Valid MC event Collection found "
-	   << endmsg;
+  if (count > CPTRMAXMSGCOUNT) {
+    log << MSG::VERBOSE << "find_proxy: No Valid MC event Collection found "
+        << endmsg;
   }
-  return false;
+  return nullptr;
 }
 
 
+/**
+ * @brief Return the most recent SG key used for a particular collection type.
+ * @param evColl The targeted event collection, as an enum.
+ */
+std::string HepMcParticleLink::getLastEventCollectionName (EBC_EVCOLL evColl)
+{
+  static const std::string unset[EBC_NCOLLKINDS] =
+    {
+     "CollectionNotSet",
+     "PUCollectionNotSet",
+     "PU2CollectionNotSet",
+     "PU3CollectionNotSet",
+    };
+  assert (evColl < EBC_NCOLLKINDS);
+  unsigned idx = s_hints[evColl];
+  if (idx < NKEYS) {
+    return s_keys[evColl][idx];
+  }
+  return unset[evColl];
+}
+
+
+/**
+ * @brief Output operator.
+ * @param os Stream to which to output.
+ * @param link Link to dump.
+ */
+std::ostream&
+operator<< (std::ostream& os, const HepMcParticleLink& link)
+{
+  link.m_extBarcode.print(os);
+  return os;
+}
+
+
+/**
+ * @brief Output operator.
+ * @param os MsgStream to which to output.
+ * @param link Link to dump.
+ */
+MsgStream&
+operator<< (MsgStream& os, const HepMcParticleLink& link)
+{
+  link.m_extBarcode.print(os);
+  return os;
+}
diff --git a/Generators/GeneratorObjects/test/CachedParticlePtr_test.cxx b/Generators/GeneratorObjects/test/CachedParticlePtr_test.cxx
new file mode 100644
index 00000000000..360a5e36855
--- /dev/null
+++ b/Generators/GeneratorObjects/test/CachedParticlePtr_test.cxx
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file GeneratorObjects/CachedParticlePtr_test.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Feb, 2019
+ * @brief Unit tests for CachedParticlePtr
+ */
+
+
+#undef NDEBUG
+#include "GeneratorObjects/CachedParticlePtr.h"
+#include "HepMC/GenParticle.h"
+#include "SGTools/TestStore.h"
+#include "SGTools/CurrentEventStore.h"
+#include <thread>
+#include <shared_mutex>
+#include <iostream>
+#include <cassert>
+
+
+void test1 (const IProxyDict* store)
+{
+  std::cout << "test1\n";
+  HepMC::GenParticle gp1;
+
+  const IProxyDict* sg = nullptr;
+  GeneratorObjects::CachedParticlePtr p1;
+  assert (p1.get (sg) == nullptr);
+  assert (sg == store);
+  p1.set (sg, &gp1);
+  assert (p1.get (sg) == &gp1);
+  assert (sg == nullptr);
+
+  SGTest::TestStore store2;
+  GeneratorObjects::CachedParticlePtr p2 (&store2);
+  assert (p2.get (sg) == nullptr);
+  assert (sg == &store2);
+
+  GeneratorObjects::CachedParticlePtr p3 (&gp1);
+  assert (p3.get (sg) == &gp1);
+  assert (sg == nullptr);
+
+  GeneratorObjects::CachedParticlePtr p4 (p1);
+  assert (p4.get (sg) == &gp1);
+  assert (sg == nullptr);
+
+  p2 = p4;
+  assert (p2.get (sg) == &gp1);
+  assert (sg == nullptr);
+
+  p1.store (&store2);
+  assert (p1.get (sg) == nullptr);
+  assert (sg == &store2);
+}
+
+
+class ThreadingTest
+{
+public:
+  static const int NVAL = 10;
+  GeneratorObjects::CachedParticlePtr m_vals[NVAL];
+  std::shared_timed_mutex m_sm;
+  HepMC::GenParticle m_parts[NVAL];
+
+  void threadedTest (const IProxyDict* store);
+
+  struct writerThread
+  {
+    writerThread (ThreadingTest& test, int iworker, const IProxyDict* store)
+      : m_test (test), m_iworker (iworker), m_store (store) {}
+    void operator()();
+    ThreadingTest& m_test;
+    int m_iworker;
+    const IProxyDict* m_store;
+  };
+
+  
+  struct readerThread
+  {
+    readerThread (ThreadingTest& test, int iworker, const IProxyDict* store)
+      : m_test (test), m_iworker (iworker), m_store (store) {}
+    void operator()();
+    ThreadingTest& m_test;
+    int m_iworker;
+    const IProxyDict* m_store;
+  };
+};
+
+
+void ThreadingTest::writerThread::operator()()
+{
+  int i = m_iworker;
+  do {
+    m_test.m_vals[i].set (m_store, &m_test.m_parts[i]);
+    i++;
+    if (i >= NVAL) i = 0;
+  } while (i != m_iworker);
+}
+
+
+void ThreadingTest::readerThread::operator()()
+{
+  bool checked[NVAL] = {false};
+  int nchecked = 0;
+  while (nchecked < NVAL) {
+    int i = m_iworker;
+    do {
+      if (!checked[i]) {
+        const IProxyDict* sg = nullptr;
+        const HepMC::GenParticle* p = m_test.m_vals[i].get (sg);
+        if (p != nullptr) {
+          assert (p == &m_test.m_parts[i]);
+          assert (sg == nullptr);
+          checked[i] = true;
+          ++nchecked;
+        }
+        else {
+          assert (sg == m_store);
+        }
+      }
+      i++;
+      if (i >= NVAL) i = 0;
+    } while (i != m_iworker);
+  }
+}
+
+
+void ThreadingTest::threadedTest (const IProxyDict* store)
+{
+  const int nthread = 10;
+  std::thread threads[nthread];
+  m_sm.lock();
+
+  for (int i=0; i < nthread; i++) {
+    if (i < 3) {
+      threads[i] = std::thread (writerThread (*this, i, store));
+    }
+    else {
+      threads[i] = std::thread (readerThread (*this, i, store));
+    }
+  }
+
+  // Try to get the threads starting as much at the same time as possible.
+  m_sm.unlock();
+  for (int i=0; i < nthread; i++)
+    threads[i].join();
+}
+
+
+// Threading test.
+void test2 (const IProxyDict* store)
+{
+  std::cout << "test2\n";
+
+  ThreadingTest test;
+  for (int i=0; i < 20; i++)
+    test.threadedTest (store);
+}
+
+
+int main()
+{
+  std::cout << "CachedParticlePtr_test\n";
+
+  SGTest::TestStore store;
+  SG::CurrentEventStore::setStore (&store);
+
+  test1 (&store);
+  test2 (&store);
+
+  return 0;
+}
diff --git a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx
old mode 100755
new mode 100644
index c48b24b9e98..5edff9738ea
--- a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx
+++ b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx
@@ -1,11 +1,10 @@
 /*
-  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 John Chapman
  * @date June, 2016
- * @brief Tests for BeamEffectsAlg.
  */
 
 #undef NDEBUG
@@ -20,8 +19,6 @@
 
 // Google Test
 #include "gtest/gtest.h"
-// Google Mock
-// #include "gmock/gmock.h"
 
 // HepMC includes
 #include "HepMC/GenEvent.h"
@@ -201,7 +198,7 @@ namespace MCTesting {
   TEST_F(HepMcParticleLink_test, old_test) {
     std::cout << "*** HepMcParticleLink_test starts ***" <<std::endl;
 
-    SG::WriteHandle<McEventCollection> inputTestDataHandle{HepMcParticleLink::s_DEFAULTKEY};
+    SG::WriteHandle<McEventCollection> inputTestDataHandle{"TruthEvent"};
     inputTestDataHandle = CxxUtils::make_unique<McEventCollection>();
 
     HepMC::GenEvent* pEvent(buildEvent());
@@ -244,7 +241,7 @@ namespace MCTesting {
     ASSERT_LT( gammaLink1, gammaLink11 );  //FIXME weird! Can't check ptr...
     StoreGateSvc* pStore(nullptr);
     ASSERT_TRUE(MCTesting::g_svcLoc->service("StoreGateSvc", pStore).isSuccess());
-    pStore->clearStore();
+    pStore->clearStore(true); // forceRemove=true to remove all proxies
     std::cout << "*** HepMcParticleLink_test OK ***" <<std::endl;
   }
 
@@ -262,12 +259,12 @@ namespace MCTesting {
     HepMcParticleLink testLink1a(particle1,0);
     ASSERT_TRUE( testLink1a.isValid() );
     // A HepMcParticleLink built using the barcode and the position of
-    // the GenEvent in the McEventCollection will not work.
+    // the GenEvent in the McEventCollection should still work.
     HepMcParticleLink testLink1b(particle1->barcode(),0);
-    ASSERT_FALSE( testLink1b.isValid() );
+    ASSERT_TRUE( testLink1b.isValid() );
     StoreGateSvc* pStore(nullptr);
     ASSERT_TRUE(MCTesting::g_svcLoc->service("StoreGateSvc", pStore).isSuccess());
-    pStore->clearStore();
+    pStore->clearStore(true); // forceRemove=true to remove all proxies
   }
 
   TEST_F(HepMcParticleLink_test, truth_event_link) {
@@ -296,22 +293,25 @@ namespace MCTesting {
     const HepMC::GenParticle* particle3 = populateGenEvent(ge3);
 
     //Testing links to the first dummy GenEvent
+    const IProxyDict* sg = SG::CurrentEventStore::store();
 
     // HepMcParticleLink built using a GenParticle pointer and the
     // position of the GenEvent.
-    HepMcParticleLink testLink1a(particle1,0);
+    HepMcParticleLink testLink1a(particle1,0, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
     ASSERT_TRUE( testLink1a.isValid() );
     ASSERT_EQ( particle1->barcode(), testLink1a.barcode());
-    ASSERT_EQ(  0, testLink1a.eventIndex());
-    ASSERT_NE( event_number1, testLink1a.eventIndex());
+    ASSERT_EQ( event_number1, testLink1a.eventIndex());
+    ASSERT_EQ( 0, testLink1a.getEventPositionInCollection(sg));
     ASSERT_EQ(particle1,testLink1a.cptr());
     // A HepMcParticleLink built using the barcode and the position of
     // the GenEvent.
-    HepMcParticleLink testLink1b(particle1->barcode(),0);
+    HepMcParticleLink testLink1b(particle1->barcode(),0, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
     ASSERT_TRUE( testLink1b.isValid() );
     ASSERT_EQ( particle1->barcode(), testLink1b.barcode());
-    ASSERT_EQ(  0, testLink1b.eventIndex());
-    ASSERT_NE( event_number1, testLink1b.eventIndex());
+    ASSERT_EQ( event_number1, testLink1b.eventIndex());
+    ASSERT_EQ( 0, testLink1b.getEventPositionInCollection(sg));
     ASSERT_EQ(*(testLink1a.cptr()),*(testLink1b.cptr()));
     // HepMcParticleLink built using a GenParticle pointer and the
     // event_number of the GenEvent.
@@ -320,6 +320,7 @@ namespace MCTesting {
     ASSERT_EQ( particle1->barcode(), testLink1c.barcode());
     ASSERT_NE(  0, testLink1c.eventIndex());
     ASSERT_EQ( event_number1, testLink1c.eventIndex());
+    ASSERT_EQ( 0, testLink1c.getEventPositionInCollection(sg));
     ASSERT_EQ(particle1,testLink1c.cptr());
     // A HepMcParticleLink built using the barcode and the event_number of
     // the GenEvent.
@@ -328,22 +329,29 @@ namespace MCTesting {
     ASSERT_EQ( particle1->barcode(), testLink1d.barcode());
     ASSERT_NE(  0, testLink1d.eventIndex());
     ASSERT_EQ( event_number1, testLink1d.eventIndex());
+    ASSERT_EQ( 0, testLink1d.getEventPositionInCollection(sg));
     ASSERT_EQ(particle1,testLink1d.cptr());
 
     //Testing links to the second dummy GenEvent
 
     // HepMcParticleLink built using a GenParticle pointer and the
     // position of the GenEvent.
-    HepMcParticleLink testLink2a(particle2,1);
+    HepMcParticleLink testLink2a(particle2,1, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
     ASSERT_TRUE( testLink2a.isValid() );
     ASSERT_EQ( particle2->barcode(), testLink2a.barcode());
-    ASSERT_EQ(  1, testLink2a.eventIndex());
-    ASSERT_NE( event_number2, testLink2a.eventIndex());
+    ASSERT_EQ( event_number2, testLink2a.eventIndex());
+    ASSERT_EQ( 1, testLink2a.getEventPositionInCollection(sg));
     ASSERT_EQ(particle2,testLink2a.cptr());
     // A HepMcParticleLink built using the barcode and the position of
-    // the GenEvent. BROKEN
-    HepMcParticleLink testLink2b(particle2->barcode(),1);
-    ASSERT_FALSE( testLink2b.isValid() );
+    // the GenEvent.
+    HepMcParticleLink testLink2b(particle2->barcode(),1, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
+    ASSERT_TRUE( testLink2b.isValid() );
+    ASSERT_EQ( particle2->barcode(), testLink2b.barcode());
+    ASSERT_EQ( event_number2, testLink2b.eventIndex());
+    ASSERT_EQ( 1, testLink2b.getEventPositionInCollection(sg));
+    ASSERT_EQ(particle2,testLink2b.cptr());
     // HepMcParticleLink built using a GenParticle pointer and the
     // event_number of the GenEvent.
     HepMcParticleLink testLink2c(particle2,event_number2);
@@ -351,6 +359,7 @@ namespace MCTesting {
     ASSERT_EQ( particle2->barcode(), testLink2c.barcode());
     ASSERT_NE(  1, testLink2c.eventIndex());
     ASSERT_EQ( event_number2, testLink2c.eventIndex());
+    ASSERT_EQ( 1, testLink2c.getEventPositionInCollection(sg));
     ASSERT_EQ(particle2,testLink2c.cptr());
     // A HepMcParticleLink built using the barcode and the event_number of
     // the GenEvent.
@@ -359,22 +368,27 @@ namespace MCTesting {
     ASSERT_EQ( particle2->barcode(), testLink2d.barcode());
     ASSERT_NE(  1, testLink2d.eventIndex());
     ASSERT_EQ( event_number2, testLink2d.eventIndex());
+    ASSERT_EQ( 1, testLink2d.getEventPositionInCollection(sg));
     ASSERT_EQ(particle2,testLink2d.cptr());
 
     //Testing links to the third dummy GenEvent
 
     // HepMcParticleLink built using a GenParticle pointer and the
     // position of the GenEvent.
-    HepMcParticleLink testLink3a(particle3,2);
+    HepMcParticleLink testLink3a(particle3,2, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
     ASSERT_TRUE( testLink3a.isValid() );
     ASSERT_EQ( particle3->barcode(), testLink3a.barcode());
-    ASSERT_EQ(  2, testLink3a.eventIndex());
-    ASSERT_NE( event_number3, testLink3a.eventIndex());
+    ASSERT_EQ( event_number3, testLink3a.eventIndex());
     ASSERT_EQ(particle3,testLink3a.cptr());
     // A HepMcParticleLink built using the barcode and the position of
-    // the GenEvent. BROKEN
-    HepMcParticleLink testLink3b(particle3->barcode(),2);
-    ASSERT_FALSE( testLink3b.isValid() );
+    // the GenEvent.
+    HepMcParticleLink testLink3b(particle3->barcode(),2, EBC_MAINEVCOLL,
+                                 HepMcParticleLink::IS_POSITION);
+    ASSERT_TRUE( testLink3b.isValid() );
+    ASSERT_EQ( particle3->barcode(), testLink3b.barcode());
+    ASSERT_EQ( event_number3, testLink3b.eventIndex());
+    ASSERT_EQ(particle3,testLink3b.cptr());
     // HepMcParticleLink built using a GenParticle pointer and the
     // event_number of the GenEvent.
     HepMcParticleLink testLink3c(particle3,event_number3);
@@ -395,7 +409,7 @@ namespace MCTesting {
 
     StoreGateSvc* pStore(nullptr);
     ASSERT_TRUE(MCTesting::g_svcLoc->service("StoreGateSvc", pStore).isSuccess());
-    pStore->clearStore();
+    pStore->clearStore(true); // forceRemove=true to remove all proxies
   }
 
 } // <-- namespace MCTesting
-- 
GitLab


From 623361a3e9ac52e7ce1067ea4eee9513a02d494c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 19 Feb 2019 23:05:37 -0500
Subject: [PATCH 228/404] GeneratorObjectsTPCnv: Update HepMcParticleLink for
 multiple McEventCollections.

Allow HepMcParticleLink to point at one of several
McEventCollections.  See !20486.
---
 .../share/HepMcParticleLinkCnv_p1_test.ref       |  7 +++----
 .../share/HepMcParticleLinkCnv_p2_test.ref       |  8 +++++++-
 .../src/HepMcParticleLinkCnv_p1.cxx              | 16 ++++++++--------
 .../src/HepMcParticleLinkCnv_p2.cxx              | 16 ++++++++--------
 .../test/HepMcParticleLinkCnv_p1_test.cxx        |  3 ++-
 .../test/HepMcParticleLinkCnv_p2_test.cxx        |  1 +
 6 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p1_test.ref b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p1_test.ref
index 293789a64a3..075f1607b3a 100644
--- a/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p1_test.ref
+++ b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p1_test.ref
@@ -1,7 +1,7 @@
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
-                                          running on karma on Tue Mar  6 11:36:17 2018
+                                          running on karma on Tue Feb 19 21:52:54 2019
 ====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
@@ -10,6 +10,5 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-ClassIDSvc           INFO  getRegistryEntries: read 1157 CLIDRegistry entries for module ALL
-ClassIDSvc           INFO  getRegistryEntries: read 374 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+ClassIDSvc           INFO  getRegistryEntries: read 1853 CLIDRegistry entries for module ALL
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref
index 8633d8ace9b..ad71efce4f8 100644
--- a/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref
+++ b/Generators/GeneratorObjectsTPCnv/share/HepMcParticleLinkCnv_p2_test.ref
@@ -1,3 +1,8 @@
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Tue Feb 19 21:52:20 2019
+====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
@@ -5,4 +10,5 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+ClassIDSvc           INFO  getRegistryEntries: read 1853 CLIDRegistry entries for module ALL
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
index d3e139790d1..a231c671b46 100755
--- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // Framework includes
@@ -23,11 +23,11 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj,
                                            HepMcParticleLink* transObj,
                                            MsgStream &/*msg*/ )
 {
-  if (transObj->m_ptrs.m_dict == nullptr)
-    transObj->init_dict();
-  transObj->m_extBarcode =
-    HepMcParticleLink::ExtendedBarCode( persObj->m_barcode,
-                                        persObj->m_mcEvtIndex );
+  transObj->setExtendedBarCode
+    ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode,
+                                          persObj->m_mcEvtIndex,
+                                          EBC_MAINEVCOLL,
+                                          HepMcParticleLink::IS_POSITION) );
   return;
 }
 
@@ -35,8 +35,8 @@ void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj,
                                            HepMcParticleLink_p1* persObj,
                                            MsgStream &/*msg*/ )
 {
-  persObj->m_mcEvtIndex = transObj->eventIndex();
-  persObj->m_barcode    = transObj->m_extBarcode.barcode();
+  persObj->m_mcEvtIndex = transObj->getEventPositionInCollection(SG::CurrentEventStore::store());
+  persObj->m_barcode    = transObj->barcode();
   return;
 }
 
diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx
index f515cf3d997..ac9e2258b02 100755
--- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // Framework includes
@@ -23,11 +23,11 @@ void HepMcParticleLinkCnv_p2::persToTrans( const HepMcParticleLink_p2* persObj,
                                            HepMcParticleLink* transObj,
                                            MsgStream &/*msg*/ )
 {
-  if (transObj->m_ptrs.m_dict == nullptr)
-    transObj->init_dict();
-  transObj->m_extBarcode =
-    HepMcParticleLink::ExtendedBarCode( persObj->m_barcode,
-                                        persObj->m_mcEvtIndex );
+  transObj->setExtendedBarCode
+    ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode,
+                                          persObj->m_mcEvtIndex,
+                                          HepMcParticleLink::ExtendedBarCode::eventCollectionFromChar(persObj->m_evtColl),
+                                          HepMcParticleLink::IS_INDEX) );
   return;
 }
 
@@ -36,8 +36,8 @@ void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink* transObj,
                                            MsgStream &/*msg*/ )
 {
   persObj->m_mcEvtIndex = transObj->eventIndex();
-  persObj->m_barcode    = transObj->m_extBarcode.barcode();
-  persObj->m_evtColl    = 'a'; // hard-coded until we change the transient class implementation
+  persObj->m_barcode    = transObj->barcode();
+  persObj->m_evtColl    = transObj->getEventCollectionAsChar();
   return;
 }
 
diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx
index 6102c52d7d8..0e4af50864d 100644
--- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx
+++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.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
 */
 
 // $Id$
@@ -31,6 +31,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx
index fe8836e3357..5284dfa1a0c 100644
--- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx
+++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx
@@ -26,6 +26,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
-- 
GitLab


From c954decd278b30aa09334b8de6212004bc34f1fb Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Fri, 28 Jul 2017 11:29:44 +0200
Subject: [PATCH 229/404] Add TimedHitPtr::m_pileupType variable to record the
 source of the hit

For the `HepMcParticleLink` migration (ATLASSIM-2430) we need to be able
to record which type of events a hit comes from i.e. hard-scatter, low
pT minbias, high pT minbias, cavern background etc. - see ATLASSIM-3053
These changes were pulled in from `HitManagement-00-01-21-02`.
---
 .../HitManagement/TimedHitCollection.icc      | 27 +++++++++----------
 .../HitManagement/HitManagement/TimedHitPtr.h | 19 ++++++++-----
 .../HitManagement/TimedHitPtrCollection.icc   |  2 +-
 3 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/Simulation/HitManagement/HitManagement/TimedHitCollection.icc b/Simulation/HitManagement/HitManagement/TimedHitCollection.icc
index 481d14e9ccc..dc029648da4 100755
--- a/Simulation/HitManagement/HitManagement/TimedHitCollection.icc
+++ b/Simulation/HitManagement/HitManagement/TimedHitCollection.icc
@@ -7,15 +7,15 @@
 #include <algorithm>
 #include <exception>
 template <class HIT>
-void 	
+void
 TimedHitCollection<HIT>::insert(const PileUpTimeEventIndex& timeEventIndex,
-				const AtlasHitsVector<HIT>* inputCollection) {
+                                const AtlasHitsVector<HIT>* inputCollection) {
   if (!inputCollection){
-    throw("Empty input collection!"); 
+    throw("Empty input collection!");
   }
   typename AtlasHitsVector<HIT>::const_iterator i(inputCollection->begin());
   typename AtlasHitsVector<HIT>::const_iterator e(inputCollection->end());
-  while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(), &(*i++) ));
+  while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(), &(*i++), timeEventIndex.type() ));
   if (m_sorted) {
     m_sorted=false;
     throw SortedException();
@@ -23,11 +23,11 @@ TimedHitCollection<HIT>::insert(const PileUpTimeEventIndex& timeEventIndex,
 }
 
 template <class HIT>
-void 	
-TimedHitCollection<HIT>::insert(float evtTime, 
-				const AtlasHitsVector<HIT>* inputCollection) {
+void
+TimedHitCollection<HIT>::insert(float evtTime,
+                                const AtlasHitsVector<HIT>* inputCollection) {
   if (!inputCollection){
-    throw("Empty input collection!");       
+    throw("Empty input collection!");
   }
   typename AtlasHitsVector<HIT>::const_iterator i(inputCollection->begin());
   typename AtlasHitsVector<HIT>::const_iterator e(inputCollection->end());
@@ -39,15 +39,15 @@ TimedHitCollection<HIT>::insert(float evtTime,
 }
 
 template <class HIT>
-void 	
+void
 TimedHitCollection<HIT>::reserve(unsigned int numberOfHits) {
   m_hits.reserve(numberOfHits);
   return;
 }
 
 ///returns an iterator range with the hits of current detector element
-template <class HIT> 
-bool 
+template <class HIT>
+bool
 TimedHitCollection<HIT>::nextDetectorElement(const_iterator& b, const_iterator& e) const {
   if (!m_sorted) sortVector();
   b = m_currentHit;
@@ -55,12 +55,11 @@ TimedHitCollection<HIT>::nextDetectorElement(const_iterator& b, const_iterator&
   e = m_currentHit;
   return (b != e);
 }
- 
+
 template <class HIT>
-void 
+void
 TimedHitCollection<HIT>::sortVector() const {
   std::stable_sort(m_hits.begin(), m_hits.end());
   m_currentHit = m_hits.begin();
   m_sorted=true;
 }
-
diff --git a/Simulation/HitManagement/HitManagement/TimedHitPtr.h b/Simulation/HitManagement/HitManagement/TimedHitPtr.h
index 5cfa88d4960..a0ef033aa42 100755
--- a/Simulation/HitManagement/HitManagement/TimedHitPtr.h
+++ b/Simulation/HitManagement/HitManagement/TimedHitPtr.h
@@ -16,20 +16,20 @@ template <class HIT>
 class TimedHitPtr {
 public:
   ///STL required constructors
-  TimedHitPtr() : m_eventTime(0), m_eventId(0), m_pHit(0) {}
+  TimedHitPtr() : m_eventTime(0), m_eventId(0), m_pileupType(0), m_pHit(nullptr) {}
   TimedHitPtr(const TimedHitPtr<HIT>& rhs) :
-    m_eventTime(rhs.m_eventTime), m_eventId(rhs.m_eventId), m_pHit(rhs.m_pHit)  {}
+    m_eventTime(rhs.m_eventTime), m_eventId(rhs.m_eventId), m_pileupType(rhs.m_pileupType), m_pHit(rhs.m_pHit)  {}
 
   ///minimal constructor: pass only t0 offset of bunch xing
-  TimedHitPtr(float eventTime, const HIT* pHit) :
-    m_eventTime(eventTime), m_eventId(0), m_pHit(pHit) {}
+  TimedHitPtr(float eventTime, const HIT* pHit, int pileupType=0) :
+    m_eventTime(eventTime), m_eventId(0), m_pileupType(pileupType), m_pHit(pHit) {}
   ///use this constructor when hit has a PileUpTimeEventIndex
-  TimedHitPtr(float eventTime, unsigned short eventId, const HIT* pHit) :
-    m_eventTime(eventTime), m_eventId(eventId), m_pHit(pHit) {}
+  TimedHitPtr(float eventTime, unsigned short eventId, const HIT* pHit, int pileupType=0) :
+    m_eventTime(eventTime), m_eventId(eventId), m_pileupType(pileupType), m_pHit(pHit) {}
 
   ///assignment operator
   TimedHitPtr<HIT>& operator=(const TimedHitPtr<HIT>& rhs) {
-    if(&rhs != this) { m_eventTime = rhs.m_eventTime; m_eventId = rhs.m_eventId; m_pHit = rhs.m_pHit; }
+    if(&rhs != this) { m_eventTime = rhs.m_eventTime; m_eventId = rhs.m_eventId; m_pileupType = rhs.m_pileupType; m_pHit = rhs.m_pHit; }
     return *this;
   }
 
@@ -41,6 +41,10 @@ public:
   ///to navigate back to the parent event
   unsigned short eventId() const { return m_eventId; }
 
+  ///the type of event which the hit came from (signal, low pt
+  ///minbias, high pt minbias, cavern bg, etc.)
+  int pileupType() const { return m_pileupType; }
+
   /// t0 offset of the bunch xing containing the hit in ns. This is an integer
   /// multiple of the bunch xing distance for a certain event (e.g. N*25ns)
   float eventTime() const { return m_eventTime; }
@@ -51,6 +55,7 @@ private:
   float m_eventTime;
   ///the index in PileUpEventInfo of the component event hosting this hit
   unsigned short m_eventId;
+  int m_pileupType;
   const HIT* m_pHit; //don't own
 
   template <class FHIT>
diff --git a/Simulation/HitManagement/HitManagement/TimedHitPtrCollection.icc b/Simulation/HitManagement/HitManagement/TimedHitPtrCollection.icc
index eed7aa5b19e..79bd381d750 100755
--- a/Simulation/HitManagement/HitManagement/TimedHitPtrCollection.icc
+++ b/Simulation/HitManagement/HitManagement/TimedHitPtrCollection.icc
@@ -11,7 +11,7 @@ TimedHitPtrCollection<HIT>::insert(const PileUpTimeEventIndex& timeEventIndex,
   assert(inputCollection);
   typename AthenaHitsVector<HIT>::const_iterator i(inputCollection->begin());
   typename AthenaHitsVector<HIT>::const_iterator e(inputCollection->end());
-  while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(),*i++));
+  while (i!=e) m_hits.push_back(TimedHitPtr<HIT>(timeEventIndex.time(), timeEventIndex.index(),*i++, timeEventIndex.type()));
   if (m_sorted) {
     m_sorted=false;
     throw SortedException();
-- 
GitLab


From e3aaa99fb66112d7fa40a48058180a99d371af4a Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 27 Jul 2017 17:37:54 +0200
Subject: [PATCH 230/404] Migrating the InDetSimEventTPCnv TP Converters to
 work with the new transient HepMcParticleLink

This commit updates the TP converters in the `InDetSimEventTPCnv` package
to work with the new transient version of the `HepMcParticleLink` class.

All existing `InDetSimEventTPCnv` unit tests are updated to correctly set
the eventIndex property property of `HepMcParticleLinks` and check that
the event collection char member variable is set properly.
---
 .../src/InDetHits/SiHitCollectionCnv_p2.cxx                | 3 ++-
 .../src/InDetHits/SiHitCollectionCnv_p3.cxx                | 5 +++--
 .../src/InDetHits/TRT_HitCollectionCnv_p2.cxx              | 4 +++-
 .../src/InDetHits/TRT_HitCollectionCnv_p3.cxx              | 4 +++-
 .../src/InDetHits/TRT_HitCollectionCnv_p4.cxx              | 5 +++--
 .../InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx           | 1 +
 .../InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx | 5 +++--
 .../InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx | 5 +++--
 .../InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx         | 1 +
 .../test/TRT_HitCollectionCnv_p2_test.cxx                  | 7 ++++---
 .../test/TRT_HitCollectionCnv_p3_test.cxx                  | 7 ++++---
 .../test/TRT_HitCollectionCnv_p4_test.cxx                  | 7 ++++---
 12 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx
index 6469d1be6b1..c490af1bddb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx
@@ -298,7 +298,8 @@ void SiHitCollectionCnv_p2::persToTrans(const SiHitCollection_p2* persCont, SiHi
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        transCont->Emplace( endLast, endThis, eneLoss, meanTime, persCont->m_barcode[idxBC], persCont->m_id[idxId]);
+        HepMcParticleLink partLink; partLink.setExtendedBarCode( HepMcParticleLink::ExtendedBarCode( persCont->m_barcode[idxBC], 0, EBC_MAINEVCOLL, HepMcParticleLink::IS_POSITION) );
+        transCont->Emplace( endLast, endThis, eneLoss, meanTime, partLink, persCont->m_id[idxId]);
 
         endLast = endThis;
 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx
index 1ed44137a46..2d2104f6f8d 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx
@@ -103,7 +103,7 @@ void SiHitCollectionCnv_p3::transToPers(const SiHitCollection* transCont, SiHitC
       lastLink = &(siHit->particleLink());
       persCont->m_barcode.push_back(lastLink->barcode());
       persCont->m_mcEvtIndex.push_back(lastLink->eventIndex());
-      persCont->m_evtColl.push_back('a');
+      persCont->m_evtColl.push_back(lastLink->getEventCollectionAsChar());
 
       if (idx > 0) {
         persCont->m_nBC.push_back(idx - endBC);
@@ -299,7 +299,8 @@ void SiHitCollectionCnv_p3::persToTrans(const SiHitCollection_p3* persCont, SiHi
 
         HepGeom::Point3D<double> endThis( endLast + r );
 
-        transCont->Emplace( endLast, endThis, eneLoss, meanTime, persCont->m_barcode[idxBC], persCont->m_id[idxId]);
+        HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], HepMcParticleLink::ExtendedBarCode::eventCollectionFromChar(persCont->m_evtColl[idxBC]), HepMcParticleLink::IS_INDEX );
+        transCont->Emplace( endLast, endThis, eneLoss, meanTime, partLink, persCont->m_id[idxId]);
 
         endLast = endThis;
 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx
index 57439ec221b..ea39ab3fc3d 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx
@@ -158,7 +158,9 @@ void TRT_HitCollectionCnv_p2::persToTrans(const TRT_HitCollection_p2* persCont,
 
         HepGeom::Point3D<double> endThis(persCont->m_endX[j], persCont->m_endY[j], persCont->m_endZ[j]);
 
-        transCont->Emplace( persCont->m_hitId[hitCount], persCont->m_barcode[idxBC], persCont->m_id[idxId], persCont->m_kinEne[hitCount],
+        HepMcParticleLink partLink(persCont->m_barcode[idxBC]);
+        partLink.setExtendedBarCode(HepMcParticleLink::ExtendedBarCode(persCont->m_barcode[idxBC], 0, EBC_MAINEVCOLL, HepMcParticleLink::IS_POSITION));;
+        transCont->Emplace( persCont->m_hitId[hitCount], partLink, persCont->m_id[idxId], persCont->m_kinEne[hitCount],
                             eneLoss, endLast.x(), endLast.y(), endLast.z(), endThis.x(), endThis.y(), endThis.z(),
                             persCont->m_meanTime[hitCount] );
 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx
index 959cd858b18..ddc687f73e1 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx
@@ -478,7 +478,9 @@ void TRT_HitCollectionCnv_p3::persToTrans(const TRT_HitCollection_p3* persCont,
         // - For charged particles kinEne is *zero*!
         //
 
-        transCont->Emplace( strawId, persCont->m_barcode[idxBC], persCont->m_id[idxId],
+        HepMcParticleLink partLink(persCont->m_barcode[idxBC]);
+        partLink.setExtendedBarCode(HepMcParticleLink::ExtendedBarCode(persCont->m_barcode[idxBC], 0, EBC_MAINEVCOLL, HepMcParticleLink::IS_POSITION));;
+        transCont->Emplace( strawId, partLink, persCont->m_id[idxId],
                             kinEne, hitEne, startX, startY, startZ,
                             endX, endY, endZ, meanTime );
         //
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx
index 1d5e3a5d563..7b0b97f8706 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx
@@ -68,7 +68,7 @@ void TRT_HitCollectionCnv_p4::transToPers(const TRTUncompressedHitCollection* tr
       lastLink = &(trtHit->particleLink());
       persCont->m_barcode.push_back(lastLink->barcode());
       persCont->m_mcEvtIndex.push_back(lastLink->eventIndex());
-      persCont->m_evtColl.push_back('a');
+      persCont->m_evtColl.push_back(lastLink->getEventCollectionAsChar());
 
       if ( idx > 0 ) {
         persCont->m_nBC.push_back(idx - endBC);
@@ -481,7 +481,8 @@ void TRT_HitCollectionCnv_p4::persToTrans(const TRT_HitCollection_p4* persCont,
         // - For charged particles kinEne is *zero*!
         //
 
-        transCont->Emplace( strawId, persCont->m_barcode[idxBC], persCont->m_id[idxId],
+        HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], HepMcParticleLink::ExtendedBarCode::eventCollectionFromChar(persCont->m_evtColl[idxBC]), HepMcParticleLink::IS_INDEX );
+        transCont->Emplace( strawId, partLink, persCont->m_id[idxId],
                             kinEne, hitEne, startX, startY, startZ,
                             endX, endY, endZ, meanTime );
         //
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx
index 069909fa731..3ba814891c5 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx
index a40a88c30cc..2729c87fb73 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
@@ -73,7 +74,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   std::cout << "test1\n";
   const HepMC::GenParticle *particle = genPartVector.at(0);
   // Create HepMcParticleLink outside of leak check.
-  HepMcParticleLink dummyHMPL(particle->barcode(),0);
+  HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number());
   assert(dummyHMPL.cptr()==particle);
   // Create DVL info outside of leak check.
   SiHitCollection dum ("coll");
@@ -82,7 +83,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   SiHitCollection trans1 ("coll");
   for (int i=0; i < 10; i++) {
     const HepMC::GenParticle* pGenParticle = genPartVector.at(i);
-    HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
     int o = i*100;
     trans1.Emplace (HepGeom::Point3D<double> (10.5+o, 11.5+o, 12.5+o),
                     HepGeom::Point3D<double> (13.5+o, 14.5+o, 15.5+o),
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx
index 2428877ba06..597f9d21137 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
@@ -72,7 +73,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   std::cout << "test1\n";
   const HepMC::GenParticle *particle = genPartVector.at(0);
   // Create HepMcParticleLink outside of leak check.
-  HepMcParticleLink dummyHMPL(particle->barcode(),0);
+  HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number());
   assert(dummyHMPL.cptr()==particle);
   // Create DVL info outside of leak check.
   SiHitCollection dum ("coll");
@@ -81,7 +82,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   SiHitCollection trans1 ("coll");
   for (int i=0; i < 10; i++) {
     const HepMC::GenParticle* pGenParticle = genPartVector.at(i);
-    HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
     int o = i*100;
     trans1.Emplace (HepGeom::Point3D<double> (10.5+o, 11.5+o, 12.5+o),
                     HepGeom::Point3D<double> (13.5+o, 14.5+o, 15.5+o),
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx
index e8182ac840b..b0947c43205 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx
index 887a2dcfb34..de1afb5f4ae 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
@@ -78,7 +79,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   std::cout << "test1\n";
   const HepMC::GenParticle *particle = genPartVector.at(0);
   // Create HepMcParticleLink outside of leak check.
-  HepMcParticleLink dummyHMPL(particle->barcode(),0);
+  HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number());
   assert(dummyHMPL.cptr()==particle);
   // Create DVL info outside of leak check.
   TRTUncompressedHitCollection dum ("coll");
@@ -88,7 +89,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   for (int i=0; i < 10; i++) {
     int o = i*100;
     const HepMC::GenParticle* pGenParticle = genPartVector.at(0);
-    HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
     trans1.Emplace (101+o, trkLink, pGenParticle->pdg_id(),
                     104.5+o, 105.5+o,
                     (106.5+o)/1000, (107.5+o)/1000, 108.5+o,
@@ -97,7 +98,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   }
   // Special case for photons
   const HepMC::GenParticle* pGenParticle = genPartVector.at(10);
-  HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+  HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
   trans1.Emplace (131, trkLink, 22,
                   134.5, 135.5,
                   10, 3, 138.5,
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx
index 5319e538c7e..19d3c099ede 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx
@@ -33,6 +33,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
@@ -98,7 +99,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   std::cout << "test1\n";
   const HepMC::GenParticle *particle = genPartVector.at(0);
   // Create HepMcParticleLink outside of leak check.
-  HepMcParticleLink dummyHMPL(particle->barcode(),0);
+  HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number());
   assert(dummyHMPL.cptr()==particle);
   // Create DVL info outside of leak check.
   TRTUncompressedHitCollection dum ("coll");
@@ -108,7 +109,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   for (int i=0; i < 10; i++) {
     int o = i*100;
     const HepMC::GenParticle* pGenParticle = genPartVector.at(0);
-    HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
     trans1.Emplace (101+o, trkLink, 20+o,
                     104.5+o, 105.5+o,
                     (106.5+o)/1000, (107.5+o)/1000, 108.5+o,
@@ -117,7 +118,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   }
   // Special case for photons
   const HepMC::GenParticle* pGenParticle = genPartVector.at(10);
-  HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+  HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
   trans1.Emplace (131, trkLink, 22,
                   134.5, 135.5,
                   10, 3, 138.5,
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx
index 1991aeacee2..d57eccd700d 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx
@@ -33,6 +33,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
@@ -98,7 +99,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   std::cout << "test1\n";
   const HepMC::GenParticle *particle = genPartVector.at(0);
   // Create HepMcParticleLink outside of leak check.
-  HepMcParticleLink dummyHMPL(particle->barcode(),0);
+  HepMcParticleLink dummyHMPL(particle->barcode(),particle->parent_event()->event_number());
   assert(dummyHMPL.cptr()==particle);
   // Create DVL info outside of leak check.
   TRTUncompressedHitCollection dum ("coll");
@@ -108,7 +109,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   for (int i=0; i < 10; i++) {
     int o = i*100;
     const HepMC::GenParticle* pGenParticle = genPartVector.at(0);
-    HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+    HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
     trans1.Emplace (101+o, trkLink, 20+o,
                     104.5+o, 105.5+o,
                     (106.5+o)/1000, (107.5+o)/1000, 108.5+o,
@@ -117,7 +118,7 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   }
   // Special case for photons
   const HepMC::GenParticle* pGenParticle = genPartVector.at(10);
-  HepMcParticleLink trkLink(pGenParticle->barcode(),0);
+  HepMcParticleLink trkLink(pGenParticle->barcode(),pGenParticle->parent_event()->event_number());
   trans1.Emplace (131, trkLink, 22,
                   134.5, 135.5,
                   10, 3, 138.5,
-- 
GitLab


From 8ffe227955852013b1dc7e6baf89d2ceb009f556 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 20 Feb 2019 16:08:34 +0100
Subject: [PATCH 231/404] Update reference files for InDetSimEventTPCnv

---
 .../InDetEventCnv/InDetSimEventTPCnv/share/SiHitCnv_p1_test.ref | 2 +-
 .../InDetSimEventTPCnv/share/SiHitCollectionCnv_p2_test.ref     | 2 +-
 .../InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref     | 2 +-
 .../InDetSimEventTPCnv/share/TRT_HitCnv_p1_test.ref             | 2 +-
 .../InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p2_test.ref   | 2 +-
 .../InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p3_test.ref   | 2 +-
 .../InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCnv_p1_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCnv_p1_test.ref
index 6a0927bf3bf..eebebda9e1c 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCnv_p1_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCnv_p1_test.ref
@@ -13,4 +13,4 @@ test1
 ClassIDSvc           INFO  getRegistryEntries: read 1130 CLIDRegistry entries for module ALL
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 869 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p2_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p2_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref
index fe4376f9b7e..ee9824a396e 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/SiHitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCnv_p1_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCnv_p1_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p2_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p2_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p3_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p3_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/share/TRT_HitCollectionCnv_p4_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
-- 
GitLab


From 1aca3d5cc4ac3252db47b7b2c8a6a05a95d58474 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 21 Jan 2019 16:47:17 +0100
Subject: [PATCH 232/404] Extend all TP Converter unit tests for classes
 containing HepMcParticleLinks

Check that the new char member variable of HepMcParticleLink is treated
correctly by all TP converters for classes containing HepMcParticleLinks.
---
 .../LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx  | 1 +
 .../LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx  | 1 +
 .../MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx        | 1 +
 .../MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx        | 1 +
 .../MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx      | 1 +
 .../MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx      | 1 +
 .../MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx       | 1 +
 .../MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx       | 1 +
 .../MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx     | 1 +
 .../MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx     | 1 +
 .../MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx    | 1 +
 .../test/GenericMuonSimHitCollectionCnv_p1_test.cxx              | 1 +
 .../test/GenericMuonSimHitCollectionCnv_p2_test.cxx              | 1 +
 .../MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx    | 1 +
 .../MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx   | 1 +
 .../MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx   | 1 +
 .../test/TrackParticleTruthCollectionCnv_p1_test.cxx             | 1 +
 .../test/TrackParticleTruthCollectionCnv_p2_test.cxx             | 1 +
 .../TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx   | 1 +
 .../TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx   | 1 +
 .../TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx       | 1 +
 .../TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx       | 1 +
 .../TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx            | 1 +
 .../TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx            | 1 +
 35 files changed, 35 insertions(+)

diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx
index d6bd1512264..51d5a2c4156 100644
--- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx
+++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx
index 672e926e74a..df6b13213a2 100644
--- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx
+++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx
index 2d7ec36480d..dad2128062f 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx
index 0ac3952866a..1a30c5f76f9 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx
index 53a5486e523..6f48a617c14 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx
index 3a6eb294ab8..8a6a8863479 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx
index ec68ac382cc..4013457cc4b 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx
index d1634520621..b5a8e95a730 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx
index 0a452375344..0cbe905b0ef 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx
index ff51f024e51..bda5460d5a6 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx
index bc6b72cb6f8..eab8744c112 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx
index 692c225e164..5b16c50c5bd 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx
index ca87a4dfd3c..25addc7f029 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx
index 834e29f59d5..c6af7c66539 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx
index a17aca581dd..ca40dd29e9b 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx
index 9f12d9f7945..ca4d16d12f6 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx
index 9b3aeb2dbca..a5ff003523f 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx
index a18618673f3..9aaea2e3d29 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx
index 5fad00aaaea..b674908b805 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx
index 98501c7383d..d4d4a66e1a6 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx
index b42dbf0fab2..f9e0b39b123 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx
index f601db0c1d2..88da4f2b7b1 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx
index f7adcfbce9d..9a75089345e 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx
index c3baa29f0e6..e81dceff1a4 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx
index 1ab0281b7f1..d2994015bcb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx
index 7bf1e66c667..7db92b3901b 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx
@@ -27,6 +27,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx
index 04918d01d9c..0fbca4423c9 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx
@@ -35,6 +35,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx
index 17e9ccbe68e..b9365fda41e 100644
--- a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx
+++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx
@@ -30,6 +30,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx
index df5bf61d34f..16620b0e2af 100644
--- a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx
+++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx
index 69aafc4c4a3..62876f04a91 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx
index 7f951db5a53..129ecfe4178 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx
@@ -29,6 +29,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx
index 42a0f3b3ae3..d8dc05d3765 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx
index d26a7783794..27eb48c3bdc 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx
index e9d28f4fb23..a934c5d72a0 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx
index d65640f18d4..61db3c83735 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx
@@ -28,6 +28,7 @@ void compare (const HepMcParticleLink& p1,
   assert ( p1.isValid() == p2.isValid() );
   assert ( p1.barcode() == p2.barcode() );
   assert ( p1.eventIndex() == p2.eventIndex() );
+  assert ( p1.getEventCollectionAsChar() == p2.getEventCollectionAsChar() );
   assert ( p1.cptr() == p2.cptr() );
   assert ( p1 == p2 );
 }
-- 
GitLab


From 48228658bfa8d73086ea32852e291b0240e7034d Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 20 Feb 2019 16:11:01 +0100
Subject: [PATCH 233/404] Update reference files for TPCnv tests involving HMPL

---
 .../LUCID_EventTPCnv/share/LUCID_SimHitCnv_p1_test.ref          | 2 +-
 .../LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref          | 2 +-
 .../MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p1_test.ref      | 2 +-
 .../MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref      | 2 +-
 .../MuonEventTPCnv/share/CscSimDataCollectionCnv_p1_test.ref    | 2 +-
 .../MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref    | 2 +-
 .../MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p1_test.ref     | 2 +-
 .../MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref     | 2 +-
 .../MuonEventTPCnv/share/MuonSimDataCollectionCnv_p1_test.ref   | 2 +-
 .../MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref   | 2 +-
 .../MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p1_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p2_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref  | 2 +-
 .../share/GenericMuonSimHitCollectionCnv_p1_test.ref            | 2 +-
 .../share/GenericMuonSimHitCollectionCnv_p2_test.ref            | 2 +-
 .../MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p1_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p2_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p1_test.ref   | 2 +-
 .../MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p2_test.ref   | 2 +-
 .../MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p1_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p2_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p1_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p2_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p3_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref  | 2 +-
 .../MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p1_test.ref | 2 +-
 .../MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p2_test.ref | 2 +-
 .../share/TrackParticleTruthCollectionCnv_p1_test.ref           | 2 +-
 .../share/TrackParticleTruthCollectionCnv_p2_test.ref           | 2 +-
 .../TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref | 2 +-
 .../TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref | 2 +-
 .../TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref     | 2 +-
 .../TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref     | 2 +-
 .../TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref          | 2 +-
 .../TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref          | 2 +-
 .../share/TrigInDetTrackTruthCnv_p1_test.ref                    | 2 +-
 .../share/TrigInDetTrackTruthMapCnv_p1_test.ref                 | 2 +-
 39 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p1_test.ref b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p1_test.ref
index 6a0927bf3bf..eebebda9e1c 100644
--- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p1_test.ref
+++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p1_test.ref
@@ -13,4 +13,4 @@ test1
 ClassIDSvc           INFO  getRegistryEntries: read 1130 CLIDRegistry entries for module ALL
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 869 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref
index 6a0927bf3bf..eebebda9e1c 100644
--- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref
+++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/share/LUCID_SimHitCnv_p2_test.ref
@@ -13,4 +13,4 @@ test1
 ClassIDSvc           INFO  getRegistryEntries: read 1130 CLIDRegistry entries for module ALL
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 869 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p1_test.ref
index 6a0927bf3bf..eebebda9e1c 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p1_test.ref
@@ -13,4 +13,4 @@ test1
 ClassIDSvc           INFO  getRegistryEntries: read 1130 CLIDRegistry entries for module ALL
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 869 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref
index 6a0927bf3bf..eebebda9e1c 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCnv_p2_test.ref
@@ -13,4 +13,4 @@ test1
 ClassIDSvc           INFO  getRegistryEntries: read 1130 CLIDRegistry entries for module ALL
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 869 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref
index 1a2f833e338..6285c85d63a 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/CscSimDataCollectionCnv_p2_test.ref
@@ -5,5 +5,5 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/share/MuonSimDataCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/CSCSimHitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/GenericMuonSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MDTSimHitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/MMSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p1_test.ref
index cebc950724d..236530a4282 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p1_test.ref
@@ -5,5 +5,5 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
 test                 INFO Processing 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/RPCSimHitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p3_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p3_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/TGCSimHitCollectionCnv_p4_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p1_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p1_test.ref
index f00f0d56df7..0bc5f1e1916 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p1_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p1_test.ref
@@ -11,4 +11,4 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 ClassIDSvc           INFO  getRegistryEntries: read 2754 CLIDRegistry entries for module ALL
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p2_test.ref b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p2_test.ref
index 8dae6c25e69..657d3812c19 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p2_test.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/share/sTGCSimHitCollectionCnv_p2_test.ref
@@ -11,4 +11,4 @@ ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 ClassIDSvc           INFO  getRegistryEntries: read 2754 CLIDRegistry entries for module ALL
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p1_test.ref b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p1_test.ref
index 416e0ab738c..5179cef48bd 100644
--- a/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p1_test.ref
+++ b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p1_test.ref
@@ -13,4 +13,4 @@ ClassIDSvc           INFO  getRegistryEntries: read 1684 CLIDRegistry entries fo
 ProxyProviderSvc     INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00
 test1
 ClassIDSvc           INFO  getRegistryEntries: read 359 CLIDRegistry entries for module ALL
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref
index 15b0f8802aa..49ab8717b83 100644
--- a/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref
+++ b/Reconstruction/TrackParticleTruthTPCnv/share/TrackParticleTruthCollectionCnv_p2_test.ref
@@ -10,4 +10,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p3_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref
+++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p2_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref
+++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref
index 8633d8ace9b..4a7c11977bb 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref
+++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/share/TrigInDetTrackTruthMapCnv_p1_test.ref
@@ -5,4 +5,4 @@ HistogramPersis...WARNING Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
 test1
-HepMcParticleLink    INFO find_hostkey: Using TruthEvent as McEventCollection key for this job 
+HepMcParticleLink    INFO find_proxy: Using TruthEvent as McEventCollection key for this job 
-- 
GitLab


From b15c4f34c21509eec332f3688246301fb6a4578f Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 2 Aug 2017 14:57:53 +0200
Subject: [PATCH 234/404] HepMcParticleLink migration of ISF_Event package

svnpull of changes from `ISF_Event-00-12-01`

- `ISFParticle`: adding a `setBarcodeAndUpdateHepMcParticleLink(barcode)` function taking
care of synchronizing the HMPL in case of update of the barcode.
- `src/ISFTruthIncident.cxx`: replacing calls to setBarcode() by
`setBarcodeAndUpdateHepMcParticleLink()`.
- `src/ISFTruthIncident.cxx`: trying to retrieve the `GenParticle` from
the `HepMcPartileLink` if existing when "converting" the `ISFParticle`.
- `src/ISFParticle.cxx`: Cloning `HepMcParticleLink` object when using
copy constructor for `ISFParticle`.
- Added `HepMcParticleLink` object as member variable for `ISFParticle`
and its accessors.

NB Not adding `getParentHepMcParticleLink()` accessor to `ITruthIncident.h`
as it was not possible to implement this satisfactorily for
`GeantTruthIncident`.
---
 .../ISF/ISF_Core/ISF_Event/CMakeLists.txt     |   6 +-
 .../ISF_Event/ISF_Event/ISFParticle.h         |  18 +-
 .../ISF_Event/ISF_Event/ISFParticle.icc       | 136 +++++++-------
 .../ISF_Event/ISF_Event/ITruthIncident.h      |  10 +-
 .../ISF_Event/ISF_Event/TruthBinding.h        |  94 +++++-----
 .../ISF_Event/ISF_Event/TruthBinding.icc      | 170 ++++++++---------
 .../ISF_Core/ISF_Event/src/ISFParticle.cxx    | 172 +++++++++++-------
 .../ISF_Event/src/ISFTruthIncident.cxx        |  29 ++-
 8 files changed, 355 insertions(+), 280 deletions(-)

diff --git a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt
index bb781fbf861..6319de57568 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt
@@ -11,6 +11,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           DetectorDescription/AtlasDetDescr
                           DetectorDescription/GeoPrimitives
+                          Generators/GeneratorObjects
                           GaudiKernel
                           Simulation/Barcode/BarcodeEvent )
 
@@ -25,11 +26,10 @@ atlas_add_library( ISF_Event
                    PUBLIC_HEADERS ISF_Event
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GaudiKernel )
+                   LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GeneratorObjects GaudiKernel )
 
 atlas_add_test( ISFParticle_test
                 SOURCES
                 test/ISFParticle_test.cxx
                 INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GaudiKernel ISF_Event )
-
+                LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GeneratorObjects GaudiKernel ISF_Event )
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h
index 3d28b5328eb..be5dff4aa2e 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h
@@ -25,6 +25,8 @@
 // CHLEP classes
 #include "CLHEP/Geometry/Point3D.h"
 #include "CLHEP/Geometry/Vector3D.h"
+// Common classes
+#include "GeneratorObjects/HepMcParticleLink.h"
 
 namespace ISF {
 
@@ -56,7 +58,8 @@ namespace ISF {
                 double time,
                 const ISFParticle &parent,
                 Barcode::ParticleBarcode barcode = Barcode::fUndefinedBarcode,
-                TruthBinding* truth = nullptr );
+                TruthBinding* truth = nullptr,
+                const HepMcParticleLink * partLink = nullptr );
 
     /** CLHEP-compatible constructor */
     ISFParticle(const HepGeom::Point3D<double>& pos,
@@ -67,7 +70,8 @@ namespace ISF {
                 double time,
                 const ISFParticle &parent,
                 Barcode::ParticleBarcode barcode = Barcode::fUndefinedBarcode,
-                TruthBinding* truth = nullptr );
+                TruthBinding* truth = nullptr,
+                const HepMcParticleLink * partLink = nullptr );
 
     /** this constructor should only be used for event read-in */
     ISFParticle(const Amg::Vector3D& pos,
@@ -79,7 +83,8 @@ namespace ISF {
                 const DetRegionSvcIDPair &origin,
                 int bcid,
                 Barcode::ParticleBarcode barcode = Barcode::fUndefinedBarcode,
-                TruthBinding* truth = nullptr );
+                TruthBinding* truth = nullptr,
+                const HepMcParticleLink * partLink = nullptr );
 
     /** Copy constructor */
     ISFParticle(const ISFParticle& isfp);
@@ -152,6 +157,8 @@ namespace ISF {
 
     /** set a new barcode */
     void setBarcode(Barcode::ParticleBarcode bc);
+    /** set a new barcode and update the HepMcParticleLink  */
+    void setBarcodeAndUpdateHepMcParticleLink(Barcode::ParticleBarcode bc);
 
     /** bunch-crossing identifier */
     int getBCID() const;
@@ -163,6 +170,10 @@ namespace ISF {
     TruthBinding* getTruthBinding() const;
     void          setTruthBinding(TruthBinding *truth);
 
+    /** HepMcParticleLink accessors */
+    inline const HepMcParticleLink* getParticleLink() const {return  m_partLink;};
+    inline void setParticleLink(const HepMcParticleLink* partLink) {m_partLink=partLink;};
+
     /** return the particle order (eg used to assure ID->Calo->MS simulation order) */
     ParticleOrder  getOrder() const;
     void           setOrder(ParticleOrder order);
@@ -188,6 +199,7 @@ namespace ISF {
     TruthBinding*                m_truth;
     ParticleOrder                m_order;                 //!< particle simulation order
     mutable ParticleUserInformation *m_userInfo;          //!< user information stored with the ISFParticle
+    const HepMcParticleLink*     m_partLink;
   };
 
   // Overload of << operator for MsgStream for debug output
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.icc
index 04f443e2599..ec181bc1cdf 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.icc
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.icc
@@ -6,80 +6,88 @@
 
 namespace ISF {
 
-// inline methods, nomen est omen
-//
-inline const Amg::Vector3D& ISFParticle::position() const { return m_position; }
-inline const Amg::Vector3D& ISFParticle::momentum() const { return m_momentum; }
-inline void ISFParticle::updatePosition(const Amg::Vector3D& position) { m_position=position; }
-inline void ISFParticle::updateMomentum(const Amg::Vector3D& momentum) { m_momentum=momentum; }
+  // inline methods, nomen est omen
+  //
+  inline const Amg::Vector3D& ISFParticle::position() const { return m_position; }
+  inline const Amg::Vector3D& ISFParticle::momentum() const { return m_momentum; }
+  inline void ISFParticle::updatePosition(const Amg::Vector3D& position) { m_position=position; }
+  inline void ISFParticle::updateMomentum(const Amg::Vector3D& momentum) { m_momentum=momentum; }
 
-inline double          ISFParticle::mass() const      { return m_mass; }
-inline double          ISFParticle::charge() const    { return m_charge; }
-inline double          ISFParticle::timeStamp() const { return m_tstamp; }
-inline int             ISFParticle::pdgCode() const   { return m_pdgCode; }
+  inline double          ISFParticle::mass() const      { return m_mass; }
+  inline double          ISFParticle::charge() const    { return m_charge; }
+  inline double          ISFParticle::timeStamp() const { return m_tstamp; }
+  inline int             ISFParticle::pdgCode() const   { return m_pdgCode; }
 
-inline double          ISFParticle::ekin() const      { return sqrt( m_momentum.mag2() + m_mass*m_mass ) - m_mass; }
+  inline double          ISFParticle::ekin() const      { return sqrt( m_momentum.mag2() + m_mass*m_mass ) - m_mass; }
 
-// history methods
-//
-inline const ParticleHistory&      ISFParticle::history()     const { return m_history;                    }
-inline AtlasDetDescr::AtlasRegion  ISFParticle::originGeoID() const { return m_history.front().first;      }
-inline SimSvcID                    ISFParticle::originSimID() const { return m_history.front().second;     }
-inline AtlasDetDescr::AtlasRegion  ISFParticle::prevGeoID()   const { return (m_history.end()-1)->first;   }
-inline SimSvcID                    ISFParticle::prevSimID()   const { return (m_history.end()-1)->second;  }
-inline AtlasDetDescr::AtlasRegion  ISFParticle::nextGeoID()   const { return m_history.back().first;       }
-inline SimSvcID                    ISFParticle::nextSimID()   const { return m_history.back().second;      }
-inline void                        ISFParticle::setNextGeoID( AtlasDetDescr::AtlasRegion geoID) { m_history.back().first = geoID; }
-inline void                        ISFParticle::setNextSimID( SimSvcID simID)                   { m_history.back().second = simID;}
+  // history methods
+  //
+  inline const ParticleHistory&      ISFParticle::history()     const { return m_history;                    }
+  inline AtlasDetDescr::AtlasRegion  ISFParticle::originGeoID() const { return m_history.front().first;      }
+  inline SimSvcID                    ISFParticle::originSimID() const { return m_history.front().second;     }
+  inline AtlasDetDescr::AtlasRegion  ISFParticle::prevGeoID()   const { return (m_history.end()-1)->first;   }
+  inline SimSvcID                    ISFParticle::prevSimID()   const { return (m_history.end()-1)->second;  }
+  inline AtlasDetDescr::AtlasRegion  ISFParticle::nextGeoID()   const { return m_history.back().first;       }
+  inline SimSvcID                    ISFParticle::nextSimID()   const { return m_history.back().second;      }
+  inline void                        ISFParticle::setNextGeoID( AtlasDetDescr::AtlasRegion geoID) { m_history.back().first = geoID; }
+  inline void                        ISFParticle::setNextSimID( SimSvcID simID)                   { m_history.back().second = simID;}
 
-// barcode methods
-//
-inline Barcode::ParticleBarcode ISFParticle::barcode() const { return m_barcode; }
-inline void            ISFParticle::setBarcode(Barcode::ParticleBarcode bc) { m_barcode = bc; }
+  // barcode methods
+  //
+  inline Barcode::ParticleBarcode ISFParticle::barcode() const { return m_barcode; }
+  inline void            ISFParticle::setBarcode(Barcode::ParticleBarcode bc) { m_barcode = bc; }
 
-// truth methods
-//
-inline TruthBinding* ISFParticle::getTruthBinding() const              { return m_truth; }
-inline void          ISFParticle::setTruthBinding(TruthBinding *truth) { m_truth = truth; }
+  // truth methods
+  //
+  inline TruthBinding* ISFParticle::getTruthBinding() const              { return m_truth; }
+  inline void          ISFParticle::setTruthBinding(TruthBinding *truth) { m_truth = truth; }
 
-// particle order methods
-//
-inline int  ISFParticle::getOrder() const { return m_order; }
-inline void ISFParticle::setOrder( ParticleOrder order ) { m_order = order; }
+  // particle order methods
+  //
+  inline int  ISFParticle::getOrder() const { return m_order; }
+  inline void ISFParticle::setOrder( ParticleOrder order ) { m_order = order; }
 
-// set ParticleUserInformation
-inline ParticleUserInformation *ISFParticle::getUserInformation() const                            { return m_userInfo;    }
-inline void                     ISFParticle::setUserInformation(ParticleUserInformation *userInfo)
-{
-  if ( m_userInfo==0 ) { m_userInfo = userInfo; }
-  else {
-    m_userInfo->setGeneration( userInfo->generation() );
-    m_userInfo->setProcess( userInfo->process() );
-    // don't overwrite barcode
+  // set ParticleUserInformation
+  inline ParticleUserInformation *ISFParticle::getUserInformation() const                            { return m_userInfo;    }
+  inline void                     ISFParticle::setUserInformation(ParticleUserInformation *userInfo)
+  {
+    if ( m_userInfo==0 ) { m_userInfo = userInfo; }
+    else {
+      m_userInfo->setGeneration( userInfo->generation() );
+      m_userInfo->setProcess( userInfo->process() );
+      // don't overwrite barcode
+    }
   }
-}
 
-// bunch-crossing identifier
-inline int ISFParticle::getBCID() const {
-  return m_bcid;
-}
-inline void ISFParticle::setBCID(int bcid) {
-  m_bcid = bcid;
-}
+  // bunch-crossing identifier
+  inline int ISFParticle::getBCID() const {
+    return m_bcid;
+  }
+  inline void ISFParticle::setBCID(int bcid) {
+    m_bcid = bcid;
+  }
 
-// printout methods
-inline MsgStream& ISFParticle::dump( MsgStream& out ) const
-    { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
-          << " xyz=(" << m_position.x() << "," <<  m_position.y() << "," <<  m_position.z() << ")"
-          << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
-          << " barcode=" << m_barcode << " mass=" << m_mass << " BCID=" << m_bcid << " order=" << m_order;
-      return out;}
+  // printout methods
+  inline MsgStream& ISFParticle::dump( MsgStream& out ) const
+  { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
+        << " xyz=(" << m_position.x() << "," <<  m_position.y() << "," <<  m_position.z() << ")"
+        << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
+        << " barcode=" << m_barcode << " mass=" << m_mass << " order=" << m_order << " bcid=" << m_bcid;
+    if (m_partLink)
+      out << " (" << *m_partLink << ")";
+    else
+      out << " (No assoc. HMPL)";
+    return out;}
 
-inline std::ostream& ISFParticle::dump( std::ostream& out ) const
-    { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
-          << " xyz=(" << m_position.x() << "," <<  m_position.y() << "," <<  m_position.z() << ")"
-          << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
-          << " barcode=" << m_barcode << " mass=" << m_mass << " BCID=" << m_bcid << " order=" << m_order;
-      return out;}
+  inline std::ostream& ISFParticle::dump( std::ostream& out ) const
+  { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
+        << " xyz=(" << m_position.x() << "," <<  m_position.y() << "," <<  m_position.z() << ")"
+        << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
+        << " barcode=" << m_barcode << " mass=" << m_mass << " order=" << m_order << " bcid=" << m_bcid;
+    if (m_partLink)
+      out << " (" << *m_partLink << ")";
+    else
+      out << " (No assoc. HMPL)";
+    return out;}
 
 } // end ISF namespace
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
index 69c949f2cc8..840d890fce5 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h
@@ -51,9 +51,9 @@ namespace ISF {
   class ITruthIncident {
   public:
     ITruthIncident(AtlasDetDescr::AtlasRegion geoID, unsigned short numChildren): m_geoID(geoID),
-                                                                          m_numChildren(numChildren),
-                                                                          m_passWholeVertex(true),
-                                                                          m_childPassedFilters(numChildren,false) { };
+                                                                                  m_numChildren(numChildren),
+                                                                                  m_passWholeVertex(true),
+                                                                                  m_childPassedFilters(numChildren,false) { };
 
     /** Return the SimGeoID corresponding to the vertex of the truth incident */
     AtlasDetDescr::AtlasRegion geoID() { return m_geoID; };
@@ -79,8 +79,8 @@ namespace ISF {
     virtual HepMC::GenParticle*       parentParticle() const = 0;
     /** Return the barcode of the parent particle */
     virtual Barcode::ParticleBarcode  parentBarcode() const = 0;
-    /** Return the extra barcode of the parent particle */
-    virtual Barcode::ParticleBarcode  parentBCID() const = 0;
+    /** Return the bunch-crossing identifier of the parent particle */
+    virtual int                       parentBCID() const { return 0; }
     /** Return a boolean whether or not the parent particle survives the incident */
     virtual bool                      parentSurvivesIncident() const = 0;
     /** Return the parent particle after the TruthIncident vertex (and assign
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
index 31eb53c1de2..c430edc6306 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.h
@@ -15,53 +15,53 @@
 namespace ISF {
 
   /**
-   @class TruthBinding 
-   @author Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch
-   */
-
-class TruthBinding {
- public:
-  /** default constructor */
-  TruthBinding() = delete;
-  
-  /** constructor setting all truth particle pointers to the given particle */
-  inline TruthBinding(HepMC::GenParticle* allTruthP);
-  /** constructor setting all truth particle pointers individually */
-  inline TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP);
-  
-  /** copy constructors */
-  inline TruthBinding(const TruthBinding& rhs);
-  inline TruthBinding(TruthBinding&& rhs);
-  
-  /** assignment operators */
-  inline TruthBinding& operator=(const TruthBinding& rhs);
-  inline TruthBinding& operator=(TruthBinding&& rhs);
-  
-  /** destructor */
-  inline ~TruthBinding();
-  
-  /** comparisons */
-  inline bool operator==(const TruthBinding& rhs) const;
-  inline bool isEqual(const TruthBinding& rhs) const;
-  inline bool isIdent(const TruthBinding& rhs) const;
-  
-  /** pointer to the particle in the simulation truth */
-  inline HepMC::GenParticle* getTruthParticle() const;
-  inline void                setTruthParticle(HepMC::GenParticle* p);
-  
-  /** pointer to the primary particle in the simulation truth */
-  inline HepMC::GenParticle* getPrimaryTruthParticle() const;
-  
-  /** pointer to the simulation truth particle before any regeneration happened (eg. brem) */
-  inline HepMC::GenParticle* getGenerationZeroTruthParticle() const;
-  inline void                setGenerationZeroTruthParticle(HepMC::GenParticle* p);
-
- private:
-  HepMC::GenParticle*   m_truthParticle;               //!< pointer to particle in MC truth
-  HepMC::GenParticle*   m_primaryTruthParticle;        //!< pointer to corresponding primary (generator) particle
-  HepMC::GenParticle*   m_generationZeroTruthParticle; //!< pointer to corresponding truth particle before any regenration
-};
-  
+     @class TruthBinding
+     @author Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch
+  */
+
+  class TruthBinding {
+  public:
+    /** No default constructor */
+    TruthBinding() = delete;
+
+    /** constructor setting all truth particle pointers to the given particle */
+    inline TruthBinding(HepMC::GenParticle* allTruthP);
+    /** constructor setting all truth particle pointers individually */
+    inline TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP);
+
+    /** copy constructors */
+    inline TruthBinding(const TruthBinding &rhs);
+    inline TruthBinding(TruthBinding&& rhs);
+
+    //** assignment operators */
+    inline TruthBinding& operator=(const TruthBinding &rhs);
+    inline TruthBinding& operator=(TruthBinding&& rhs);
+
+    /** comparisons */
+    inline bool operator==(const TruthBinding& rhs) const;
+    inline bool isEqual(const TruthBinding& rhs) const;
+    inline bool isIdent(const TruthBinding& rhs) const;
+
+    /** destructor */
+    inline ~TruthBinding();
+
+    /** pointer to the particle in the simulation truth */
+    inline HepMC::GenParticle* getTruthParticle() const;
+    inline void                setTruthParticle(HepMC::GenParticle* p);
+
+    /** pointer to the primary particle in the simulation truth */
+    inline HepMC::GenParticle* getPrimaryTruthParticle() const;
+
+    /** pointer to the simulation truth particle before any regeneration happened (eg. brem) */
+    inline HepMC::GenParticle* getGenerationZeroTruthParticle() const;
+    inline void                setGenerationZeroTruthParticle(HepMC::GenParticle* p);
+
+  private:
+    HepMC::GenParticle*   m_truthParticle;               //!< pointer to particle in MC truth
+    HepMC::GenParticle*   m_primaryTruthParticle;        //!< pointer to corresponding primary (generator) particle
+    HepMC::GenParticle*   m_generationZeroTruthParticle; //!< pointer to corresponding truth particle before any regenration
+  };
+
 } // end of namespace
 
 /* implementation for inlined methods */
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
index cad6789526d..b97272c450b 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
+++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/TruthBinding.icc
@@ -5,100 +5,100 @@
 // this file contains all ITruthBinding inline methods
 
 namespace ISF {
-/** constructor setting all truth particle pointers to the given particle */
-TruthBinding::TruthBinding(HepMC::GenParticle* allTruthP) :
-  m_truthParticle(allTruthP),
-  m_primaryTruthParticle(allTruthP),
-  m_generationZeroTruthParticle(allTruthP) { }
-
-/** constructor setting all truth particle pointers individually */
-TruthBinding::TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP) :
-  m_truthParticle(truthP),
-  m_primaryTruthParticle(primaryTruthP),
-  m_generationZeroTruthParticle(genZeroTruthP) { }
-
-/** copy constructor */
-TruthBinding::TruthBinding(const TruthBinding& rhs) :
-  m_truthParticle(rhs.getTruthParticle()),
-  m_primaryTruthParticle(rhs.getPrimaryTruthParticle()),
-  m_generationZeroTruthParticle(rhs.getGenerationZeroTruthParticle()) { }
-
-/** move copy constructor */
-TruthBinding::TruthBinding(TruthBinding&& rhs) :
-  m_truthParticle(rhs.getTruthParticle()),
-  m_primaryTruthParticle(rhs.getPrimaryTruthParticle()),
-  m_generationZeroTruthParticle(rhs.getGenerationZeroTruthParticle()) { }
-
-/** assignment operator */
-TruthBinding& TruthBinding::operator=(const TruthBinding& rhs) {
-  m_truthParticle=rhs.getTruthParticle();
-  m_primaryTruthParticle=rhs.getPrimaryTruthParticle();
-  m_generationZeroTruthParticle=rhs.getGenerationZeroTruthParticle();
-  return *this;
-}
-
-/** move assignment operator */
-TruthBinding& TruthBinding::operator=(TruthBinding&& rhs) {
-  m_truthParticle=rhs.getTruthParticle();
-  m_primaryTruthParticle=rhs.getPrimaryTruthParticle();
-  m_generationZeroTruthParticle=rhs.getGenerationZeroTruthParticle();
-  return *this;
-}
-
-/** destructor */
-TruthBinding::~TruthBinding() { }
-
-/** comparison operator */
-bool TruthBinding::operator==(const TruthBinding& rhs) const {
-  return isEqual(rhs);
-}
-
-/** check equality */
-bool TruthBinding::isEqual(const TruthBinding& rhs) const {
-  bool pass = true;
-
-  const auto rhsTruth = rhs.getTruthParticle();
-  if (m_truthParticle && rhsTruth) {
-    pass &= *m_truthParticle == *rhsTruth;
-  } else {
-    return false;
+  /** constructor setting all truth particle pointers to the given particle */
+  TruthBinding::TruthBinding(HepMC::GenParticle* allTruthP) :
+    m_truthParticle(allTruthP),
+    m_primaryTruthParticle(allTruthP),
+    m_generationZeroTruthParticle(allTruthP) { }
+
+  /** constructor setting all truth particle pointers individually */
+  TruthBinding::TruthBinding(HepMC::GenParticle* truthP, HepMC::GenParticle* primaryTruthP, HepMC::GenParticle* genZeroTruthP) :
+    m_truthParticle(truthP),
+    m_primaryTruthParticle(primaryTruthP),
+    m_generationZeroTruthParticle(genZeroTruthP) { }
+
+  /** copy constructor */
+  TruthBinding::TruthBinding(const TruthBinding &rhs) :
+    m_truthParticle(rhs.getTruthParticle()),
+    m_primaryTruthParticle(rhs.getPrimaryTruthParticle()),
+    m_generationZeroTruthParticle(rhs.getGenerationZeroTruthParticle()) { }
+
+  /** move copy constructor */
+  TruthBinding::TruthBinding(TruthBinding&& rhs) :
+    m_truthParticle(rhs.getTruthParticle()),
+    m_primaryTruthParticle(rhs.getPrimaryTruthParticle()),
+    m_generationZeroTruthParticle(rhs.getGenerationZeroTruthParticle()) { }
+
+  /** assignment operator */
+  TruthBinding& TruthBinding::operator=(const TruthBinding &rhs) {
+    m_truthParticle=rhs.getTruthParticle();
+    m_primaryTruthParticle=rhs.getPrimaryTruthParticle();
+    m_generationZeroTruthParticle=rhs.getGenerationZeroTruthParticle();
+    return *this;
   }
 
-  const auto rhsPrimary = rhs.getPrimaryTruthParticle();
-  if (m_primaryTruthParticle && rhsPrimary) {
-    pass &= *m_primaryTruthParticle == *rhsPrimary;
-  } else {
-    return false;
+  /** move assignment operator */
+  TruthBinding& TruthBinding::operator=(TruthBinding&& rhs) {
+    m_truthParticle=rhs.getTruthParticle();
+    m_primaryTruthParticle=rhs.getPrimaryTruthParticle();
+    m_generationZeroTruthParticle=rhs.getGenerationZeroTruthParticle();
+    return *this;
   }
 
-  const auto rhsGenZero = rhs.getGenerationZeroTruthParticle();
-  if (m_generationZeroTruthParticle && rhsGenZero) {
-    pass &= *m_generationZeroTruthParticle == *rhsGenZero;
-  } else {
-    return false;
+  /** destructor */
+  TruthBinding::~TruthBinding() { }
+
+  /** comparison operator */
+  bool TruthBinding::operator==(const TruthBinding& rhs) const {
+    return isEqual(rhs);
   }
 
-  return pass;
-}
+  /** check equality */
+  bool TruthBinding::isEqual(const TruthBinding& rhs) const {
+    bool pass = true;
+
+    const auto rhsTruth = rhs.getTruthParticle();
+    if (m_truthParticle && rhsTruth) {
+      pass &= *m_truthParticle == *rhsTruth;
+    } else {
+      return false;
+    }
+
+    const auto rhsPrimary = rhs.getPrimaryTruthParticle();
+    if (m_primaryTruthParticle && rhsPrimary) {
+      pass &= *m_primaryTruthParticle == *rhsPrimary;
+    } else {
+      return false;
+    }
+
+    const auto rhsGenZero = rhs.getGenerationZeroTruthParticle();
+    if (m_generationZeroTruthParticle && rhsGenZero) {
+      pass &= *m_generationZeroTruthParticle == *rhsGenZero;
+    } else {
+      return false;
+    }
+
+    return pass;
+  }
 
-/** check identity */
-bool TruthBinding::isIdent(const TruthBinding& rhs) const {
-  bool pass = true;
-  pass &= m_truthParticle == rhs.getTruthParticle();
-  pass &= m_primaryTruthParticle == rhs.getPrimaryTruthParticle();
-  pass &= m_generationZeroTruthParticle == rhs.getGenerationZeroTruthParticle();
-  return pass;
-}
+  /** check identity */
+  bool TruthBinding::isIdent(const TruthBinding& rhs) const {
+    bool pass = true;
+    pass &= m_truthParticle == rhs.getTruthParticle();
+    pass &= m_primaryTruthParticle == rhs.getPrimaryTruthParticle();
+    pass &= m_generationZeroTruthParticle == rhs.getGenerationZeroTruthParticle();
+    return pass;
+  }
 
-/** pointer to the particle in the simulation truth */
-HepMC::GenParticle* TruthBinding::getTruthParticle() const { return m_truthParticle; }
-void                TruthBinding::setTruthParticle(HepMC::GenParticle* p) { m_truthParticle = p; }
+  /** pointer to the particle in the simulation truth */
+  HepMC::GenParticle* TruthBinding::getTruthParticle() const { return m_truthParticle; }
+  void                TruthBinding::setTruthParticle(HepMC::GenParticle* p) { m_truthParticle = p; }
 
-/** pointer to the primary particle in the simulation truth */
-HepMC::GenParticle* TruthBinding::getPrimaryTruthParticle() const { return m_primaryTruthParticle; }
+  /** pointer to the primary particle in the simulation truth */
+  HepMC::GenParticle* TruthBinding::getPrimaryTruthParticle() const { return m_primaryTruthParticle; }
 
-/** pointer to the simulation truth particle before any regeneration (eg. brem) */
-HepMC::GenParticle* TruthBinding::getGenerationZeroTruthParticle() const { return m_generationZeroTruthParticle; }
-void                TruthBinding::setGenerationZeroTruthParticle(HepMC::GenParticle* p) { m_generationZeroTruthParticle = p; }
+  /** pointer to the simulation truth particle before any regeneration (eg. brem) */
+  HepMC::GenParticle* TruthBinding::getGenerationZeroTruthParticle() const { return m_generationZeroTruthParticle; }
+  void                TruthBinding::setGenerationZeroTruthParticle(HepMC::GenParticle* p) { m_generationZeroTruthParticle = p; }
 
 } // end ISF namespace
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx
index e64c118a036..e78d8db5349 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx
@@ -11,85 +11,90 @@
 #include <cmath> // fabs
 
 ISF::ISFParticle::ISFParticle(
-  const Amg::Vector3D& pos,
-  const Amg::Vector3D& mom,
-  double mass,
-  double charge,
-  int pdgCode,
-  double time,
-  const ISFParticle &parent,
-  Barcode::ParticleBarcode barcode,
-  TruthBinding* truth):
- m_position(pos),
- m_momentum(mom),
- m_mass(mass),
- m_charge(charge),
- m_pdgCode(pdgCode),
- m_tstamp(time),
- m_history(parent.history()),
- m_barcode(barcode),
- m_bcid(parent.getBCID()),
- m_truth(truth),
- m_order(ISF::DefaultParticleOrder),
- m_userInfo(nullptr)
+                              const Amg::Vector3D& pos,
+                              const Amg::Vector3D& mom,
+                              double mass,
+                              double charge,
+                              int pdgCode,
+                              double time,
+                              const ISFParticle &parent,
+                              Barcode::ParticleBarcode barcode,
+                              TruthBinding* truth,
+                              const HepMcParticleLink* partLink):
+  m_position(pos),
+  m_momentum(mom),
+  m_mass(mass),
+  m_charge(charge),
+  m_pdgCode(pdgCode),
+  m_tstamp(time),
+  m_history(parent.history()),
+  m_barcode(barcode),
+  m_bcid(parent.getBCID()),
+  m_truth(truth),
+  m_order(ISF::DefaultParticleOrder),
+  m_userInfo(nullptr),
+  m_partLink(partLink)
 {
 
 }
 
 ISF::ISFParticle::ISFParticle(
-  const HepGeom::Point3D<double>& pos,
-  const HepGeom::Vector3D<double>& mom,
-  double mass,
-  double charge,
-  int pdgCode,
-  double time,
-  const ISFParticle &parent,
-  Barcode::ParticleBarcode barcode,
-  TruthBinding* truth):
- m_position( pos.x(), pos.y(), pos.z()),
- m_momentum( mom.x(), mom.y(), mom.z()),
- m_mass(mass),
- m_charge(charge),
- m_pdgCode(pdgCode),
- m_tstamp(time),
- m_history(parent.history()),
- m_barcode(barcode),
- m_bcid(parent.getBCID()),
- m_truth(truth),
- m_order(ISF::DefaultParticleOrder),
- m_userInfo(nullptr)
+                              const HepGeom::Point3D<double>& pos,
+                              const HepGeom::Vector3D<double>& mom,
+                              double mass,
+                              double charge,
+                              int pdgCode,
+                              double time,
+                              const ISFParticle &parent,
+                              Barcode::ParticleBarcode barcode,
+                              TruthBinding* truth,
+                              const HepMcParticleLink* partLink):
+  m_position( pos.x(), pos.y(), pos.z()),
+  m_momentum( mom.x(), mom.y(), mom.z()),
+  m_mass(mass),
+  m_charge(charge),
+  m_pdgCode(pdgCode),
+  m_tstamp(time),
+  m_history(parent.history()),
+  m_barcode(barcode),
+  m_bcid(parent.getBCID()),
+  m_truth(truth),
+  m_order(ISF::DefaultParticleOrder),
+  m_userInfo(nullptr),
+  m_partLink(partLink)
 {
 
 }
 
 ISF::ISFParticle::ISFParticle(
-  const Amg::Vector3D& pos,
-  const Amg::Vector3D& mom,
-  double mass,
-  double charge,
-  int pdgCode,
-  double time,
-  const DetRegionSvcIDPair &origin,
-  int bcid,
-  Barcode::ParticleBarcode barcode,
-  TruthBinding* truth):
- m_position(pos),
- m_momentum(mom),
- m_mass(mass),
- m_charge(charge),
- m_pdgCode(pdgCode),
- m_tstamp(time),
- m_history(1, origin),
- m_barcode(barcode),
- m_bcid(bcid),
- m_truth(truth),
- m_order(ISF::DefaultParticleOrder),
- m_userInfo(nullptr)
+                              const Amg::Vector3D& pos,
+                              const Amg::Vector3D& mom,
+                              double mass,
+                              double charge,
+                              int pdgCode,
+                              double time,
+                              const DetRegionSvcIDPair &origin,
+                              int bcid,
+                              Barcode::ParticleBarcode barcode,
+                              TruthBinding* truth,
+                              const HepMcParticleLink* partLink):
+  m_position(pos),
+  m_momentum(mom),
+  m_mass(mass),
+  m_charge(charge),
+  m_pdgCode(pdgCode),
+  m_tstamp(time),
+  m_history(1, origin),
+  m_barcode(barcode),
+  m_bcid(bcid),
+  m_truth(truth),
+  m_order(ISF::DefaultParticleOrder),
+  m_userInfo(nullptr),
+  m_partLink(partLink)
 {
 
 }
 
-
 ISF::ISFParticle::ISFParticle(const ISFParticle& isfp):
   m_position(isfp.position()),
   m_momentum(isfp.momentum()),
@@ -106,8 +111,9 @@ ISF::ISFParticle::ISFParticle(const ISFParticle& isfp):
 {
   TruthBinding *truth = isfp.getTruthBinding();
   if (truth) {
-      m_truth = new TruthBinding(*truth);
+    m_truth = new TruthBinding(*truth);
   }
+  m_partLink = ((isfp.getParticleLink()) ? new HepMcParticleLink(*isfp.getParticleLink()) : nullptr);
 }
 
 ISF::ISFParticle::ISFParticle(ISFParticle&& isfp):
@@ -122,17 +128,20 @@ ISF::ISFParticle::ISFParticle(ISFParticle&& isfp):
   m_bcid(isfp.getBCID()),
   m_truth(isfp.getTruthBinding()),
   m_order(isfp.getOrder()),
-  m_userInfo(isfp.getUserInformation())
+  m_userInfo(isfp.getUserInformation()),
+  m_partLink(isfp.getParticleLink())
 {
 }
 
 ISF::ISFParticle::~ISFParticle() {
   delete m_truth;
   delete m_userInfo;
+  if (m_partLink) delete m_partLink;
 }
 
 ISF::ISFParticle& ISF::ISFParticle::operator=(const ISF::ISFParticle& rhs)
 {
+
   if (this != &rhs) {
     m_position     = rhs.position();
     m_momentum     = rhs.momentum();
@@ -149,8 +158,9 @@ ISF::ISFParticle& ISF::ISFParticle::operator=(const ISF::ISFParticle& rhs)
 
     TruthBinding *rhsTruth = rhs.getTruthBinding();
     if (rhsTruth) {
-        m_truth = new TruthBinding(*rhsTruth);
+      m_truth = new TruthBinding(*rhsTruth);
     }
+    m_partLink = ((rhs.getParticleLink()) ? new HepMcParticleLink(*rhs.getParticleLink()): nullptr);
 
     delete m_userInfo;
     m_userInfo = nullptr;
@@ -174,6 +184,8 @@ ISF::ISFParticle& ISF::ISFParticle::operator=(ISF::ISFParticle&& rhs)
   m_truth        = rhs.getTruthBinding();
   delete m_userInfo;
   m_userInfo     = rhs.getUserInformation();
+  if (m_partLink) delete m_partLink;
+  m_partLink     = rhs.getParticleLink();
 
   return *this;
 }
@@ -216,6 +228,14 @@ bool ISF::ISFParticle::isEqual(const ISF::ISFParticle& rhs) const
     }
   }
 
+  {
+    const auto rhsPartLinkPtr = rhs.getParticleLink();
+    if(m_partLink && rhsPartLinkPtr) {
+      pass &= *m_partLink == *rhsPartLinkPtr;
+    } else {
+      pass &= m_partLink == rhsPartLinkPtr; // must be both nullptr to pass
+    }
+  }
   return pass;
 }
 
@@ -233,5 +253,21 @@ bool ISF::ISFParticle::isIdent(const ISF::ISFParticle& rhs) const
   pass &= m_bcid == rhs.getBCID();
   pass &= m_truth && rhs.getTruthBinding();
   pass &= m_userInfo == rhs.getUserInformation();
+  pass &= m_partLink == rhs.getParticleLink();
   return pass;
 }
+
+void ISF::ISFParticle::setBarcodeAndUpdateHepMcParticleLink( Barcode::ParticleBarcode bc) {
+  // set a new barcode
+  setBarcode(bc);
+
+  //creating/changing the ISFParticle's HepMcParticleLink
+  HepMcParticleLink* newHMPL = nullptr;
+  if (m_partLink) {
+    newHMPL = new HepMcParticleLink(bc, m_partLink->eventIndex(), m_partLink->getEventCollection());
+    delete m_partLink;
+  } else {
+    newHMPL = new HepMcParticleLink(bc);
+  }
+  m_partLink = newHMPL;
+}
diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
index 6cd8494cc14..484384db43b 100644
--- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx
@@ -78,8 +78,7 @@ int ISF::ISFTruthIncident::parentPdgCode() const {
 }
 
 HepMC::GenParticle* ISF::ISFTruthIncident::parentParticle() const {
-
-  if ( m_parent.getTruthBinding() ) {
+  if ( m_parent.getTruthBinding() || m_parent.getParticleLink()) {
     return getHepMCTruthParticle(m_parent);
   } else {
     return updateHepMCTruthParticle(m_parent, &m_parent);
@@ -104,8 +103,10 @@ HepMC::GenParticle* ISF::ISFTruthIncident::parentParticleAfterIncident(Barcode::
 
   // only update the parent particle, if it survived the interaction
 
+  // set a new barcode
   m_parent.setBarcode( newBC );
 
+  // and update truth info (including the ISFParticle's HMPL)
   return updateHepMCTruthParticle(m_parent, &m_parent);
 }
 
@@ -136,6 +137,7 @@ HepMC::GenParticle* ISF::ISFTruthIncident::childParticle(unsigned short index,
     sec->setBarcode( bc);
   }
 
+  // and update truth info (including the ISFParticle's HMPL)
   return updateHepMCTruthParticle( *sec, &m_parent );
 }
 
@@ -151,8 +153,8 @@ void ISF::ISFTruthIncident::setAllChildrenBarcodes(Barcode::ParticleBarcode bc)
     // the current particle
     ISF::ISFParticle *p = m_children[i];
 
-    // set a new barcode
-    p->setBarcode( bc);
+    // set a new barcode and update the ISFParticle's HMPL
+    p->setBarcodeAndUpdateHepMcParticleLink(bc);
   }
 
   return;
@@ -164,6 +166,13 @@ HepMC::GenParticle* ISF::ISFTruthIncident::getHepMCTruthParticle( const ISF::ISF
   auto* truthBinding     = particle.getTruthBinding();
   auto* hepTruthParticle = truthBinding ? truthBinding->getTruthParticle() : nullptr;
 
+  // HepMC::GenParticle not in TruthBinding -> see if the HepMcParticleLink can retrieve it
+  if (!hepTruthParticle) {
+    const HepMcParticleLink* oldHMPL = particle.getParticleLink();
+    if (oldHMPL && oldHMPL->cptr())
+      hepTruthParticle = const_cast<HepMC::GenParticle*>(oldHMPL->cptr());
+  }
+
   return hepTruthParticle;
 }
 
@@ -184,6 +193,16 @@ HepMC::GenParticle* ISF::ISFTruthIncident::updateHepMCTruthParticle( ISF::ISFPar
     particle.setTruthBinding(truthBinding);
   }
 
+  //register the new GenParticle as HepMcParticleLink, copying over some old properties if present
+  const HepMcParticleLink* oldHMPL = particle.getParticleLink();
+  HepMcParticleLink* newHMPL = nullptr;
+  if (oldHMPL) {
+    newHMPL = new HepMcParticleLink(hepTruthParticle, oldHMPL->eventIndex(), oldHMPL->getEventCollection());
+    delete oldHMPL;
+  } else {
+    newHMPL = new HepMcParticleLink(hepTruthParticle);
+  }
+  particle.setParticleLink(newHMPL);
+
   return hepTruthParticle;
 }
-
-- 
GitLab


From 4e9db67430e4c630d5193c7982dc3503db834e63 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 2 Aug 2017 15:05:53 +0200
Subject: [PATCH 235/404] ISF_Interfaces changes for HepMcParticleLink
 migration.

Adding the ability to pass a full `HepMcParticleLink` when using
`IParticleHelper::createParticle(...)` - See ATLASSIM-2430.
Altering `IInputConverter` and `InputConverter` to use the "type of
`McEventCollection`" enum from `HepMcParticleLink` rather than a
simple bool. See ATLASSIM-3117.
Adapt `SimKernel` to the new `IInputConverter` interface. See
ATLASSIM-3117.
svnpull of changes from `ISF_Interfaces-00-08-00`,
`ISF_Services-00-08-02-01` and `ISF_Algorithms-00-02-01-01`.
Update InputConverter interface used by `G4AtlasAlg`.
---
 .../G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx     |  3 +-
 .../ISF_Core/ISF_Algorithms/src/SimKernel.cxx | 11 +--
 .../ISF_Core/ISF_Algorithms/src/SimKernel.h   |  3 +-
 .../ISF_Algorithms/src/SimKernelMT.cxx        |  3 +-
 .../ISF_Algorithms/test/SimKernelMT_test.cxx  |  4 +-
 .../ISF_Core/ISF_Interfaces/CMakeLists.txt    |  1 +
 .../ISF_Interfaces/IInputConverter.h          |  7 +-
 .../ISF_Interfaces/IParticleHelper.h          | 38 ++++---
 .../ISF_Services/src/InputConverter.cxx       | 51 +++++-----
 .../ISF_Services/src/InputConverter.h         |  6 +-
 .../ISF_Services/test/InputConverter_test.cxx | 99 ++++++++++++-------
 11 files changed, 137 insertions(+), 89 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx
index ab1f781b9a5..6a5c481c75f 100644
--- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx
+++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx
@@ -36,6 +36,7 @@
 #include "MCTruthBase/TruthStrategyManager.h"
 #include "GeoModelInterfaces/IGeoModelSvc.h"
 #include "GaudiKernel/IThreadInitTool.h"
+#include "GeneratorObjects/HepMcParticleLink.h"
 
 // call_once mutexes
 #include <mutex>
@@ -312,7 +313,7 @@ StatusCode G4AtlasAlg::execute()
   }
   ATH_MSG_DEBUG("Recorded output GenEvent collection " << outputTruthCollection.name() << " in store " << outputTruthCollection.store());
   G4Event *inputEvent{};
-  ATH_CHECK( m_inputConverter->convertHepMCToG4Event(*outputTruthCollection, inputEvent, false) );
+  ATH_CHECK( m_inputConverter->convertHepMCToG4Event(*outputTruthCollection, inputEvent, HepMcParticleLink::find_enumFromKey(outputTruthCollection.name())) );
 
   bool abort = false;
   // Worker run manager
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.cxx
index b97decb5d82..c101a89fb33 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.cxx
@@ -23,8 +23,9 @@
 #include "TTree.h"
 // DetectorDescription
 #include "AtlasDetDescr/AtlasRegionHelper.h"
-// McEventCollection
+// GeneratorObjects
 #include "GeneratorObjects/McEventCollection.h"
+#include "GeneratorObjects/HepMcParticleLink.h"
 
 ///////////////////////////////////////////////////////////////////
 // Public methods:
@@ -322,8 +323,7 @@ StatusCode ISF::SimKernel::execute()
   ATH_CHECK( prepareInput(m_inputHardScatterEvgen, m_outputHardScatterTruth, simParticles) );
   //  b. pileup
   if (!m_inputPileupEvgen.key().empty()) {
-    bool isPileup = true;
-    ATH_CHECK( prepareInput(m_inputPileupEvgen, m_outputPileupTruth, simParticles, isPileup) );
+    ATH_CHECK( prepareInput(m_inputPileupEvgen, m_outputPileupTruth, simParticles) );
   }
 
   // -----------------------------------------------------------------------------------------------
@@ -479,8 +479,7 @@ StatusCode ISF::SimKernel::execute()
     generator truth collection into output simulation truth collection */
 StatusCode ISF::SimKernel::prepareInput(SG::ReadHandle<McEventCollection>& inputTruth,
                                         SG::WriteHandle<McEventCollection>& outputTruth,
-                                        ISFParticleContainer& simParticles,
-                                        bool isPileup) const {
+                                        ISFParticleContainer& simParticles) const {
 
   if (!inputTruth.isValid()) {
     ATH_MSG_FATAL("Unable to read input GenEvent collection '" << inputTruth.key() << "'");
@@ -490,7 +489,7 @@ StatusCode ISF::SimKernel::prepareInput(SG::ReadHandle<McEventCollection>& input
   // create copy
   outputTruth = CxxUtils::make_unique<McEventCollection>(*inputTruth);
 
-  ATH_CHECK( m_inputConverter->convert(*outputTruth, simParticles, isPileup) );
+  ATH_CHECK( m_inputConverter->convert(*outputTruth, simParticles, HepMcParticleLink::find_enumFromKey(outputTruth.name())) );
 
   return StatusCode::SUCCESS;
 }
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.h b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.h
index 32669eacd76..3854d8a831e 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.h
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernel.h
@@ -85,8 +85,7 @@ namespace ISF {
         generator truth collection into output simulation truth collection */
     StatusCode prepareInput(SG::ReadHandle<McEventCollection>& inputTruth,
                             SG::WriteHandle<McEventCollection>& outputTruth,
-                            ISFParticleContainer& simParticles,
-                            bool isPileup=false) const;
+                            ISFParticleContainer& simParticles) const;
 
 
     /** Input/output truth collections and input conversion */
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernelMT.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernelMT.cxx
index 3ee6b49b963..ff5f2eade0c 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernelMT.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimKernelMT.cxx
@@ -151,8 +151,7 @@ StatusCode ISF::SimKernelMT::execute() {
 
   // read and convert input
   ISFParticleContainer simParticles; // particles for ISF simulation
-  bool isPileup = false;
-  ATH_CHECK( m_inputConverter->convert(*outputTruth, simParticles, isPileup) );
+  ATH_CHECK( m_inputConverter->convert(*outputTruth, simParticles, HepMcParticleLink::find_enumFromKey(outputTruth.name())) );
 
   // loop until there are no more particles to simulate
   while (simParticles.size() ) {
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx
index 780f54f2eea..41ab53d2635 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/test/SimKernelMT_test.cxx
@@ -56,10 +56,10 @@ namespace ISFTesting {
     MOCK_METHOD0(finalize, StatusCode());
     MOCK_CONST_METHOD3(convert, StatusCode(const McEventCollection&,
                                            ISF::ISFParticleContainer&,
-                                           bool));
+                                           EBC_EVCOLL kindOfCollection));
     MOCK_CONST_METHOD3(convertHepMCToG4Event, StatusCode(McEventCollection&,
                                                          G4Event*&,
-                                                         bool));
+                                                         EBC_EVCOLL kindOfCollection));
     MOCK_CONST_METHOD2(ISF_to_G4Event, G4Event*(const std::vector<const ISF::ISFParticle*>&,
                                                 HepMC::GenEvent*));
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt
index 5925a11fd64..782f95e97f0 100644
--- a/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt
@@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/StoreGate
                           DetectorDescription/AtlasDetDescr
                           DetectorDescription/GeoPrimitives
+			  Generators/GeneratorObjects
                           GaudiKernel
                           Generators/GeneratorObjects
                           Simulation/Barcode/BarcodeEvent
diff --git a/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IInputConverter.h b/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IInputConverter.h
index 26ca2d55d57..13b2bc77356 100644
--- a/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IInputConverter.h
+++ b/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IInputConverter.h
@@ -12,6 +12,9 @@
 // Gaudi
 #include "GaudiKernel/IInterface.h"
 
+//GeneratorObjects
+#include "GeneratorObjects/HepMcParticleLink.h"
+
 // StoreGate
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
@@ -52,13 +55,13 @@ namespace ISF {
         and push them into the given ISFParticleContainer */
     virtual StatusCode convert(const McEventCollection& inputGenEvents,
                                ISFParticleContainer& simParticles,
-                               bool isPileup) const = 0;
+                               EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const = 0;
 
     /** Convert selected particles from the given McEventCollection into G4PrimaryParticles
         and push them into the given G4Event */
     virtual StatusCode convertHepMCToG4Event(McEventCollection& inputGenEvents,
                                              G4Event*& outputG4Event,
-                                             bool isPileup) const = 0;
+                                             EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const = 0;
 
     /** Converts vector of ISF::ISFParticles to G4Event */
     virtual G4Event* ISF_to_G4Event(const std::vector<const ISF::ISFParticle*>& isp, HepMC::GenEvent *genEvent) const = 0;
diff --git a/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IParticleHelper.h b/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IParticleHelper.h
index 3baa725c72d..1ae95863f0a 100644
--- a/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IParticleHelper.h
+++ b/Simulation/ISF/ISF_Core/ISF_Interfaces/ISF_Interfaces/IParticleHelper.h
@@ -11,36 +11,39 @@
 
 // Gaudi
 #include "GaudiKernel/IAlgTool.h"
- 
+
 // Simulation includes
-#include "ISF_Event/SimSvcID.h" 
+#include "ISF_Event/SimSvcID.h"
 
 // Barcode includes
 #include "BarcodeEvent/Barcode.h"
 
 // Amg includes
 #include "GeoPrimitives/GeoPrimitives.h"
- 
+
 // CLHEP includes
 #include "CLHEP/Geometry/Vector3D.h"
 #include "CLHEP/Geometry/Point3D.h"
 
+// McEventCollection
+#include "GeneratorObjects/HepMcParticleLink.h"
+
 namespace ISF {
 
   class ISFParticle;
   class TruthBinding;
  
   /**
-   @class IParticleHelper
-       
-   Interface to create a particle from primary information,
-   allows to reduce dependency on actual StackParticle implementation
-       
-   Could make use of a Data POOL eventually       
-       
-   @author Andreas.Salzburger -at- cern.ch
-   */
-     
+     @class IParticleHelper
+
+     Interface to create a particle from primary information,
+     allows to reduce dependency on actual StackParticle implementation
+
+     Could make use of a Data POOL eventually
+
+     @author Andreas.Salzburger -at- cern.ch
+  */
+
   class IParticleHelper : virtual public IAlgTool {
      public:
      
@@ -59,7 +62,8 @@ namespace ISF {
                                               double pTime,
                                               const ISFParticle &parent,
                                               Barcode::ParticleBarcode bc = Barcode::fUndefinedBarcode,
-                                              TruthBinding* tBinding = nullptr) const = 0;
+                                              TruthBinding* tBinding = nullptr,
+                                           const HepMcParticleLink * partLink = nullptr) const = 0;
 
        /** Create a new particle */
        virtual ISFParticle* createParticle( const Amg::Vector3D& x,
@@ -70,7 +74,8 @@ namespace ISF {
                                             double pTime,
                                             const ISFParticle &parent,
                                             Barcode::ParticleBarcode bc = Barcode::fUndefinedBarcode,
-                                            TruthBinding* tBinding = nullptr) const = 0;
+                                            TruthBinding* tBinding = nullptr,
+                                         const HepMcParticleLink * partLink = nullptr) const = 0;
 
        /** Create a new particle */
        virtual ISFParticle* createParticle( const HepGeom::Point3D<double>& x,
@@ -81,7 +86,8 @@ namespace ISF {
                                             double pTime,
                                             const ISFParticle &parent,
                                             Barcode::ParticleBarcode bc = Barcode::fUndefinedBarcode,
-                                            TruthBinding* tBinding = nullptr) const = 0;
+                                            TruthBinding* tBinding = nullptr,
+                                         const HepMcParticleLink * partLink = nullptr) const = 0;
 
        /** An updated particle (e.g. after transport) */
        virtual ISFParticle* updatedParticle( const ISFParticle& origIsp,
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
index 725ce48699b..9005d9b755b 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx
@@ -133,16 +133,12 @@ ISF::InputConverter::finalize()
 StatusCode
 ISF::InputConverter::convert(const McEventCollection& inputGenEvents,
                              ISF::ISFParticleContainer& simParticles,
-                             bool isPileup) const
+                             EBC_EVCOLL kindOfCollection) const
 {
   for ( const auto& eventPtr : inputGenEvents ) {
     // skip empty events
     if (eventPtr == nullptr) { continue; }
 
-    // @FIXME: set the bunch-crossing identifier for pileup dynamically
-    // rather than a constant '1' (e.g. could use GenEvent index for that?)
-    int bcid = isPileup ? 1 : 0;
-
     ATH_MSG_DEBUG("Starting conversion of GenEvent with"
                   " signal_process_id=" << eventPtr->signal_process_id() <<
                   " and event_number=" << eventPtr->event_number() );
@@ -157,7 +153,7 @@ ISF::InputConverter::convert(const McEventCollection& inputGenEvents,
 
     for ( auto& genPartPtr : passedGenParticles ) {
       ATH_MSG_VERBOSE("Picking up following GenParticle for conversion to ISFParticle: " <<  *genPartPtr);
-      auto *simParticlePtr = this->convertParticle(genPartPtr, bcid);
+      auto simParticlePtr = convertParticle(genPartPtr, kindOfCollection);
       if (!simParticlePtr) {
         ATH_MSG_ERROR("Error while trying to convert input generator particles. Aborting.");
         return StatusCode::FAILURE;
@@ -176,10 +172,10 @@ ISF::InputConverter::convert(const McEventCollection& inputGenEvents,
 
 StatusCode ISF::InputConverter::convertHepMCToG4Event(McEventCollection& inputGenEvents,
                                                       G4Event*& outputG4Event,
-                                                      bool isPileup) const
+                                                      EBC_EVCOLL kindOfCollection) const
 {
   ISF::ISFParticleContainer simParticleList{}; // particles for ISF simulation
-  ATH_CHECK(this->convert(inputGenEvents, simParticleList, isPileup));
+  ATH_CHECK(this->convert(inputGenEvents, simParticleList, kindOfCollection));
   //Convert from ISFParticleContainer to ConstISFParticleVector
   ISF::ConstISFParticleVector simParticleVector{std::make_move_iterator(std::begin(simParticleList)),
                                                 std::make_move_iterator(std::end(simParticleList))};
@@ -227,10 +223,14 @@ ISF::InputConverter::getSelectedParticles(const HepMC::GenEvent& evnt, bool lega
 
 /** get all generator particles which pass filters */
 ISF::ISFParticle*
-ISF::InputConverter::convertParticle(HepMC::GenParticle* genPartPtr, int bcid) const {
+ISF::InputConverter::convertParticle(HepMC::GenParticle* genPartPtr, EBC_EVCOLL kindOfCollection) const {
   if (!genPartPtr) { return nullptr; }
   auto& genPart = *genPartPtr;
 
+  // @FIXME: set the bunch-crossing identifier for pile-up dynamically
+  // rather than a constant '1' (e.g. could use GenEvent index for that?)
+  const int bcid = (kindOfCollection==EBC_MAINEVCOLL) ? 0 : 1;
+
   HepMC::GenVertex* pVertex = genPart.production_vertex();
   if (!pVertex) {
     ATH_MSG_ERROR("Unable to convert following generator particle due to missing "
@@ -249,19 +249,26 @@ ISF::InputConverter::convertParticle(HepMC::GenParticle* genPartPtr, int bcid) c
   /// particle origin (TODO: add proper GeoID, collision/cosmics)
   DetRegionSvcIDPair origin(AtlasDetDescr::fUndefinedAtlasRegion, ISF::fEventGeneratorSimID);
   const auto pBarcode = genPart.barcode();
-  ISF::TruthBinding* tBinding = new ISF::TruthBinding(genPartPtr);
-
-  auto* sParticle = new ISF::ISFParticle( std::move(pos),
-                                         std::move(mom),
-                                         pMass,
-                                         charge,
-                                         pPdgId,
-                                         pTime,
-                                         origin,
-                                         bcid,
-                                         pBarcode,
-                                         tBinding );
-  return sParticle;
+  auto tBinding = std::make_unique<ISF::TruthBinding>(genPartPtr);
+
+  auto *parentEvent = genPart.parent_event();
+  if(!parentEvent) {
+    ATH_MSG_ERROR("Cannot convert a GenParticle without a parent GenEvent into an ISFParticle!!!");
+    return nullptr;
+  }
+  auto hmpl = std::make_unique<HepMcParticleLink>(&genPart, parentEvent->event_number(), kindOfCollection);
+  auto sParticle = std::make_unique<ISF::ISFParticle>( std::move(pos),
+                                                       std::move(mom),
+                                                       pMass,
+                                                       charge,
+                                                       pPdgId,
+                                                       pTime,
+                                                       origin,
+                                                       bcid,
+                                                       pBarcode,
+                                                       tBinding.release(),
+                                                       hmpl.release() );
+  return sParticle.release();
 }
 
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
index ec7ad7425b9..5f57a516d13 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
+++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.h
@@ -70,12 +70,12 @@ namespace ISF {
         and push them into the given ISFParticleContainer */
     virtual StatusCode convert(const McEventCollection& inputGenEvents,
                                ISF::ISFParticleContainer& simParticles,
-                               bool isPileup=false) const override final;
+                               EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const override final;
 
     /** */
     virtual StatusCode convertHepMCToG4Event(McEventCollection& inputGenEvents,
                                              G4Event*& outputG4Event,
-                                             bool isPileup) const override final;
+                                             EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const override final;
 
     /** Converts vector of ISF::ISFParticles to G4Event */
     G4Event* ISF_to_G4Event(const std::vector<const ISF::ISFParticle*>& isp, HepMC::GenEvent *genEvent) const override final;
@@ -103,7 +103,7 @@ namespace ISF {
     bool passesFilters(const HepMC::GenParticle& p) const;
 
     /** convert GenParticle to ISFParticle */
-    ISF::ISFParticle* convertParticle(HepMC::GenParticle* genPartPtr, int bcid) const;
+    ISF::ISFParticle* convertParticle(HepMC::GenParticle* genPartPtr, EBC_EVCOLL kindOfCollection=EBC_MAINEVCOLL) const;
 
     /** ParticlePropertyService and ParticleDataTable */
     ServiceHandle<IPartPropSvc>           m_particlePropSvc;          //!< particle properties svc to retrieve PDT
diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx
index 2affadff16c..0eae9414b91 100644
--- a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx
@@ -10,9 +10,6 @@
 
 #undef NDEBUG
 
-// Tested service
-#include "../src/InputConverter.h"
-
 // Framework
 #include "GaudiKernel/PhysicalConstants.h"
 //#include "GaudiKernel/DeclareFactoryEntries.h"
@@ -42,10 +39,14 @@
 // HepMC
 #include "HepMC/GenParticle.h"
 #include "HepMC/GenVertex.h"
+#include "GeneratorObjects/HepMcParticleLink.h"
+#include "GeneratorObjects/McEventCollection.h"
 
 // STL includes
 #include <cstdlib> // quick_exit
 
+// Tested service
+#include "../src/InputConverter.h"
 
 namespace ISFTesting {
 
@@ -152,8 +153,7 @@ TEST_F(InputConverter_test, initialize_empty) {
 
 TEST_F(InputConverter_test, convertParticle_nullptr) {
   ISF::ISFParticle* expected = nullptr;
-  int bcid = 1;
-  ASSERT_EQ( expected, convertParticle(nullptr, bcid) );
+  ASSERT_EQ( expected, convertParticle(nullptr, EBC_MAINEVCOLL) );
 }
 
 
@@ -164,8 +164,7 @@ TEST_F(InputConverter_test, convertParticle_without_production_vertex) {
                                                        1 // status
                                                       );
   ISF::ISFParticle* expected = nullptr;
-  int bcid = 99;
-  ASSERT_EQ( expected, convertParticle(genPart, bcid) );
+  ASSERT_EQ( expected, convertParticle(genPart, EBC_FIRSTPUEVCOLL) );
   delete genPart;
 }
 
@@ -174,6 +173,7 @@ TEST_F(InputConverter_test, convertParticle_using_generated_mass) {
   m_svc->setProperty("UseGeneratedParticleMass", "True");
   ASSERT_TRUE( m_svc->initialize().isSuccess() );
 
+  const int particleBarcode(546);
   HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12);
   // dynamic allocation necessary as particle ownership is
   // handed over to a HepMC::GenVertex later
@@ -182,17 +182,28 @@ TEST_F(InputConverter_test, convertParticle_using_generated_mass) {
                                                        1 // status
                                                       );
   genPart->set_generated_mass(1234.56);
-  genPart->suggest_barcode(9876352);
+  genPart->suggest_barcode(particleBarcode);
 
   HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c
   int vtx_id = -123;
-  HepMC::GenVertex prodVtx(pos, vtx_id);
-  prodVtx.add_particle_out(genPart);
+  HepMC::GenVertex *prodVtx = new HepMC::GenVertex(pos, vtx_id);
+  prodVtx->add_particle_out(genPart);
+
+  // create dummy input McEventCollection containing a dummy GenEvent
+  SG::WriteHandle<McEventCollection> inputTestDataHandle{"GEN_EVENT_HighPtPU"};
+  inputTestDataHandle = std::make_unique<McEventCollection>();
+  inputTestDataHandle->push_back(new HepMC::GenEvent());
+  HepMC::GenEvent& ge = *(inputTestDataHandle->at(0));
+  ge.add_vertex( prodVtx );
+  HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0, EBC_SECONDPUEVCOLL);
 
   Amg::Vector3D expectedPos(9.8, 7.65, 4.3);
   Amg::Vector3D expectedMom(12.3, 45.6, 78.9);
   ISF::DetRegionSvcIDPair expectedHistory(AtlasDetDescr::fUndefinedAtlasRegion, ISF::fEventGeneratorSimID);
   auto expectedTruthBinding = new ISF::TruthBinding(genPart);
+  const int expectedBCID(1); // FIXME for now convertParticle forces
+                             // the bcid for pile-up
+                             // McEventCollections to be 1.
   ISF::ISFParticle expected(expectedPos,
                             expectedMom,
                             1234.56,
@@ -200,14 +211,13 @@ TEST_F(InputConverter_test, convertParticle_using_generated_mass) {
                             11, // pdg id
                             0.321/Gaudi::Units::c_light, // time
                             expectedHistory,
-                            563, // bcid
-                            9876352, // barcode
-                            expectedTruthBinding
-                            );
+                            expectedBCID, // bcid
+                            particleBarcode, // barcode
+                            expectedTruthBinding,
+                            trackLink);
 
-  int bcid = 563;
   // call the InputConverter's private method
-  ISF::ISFParticle* returned = convertParticle(genPart, bcid);
+  ISF::ISFParticle* returned = convertParticle(genPart, EBC_SECONDPUEVCOLL);
   ASSERT_TRUE( returned );
 
   ASSERT_EQ( expected, *returned );
@@ -218,6 +228,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_photon) {
   m_svc->setProperty("UseGeneratedParticleMass", "False");
   ASSERT_TRUE( m_svc->initialize().isSuccess() );
 
+  const int particleBarcode(546);
   HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12);
   // dynamic allocation necessary as particle ownership is
   // handed over to a HepMC::GenVertex later
@@ -226,17 +237,26 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_photon) {
                                                        1 // status
                                                       );
   genPart->set_generated_mass(1234.56); // should be ignored later on
-  genPart->suggest_barcode(9876352);
+  genPart->suggest_barcode(particleBarcode);
 
   HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c
   int vtx_id = -123;
-  HepMC::GenVertex prodVtx(pos, vtx_id);
-  prodVtx.add_particle_out(genPart);
+  HepMC::GenVertex *prodVtx = new HepMC::GenVertex(pos, vtx_id);
+  prodVtx->add_particle_out(genPart);
+
+  // create dummy input McEventCollection containing a dummy GenEvent
+  SG::WriteHandle<McEventCollection> inputTestDataHandle{"GEN_EVENT"};
+  inputTestDataHandle = std::make_unique<McEventCollection>();
+  inputTestDataHandle->push_back(new HepMC::GenEvent());
+  HepMC::GenEvent& ge = *(inputTestDataHandle->at(0));
+  ge.add_vertex( prodVtx );
+  HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode);
 
   Amg::Vector3D expectedPos(9.8, 7.65, 4.3);
   Amg::Vector3D expectedMom(12.3, 45.6, 78.9);
   ISF::DetRegionSvcIDPair expectedHistory(AtlasDetDescr::fUndefinedAtlasRegion, ISF::fEventGeneratorSimID);
   auto expectedTruthBinding = new ISF::TruthBinding(genPart);
+  const int expectedBCID(0);
   ISF::ISFParticle expected(expectedPos,
                             expectedMom,
                             0., // mass from ParticleDataTable
@@ -244,14 +264,14 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_photon) {
                             22, // pdg id
                             0.321/Gaudi::Units::c_light, // time
                             expectedHistory,
-                            0, // bcid
-                            9876352, // barcode
-                            expectedTruthBinding
+                            expectedBCID, // bcid
+                            particleBarcode, // barcode
+                            expectedTruthBinding,
+                            trackLink
                             );
 
-  int bcid = 0;
   // call the InputConverter's private method
-  ISF::ISFParticle* returned = convertParticle(genPart, bcid);
+  ISF::ISFParticle* returned = convertParticle(genPart, EBC_MAINEVCOLL);
   ASSERT_TRUE( returned );
 
   ASSERT_EQ( expected, *returned );
@@ -262,6 +282,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) {
   m_svc->setProperty("UseGeneratedParticleMass", "False");
   ASSERT_TRUE( m_svc->initialize().isSuccess() );
 
+  const int particleBarcode(546);
   HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12);
   // dynamic allocation necessary as particle ownership is
   // handed over to a HepMC::GenVertex later
@@ -270,17 +291,28 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) {
                                                        1 // status
                                                       );
   genPart->set_generated_mass(1234.56); // should be ignored later on
-  genPart->suggest_barcode(9876352);
+  genPart->suggest_barcode(particleBarcode);
 
   HepMC::FourVector pos(9.8, 7.65, 4.3, 0.321); // NB: 4th component is time*c
   int vtx_id = -123;
-  HepMC::GenVertex prodVtx(pos, vtx_id);
-  prodVtx.add_particle_out(genPart);
+  HepMC::GenVertex *prodVtx = new HepMC::GenVertex(pos, vtx_id);
+  prodVtx->add_particle_out(genPart);
+
+  // create dummy input McEventCollection containing a dummy GenEvent
+  SG::WriteHandle<McEventCollection> inputTestDataHandle{"GEN_EVENT_PU"};
+  inputTestDataHandle = std::make_unique<McEventCollection>();
+  inputTestDataHandle->push_back(new HepMC::GenEvent());
+  HepMC::GenEvent& ge = *(inputTestDataHandle->at(0));
+  ge.add_vertex( prodVtx );
+  HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0, EBC_FIRSTPUEVCOLL);
 
   Amg::Vector3D expectedPos(9.8, 7.65, 4.3);
   Amg::Vector3D expectedMom(12.3, 45.6, 78.9);
   ISF::DetRegionSvcIDPair expectedHistory(AtlasDetDescr::fUndefinedAtlasRegion, ISF::fEventGeneratorSimID);
   auto expectedTruthBinding = new ISF::TruthBinding(genPart);
+  const int expectedBCID(1); // FIXME for now convertParticle forces
+                             // the bcid for pile-up
+                             // McEventCollections to be 1.
   ISF::ISFParticle expected(expectedPos,
                             expectedMom,
                             0.51099891/Gaudi::Units::MeV, // from particle
@@ -288,14 +320,14 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) {
                             11, // pdg id
                             0.321/Gaudi::Units::c_light, // time
                             expectedHistory,
-                            11, // bcid
-                            9876352, // barcode
-                            expectedTruthBinding
+                            expectedBCID, // bcid
+                            particleBarcode, // barcode
+                            expectedTruthBinding,
+                            trackLink
                             );
 
-  int bcid = 11;
   // call the InputConverter's private method
-  ISF::ISFParticle* returned = convertParticle(genPart, bcid);
+  ISF::ISFParticle* returned = convertParticle(genPart, EBC_FIRSTPUEVCOLL);
   ASSERT_TRUE( returned );
 
   ASSERT_EQ( expected, *returned );
@@ -313,13 +345,14 @@ TEST_F(InputConverter_test, passesFilters_empty_filters_defaultconstructed_genpa
 TEST_F(InputConverter_test, passesFilters_empty_filters) {
   ASSERT_TRUE( m_svc->initialize().isSuccess() );
 
+  const int particleBarcode(546);
   HepMC::FourVector mom(12.3, 45.6, 78.9, 0.12);
   HepMC::GenParticle genPart(mom,
                               11, // pdg id (e-)
                               1 // status
                              );
   genPart.set_generated_mass(1234.56);
-  genPart.suggest_barcode(9876352);
+  genPart.suggest_barcode(particleBarcode);
   const HepMC::GenParticle constGenPart(std::move(genPart));
 
   ASSERT_TRUE( passesFilters(constGenPart) );
-- 
GitLab


From 44a3ce532878a765bbadfc22842b4153081f06a3 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 19 Sep 2017 15:27:32 +0200
Subject: [PATCH 236/404] Updates to ParticleHelper for HepMcParticleLink
 migration

Added the possibility to provide full `HepMcParticleLink` information
in `ParticleHelper::createParticle` signatures.
`ParticleHelper` now clones the `HepMcParticleLink` when creating
a new `ISFParticle`. The full `HepMcParticleLink` is now propagated
when updating an `ISFParticle`.
These changes are for the `HepMcParticleLink` EDM migration and pull
in updates from `ISF_Tools-00-07-00`. See ATLASSIM-2430.
---
 .../ISF/ISF_Core/ISF_Tools/CMakeLists.txt     |  3 ++-
 .../ISF_Core/ISF_Tools/src/ParticleHelper.cxx | 26 +++++++++++++------
 .../ISF_Core/ISF_Tools/src/ParticleHelper.h   | 19 ++++++++------
 3 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt
index 82deeb40784..c9c207a85b4 100644
--- a/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt
@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Simulation/Barcode/BarcodeEvent
                           Simulation/Barcode/BarcodeInterfaces
                           Simulation/G4Sim/TrackRecord
+                          Generators/GeneratorObjects
                           Simulation/ISF/ISF_Core/ISF_Event
                           Simulation/ISF/ISF_Core/ISF_Interfaces )
 
@@ -21,7 +22,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_component( ISF_Tools
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES GaudiKernel AthenaBaseComps AtlasDetDescr ISF_Event ISF_Interfaces )
+                     LINK_LIBRARIES GaudiKernel AthenaBaseComps AtlasDetDescr GeneratorObjects ISF_Event ISF_Interfaces )
 
 # Install files from the package:
 atlas_install_headers( ISF_Tools )
diff --git a/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.cxx b/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.cxx
index 2d4facec823..e0adba39983 100644
--- a/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.cxx
@@ -15,6 +15,8 @@
 // Barcode
 #include "BarcodeInterfaces/IBarcodeSvc.h"
 
+// HMPL
+#include "GeneratorObjects/HepMcParticleLink.h"
 
 /** Constructor **/
 ISF::ParticleHelper::ParticleHelper(const std::string& t, const std::string& n, const IInterface* p) :
@@ -44,7 +46,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle(double x, double y, double
                                                       double pTime,
                                                       const ISFParticle &parent,
                                                       Barcode::ParticleBarcode bc,
-                                                      TruthBinding* tBinding) const {
+                                                      TruthBinding* tBinding,
+						      const HepMcParticleLink * partLink) const {
   return new ISF::ISFParticle( Amg::Vector3D(x,y,z),
                                Amg::Vector3D(px,py,pz),
                                pMass,
@@ -53,7 +56,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle(double x, double y, double
                                pTime,
                                parent,
                                bc,
-                               tBinding);
+                               tBinding,
+			       partLink);
 }
 
 
@@ -66,7 +70,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle( const Amg::Vector3D& x,
                                                        double pTime,
                                                        const ISFParticle &parent,
                                                        Barcode::ParticleBarcode bc,
-                                                       TruthBinding* tBinding) const {
+                                                       TruthBinding* tBinding,
+						       const HepMcParticleLink * partLink) const {
   return new ISF::ISFParticle( x,
                                p,
                                pMass,
@@ -75,7 +80,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle( const Amg::Vector3D& x,
                                pTime,
                                parent,
                                bc,
-                               tBinding);
+                               tBinding,
+			       partLink);
 }
 
 /** Create a new particle */
@@ -87,7 +93,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle( const HepGeom::Point3D<do
                                                        double pTime,
                                                        const ISFParticle &parent,
                                                        Barcode::ParticleBarcode bc,
-                                                       TruthBinding* tBinding) const {
+                                                       TruthBinding* tBinding,
+						       const HepMcParticleLink * partLink) const {
   return createParticle( pos.x(), pos.y(), pos.z(),
                          mom.x(), mom.y(), mom.z(),
                          pMass,
@@ -96,7 +103,8 @@ ISF::ISFParticle* ISF::ParticleHelper::createParticle( const HepGeom::Point3D<do
                          pTime,
                          parent,
                          bc,
-                         tBinding );
+                         tBinding,
+			 partLink);
 }
 
 /** Returns the Particle Stack, should register truth */
@@ -113,7 +121,8 @@ ISF::ISFParticle* ISF::ParticleHelper::updatedParticle(const ISFParticle& origIs
                                origIsp.timeStamp()+deltaTime,
                                origIsp,
                                origIsp.barcode(),
-                               origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr);
+                               origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr,
+			       origIsp.getParticleLink() ? new HepMcParticleLink(*origIsp.getParticleLink()) : nullptr);
 }
 
 /** Returns the Particle Stack, should register truth */
@@ -130,7 +139,8 @@ ISF::ISFParticle* ISF::ParticleHelper::updatedParticle(const ISFParticle& origIs
                                origIsp.timeStamp()+deltaTime,
                                origIsp,
                                origIsp.barcode(),
-                               origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr);
+                               origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr,
+			       origIsp.getParticleLink() ? new HepMcParticleLink(*origIsp.getParticleLink()) : nullptr);
 }
 
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.h b/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.h
index de3625bd38f..5f95411d002 100644
--- a/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.h
+++ b/Simulation/ISF/ISF_Core/ISF_Tools/src/ParticleHelper.h
@@ -49,7 +49,7 @@ namespace ISF {
       StatusCode  finalize();
 
       /** Create a new particle */
-      ISFParticle* createParticle( double x, double y, double z,
+      virtual ISFParticle* createParticle( double x, double y, double z,
                                    double px, double py, double pz,
                                    double pMass,
                                    double pCharge,
@@ -57,10 +57,11 @@ namespace ISF {
                                    double pTime,
                                    const ISFParticle &parent,
                                    Barcode::ParticleBarcode bc,
-                                   TruthBinding* tBinding = nullptr) const override final;
+                                   TruthBinding* tBinding = nullptr,
+				   const HepMcParticleLink * partLink = nullptr) const override final;
 
       /** Create a new particle */
-      ISFParticle* createParticle( const Amg::Vector3D& x,
+      virtual ISFParticle* createParticle( const Amg::Vector3D& x,
                                    const Amg::Vector3D& p,
                                    double pMass,
                                    double pCharge,
@@ -68,10 +69,11 @@ namespace ISF {
                                    double pTime,
                                    const ISFParticle &parent,
                                    Barcode::ParticleBarcode bc,
-                                   TruthBinding* tBinding = nullptr) const override final;
+                                   TruthBinding* tBinding = nullptr,
+				   const HepMcParticleLink * partLink = nullptr) const override final;
 
       /** Create a new particle */
-      ISFParticle* createParticle( const HepGeom::Point3D<double>& x,
+      virtual ISFParticle* createParticle( const HepGeom::Point3D<double>& x,
                                    const HepGeom::Vector3D<double>& p,
                                    double pMass,
                                    double pCharge,
@@ -79,16 +81,17 @@ namespace ISF {
                                    double pTime,
                                    const ISFParticle &parent,
                                    Barcode::ParticleBarcode bc,
-                                   TruthBinding* tBinding = nullptr) const override final;
+                                   TruthBinding* tBinding = nullptr,
+				   const HepMcParticleLink * partLink = nullptr) const override final;
 
       /** An updated particle (e.g. after transport) */
-      ISFParticle* updatedParticle( const ISFParticle& origIsp,
+      virtual ISFParticle* updatedParticle( const ISFParticle& origIsp,
                                     const Amg::Vector3D& updatedPos,
                                     const Amg::Vector3D& updatedMom,
                                     double deltaTime = 0.) const override final;
       
       /** An updated particle (e.g. after transport) */
-      ISFParticle* updatedParticle( const ISFParticle& origIsp,
+      virtual ISFParticle* updatedParticle( const ISFParticle& origIsp,
                                     const HepGeom::Point3D<double>&  updatedPos,
                                     const HepGeom::Vector3D<double>& updatedMom,
                                     double deltaTime = 0.) const override final;
-- 
GitLab


From 836763736df30a5c6f28e4dd6a92ee0c496c4597 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 20 Feb 2019 14:37:48 +0100
Subject: [PATCH 237/404] Update PileUpMergeSvc for EventInfo->xAOD::EventInfo
 migration

---
 .../PileUpTools/PileUpMergeSvc.icc            | 31 +++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
index f406d2bdf7d..2346a7cd8a1 100755
--- a/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
+++ b/Control/PileUpTools/PileUpTools/PileUpMergeSvc.icc
@@ -29,6 +29,33 @@ namespace {
   template <class DATALINK> 
   void fillLink(DATALINK&, const NoKey&, IProxyDict*)
   { /*leave it in default state*/ }
+
+  PileUpTimeEventIndex::PileUpType getOldPileUpType(const xAOD::EventInfo_v1::PileUpType &newType) {
+    PileUpTimeEventIndex::PileUpType oldType = PileUpTimeEventIndex::Unknown;
+    switch(newType) {
+    case xAOD::EventInfo_v1::Signal :
+      oldType = PileUpTimeEventIndex::Signal;
+      break;
+    case xAOD::EventInfo_v1::MinimumBias:
+      oldType = PileUpTimeEventIndex::MinimumBias;
+      break;
+    case xAOD::EventInfo_v1::Cavern:
+      oldType = PileUpTimeEventIndex::Cavern;
+      break;
+    case xAOD::EventInfo_v1::HaloGas:
+      oldType = PileUpTimeEventIndex::HaloGas;
+      break;
+    case xAOD::EventInfo_v1::HighPtMinimumBias:
+      oldType = PileUpTimeEventIndex::HighPtMinimumBias;
+      break;
+    case xAOD::EventInfo_v1::ZeroBias:
+      oldType = PileUpTimeEventIndex::ZeroBias;
+      break;
+    default:
+      break;
+    }
+    return oldType;
+  }
 }
 
 ///retrieve keyed DATA obj for the original event
@@ -87,7 +114,7 @@ PileUpMergeSvc::retrieveSubEvtsData(const KEY& dataKey, //orig evt key
 	    if (!m_pITriggerTime.empty()) sigTime-= m_pITriggerTime->time();
 	    evtIndex = subEv.index();
 	  }
-	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,iEvt->type()), dLink);
+	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,getOldPileUpType(subEv.type())), dLink);
 	  numberOfSimHits+=tData.second->size();
 	  timedData.push_back(tData);
 	  ATH_MSG_DEBUG ( "added entry from store " <<  pSubEvtSG->name()
@@ -237,7 +264,7 @@ PileUpMergeSvc::retrieveSubEvtsData(const KEY& dataKey, //orig evt key
 	    if (!m_pITriggerTime.empty()) sigTime-= m_pITriggerTime->time();
 	    evtIndex = subEv.index();
 	  }
-	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,iEvt->type()), dLink);
+	  value_type tData(PileUpTimeEventIndex(int(sigTime),evtIndex,getOldPileUpType(subEv.type())), dLink);
 	  timedData.push_back(tData);
 	  ATH_MSG_DEBUG ( "added entry from store " << pSubEvtSG->name()
 			  << " for object of type " << System::typeinfoName(typeid(data_t)) 
-- 
GitLab


From 71cd81afd939ea2a189a62772480294eb25b4ea7 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 21 Feb 2019 12:46:59 +0100
Subject: [PATCH 238/404] Update HepMcParticleLink constructor syntax in
 TruthParticleCnvTool::convert

Currently we have to assume that we are linking to the hard-scatter `McEventCollection`
the `ITruthParticleCnvTool::convert` would need to be updated to pass this info as an argument
in order to fix this properly.
---
 .../McParticleTools/src/TruthParticleCnvTool.cxx              | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx
index 50f81de5510..7e5e49dc655 100755
--- a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx
+++ b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.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
 */
 
 /////////////////////////////////////////////////////////////////// 
@@ -286,7 +286,7 @@ TruthParticleCnvTool::convert( const McEventCollection * mcCollection,
 		    << hepMcPart->barcode() << " !!");
     }
     //bcToMcPart[ hepMcPart->barcoade() ] = mcPart;
-    HepMcParticleLink mcLink( hepMcPart->barcode(), genEventIndex, sg );
+    HepMcParticleLink mcLink( hepMcPart->barcode(), genEventIndex, EBC_MAINEVCOLL, HepMcParticleLink::IS_POSITION, sg ); // FIXME assuming that we are using the hard-scatter McEventCollection - would need to pass this info as an argument to the convert function.
     bcToMcPart[ mcLink.compress() ] = mcPart;
 
   }//> end loop over particles
-- 
GitLab


From 20e0cecf2d0d09f5e27727234c7db97f2340364f Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 21 Feb 2019 12:50:04 +0100
Subject: [PATCH 239/404] Update HepMcParticleLink::ExtendedBarCode syntax in
 FTK_SGHitInput::read_raw_silicon and DumpSp class

---
 .../TrigFTK/FastTrackSimWrap/src/DumpSp.cxx   | 43 +++++++++++++------
 .../TrigFTK/TrigFTKSim/src/FTK_SGHitInput.cxx | 41 ++++++++++++------
 2 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx b/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx
index e49b68ecb7b..881f1250667 100644
--- a/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx
+++ b/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx
@@ -476,7 +476,8 @@ DumpSp::build_matching_maps()
     TrackTruthCollection::const_iterator found( TruthMap->find(tracklink2) );
     if( found==TruthMap->end() ) { continue; }
     TrackTruth trtruth( found->second );
-    HepMcParticleLink::ExtendedBarCode extBarcode(trtruth.particleLink().barcode(),trtruth.particleLink().eventIndex());
+    HepMcParticleLink::ExtendedBarCode extBarcode(trtruth.particleLink().barcode(),trtruth.particleLink().eventIndex(),
+                                                  trtruth.particleLink().getEventCollection(), HepMcParticleLink::IS_INDEX);
     // update m_ttrTrackMap with track index corresponding to the greatest figure of merit.
     if( m_ttrProbMap.find(extBarcode)==m_ttrProbMap.end() ) {
       // this is the only track matching this barcode so far
@@ -639,6 +640,8 @@ DumpSp::dump_truth() const
           irecmatch = ibestrec->second;
         }
       }
+      HepMcParticleLink::index_type extBarcode2_index, extBarcode2_position;
+      extBarcode2.eventIndex(extBarcode2_index, extBarcode2_position);
       ParentBitmask parent_mask( construct_truth_bitmap( particle ) );
       (*m_oflraw) << setiosflags(ios::scientific) << "T\t"
                 << setw(14) << setprecision(10) << track_truth_x0 << '\t'
@@ -651,7 +654,7 @@ DumpSp::dump_truth() const
                 << pdgcode << '\t'
                 << setw(14) << (int)irecmatch << '\t'
                 << setw(14) << setprecision(10) << precmatch << '\t'
-                << extBarcode2.eventIndex() << '\t'
+                << extBarcode2_index << '\t'
                 << extBarcode2.barcode() << '\t'
                 << parent_mask.to_ulong() << '\t'
                 << isDetPaperCut << '\t'
@@ -870,7 +873,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               // bcs.insert( HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() ) );
               // if( particleLink.eventIndex()==0 ) {
@@ -904,6 +908,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
           } // end if truth found for this pixel
         } // end if pixel truth available
         ++hitIndex;
+        HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+        best_extcode.eventIndex(best_extcode_index, best_extcode_position);
         (*m_oflraw) << "S\t" 
                   << setw(14) << setprecision(10)
                   << gPos.x() << '\t'
@@ -919,7 +925,7 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
                   << m_pixelId->phi_index(rdoId) << '\t'
                   << m_pixelId->eta_index(rdoId) << '\t'
                   << (*iRDO)->getToT() << '\t'
-                  << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                  << (long)(best_parent ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
                   << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                   << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                   << parent_mask.to_ulong() << '\t'
@@ -1047,7 +1053,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               // bcs.insert( HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() ) );
               // if( particleLink.eventIndex()==0 ) {
@@ -1078,6 +1085,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
             } // end for each contributing particle
           } // end if truth found for this strip
         } // end if sct truth available        
+        HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+        best_extcode.eventIndex(best_extcode_index, best_extcode_position);
         (*m_oflraw) << "S\t" 
                   << setw(14) << setprecision(10)
                   << gPos.x() << '\t'
@@ -1093,7 +1102,7 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
                   << m_sctId->side(rdoId) << '\t'
                   << m_sctId->strip(rdoId) << '\t'
                   << (*iRDO)->getGroupSize() << '\t'
-                  << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                  << (long)(best_parent ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
                   << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                   << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                   << parent_mask.to_ulong() << '\t'
@@ -1219,7 +1228,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               parent_mask |= construct_truth_bitmap( particle );
             } // loop over deposits
@@ -1274,7 +1284,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
         localx = (*iCluster)->localPosition()[Trk::distPhi] - m_pixelLorentzAngleTool->getLorentzShift(sielement->identifyHash());
         localy = (*iCluster)->localPosition()[Trk::distEta];
       }
-
+      HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+      best_extcode.eventIndex(best_extcode_index, best_extcode_position);
       (*m_oflraw) << "P\t" 
                 << setw(14) << setprecision(10)
                 << gPos.x() << '\t'
@@ -1296,7 +1307,7 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
                 << (*iCluster)->width().colRow().y() << '\t' // width in eta?
                 << (*iCluster)->rdoList().size() << '\t' // number of pixels in cluster
         // Cluster truth
-                << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                << (long)(best_parent ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
                 << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                 << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                 << parent_mask.to_ulong()
@@ -1355,7 +1366,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               parent_mask |= construct_truth_bitmap( particle );
             } // loop over deposits
@@ -1386,7 +1398,8 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
         // do not add 0.5 to center in middle of strip; match SCT leading spatial edge convention
         localx = cellIdCentroid.phiIndex() + deltaxphi; // + 0.5
       }
-
+      HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+      best_extcode.eventIndex(best_extcode_index, best_extcode_position);
       (*m_oflraw) << "C\t" 
                 << setw(14) << setprecision(10)
                 << gPos.x() << '\t'
@@ -1404,7 +1417,7 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap
                 << m_sctId->strip(theId) << '\t'
                 << localx << '\t'
                 << (*iCluster)->rdoList().size() << '\t' // number of strips in cluster
-                << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                << (long)(best_parent ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
                 << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                 << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                 << parent_mask.to_ulong() << '\t'
@@ -1600,6 +1613,8 @@ DumpSp::dump_tracks( const HitIndexMap& /*hitIndexMap*/, const HitIndexMap& clus
       assert( ittr != m_ttrProbMap.end() );
       mc_frac = ittr->second;
     }
+    HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+    best_extcode.eventIndex(best_extcode_index, best_extcode_position);
     // dump one line for each track
     if( m_dumpSpacePoints ) {
       (*m_ofl) << "E\t" 
@@ -1608,7 +1623,7 @@ DumpSp::dump_tracks( const HitIndexMap& /*hitIndexMap*/, const HitIndexMap& clus
              << setw(14) << setprecision(10) << phi0 << '\t'
              << setw(14) << setprecision(10) << 1./tan(track->perigeeParameters()->parameters()[Trk::theta]) << '\t'
              << setw(15) << setprecision(10) << qpt << '\t'
-             << setw(14) << (long)(mc_frac>=0. ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+             << setw(14) << (long)(mc_frac>=0. ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
              << setw(14) << (long)(mc_frac>=0. ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
              << setw(14) << setprecision(10) << mc_frac
              << endl;
@@ -1619,7 +1634,7 @@ DumpSp::dump_tracks( const HitIndexMap& /*hitIndexMap*/, const HitIndexMap& clus
               << setw(14) << setprecision(10) << phi0 << '\t'
               << setw(14) << setprecision(10) << 1./tan(track->perigeeParameters()->parameters()[Trk::theta]) << '\t'
               << setw(15) << setprecision(10) << qpt << '\t'
-              << setw(14) << (mc_frac>=0. ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+              << setw(14) << (mc_frac>=0. ? best_extcode_index : std::numeric_limits<long>::max()) << '\t'
               << setw(14) << (mc_frac>=0. ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
               << setw(14) << setprecision(10) << mc_frac << '\t';
     // dump the indices of the clusters used in this track
diff --git a/Trigger/TrigFTK/TrigFTKSim/src/FTK_SGHitInput.cxx b/Trigger/TrigFTK/TrigFTKSim/src/FTK_SGHitInput.cxx
index b703ce1e81e..25e1228db1e 100644
--- a/Trigger/TrigFTK/TrigFTKSim/src/FTK_SGHitInput.cxx
+++ b/Trigger/TrigFTK/TrigFTKSim/src/FTK_SGHitInput.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 "TrigFTKSim/FTK_SGHitInput.h"
@@ -365,7 +365,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX  );
               }
               // bcs.insert( HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() ) );
               // if( particleLink.eventIndex()==0 ) {
@@ -402,6 +403,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
 
         //output//
         if(m_dooutFileRawHits){ //bz2 file
+          HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+          best_extcode.eventIndex(best_extcode_index, best_extcode_position);
           (*m_oflraw) << "S\t"
                     << setw(14) << setprecision(10)
                     << gPos.x() << '\t'
@@ -417,7 +420,7 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
                     << m_pixelId->phi_index(rdoId) << '\t'
                     << m_pixelId->eta_index(rdoId) << '\t'
                     << (*iRDO)->getToT() << '\t'
-                    << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                    << (long)(best_parent ? best_extcode_position : std::numeric_limits<long>::max()) << '\t'
                     << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                     << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                     << parent_mask.to_ulong() << '\t'
@@ -449,7 +452,9 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
         tmpSGhit.setPhiSide(m_pixelId->phi_index(rdoId));
         tmpSGhit.setEtaStrip(m_pixelId->eta_index(rdoId));
         tmpSGhit.setNStrips((*iRDO)->getToT());
-        tmpSGhit.setEventIndex((long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()));
+        HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+        best_extcode.eventIndex(best_extcode_index, best_extcode_position);
+        tmpSGhit.setEventIndex((long)(best_parent ? best_extcode_position : std::numeric_limits<long>::max()));
         tmpSGhit.setBarcode((long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()));
         tmpSGhit.setBarcodePt( static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) );
         tmpSGhit.setParentageMask(parent_mask.to_ulong());
@@ -587,7 +592,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               // bcs.insert( HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() ) );
               // if( particleLink.eventIndex()==0 ) {
@@ -619,6 +625,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
           } // end if truth found for this strip
         } // end if sct truth available
         if(m_dooutFileRawHits){
+          HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+          best_extcode.eventIndex(best_extcode_index, best_extcode_position);
           (*m_oflraw) << "S\t"
                     << setw(14) << setprecision(10)
                     << gPos.x() << '\t'
@@ -634,7 +642,7 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
                     << m_sctId->side(rdoId) << '\t'
                     << m_sctId->strip(rdoId) << '\t'
                     << (*iRDO)->getGroupSize() << '\t'
-                    << (long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()) << '\t'
+                    << (long)(best_parent ? best_extcode_position : std::numeric_limits<long>::max()) << '\t'
                     << (long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()) << '\t'
                     << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                     << parent_mask.to_ulong() << '\t'
@@ -655,7 +663,9 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
         tmpSGhit.setPhiSide(m_sctId->side(rdoId));
         tmpSGhit.setEtaStrip(m_sctId->strip(rdoId));
         tmpSGhit.setNStrips((*iRDO)->getGroupSize());
-        tmpSGhit.setEventIndex((long)(best_parent ? best_extcode.eventIndex() : std::numeric_limits<long>::max()));
+        HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+        best_extcode.eventIndex(best_extcode_index, best_extcode_position);
+        tmpSGhit.setEventIndex((long)(best_parent ? best_extcode_position : std::numeric_limits<long>::max()));
         tmpSGhit.setBarcode((long)(best_parent ? best_extcode.barcode() : std::numeric_limits<long>::max()));
         tmpSGhit.setBarcodePt( static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) );
         tmpSGhit.setParentageMask(parent_mask.to_ulong());
@@ -791,7 +801,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
               // "best_parent" is the highest pt particle
               if( !best_parent || best_parent->momentum().perp()<genPt ) {
                 best_parent = particle;
-                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex() );
+                best_extcode = HepMcParticleLink::ExtendedBarCode( particleLink.barcode() , particleLink.eventIndex(),
+                                                                   particleLink.getEventCollection(), HepMcParticleLink::IS_INDEX );
               }
               parent_mask |= construct_truth_bitmap( particle );
             } // loop over deposits
@@ -800,6 +811,8 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
       } // if we have pixel sdo's available
 
       if(m_dooutFileRawHits){
+        HepMcParticleLink::index_type best_extcode_index, best_extcode_position;
+        best_extcode.eventIndex(best_extcode_index, best_extcode_position);
         (*m_oflraw) << "P\t"
                   << setw(14) << setprecision(10)
                   << gPos.x() << '\t'
@@ -818,7 +831,7 @@ FTK_SGHitInput::read_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& pixelCl
                   << (*iCluster)->width().colRow().y() << '\t' // width in eta?
                   << (*iCluster)->rdoList().size() << '\t' // number of pixels in cluster
                   // Cluster truth
-                  << (long)(best_parent ? best_extcode.eventIndex() : -1) << '\t'
+                  << (long)(best_parent ? best_extcode_position : -1) << '\t'
                   << (long)(best_parent ? best_extcode.barcode() : -1) << '\t'
                   << setprecision(5) << static_cast<unsigned long>(std::ceil(best_parent ? best_parent->momentum().perp() : 0.)) << '\t' // particle pt in MeV
                   << parent_mask.to_ulong()
@@ -1019,7 +1032,7 @@ FTK_SGHitInput::read_truth_tracks()
       // print truth track info and geant matching for highest figure-of-merit track
       int irecmatch = -1;
       float precmatch = 0.;
-      HepMcParticleLink::ExtendedBarCode extBarcode2( particle->barcode(), ievt );
+      HepMcParticleLink::ExtendedBarCode extBarcode2( particle->barcode(), ievt, EBC_MAINEVCOLL, HepMcParticleLink::IS_INDEX ); //FIXME need to determine event collection properly
       /*if( !_ttrProbMap.empty() ) {
         TruthToRecoProbMap::const_iterator barcode=_ttrProbMap.find(extBarcode2);
         if( barcode!=_ttrProbMap.end() ) {
@@ -1036,6 +1049,8 @@ FTK_SGHitInput::read_truth_tracks()
         }*///toshi  comment out
       ParentBitmask parent_mask( construct_truth_bitmap( particle ) );
       if(m_dooutFileRawHits){
+        HepMcParticleLink::index_type extBarcode2_index, extBarcode2_position;
+        extBarcode2.eventIndex(extBarcode2_index, extBarcode2_position);
         (*m_oflraw) << setiosflags(ios::scientific) << "T\t"
                   << setw(14) << setprecision(10) << track_truth_x0 << '\t'
                   << setw(14) << setprecision(10) << track_truth_y0 << '\t'
@@ -1049,7 +1064,7 @@ FTK_SGHitInput::read_truth_tracks()
                   << pdgcode << '\t'
                   << setw(14) << (int)irecmatch << '\t'
                   << setw(14) << setprecision(10) << precmatch << '\t'
-                  << extBarcode2.eventIndex() << '\t'
+                  << extBarcode2_position << '\t'
                   << extBarcode2.barcode() << '\t'
                   << parent_mask.to_ulong() << '\t'
                   << isDetPaperCut << '\t'
@@ -1068,7 +1083,9 @@ FTK_SGHitInput::read_truth_tracks()
       tmpSGTrack.setPZ(track_truth_p*track_truth_costheta);
       tmpSGTrack.setPDGCode(pdgcode);
       tmpSGTrack.setBarcode(extBarcode2.barcode());
-      tmpSGTrack.setEventIndex(extBarcode2.eventIndex());
+      HepMcParticleLink::index_type extBarcode2_index, extBarcode2_position;
+      extBarcode2.eventIndex(extBarcode2_index, extBarcode2_position);
+      tmpSGTrack.setEventIndex(extBarcode2_position);
       m_truth_track.push_back(tmpSGTrack);
 
 
-- 
GitLab


From 8c33397849b73baf3ded68d3d94a7900e5943058 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 27 Feb 2019 13:25:45 +0100
Subject: [PATCH 240/404] Update TrigTruthEventTPCnv unit tests to work with
 new HepMcParticleLink class

The syntax for `TrigInDetTrackTruthCnv_p1_test` and `TrigInDetTrackTruthMapCnv_p1_test`
needed to be updated to work properly with the new `HepMcParticleLink` class.
---
 .../test/TrigInDetTrackTruthCnv_p1_test.cxx   | 31 ++++++--------
 .../TrigInDetTrackTruthMapCnv_p1_test.cxx     | 40 ++++++++-----------
 2 files changed, 28 insertions(+), 43 deletions(-)

diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx
index 4aeac823ed6..d7ec5861b68 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx
+++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.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
 */
 
 // $Id$
@@ -46,29 +46,22 @@ public:
     for (size_t i = 0; i < p1.m_nr_common_hits.size(); i++)
       ::compare (p1.m_nr_common_hits[i], p2.m_nr_common_hits[i]);
     assert (p1.m_family_tree == p2.m_family_tree);
-    
+
   }
 
-  static void set (TrigInDetTrackTruth& p)
+  static void set (TrigInDetTrackTruth& p, std::vector<HepMC::GenParticle*>& genPartVector)
   {
-    p.m_true_part_vec.emplace_back (1001, 10);
-    p.m_true_part_vec.emplace_back (1002, 11);
-    p.m_true_part_vec.emplace_back (1003, 12);
-
     int nstat = 4;
     p.m_nr_common_hits.resize (nstat);
     for (int i=0; i < nstat; i++) {
-      p.m_nr_common_hits[i][TrigIDHitStats::PIX] = 12 + i*10;
-      p.m_nr_common_hits[i][TrigIDHitStats::SCT] = 13 + i*10;
-      p.m_nr_common_hits[i][TrigIDHitStats::TRT] = 14 + i*10;
+      HepMcParticleLink particleLink(genPartVector.at(i)->barcode(),genPartVector.at(i)->parent_event()->event_number());
+      TrigIDHitStats tihs;
+      tihs[TrigIDHitStats::PIX] = 12 + i*10;
+      tihs[TrigIDHitStats::SCT] = 13 + i*10;
+      tihs[TrigIDHitStats::TRT] = 14 + i*10;
+      p.addMatch(particleLink, tihs);
+      p.updateFamilyTree();
     }
-
-    p.m_family_tree.emplace_back (0, 1);
-    p.m_family_tree.emplace_back (0, 2);
-
-    p.m_best_match_hits = 0;
-    p.m_best_Si_match_hits = 1;
-    p.m_best_TRT_match_hits = 2;
   }
 };
 
@@ -105,8 +98,8 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   Athena_test::Leakcheck check;
 
   TrigInDetTrackTruth trans1;
-  TrigInDetTrackTruthCnv_p1_test::set (trans1);
-    
+  TrigInDetTrackTruthCnv_p1_test::set (trans1, genPartVector);
+
   testit (trans1);
 }
 
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx
index dbdec220123..179db44c05e 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx
+++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.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
 */
 
 // $Id$
@@ -48,30 +48,22 @@ public:
     for (size_t i = 0; i < p1.m_nr_common_hits.size(); i++)
       ::compare (p1.m_nr_common_hits[i], p2.m_nr_common_hits[i]);
     assert (p1.m_family_tree == p2.m_family_tree);
-    
+
   }
 
-  static void set (TrigInDetTrackTruth& p, int ndx)
+  static void set (TrigInDetTrackTruth& p, std::vector<HepMC::GenParticle*>& genPartVector, int ndx)
   {
-    int o = ndx*10;
-    p.m_true_part_vec.emplace_back (1001, 10+o);
-    p.m_true_part_vec.emplace_back (1002, 11+o);
-    p.m_true_part_vec.emplace_back (1003, 12+o);
-
-    int nstat = 4;
+    int nstat = 1;
     p.m_nr_common_hits.resize (nstat);
-    for (int i=0; i < nstat; i++) {
-      p.m_nr_common_hits[i][TrigIDHitStats::PIX] = 12 + i*10 + o*10;
-      p.m_nr_common_hits[i][TrigIDHitStats::SCT] = 13 + i*10 + o*10;
-      p.m_nr_common_hits[i][TrigIDHitStats::TRT] = 14 + i*10 + o*10;
+    for (int i=ndx; i < nstat; i++) {
+      HepMcParticleLink particleLink(genPartVector.at(i)->barcode(),genPartVector.at(i)->parent_event()->event_number());
+      TrigIDHitStats tihs;
+      tihs[TrigIDHitStats::PIX] = 12 + i*10 + ndx*100;
+      tihs[TrigIDHitStats::SCT] = 13 + i*10 + ndx*100;
+      tihs[TrigIDHitStats::TRT] = 14 + i*10 + ndx*100;
+      p.addMatch(particleLink, tihs);
+      p.updateFamilyTree();
     }
-
-    p.m_family_tree.emplace_back (0, 1);
-    p.m_family_tree.emplace_back (0, 2);
-
-    p.m_best_match_hits = 0;
-    p.m_best_Si_match_hits = 1;
-    p.m_best_TRT_match_hits = 2;
   }
 };
 
@@ -135,17 +127,17 @@ void test1(std::vector<HepMC::GenParticle*>& genPartVector)
   //TrigInDetTrackTruthMapCnv_p1_test::set (trans1);
 
   TrigInDetTrackTruth t1;
-  TrigInDetTrackTruthCnv_p1_test::set (t1, 1);
+  TrigInDetTrackTruthCnv_p1_test::set (t1, genPartVector, 1);
   trans1.addMatch (collp, 1, t1);
 
   TrigInDetTrackTruth t2;
-  TrigInDetTrackTruthCnv_p1_test::set (t2, 2);
+  TrigInDetTrackTruthCnv_p1_test::set (t2, genPartVector, 2);
   trans1.addMatch (collp, 2, t2);
 
   TrigInDetTrackTruth t3;
-  TrigInDetTrackTruthCnv_p1_test::set (t3, 3);
+  TrigInDetTrackTruthCnv_p1_test::set (t3, genPartVector, 3);
   trans1.addMatch (collp, 3, t3);
-    
+
   testit (trans1);
 }
 
-- 
GitLab


From d7060c65c03a09ca148b5c4d1cc1272e36b8bb08 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Tue, 5 Mar 2019 15:32:44 +0100
Subject: [PATCH 241/404] NewJO: fix seeding and update ref

---
 .../TrigUpgradeTest/share/NewJO.ref           | 35 +++++++++----------
 .../python/HLTMenuConfig/Menu/LS2_v1_newJO.py |  3 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
index ce273875761..a9e97b866a3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/NewJO.ref
@@ -1,21 +1,20 @@
-Storing config in the config newJOtest.pkl
 Py:Athena            INFO now loading newJOtest.pkl  ... 
 TrigSignatureMoniMT                                INFO Chains passing step (1st row events & 2nd row decision counts
 TrigSignatureMoniMT                                INFO Chain name                   L1,      AfterPS, [... steps ...], Output
-TrigSignatureMoniMT                                INFO All                           20        20        0         0         8         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut                  20        20        15        0         0         
-TrigSignatureMoniMT                                INFO HLT_e3_etcut decisions                            44        0         
-TrigSignatureMoniMT                                INFO HLT_e5_etcut                  20        20        14        0         0         
-TrigSignatureMoniMT                                INFO HLT_e5_etcut decisions                            41        0         
-TrigSignatureMoniMT                                INFO HLT_e7_etcut                  20        20        8         0         0         
-TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            13        0         
-TrigSignatureMoniMT                                INFO HLT_g10_etcut                 20        20        8         8         8         
-TrigSignatureMoniMT                                INFO HLT_g10_etcut decisions                           12        12        
-TrigSignatureMoniMT                                INFO HLT_g15_etcut                 20        20        5         8         8         
-TrigSignatureMoniMT                                INFO HLT_g15_etcut decisions                           6         12        
-TrigSignatureMoniMT                                INFO HLT_mu10                      20        20        1         0         1         
-TrigSignatureMoniMT                                INFO HLT_mu10 decisions                                1         0         
-TrigSignatureMoniMT                                INFO HLT_mu20                      20        20        0         0         0         
-TrigSignatureMoniMT                                INFO HLT_mu20 decisions                                0         0         
-TrigSignatureMoniMT                                INFO HLT_mu8                       20        20        1         0         1         
-TrigSignatureMoniMT                                INFO HLT_mu8 decisions                                 1         0         
+TrigSignatureMoniMT                                INFO All                           10        10        0         0         2         
+TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3            10        10        6         0         0         
+TrigSignatureMoniMT                                INFO HLT_e3_etcut_L1EM3 decisions                      14        0         
+TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3            10        10        5         0         0         
+TrigSignatureMoniMT                                INFO HLT_e5_etcut_L1EM3 decisions                      12        0         
+TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM7            10        10        2         0         0         
+TrigSignatureMoniMT                                INFO HLT_e7_etcut_L1EM7 decisions                      3         0         
+TrigSignatureMoniMT                                INFO HLT_g10_etcut_L1EM7           10        10        2         2         2         
+TrigSignatureMoniMT                                INFO HLT_g10_etcut_L1EM7 decisions                     3         3         
+TrigSignatureMoniMT                                INFO HLT_g15_etcut_L1EM12          10        10        2         2         2         
+TrigSignatureMoniMT                                INFO HLT_g15_etcut_L1EM12 decisions                    3         3         
+TrigSignatureMoniMT                                INFO HLT_mu10_L1MU10               10        10        0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu10_L1MU10 decisions                         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu20_L1MU20               10        10        0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu20_L1MU20 decisions                         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu8_L1MU6                 10        10        0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu8_L1MU6 decisions                           0         0         
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
index 6b54839342a..9aebb97a11d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -2,7 +2,8 @@
 
 def get_flag_item(chainName, L1itemsChainParts, groups):
     PhysicsStream = 'Main'
-    return [chainName, [], [PhysicsStream], groups, -1]
+    L1item = chainName.split('_')[-1].replace('L1', 'L1_')
+    return [chainName, L1item, [PhysicsStream], groups, -1]
 
 def setupMenu(flags):
     """ 
-- 
GitLab


From ff80e3485f2933eaebfabe18cab7d2610055125a Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Tue, 5 Mar 2019 15:51:39 +0100
Subject: [PATCH 242/404] Require that ID tracks used by STACO muons can reach
 at least one calo layer

Only for STACO muons is this basic requirement not imposed: applying it will also fix the crash reported in ATLASRECTS-4871.
---
 .../src/MuonCombinedStacoTagTool.cxx                 | 12 ++++++++++--
 .../src/MuonCombinedStacoTagTool.h                   |  4 +++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx
index 65b24990ca8..804ea1324d3 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.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
 */
 
 //////////////////////////////////////////////////////////////////////////////
@@ -28,12 +28,14 @@ namespace MuonCombined {
     :	AthAlgTool(type, name, parent),
 	m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
 	m_tagTool("MuonCombined::MuonTrackTagTestTool/MuonTrackTagTestTool"),
-        m_extrapolator        ("Trk::Extrapolator/AtlasExtrapolator")
+        m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
+	m_caloExtTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool")
   {
     declareInterface<IMuonCombinedTagTool>(this);
     declareProperty("Printer",m_printer );
     declareProperty("TagTool",m_tagTool );
     declareProperty("Extrapolator",m_extrapolator );
+    declareProperty("ParticleCaloExtensionTool", m_caloExtTool);
   }
 
   MuonCombinedStacoTagTool::~MuonCombinedStacoTagTool()
@@ -47,6 +49,7 @@ namespace MuonCombined {
     ATH_CHECK(m_printer.retrieve());
     ATH_CHECK(m_tagTool.retrieve());
     ATH_CHECK(m_extrapolator.retrieve());
+    ATH_CHECK(m_caloExtTool.retrieve());
 
     return StatusCode::SUCCESS;
   }
@@ -78,6 +81,11 @@ namespace MuonCombined {
       // ensure that also the id has a perigee with covariance
       if( !idTP->indetTrackParticle().perigeeParameters().covariance() ) continue;
 
+      //ensure that id tp can be extrapolated to something
+      std::unique_ptr<Trk::CaloExtension> caloExtension = m_caloExtTool->caloExtension(idTP->indetTrackParticle());
+      if(!caloExtension) continue;
+      if(caloExtension->caloLayerIntersections().empty()) continue;
+
       const Trk::Perigee* idPer = &idTP->indetTrackParticle().perigeeParameters();
       const Trk::Perigee* msPer = muonCandidate.extrapolatedTrack()->perigeeParameters();
 
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.h
index 0bc7e2be2bd..e718b4a7348 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.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 MUONCOMBINEDBASETOOLS_MUONCOMBINEDSTACOTAGTOOL_H
@@ -14,6 +14,7 @@
 #include "TrkTrack/TrackCollection.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkSegment/SegmentCollection.h"
+#include "RecoToolInterfaces/IParticleCaloExtensionTool.h"
 #include <vector>
 
 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
@@ -55,6 +56,7 @@ namespace MuonCombined {
     ToolHandle<Muon::MuonEDMPrinterTool>        m_printer;
     ToolHandle<MuonCombined::IMuonTrackTagTool> m_tagTool;
     ToolHandle<Trk::IExtrapolator>              m_extrapolator;
+    ToolHandle<Trk::IParticleCaloExtensionTool> m_caloExtTool;
 
   };
 
-- 
GitLab


From 6fd5eae428ed9de99004213ee86a4c82ad09839c Mon Sep 17 00:00:00 2001
From: MatousVozak <matous.vozak@cern.ch>
Date: Tue, 5 Mar 2019 17:36:44 +0100
Subject: [PATCH 243/404] precision tracking in muons

---
 .../TrigValidation/TrigUpgradeTest/python/InDetPT.py   |  2 ++
 .../TrigValidation/TrigUpgradeTest/python/MuonSetup.py | 10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
index 2f9432edbd5..ef33054cedf 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetPT.py
@@ -124,6 +124,8 @@ def makeInDetPrecisionTracking( whichSignature, verifier = False, inputFTFtracks
   #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/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
index 01a860748fd..c0cb47be800 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
@@ -581,7 +581,8 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   muEFCBRecoSequence = parOR("efcbViewNode")
   #Need ID tracking related objects and MS tracks from previous steps
   ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("muonCBViewDataVerifier")
-  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' ) ]
+  #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' ) ]
+  ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' ), ( '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
 
 
@@ -607,7 +608,6 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   #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] 
-  print 'TRACKPARTICLES %s' %trackParticles
 
   #Make InDetCandidates
   theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [ trackParticles ],ForwardParticleLocation=trackParticles,OutputLevel=DEBUG)
@@ -666,6 +666,12 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   efAlgs.append(theMuonCandidateAlgCB)
   efAlgs.append(themuoncbcreatoralg)
 
+  #Change conditionData key in algs
+  #NOTE won't change if it is loaded with a tool
+  for alg in efAlgs:
+   if  alg.properties().has_key("SCT_FlaggedCondData"):
+      alg.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"
+
 
   # setup muEFMsonly algs
   for efAlg in efAlgs:
-- 
GitLab


From 3b6b21900b5c6242b84e07047035686018c9e56c Mon Sep 17 00:00:00 2001
From: MatousVozak <matous.vozak@cern.ch>
Date: Tue, 5 Mar 2019 17:48:12 +0100
Subject: [PATCH 244/404] Removing FlaggedCondData_TRIG

---
 .../TrigValidation/TrigUpgradeTest/python/MuonSetup.py   | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
index c0cb47be800..fed58b913d3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
@@ -581,8 +581,7 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   muEFCBRecoSequence = parOR("efcbViewNode")
   #Need ID tracking related objects and MS tracks from previous steps
   ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("muonCBViewDataVerifier")
-  #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' ) ]
-  ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' ), ( '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' ) ]
+  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
 
 
@@ -666,12 +665,6 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   efAlgs.append(theMuonCandidateAlgCB)
   efAlgs.append(themuoncbcreatoralg)
 
-  #Change conditionData key in algs
-  #NOTE won't change if it is loaded with a tool
-  for alg in efAlgs:
-   if  alg.properties().has_key("SCT_FlaggedCondData"):
-      alg.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"
-
 
   # setup muEFMsonly algs
   for efAlg in efAlgs:
-- 
GitLab


From 6daf8ecf1a5c58936835b954bfdba8c873ec1a14 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Tue, 5 Mar 2019 18:04:19 +0100
Subject: [PATCH 245/404] Fix Tile simulation in AthenaMT (ATLASSIM-4053)

MT-unsafe mutable variable to keep granularity in time
for hits has been removed as private member in TileG4SDCalc.
Now it is calcuated and passed directly to clients.
---
 .../TileG4Interfaces/ITileCalculator.h        |  6 +-
 .../TileG4/TileGeoG4SD/src/TileGeoG4SD.cc     |  8 ++-
 .../TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.cc | 68 ++++++++++---------
 .../TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh | 14 ++--
 4 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/TileCalorimeter/TileG4/TileG4Interfaces/TileG4Interfaces/ITileCalculator.h b/TileCalorimeter/TileG4/TileG4Interfaces/TileG4Interfaces/ITileCalculator.h
index fc0aa2be9fa..436d8147d0c 100644
--- a/TileCalorimeter/TileG4/TileG4Interfaces/TileG4Interfaces/ITileCalculator.h
+++ b/TileCalorimeter/TileG4/TileG4Interfaces/TileG4Interfaces/ITileCalculator.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
 */
 
 //************************************************************
@@ -79,9 +79,9 @@ class ITileCalculator : virtual public IService {
   /// Search for the tilecal sub-section, its module and some identifiers
   virtual G4bool FindTileScinSection(const G4Step*, TileHitData& hitData) const = 0;
   /// Calculation of pmtID, edep and scin_Time with aStep (Sergey)
-  virtual G4bool MakePmtEdepTime(const G4Step*, TileHitData& hitData) const = 0;
+  virtual G4bool MakePmtEdepTime(const G4Step*, TileHitData& hitData, double& deltaTime) const = 0;
   /// Calculation of pmtID, edep and scin_Time with aStep (Sergey)
-  virtual G4bool ManageScintHit(TileHitData& hitData) const = 0;
+  virtual G4bool ManageScintHit(TileHitData& hitData, double deltaTime) const = 0;
   /// Used by FastCaloSimParamAction
   virtual TileMicroHit GetTileMicroHit(const G4Step*, TileHitData& hitData) const = 0;
   ///
diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SD.cc b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SD.cc
index 8a25912d862..cbd937eecec 100755
--- a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SD.cc
+++ b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SD.cc
@@ -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
 */
 
 //************************************************************
@@ -65,7 +65,9 @@ G4bool TileGeoG4SD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/) {
     return false;
   }
 
-  if ( !(m_calc->MakePmtEdepTime(aStep, hitData)) ) { //calculation of pmtID, edep and scin_Time with aStep (Sergey)
+  double deltaTime(0);
+
+  if ( !(m_calc->MakePmtEdepTime(aStep, hitData, deltaTime)) ) { //calculation of pmtID, edep and scin_Time with aStep (Sergey)
 
     if (verboseLevel >= 10)
       G4cout << "ProcessHits: wrong pmtID_up,pmtID_down,edep_up,edep_down,"
@@ -78,7 +80,7 @@ G4bool TileGeoG4SD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/) {
     return false;
   }
 
-  if ( !(m_calc->ManageScintHit(hitData)) ) { //create or update hit object in the collection
+  if ( !(m_calc->ManageScintHit(hitData, deltaTime)) ) { //create or update hit object in the collection
 
     G4cout << "ProcessHits: TileHit can not be produced; pmtID_up,pmtID_down,edep_up,edep_down,"
            << "scin_Time_up,scin_Time_down:\t" << hitData.pmtID_up
diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.cc b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.cc
index c4fe1e128ce..8fb8265c8c7 100644
--- a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.cc
+++ b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.cc
@@ -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
 */
 
 //************************************************************
@@ -50,6 +50,7 @@
 #include <stdexcept>
 #include <memory>
 
+
 namespace
 {
   thread_local std::unique_ptr<TileGeoG4LookupBuilder> s_lookup(nullptr);
@@ -61,6 +62,7 @@ TileGeoG4SDCalc::TileGeoG4SDCalc(const std::string& name, ISvcLocator *pSvcLocat
   : AthService(name, pSvcLocator)
   , m_detStore("DetectorStore",name)
   , m_geoModSvc("GeoModelSvc",name)
+  , m_keepHitTime(false)
 {
   declareProperty( "DetectorStore", m_detStore );
   declareProperty( "GeoModelSvc", m_geoModSvc );
@@ -107,16 +109,16 @@ StatusCode TileGeoG4SDCalc::initialize() {
   // Unpack TileG4SimOptions from DetectorStore
 
   // Determine time window for hit to be recorded
-  m_deltaT = m_options.deltaTHit[m_options.deltaTHit.size() - 1] * CLHEP::ns;
+  double deltaT = m_options.deltaTHit[m_options.deltaTHit.size() - 1] * CLHEP::ns;
 
   // Determine variable time window for hit to be recorded
   for (int i = m_options.deltaTHit.size() - 1; i > -1; --i) {
     m_options.deltaTHit[i] *= CLHEP::ns;
   }
   // protection agaist wrong vector size
-  if (m_options.deltaTHit.size() % 3 != 1 || m_deltaT <= 0.0) {
+  if (m_options.deltaTHit.size() % 3 != 1 || deltaT <= 0.0) {
     m_options.deltaTHit.resize(1);
-    m_options.deltaTHit[0] = m_deltaT;
+    m_options.deltaTHit[0] = deltaT;
   }
 
   // Determine maximum time for hit to be recorded
@@ -157,8 +159,8 @@ StatusCode TileGeoG4SDCalc::initialize() {
     m_options.uShape = 1;
   }
 
-  if (m_deltaT > 0.0)
-    m_options.timeCut = ((int) (m_options.timeCut / m_deltaT) + 0.5) * m_deltaT;
+  if (deltaT > 0.0)
+    m_options.timeCut = ((int) (m_options.timeCut / deltaT) + 0.5) * deltaT;
   if (m_options.deltaTHit.size() > 1) {
     G4cout << "Using deltaTHit = ";
     unsigned int i = 0;
@@ -171,7 +173,7 @@ StatusCode TileGeoG4SDCalc::initialize() {
     }
     G4cout << "and " << delta / CLHEP::ns << " ns outside this window" << G4endl;
   } else {
-    ATH_MSG_INFO("Using deltaTHit = " << m_deltaT / CLHEP::ns << " ns. ");
+    ATH_MSG_INFO("Using deltaTHit = " << deltaT / CLHEP::ns << " ns. ");
   }
   ATH_MSG_INFO("Using timeCut = " << m_options.timeCut / CLHEP::ns << " ns. ");
   ATH_MSG_INFO("Using doBirk = " << (m_options.doBirk ? "true" : "false"));
@@ -179,24 +181,26 @@ StatusCode TileGeoG4SDCalc::initialize() {
   ATH_MSG_INFO("Using doTileRow = " << (m_options.doTileRow ? "true" : "false"));
   ATH_MSG_INFO("Using doCalibHitParticleID = " << (m_options.doCalibHitParticleID ? "true" : "false"));
 
-  if (! (m_deltaT > 0.0)) {
+  if (deltaT > 0.0) {
+    m_keepHitTime = true;
+  } else {
     ATH_MSG_WARNING("deltaT is not set, ignore hit time in ProcessHits()");
   }
 
   m_tileSizeDeltaT = 100000 * CLHEP::ns; // used for doTileRow
 
-  if (m_options.timeCut > m_tileSizeDeltaT - m_deltaT) {
-    m_options.timeCut = m_tileSizeDeltaT - m_deltaT;
+  if (m_options.timeCut > m_tileSizeDeltaT - deltaT) {
+    m_options.timeCut = m_tileSizeDeltaT - deltaT;
     ATH_MSG_WARNING("Reducing timeCut to " << m_options.timeCut / CLHEP::ns << " ns. ");
   } else if ( ! m_options.doTOFCorrection && m_options.timeCut < 1000*CLHEP::ns ) {
     // assuming that if TOF correction is disabled, then we are running cosmic simulation
     // and should not use too restrictive time cut
-    m_options.timeCut = m_tileSizeDeltaT - m_deltaT;
+    m_options.timeCut = m_tileSizeDeltaT - deltaT;
     ATH_MSG_WARNING("TOF correction is disabled, settting time cut to "
                     << m_options.timeCut / CLHEP::ns << " ns. ");
   }
 
-  m_lateHitTime = m_tileSizeDeltaT - m_deltaT;
+  m_lateHitTime = m_tileSizeDeltaT - deltaT;
   ATH_MSG_INFO("All hits with time above " << m_options.timeCut / CLHEP::ns << " ns will be stored with time = "
                << m_lateHitTime / CLHEP::ns << " ns.");
 
@@ -431,7 +435,7 @@ G4bool TileGeoG4SDCalc::FindTileScinSection(const G4Step* aStep, TileHitData& hi
   return true;
 }
 
-G4bool TileGeoG4SDCalc::MakePmtEdepTime(const G4Step* aStep, TileHitData& hitData) const
+G4bool TileGeoG4SDCalc::MakePmtEdepTime(const G4Step* aStep, TileHitData& hitData, double& deltaTime) const
 {
   if (hitData.nrOfPMT == 0) {
     return false;
@@ -581,7 +585,7 @@ G4bool TileGeoG4SDCalc::MakePmtEdepTime(const G4Step* aStep, TileHitData& hitDat
 
   G4double totalTime = aStep->GetPostStepPoint()->GetGlobalTime();  //added by Mike
 
-  if (m_deltaT > 0.0) {
+  if (m_keepHitTime) {
     const G4ThreeVector position = aStep->GetPostStepPoint()->GetPosition();  //position of the hit
     const double cosTh_hit = position.cosTheta();
     const double magn_hit = position.mag();
@@ -660,7 +664,7 @@ G4bool TileGeoG4SDCalc::MakePmtEdepTime(const G4Step* aStep, TileHitData& hitDat
     ATH_MSG_VERBOSE(" hit time set to " << totalTime);
   }
   // calculate unique deltaT bin width for both up and down PMT, ignoring additional deltas
-  m_deltaT = this->deltaT(totalTime);
+  deltaTime = this->deltaT(totalTime);
   const double scin_Time = totalTime + (hitData.tileSize + 1) * m_tileSizeDeltaT;
   hitData.scin_Time_up = hitData.scin_Time_down = scin_Time;
   hitData.totalTimeUp = hitData.totalTimeDown = totalTime;
@@ -729,8 +733,10 @@ TileMicroHit TileGeoG4SDCalc::GetTileMicroHit(const G4Step* aStep, TileHitData&
     return microHit;
   }
 
+  double deltaTime(0);
+
   //calculation of pmtID, edep and scin_Time with aStep
-  if (!this->MakePmtEdepTime(aStep, hitData)) {
+  if (!this->MakePmtEdepTime(aStep, hitData, deltaTime)) {
     ATH_MSG_DEBUG("MakePmtEdepTime: wrong pmtID_up,pmtID_down,edep_up,"
                     << "edep_down,scin_Time_up,scin_Time_down:\t"
                     << hitData.pmtID_up << "\t"
@@ -751,7 +757,7 @@ TileMicroHit TileGeoG4SDCalc::GetTileMicroHit(const G4Step* aStep, TileHitData&
   return microHit;
 }
 
-G4bool TileGeoG4SDCalc::ManageScintHit(TileHitData& hitData) const
+G4bool TileGeoG4SDCalc::ManageScintHit(TileHitData& hitData, double deltaTime) const
 {
   //Having hitData.cell and hitData.nModule (number of current module) we need to
   //determine if a Hit object already exists for this cell and module.
@@ -793,24 +799,24 @@ G4bool TileGeoG4SDCalc::ManageScintHit(TileHitData& hitData) const
   }
 
   if (hitData.edep_up != 0.) {
-    if (newTileHitUp) { this->CreateScintHit(1, hitData); }
-    else { this->UpdateScintHit(1, hitData); }
+    if (newTileHitUp) { this->CreateScintHit(1, hitData, deltaTime); }
+    else { this->UpdateScintHit(1, hitData, deltaTime); }
   }
 
   if (hitData.edep_down != 0.) {
-    if (newTileHitDown) { this->CreateScintHit(0, hitData); }
-    else { this->UpdateScintHit(0, hitData); }
+    if (newTileHitDown) { this->CreateScintHit(0, hitData, deltaTime); }
+    else { this->UpdateScintHit(0, hitData, deltaTime); }
   }
 
   return true;
 }
 
-void TileGeoG4SDCalc::CreateScintHit(int pmt, TileHitData& hitData) const
+void TileGeoG4SDCalc::CreateScintHit(int pmt, TileHitData& hitData, double deltaTime) const
 {
   if (pmt == 1) { //Upper PMT of Cell
-    std::unique_ptr<TileSimHit> aHit = std::make_unique<TileSimHit>(hitData.pmtID_up, hitData.edep_up, hitData.totalTimeUp, m_deltaT);
+    std::unique_ptr<TileSimHit> aHit = std::make_unique<TileSimHit>(hitData.pmtID_up, hitData.edep_up, hitData.totalTimeUp, deltaTime);
     if (m_options.doTileRow) {
-      aHit->add(hitData.edep_up, hitData.scin_Time_up, m_deltaT);
+      aHit->add(hitData.edep_up, hitData.scin_Time_up, deltaTime);
     }
     if (hitData.isNegative) {
       hitData.cell->moduleToHitUpNegative[hitData.nModule - 1] = aHit.release();
@@ -819,9 +825,9 @@ void TileGeoG4SDCalc::CreateScintHit(int pmt, TileHitData& hitData) const
       hitData.cell->moduleToHitUp[hitData.nModule - 1] = aHit.release();
     }
   } else { //Down PMT of Cell
-    std::unique_ptr<TileSimHit> aHit = std::make_unique<TileSimHit>(hitData.pmtID_down, hitData.edep_down, hitData.totalTimeDown, m_deltaT);
+    std::unique_ptr<TileSimHit> aHit = std::make_unique<TileSimHit>(hitData.pmtID_down, hitData.edep_down, hitData.totalTimeDown, deltaTime);
     if (m_options.doTileRow) {
-      aHit->add(hitData.edep_down, hitData.scin_Time_down, m_deltaT);
+      aHit->add(hitData.edep_down, hitData.scin_Time_down, deltaTime);
     }
     if (hitData.isNegative) {
       hitData.cell->moduleToHitDownNegative[hitData.nModule - 1] = aHit.release();
@@ -832,7 +838,7 @@ void TileGeoG4SDCalc::CreateScintHit(int pmt, TileHitData& hitData) const
   }
 }
 
-void TileGeoG4SDCalc::UpdateScintHit(int pmt, TileHitData& hitData) const
+void TileGeoG4SDCalc::UpdateScintHit(int pmt, TileHitData& hitData, double deltaTime) const
 {
   TileSimHit* aHit(nullptr);
 
@@ -843,9 +849,9 @@ void TileGeoG4SDCalc::UpdateScintHit(int pmt, TileHitData& hitData) const
     else {
       aHit = hitData.cell->moduleToHitUp[hitData.nModule - 1];
     }
-    aHit->add(hitData.edep_up, hitData.totalTimeUp, m_deltaT);
+    aHit->add(hitData.edep_up, hitData.totalTimeUp, deltaTime);
     if (m_options.doTileRow) {
-      aHit->add(hitData.edep_up, hitData.scin_Time_up, m_deltaT);
+      aHit->add(hitData.edep_up, hitData.scin_Time_up, deltaTime);
     }
   } else { // Down PMT of Cell
     if (hitData.isNegative) {
@@ -854,9 +860,9 @@ void TileGeoG4SDCalc::UpdateScintHit(int pmt, TileHitData& hitData) const
     else {
       aHit = hitData.cell->moduleToHitDown[hitData.nModule - 1];
     }
-    aHit->add(hitData.edep_down, hitData.totalTimeDown, m_deltaT);
+    aHit->add(hitData.edep_down, hitData.totalTimeDown, deltaTime);
     if (m_options.doTileRow) {
-      aHit->add(hitData.edep_down, hitData.scin_Time_down, m_deltaT);
+      aHit->add(hitData.edep_down, hitData.scin_Time_down, deltaTime);
     }
   }
 }
diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh
index 694a9996ecf..4384455002e 100644
--- a/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh
+++ b/TileCalorimeter/TileG4/TileGeoG4SD/src/TileGeoG4SDCalc.hh
@@ -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
 */
 
 //************************************************************
@@ -59,9 +59,9 @@ public:
   /// Search for the tilecal sub-section, its module and some identifiers
   virtual G4bool FindTileScinSection(const G4Step*, TileHitData& hitData) const override final;
   /// Calculation of pmtID, edep and scin_Time with aStep (Sergey)
-  virtual G4bool MakePmtEdepTime(const G4Step*, TileHitData& hitData) const override final;
+  virtual G4bool MakePmtEdepTime(const G4Step*, TileHitData& hitData, double& deltaTime) const override final;
   /// Create or update hit object in the collection
-  virtual G4bool ManageScintHit(TileHitData& hitData) const override final;
+  virtual G4bool ManageScintHit(TileHitData& hitData, double deltaTime) const override final;
   /// Used by FastCaloSimParamAction
   virtual TileMicroHit GetTileMicroHit(const G4Step*, TileHitData& hitData) const override final;
   ///
@@ -72,8 +72,8 @@ public:
   /// Method used by TileFastCaloSim/TileFCSmStepToTileHitVec
   virtual void pmtEdepFromFCS_StepInfo(TileHitData& hitData, double ene, double yLocal, double halfYLocal, double zLocal, int uShape) const override final;
 private:
-  void CreateScintHit(int pmt, TileHitData& hitData) const;
-  void UpdateScintHit(int pmt, TileHitData& hitData) const;
+  void CreateScintHit(int pmt, TileHitData& hitData, double deltaTime) const;
+  void UpdateScintHit(int pmt, TileHitData& hitData, double deltaTime) const;
 
   int getUshapeFromGM() const;
 
@@ -106,8 +106,8 @@ private:
   TileSDOptions m_options;
 
 
-  /** @brief granularity in time for hits */
-  mutable double m_deltaT; // FIXME set during initialize, then reset during MakePmtEdepTime
+  /** @brief Keep hit time */
+  bool m_keepHitTime;
 
   /** @brief Structure holding the attenuation lengths */
   std::unique_ptr<TileRow> m_row;
-- 
GitLab


From 77b8533f597f0a3d7d783be1168acd595050eb77 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 1 Mar 2019 15:27:18 +0100
Subject: [PATCH 246/404] TileGeoModel: Remove set_do_checks() calls.

Remove MT-unsafe calls to set_do_checks().
---
 .../TileGeoModel/src/TileDetectorTool.cxx           | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx b/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx
index 80664b0de64..4d0a76296e5 100755
--- a/TileCalorimeter/TileGeoModel/src/TileDetectorTool.cxx
+++ b/TileCalorimeter/TileGeoModel/src/TileDetectorTool.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 "TileGeoModel/TileDetectorTool.h"
@@ -216,15 +216,6 @@ StatusCode TileDetectorTool::initIds()
 
 StatusCode TileDetectorTool::createElements()
 {
-  // ----------------- Fill in the readout part of detector manager -----------
-  const TileID* tileID = m_manager->get_id();
-  const TileHWID* tileHWID = m_manager->get_hwid();
-  bool do_checks = tileID->do_checks();
-
-  tileID->set_do_checks(true);
-  m_manager->create_elements();
-  tileID->set_do_checks(do_checks);
-  tileHWID->set_do_checks(false);
-
+  m_manager->create_elements(true);
   return StatusCode::SUCCESS;
 }
-- 
GitLab


From 559b54c9a810c75fffda0bd7b79c150d825a1d2d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 5 Mar 2019 16:12:21 +0100
Subject: [PATCH 247/404] LArBadChannelTool: Avoid MT-unsafe calls to
 set_do_checks().

Instead of calling the MT-unsafe, set_do_checks, pass a check flag
explictly to the ID helper methods for which we want checking.
---
 .../src/LArBadChannelDecoder.cxx                 | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDecoder.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDecoder.cxx
index 220fcde3cbc..da227b24599 100644
--- a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDecoder.cxx
+++ b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDecoder.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 "LArBadChannelTool/LArBadChannelDecoder.h"
@@ -14,9 +14,6 @@ LArBadChannelDecoder::readASCII( const std::string& fname,
 {
   std::vector<BadChanEntry> result;
 
-  bool oldIdCheckStatus=m_onlineID->do_checks();
-  m_onlineID->set_do_checks(true); //Check Id when reading from ASCII file
- 
   // set up parsing with exactly 6 ints and >= 1 string, for reading channels
   LArBadChannelParser parser(fname, &m_log, 6, -1);
   if (!parser.fileStatusGood()) {
@@ -40,8 +37,6 @@ LArBadChannelDecoder::readASCII( const std::string& fname,
       }
     }
   }
-  //Reset checking, to avoid downstream problems (see bug #33824)
-  m_onlineID->set_do_checks(oldIdCheckStatus); 
   return result;
 }
 
@@ -50,9 +45,6 @@ LArBadChannelDecoder::readFebASCII( const std::string& fname) const
 {
   std::vector<BadFebEntry> result;
 
-  bool oldIdCheckStatus=m_onlineID->do_checks();
-  m_onlineID->set_do_checks(true); //Check Id when reading from ASCII file
- 
  // set up a parser to read 4 ints (the 4th of which can be a wildcard) and >=1 strings
   LArBadChannelParser parser(fname, &m_log, 4, -1, 4);
   if (!parser.fileStatusGood()) {
@@ -76,8 +68,6 @@ LArBadChannelDecoder::readFebASCII( const std::string& fname) const
       }
     }
   }
-  //Reset checking, to avoid downstream problems (see bug #33824)
-  m_onlineID->set_do_checks(oldIdCheckStatus); 
   return result;
 }
 
@@ -94,7 +84,7 @@ HWIdentifier LArBadChannelDecoder::constructChannelId( const std::vector<int>& i
   }
   try {
     HWIdentifier hwid( m_onlineID->channel_Id( intVec[barrel_ec], intVec[pos_neg], intVec[feedthrough],
-					       intVec[slot], intVec[channel]));
+					       intVec[slot], intVec[channel], true));
     if (coolChan<LArBadChannelState::MAXCOOLCHAN && !checkId( hwid, intVec[barrel_ec], intVec[pos_neg], coolChan)) {
       log << MSG::WARNING << "Channel "; insertExpandedID( intVec, log);
       log << " does not belong to COOL channel " << State::coolChannelName( coolChan) 
@@ -149,7 +139,7 @@ HWIdentifier LArBadChannelDecoder::constructSingleFebId( const std::vector<int>&
   HWIdentifier invalid;
   if (v.size() != 4) return invalid;
   try {
-    HWIdentifier hwid( m_onlineID->feb_Id( v[barrel_ec], v[pos_neg], v[feedthrough], v[slot]));
+    HWIdentifier hwid( m_onlineID->feb_Id( v[barrel_ec], v[pos_neg], v[feedthrough], v[slot], true));
     log << MSG::DEBUG << "Translating FEB id ";  insertExpandedID( v, log);
     log << " to 0x" << MSG::hex << hwid << MSG::dec << endmsg;   
     return hwid;
-- 
GitLab


From 4982b72c07f48d211789ff13525883b6920df96c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 5 Mar 2019 16:14:38 +0100
Subject: [PATCH 248/404] CaloUtils: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
Also remove some calls to CaloDetDescrManager::instance() and some other
cleanups.
---
 Calorimeter/CaloUtils/CMakeLists.txt          |   2 +-
 .../CaloUtils/CaloLCClassificationTool.h      |   3 +-
 .../CaloUtils/CaloTowerBuilderTool.h          |   4 +-
 .../CaloUtils/CaloUtils/CaloTowerStore.h      |  10 +-
 .../CaloUtils/share/CaloTowerStore_test.ref   | 112 +++++++++---------
 .../CaloUtils/src/CaloLCWeightTool.cxx        |   2 +-
 .../src/CaloTopoTowerBuilderTool.cxx          |   4 +-
 .../CaloUtils/src/CaloTowerBuilderTool.cxx    |  10 +-
 Calorimeter/CaloUtils/src/CaloTowerStore.cxx  |  20 ++--
 .../CaloUtils/src/CaloTowerStoreTestAlg.cxx   |  20 +++-
 .../CaloUtils/src/CaloTowerStoreTestAlg.h     |  13 +-
 .../src/LocalNoiseSuppressionTool.cxx         |   4 +-
 12 files changed, 114 insertions(+), 90 deletions(-)

diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index 727022bffb2..2713af34055 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -88,7 +88,7 @@ atlas_add_test( CaloTowerStore_test
 
 atlas_add_test( CaloTowerBuilderTool_test
    SCRIPT test/CaloTowerBuilderTool_test.sh
-   EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|Cs Tube|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|oracle Info"
+   EXTRA_PATTERNS "[0-9] [A-Z]+ 20[123][0-9]|Reading file|^CORAL/Services/ConnectionService (Info|Warning)|^RelationalDatabase Info|^Data source lookup|^DetDescrCnvSvc +INFO|^CORAL/RelationalPlugins/frontier Info|^PluginManager Info|^RalSessionMgr Warning|^DBReplicaSvc +INFO|IOVDbSvc +INFO|^Py:Athena +INFO|^EventInfoMgtInit: Got release|^TEnvRec::ChangeValue|^PoolSvc +INFO|^PoolSvc +WARNING Unable to locate catalog|being retired|including file|Deaccess DbDatabase|^IoComponentMgr +INFO|File version|Global positioning|^Domain|duplicate entry|already loaded|RootDbase: all good|frontier.c|^Py:ConfigurableDb +(WARNING|INFO)|ApplicationMgr +INFO|INFO [sS]top|^CaloIdMgrDetDes.*INFO|^TTOnlineIDDetDe.*INFO|^CaloIDHelper_ID.*INFO|^AtlasDetectorID +INFO|^AthenaEventLoopMgrWARNING|^CaloDM_IDDetDes.*INFO|^CaloLVL1_IDDetD.*INFO|^LArFCAL_ID +INFO|^LArMiniFCAL_IDD.*INFO|^LArHEC_ID +INFO|^LArMiniFCAL_ID +INFO|TileTBIdDetDesc.*INFO|^TileIDDetDescrCnv +INFO|CaloCell_IDDetD.*INFO|TileID +INFO|^LArFCAL_IDDetDe.*INFO|^TileTBIDDetDesc.*INFO|^LArEM_ID +INFO|^LArHEC_IDDetDes.*INFO|^LArEM_IDDetDesc.*INFO|^EndcapDMConstru.*INFO|^GeoModelSvc +INFO|USHAPE|U-shape|Cs Tube|XMLFileCatalog Info|No IOVSvcTool associated|^RalSessionMgr Info|RDBMS technology|INFO Found unknown streamer checksum|^GUID: Class pool::DbString has GUID|^AthenaRootStrea.* INFO|INFO TileDddbManager|oracle Info|initialize_from_dictionary|Calo Detector Manager"
    ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-09"
    PROPERTIES TIMEOUT 500 )
 
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.h b/Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.h
index 6e65e5344e5..b0b7c8fed7c 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloLCClassificationTool.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 CALOUTILS_CALOLCCLASSIFICATIONTOOL_H
@@ -21,7 +21,6 @@
 #include "CaloInterface/IClusterClassificationTool.h"
 #include "CaloConditions/CaloLocalHadCoeff.h"
 #include "CaloConditions/CaloLocalHadDefs.h"
-#include "StoreGate/DataHandle.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h
index 69ed6ef27b4..7dfa8d11030 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.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 CALOREC_CALOTOWERBUILDERTOOL_H
@@ -25,6 +25,7 @@
 class CaloTower;
 class CaloTowerStore;
 class CaloTowerContainer;
+class CaloDetDescrManager;
 class StoreGateSvc;
 class MsgStream;
 
@@ -103,6 +104,7 @@ private:
   // Specific Initialization //
   /////////////////////////////
 
+  const CaloDetDescrManager* m_caloDDM;
   CaloTowerStore m_cellStore;
 
   virtual StatusCode checkSetup(MsgStream& log);
diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTowerStore.h b/Calorimeter/CaloUtils/CaloUtils/CaloTowerStore.h
index a705ae30445..7114bd35467 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloTowerStore.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloTowerStore.h
@@ -1,7 +1,7 @@
 // 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
 */
 
 #ifndef CALOTOWERSTORE_H
@@ -150,6 +150,9 @@ Updated:  Jul 2009, sss
 #include <utility>
 
 
+class CaloDetDescrManager;
+
+
 class CaloTowerStore
 {
 private:
@@ -351,8 +354,9 @@ private:
   size_t size() const { return m_towers.size(); }
 
   /// \brief setup trigger
-  bool buildLookUp(const CaloTowerSeg& theTowerSeg,
-                   std::vector<CaloCell_ID::SUBCALO> theCalos);
+  bool buildLookUp(const CaloDetDescrManager& theManager,
+                   const CaloTowerSeg& theTowerSeg,
+                   const std::vector<CaloCell_ID::SUBCALO>& theCalos);
 
  private:
   friend class tower_iterator;
diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
index 03fb65f0d62..92c93ec666d 100644
--- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
+++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
@@ -1,16 +1,15 @@
-Thu Dec  6 05:00:07 CET 2018
-Preloading tcmalloc_minimal.so
+Thu Feb 28 11:57:59 EST 2019
 Py:Athena            INFO including file "AthenaCommon/Preparation.py"
-Py:Athena            INFO using release [AthenaWorkDir-22.0.1] [x86_64-slc6-gcc8-opt] [atlas-work3/fa0fd6d0989] -- built on [2018-12-06T0456]
+Py:Athena            INFO using release [?-21.0.0] [i686-slc5-gcc43-dbg] [?/?] -- built on [?]
 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 "CaloUtils/CaloTowerStore_test.py"
-SetGeometryVersion.py obtained major release version 22
+SetGeometryVersion.py obtained major release version 21
 Py:Athena            INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py"
-Py:ConfigurableDb    INFO Read module info for 5472 configurables from 61 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 4799 configurables from 2 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
-EventInfoMgtInit: Got release version  Athena-22.0.1
+EventInfoMgtInit: Got release version  sss-rel_0
 Py:IOVDbSvc.CondDB    INFO Setting up conditions DB access to instance OFLP200
 Py:Athena            INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py"
 Py:Athena            INFO including file "CaloConditions/CaloConditions_jobOptions.py"
@@ -18,12 +17,13 @@ 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
+# setting LC_ALL to "C"
+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 lxplus093.cern.ch on Thu Dec  6 05:00:29 2018
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Thu Feb 28 11:58:02 2019
 ====================================================================================================================================
 ApplicationMgr       INFO Successfully loaded modules : AthenaServices
 ApplicationMgr       INFO Application Manager Configured successfully
@@ -31,7 +31,7 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 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 3642 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
@@ -39,20 +39,20 @@ AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version Athena
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 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-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 10 servers found for host lxplus093.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ]
+DBReplicaSvc         INFO Read replica configuration from /home/sss/atlas/rootaccess/build/share/dbreplica.config
+DBReplicaSvc         INFO No specific match for domain found - use default fallback
+DBReplicaSvc         INFO Total of 1 servers found for host karma [atlas_dd ]
 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
-PoolSvc           WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables
-PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml
+PoolSvc              INFO Resolved path (via DATAPATH) is /home/sss/atlas/DBRelease/current/poolcond/PoolCat_oflcond.xml
+PoolSvc              INFO Resolved path (via DATAPATH) is /home/sss/atlas/DBRelease/current/poolcond/PoolCat_oflcond.xml
+PoolSvc              INFO Resolved path (via ATLAS_POOLCOND_PATH) is /home/sss/atlas/DBRelease/poolcond/PoolFileCatalog.xml
 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
 IOVDbSvc             INFO Global tag: OFLCOND-SDR-BS14T-IBL-06 set from joboptions
 IOVDbFolder          INFO Read from meta data only for folder /TagInfo
 IOVDbSvc             INFO Initialised with 3 connections and 7 folders
@@ -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 1866 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 5707 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-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileNeighbour_reduced.txt
+TileNeighbour        INFO Reading file  /home/sss/atlas/rootaccess/build/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,37 +176,22 @@ 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-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal2DNeighbors-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/share/FCal2DNeighbors-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/share/FCal3DNeighborsNext-April2011.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/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:
-HistogramPersis...WARNING Histograms saving not required.
-ApplicationMgr       INFO Application Manager Initialized successfully
-ApplicationMgr       INFO Application Manager Started successfully
-AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
-EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
-EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
-ClassIDSvc           INFO  getRegistryEntries: read 2366 CLIDRegistry entries for module ALL
-IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift
-IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas
-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
 CaloIdMgrDetDes...   INFO in createObj: creating a CaloDescrManager object in the detector store
-ClassIDSvc           INFO  getRegistryEntries: read 193 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 4721 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
@@ -223,24 +208,39 @@ 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-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
-LArFCAL_Base_ID      INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2018-12-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/share/FCalSuperCells2DNeighborsNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/share/FCalSuperCells3DNeighborsNextNew-April2014.txt
+LArFCAL_Base_ID      INFO Reading file /home/sss/atlas/rootaccess/build/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-04T2353/Athena/22.0.1/InstallArea/x86_64-slc6-gcc8-opt/share/TileSuperCellNeighbour.txt
+TileNeighbour        INFO Reading file  /home/sss/atlas/rootaccess/build/share/TileSuperCellNeighbour.txt
 AtlasDetectorID      INFO initialize_from_dictionary - OK
 CaloIdMgrDetDes...   INFO  Finished 
 CaloIdMgrDetDes...   INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv 
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
+EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
+EventPersistenc...   INFO Added successfully Conversion service:TagInfoMgr
+ClassIDSvc           INFO  getRegistryEntries: read 109 CLIDRegistry entries for module ALL
+IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift
+IOVDbFolder          INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas
+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                           /home/sss/atlas/DBRelease/current/poolcond/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root
+RootDatabase.open    INFO /home/sss/atlas/DBRelease/current/poolcond/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200
 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
+Domain[ROOT_All]     INFO                           /home/sss/atlas/DBRelease/current/poolcond/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root
+RootDatabase.open    INFO /home/sss/atlas/DBRelease/current/poolcond/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events processed so far  <<<===
 test1
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
-/cvmfs/atlas-co...   INFO Database being retired...
+/home/sss/atlas...   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...
+/home/sss/atlas...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
@@ -248,25 +248,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.20 ))s
+IOVDbFolder          INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/340 ((     0.08 ))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.02 ))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/390 ((     0.00 ))s
+IOVDbFolder          INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/346 ((     0.00 ))s
 IOVDbFolder       WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved
-IOVDbSvc             INFO  bytes in ((      0.23 ))s
+IOVDbSvc             INFO  bytes in ((      0.09 ))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.23 ))s
+IOVDbSvc             INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: ((     0.09 ))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= 0.58  [s] Ave/Min/Max= 0.29(+- 0.28)/ 0.01/ 0.57  [s] #=  2
-cObj_ALL             INFO Time User   : Tot= 0.72  [s] Ave/Min/Max= 0.36(+- 0.27)/ 0.09/ 0.63  [s] #=  2
-ChronoStatSvc        INFO Time User   : Tot= 3.59  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=  270 [ms] Ave/Min/Max=  135(+-  135)/    0/  270 [ms] #=  2
+cObj_ALL             INFO Time User   : Tot=  440 [ms] Ave/Min/Max=  220(+-  180)/   40/  400 [ms] #=  2
+ChronoStatSvc        INFO Time User   : Tot= 2.91  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
index 2139670e35d..00414661d88 100644
--- a/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloLCWeightTool.cxx
@@ -88,7 +88,7 @@ StatusCode CaloLCWeightTool::initialize()
   ATH_CHECK( m_key.initialize() );
 
   // pointer to detector manager:
-  m_calo_dd_man = CaloDetDescrManager::instance(); 
+  ATH_CHECK( detStore()->retrieve (m_calo_dd_man, "CaloMgr") );
   m_calo_id   = m_calo_dd_man->getCaloCell_ID();
    
   //---- retrieve the noisetool ----------------
diff --git a/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx b/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx
index 1cea69a190b..399f602cf0e 100644
--- a/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTopoTowerBuilderTool.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
 */
 
 
@@ -59,7 +59,7 @@ StatusCode CaloTopoTowerBuilderTool::initializeTool()
 {
   ATH_MSG_INFO( "Initializing CaloTopoTowerAlg"  );
 
-  m_calo_dd_man  = CaloDetDescrManager::instance();
+  ATH_CHECK( detStore()->retrieve (m_calo_dd_man, "CaloMgr") );
   m_calo_id   = m_calo_dd_man->getCaloCell_ID();
 
   return StatusCode::SUCCESS;
diff --git a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx
index ca611942827..f55cf88b789 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.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,7 +13,7 @@
 
 #include "StoreGate/StoreGateSvc.h"
 
-#include "CaloIdentifier/CaloCell_ID.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloEvent/CaloCell.h"
 #include "CaloEvent/CaloCellContainer.h"
@@ -28,7 +28,8 @@
 CaloTowerBuilderTool::CaloTowerBuilderTool(const std::string& name,
 					   const std::string& type,
 					   const IInterface* parent)
-  : CaloTowerBuilderToolBase(name,type,parent)
+  : CaloTowerBuilderToolBase(name,type,parent),
+    m_caloDDM(nullptr)
     //  , m_errorCounter(0)
 {
   declareInterface<ICaloTowerBuilderToolBase>(this);    
@@ -51,6 +52,7 @@ CaloTowerBuilderTool::~CaloTowerBuilderTool()
 
 // protected!
 StatusCode CaloTowerBuilderTool::initializeTool() {
+  ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") );
   m_caloIndices = parseCalos (m_includedCalos);
   return this->checkSetup(msg());
 }
@@ -302,7 +304,7 @@ CaloTowerBuilderTool::parseCalos
 StatusCode CaloTowerBuilderTool::rebuildLookup()
 {
   if (towerSeg().neta() != 0 && towerSeg().nphi() != 0) {
-    if (m_cellStore.buildLookUp(towerSeg(), m_caloIndices)) {
+    if (m_cellStore.buildLookUp(*m_caloDDM, towerSeg(), m_caloIndices)) {
       return StatusCode::SUCCESS;
     }
   }
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStore.cxx b/Calorimeter/CaloUtils/src/CaloTowerStore.cxx
index c33c096f952..3e9a63467b6 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerStore.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTowerStore.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
 */
 
 /********************************************************************
@@ -29,8 +29,6 @@ Updated:  Ilija Vukotic August 2008.
 // include header files
 #include "Identifier/IdentifierHash.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
-
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
@@ -73,8 +71,9 @@ CaloTowerStore::towers (const CaloTowerSeg::SubSeg& subseg) const
 }
 
 
-bool CaloTowerStore::buildLookUp(const CaloTowerSeg& theTowerSeg,
-                                 std::vector<CaloCell_ID::SUBCALO> theCalos)
+bool CaloTowerStore::buildLookUp(const CaloDetDescrManager& theManager,
+                                 const CaloTowerSeg& theTowerSeg,
+                                 const std::vector<CaloCell_ID::SUBCALO>& theCalos)
 {
   m_seg = theTowerSeg;
   m_entries.clear();
@@ -95,15 +94,12 @@ bool CaloTowerStore::buildLookUp(const CaloTowerSeg& theTowerSeg,
   }
   MsgStream msg(theMsgSvc,"CaloTowerStore");
 
-  // get cell id helper
-  const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();
-
   // get cell description manager
-  const CaloDetDescrManager* theManager = CaloDetDescrManager::instance();
-  if ( ! theManager->isInitialized() ){
+  if ( ! theManager.isInitialized() ){
 	msg << MSG::ERROR<< "CaloDetDescrManager is not initialized, module unusable!"<< endmsg;
 	return false;
 	}
+  const CaloCell_ID& cellIdHelper = *theManager.getCaloCell_ID();
 
   // Get list of Calos to be considered
   size_t sizeCalos = theCalos.size();
@@ -119,7 +115,7 @@ bool CaloTowerStore::buildLookUp(const CaloTowerSeg& theTowerSeg,
 
       // find numerical ranges
       IdentifierHash firstIndex, lastIndex;
-      cellIdHelper->calo_cell_hash_range((int)theCalos[iCalo], firstIndex, lastIndex);
+      cellIdHelper.calo_cell_hash_range((int)theCalos[iCalo], firstIndex, lastIndex);
       msg << MSG::DEBUG << " firstInder,lastIndex " << firstIndex << " " << lastIndex << endmsg;
 
       
@@ -129,7 +125,7 @@ bool CaloTowerStore::buildLookUp(const CaloTowerSeg& theTowerSeg,
 	  for( size_t cellIndex = firstIndex; cellIndex < lastIndex;   cellIndex++){     // Cell Loop  //
 
 		  
-	  const CaloDetDescrElement* theDDE = theManager->get_element(cellIndex);
+	  const CaloDetDescrElement* theDDE = theManager.get_element(cellIndex);
 
 	  if(theDDE==0) {
 	    msg << MSG::ERROR<< " CellIndex =  "<< cellIndex<< " has a DDE pointer NULL " << endmsg;
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
index 5c2e75e39f0..2a98f0cd9e6 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx
+++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.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
 */
 
 // $Id$
@@ -14,6 +14,7 @@
 
 #include "CaloTowerStoreTestAlg.h"
 #include "CaloUtils/CaloTowerStore.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
 #include <iostream>
 #include <cmath>
 #include <cassert>
@@ -24,11 +25,22 @@
  */
 CaloTowerStoreTestAlg::CaloTowerStoreTestAlg (const std::string& name,
                                               ISvcLocator* pSvcLocator)
-  : AthAlgorithm (name, pSvcLocator)
+  : AthAlgorithm (name, pSvcLocator),
+    m_caloDDM (nullptr)
 {
 }
 
 
+/** 
+ * @brief Standard Gaudi initialize method.
+ */
+StatusCode CaloTowerStoreTestAlg::initialize()
+{
+  ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") );
+  return StatusCode::SUCCESS;
+}
+
+
 void
 CaloTowerStoreTestAlg::iterate_full (const CaloTowerStore& store,
                                      test_tows_t& tows)
@@ -82,7 +94,7 @@ CaloTowerStoreTestAlg::test_subseg_iter (const CaloTowerStore& store1,
 {
   CaloTowerSeg seg = subseg.segmentation();
   CaloTowerStore store2;
-  assert (store2.buildLookUp (seg, calos));
+  assert (store2.buildLookUp (*m_caloDDM, seg, calos));
 
   assert (subseg.size() == store2.size());
 
@@ -105,7 +117,7 @@ void CaloTowerStoreTestAlg::test1()
   calos.push_back (CaloCell_ID::LARHEC);
   calos.push_back (CaloCell_ID::TILE);
   CaloTowerStore store;
-  assert (store.buildLookUp (seg, calos));
+  assert (store.buildLookUp (*m_caloDDM, seg, calos));
 
   CaloTowerSeg::SubSeg subseg1 = seg.subseg (0.7, 0.3, -0.2, 0.4);
   test_subseg_iter (store, calos, subseg1);
diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
index 39fcabe59d3..817e9137a92 100644
--- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
+++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h
@@ -1,7 +1,7 @@
 // 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$
@@ -19,6 +19,7 @@
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "CaloUtils/CaloTowerStore.h"
+class CaloDetDescrManager;
 
 
 class CaloTowerStoreTestAlg
@@ -32,10 +33,16 @@ public:
                          ISvcLocator* pSvcLocator);
 
 
+  /** 
+   * @brief Standard Gaudi initialize method.
+   */
+  virtual StatusCode initialize() override;
+
+
   /** 
    * @brief Standard Gaudi execute method.
    */
-  virtual StatusCode execute();
+  virtual StatusCode execute() override;
 
 
   typedef std::vector<std::pair<unsigned, double> > test_tow_t;
@@ -43,6 +50,8 @@ public:
   void dump_tows (const test_tows_t& t);
 
 private:
+  const CaloDetDescrManager* m_caloDDM;
+
   void iterate_full (const CaloTowerStore& store,
                      test_tows_t& tows);
   void iterate_subseg (const CaloTowerStore& store,
diff --git a/Calorimeter/CaloUtils/src/LocalNoiseSuppressionTool.cxx b/Calorimeter/CaloUtils/src/LocalNoiseSuppressionTool.cxx
index 1d3debf94b9..1ee8cdd68c6 100644
--- a/Calorimeter/CaloUtils/src/LocalNoiseSuppressionTool.cxx
+++ b/Calorimeter/CaloUtils/src/LocalNoiseSuppressionTool.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
 */
 
 /********************************************************************
@@ -89,7 +89,7 @@ StatusCode LocalNoiseSuppressionTool::initialize() {
   ATH_MSG_INFO( "Noise Tool retrieved"  );
 
   // pointer to detector manager:
-  m_calo_dd_man  = CaloDetDescrManager::instance(); 
+  ATH_CHECK( detStore()->retrieve (m_calo_dd_man, "CaloMgr") );
   m_calo_id   = m_calo_dd_man->getCaloCell_ID();
 
 
-- 
GitLab


From 66ac1b43ad569611eb6b1054db9c411d7f346c0e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 5 Mar 2019 16:15:12 +0100
Subject: [PATCH 249/404] LArCafJobs: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.

Also remove some obsolete uses of DataHandle.
---
 .../LArCafJobs/LArCafJobs/LArHECNoise.h       |  4 +--
 .../LArCafJobs/LArCafJobs/LArNoiseBursts.h    |  4 +--
 LArCalorimeter/LArCafJobs/src/LArHECNoise.cxx | 13 ++++------
 .../LArCafJobs/src/LArNoiseBursts.cxx         | 26 +++++++++----------
 .../LArCafJobs/src/LArShapeDumper.cxx         |  3 +--
 .../LArCafJobs/src/LArShapeDumperTool.cxx     | 13 +++++-----
 6 files changed, 27 insertions(+), 36 deletions(-)

diff --git a/LArCalorimeter/LArCafJobs/LArCafJobs/LArHECNoise.h b/LArCalorimeter/LArCafJobs/LArCafJobs/LArHECNoise.h
index 6a785be6178..d58b0e344de 100644
--- a/LArCalorimeter/LArCafJobs/LArCafJobs/LArHECNoise.h
+++ b/LArCalorimeter/LArCafJobs/LArCafJobs/LArHECNoise.h
@@ -28,7 +28,6 @@
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArElectrodeID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 #include "LArElecCalib/ILArPedestal.h"
 
@@ -75,7 +74,6 @@ class LArHECNoise : public AthAlgorithm  {
 
    /*services*/
    const LArOnlineID* m_LArOnlineIDHelper;
-   const CaloIdManager*  m_caloIdMgr;
    const CaloDetDescrManager* m_calodetdescrmgr;
    const CaloCell_ID*   m_calocell_id;
 
@@ -115,7 +113,7 @@ class LArHECNoise : public AthAlgorithm  {
    std::vector<std::string> m_TriggerLines;
    int m_MinDigitADC;
    int m_MaxDeltaT;
-   const DataHandle<ILArPedestal> m_ped;
+   const ILArPedestal* m_ped;
 
 };
 
diff --git a/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h b/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h
index ff34065f8ef..a89873a8104 100644
--- a/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h
+++ b/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h
@@ -30,7 +30,7 @@
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArElectrodeID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 //#include "LArElecCalib/ILArHVTool.h"
 
 // Trigger
@@ -55,7 +55,6 @@ class LArOnlineIDStrHelper;
 class LArEM_ID;
 class LArHEC_ID;
 class LArFCAL_ID;
-//class CaloIdManager;
 //class CaloDetDescrManager;
 
 class TileTBID;
@@ -113,7 +112,6 @@ class LArNoiseBursts : public AthAlgorithm  {
    const LArEM_ID* m_LArEM_IDHelper;
    const LArFCAL_ID* m_LArFCAL_IDHelper;
    const LArHEC_ID*  m_LArHEC_IDHelper;
-   const CaloIdManager*  m_caloIdMgr;
    const CaloDetDescrManager* m_calodetdescrmgr;
 
    // Electrons
diff --git a/LArCalorimeter/LArCafJobs/src/LArHECNoise.cxx b/LArCalorimeter/LArCafJobs/src/LArHECNoise.cxx
index 74059869d27..805a379ce1a 100644
--- a/LArCalorimeter/LArCafJobs/src/LArHECNoise.cxx
+++ b/LArCalorimeter/LArCafJobs/src/LArHECNoise.cxx
@@ -7,7 +7,6 @@
 
 #include "StoreGate/StoreGateSvc.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloDM_ID.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
@@ -32,7 +31,6 @@
 #include "NavFourMom/IParticleContainer.h"
 #include "NavFourMom/INavigable4MomentumCollection.h"
 
-#include "StoreGate/DataHandle.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetectorElements.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
@@ -65,7 +63,6 @@ LArHECNoise::LArHECNoise(const std::string& name,
     m_tree(0),
     m_trigDec( "Trig::TrigDecisionTool/TrigDecisionTool" ),
     m_LArOnlineIDHelper(0),
-    m_caloIdMgr(0),
     m_calodetdescrmgr(0),
     m_calocell_id(nullptr),
     m_nt_run(0),
@@ -95,7 +92,8 @@ LArHECNoise::LArHECNoise(const std::string& name,
     m_nt_z(0),
     m_nt_r(0),
     m_nt_ped(0),
-    m_nt_pedRMS(0)
+    m_nt_pedRMS(0),
+    m_ped(nullptr)
  {
 
    // Trigger
@@ -126,16 +124,15 @@ StatusCode LArHECNoise::initialize() {
   ATH_CHECK( m_cablingKey.initialize() );
 
   // Retrieve online ID helper
-  const DataHandle<LArOnlineID> LArOnlineIDHelper;
+  const LArOnlineID* LArOnlineIDHelper = nullptr;
   ATH_CHECK( detStore()->retrieve(LArOnlineIDHelper, "LArOnlineID") );
   m_LArOnlineIDHelper = LArOnlineIDHelper;
   ATH_MSG_DEBUG( " Found LArOnline Helper");
 
   // Retrieve ID helpers
-  ATH_CHECK( detStore()->retrieve(m_caloIdMgr) );
-  m_calocell_id  = m_caloIdMgr->getCaloCell_ID();
+  ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
+  ATH_CHECK( detStore()->retrieve (m_calodetdescrmgr, "CaloMgr") );
 
-  m_calodetdescrmgr = CaloDetDescrManager::instance();
   /** get a handle on the NTuple and histogramming service */
   ATH_CHECK( service("THistSvc", m_thistSvc) );
  
diff --git a/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx b/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx
index b76e131e4f2..c121d2e84b0 100644
--- a/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx
+++ b/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.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
 */
 
 /// LArNoiseBursts
@@ -13,7 +13,6 @@
 
 #include "StoreGate/StoreGateSvc.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloDM_ID.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
@@ -49,7 +48,6 @@
 
 // Lar HV
 #include "LArElecCalib/ILArHVTool.h"
-#include "StoreGate/DataHandle.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetectorElements.h"
 #include "LArReadoutGeometry/EMBCell.h"
@@ -123,7 +121,6 @@ LArNoiseBursts::LArNoiseBursts(const std::string& name,
     m_LArEM_IDHelper(0),
     m_LArFCAL_IDHelper(0),
     m_LArHEC_IDHelper(0),
-    m_caloIdMgr(0),
     m_calodetdescrmgr(0),
     m_CosmicCaloStream(false),
     m_nb_sat(0),
@@ -250,8 +247,6 @@ LArNoiseBursts::LArNoiseBursts(const std::string& name,
    
    // Keep cell properties
    declareProperty("KeepOnlyCellID",          m_keepOnlyCellID = false);
-
-   m_calodetdescrmgr = CaloDetDescrManager::instance(); 
  }
 
 /////////////////////////////////////////////////////////////////////////////////////
@@ -302,28 +297,31 @@ StatusCode LArNoiseBursts::initialize() {
   ATH_CHECK( m_BCKey.initialize() );
 
   // Retrieve online ID helper
-  const DataHandle<LArOnlineID> LArOnlineIDHelper;
+  const LArOnlineID* LArOnlineIDHelper = nullptr;
   ATH_CHECK( detStore()->retrieve(LArOnlineIDHelper, "LArOnlineID") );
   m_LArOnlineIDHelper = LArOnlineIDHelper;
   ATH_MSG_DEBUG( " Found LArOnline Helper");
 
   // Retrieve HV line ID helper
-  const DataHandle<LArHVLineID> LArHVLineIDHelper;
-  ATH_CHECK( detStore()->retrieve(LArHVLineIDHelper, "LArHVLineID") );
+  const LArHVLineID* LArHVLineIDHelper = nullptr;
+    ATH_CHECK( detStore()->retrieve(LArHVLineIDHelper, "LArHVLineID") );
   m_LArHVLineIDHelper = LArHVLineIDHelper;
   ATH_MSG_DEBUG( " Found LArOnlineIDHelper Helper");
 
   // Retrieve HV electrode ID helper
-  const DataHandle<LArElectrodeID> LArElectrodeIDHelper;
+  const LArElectrodeID* LArElectrodeIDHelper = nullptr;
   ATH_CHECK( detStore()->retrieve(LArElectrodeIDHelper, "LArElectrodeID") );
   m_LArElectrodeIDHelper = LArElectrodeIDHelper;
   ATH_MSG_DEBUG( " Found LArElectrodeIDHelper Helper");
 
+  ATH_CHECK( detStore()->retrieve (m_calodetdescrmgr, "CaloMgr") );
+
   // Retrieve ID helpers
-  ATH_CHECK( detStore()->retrieve(m_caloIdMgr) );
-  m_LArEM_IDHelper   = m_caloIdMgr->getEM_ID();
-  m_LArHEC_IDHelper  = m_caloIdMgr->getHEC_ID();
-  m_LArFCAL_IDHelper = m_caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_LArEM_IDHelper   = idHelper->em_idHelper();
+  m_LArHEC_IDHelper  = idHelper->hec_idHelper();
+  m_LArFCAL_IDHelper = idHelper->fcal_idHelper();
   
   if ( m_calo_noise_tool.retrieve().isFailure() ) {
     ATH_MSG_WARNING ( "Failed to retrieve tool " << m_calo_noise_tool );
diff --git a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
index c991048d7b8..d0173a44c40 100755
--- a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
+++ b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
@@ -1,12 +1,11 @@
 /*
-  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 "LArCafJobs/LArShapeDumper.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "LArRawEvent/LArDigit.h"
 #include "GaudiKernel/IToolSvc.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "GaudiKernel/INTupleSvc.h"
 #include "GaudiKernel/MsgStream.h"
 #include "LArRawEvent/LArOFIterResultsContainer.h"
diff --git a/LArCalorimeter/LArCafJobs/src/LArShapeDumperTool.cxx b/LArCalorimeter/LArCafJobs/src/LArShapeDumperTool.cxx
index b6f701154c1..59daa657da8 100644
--- a/LArCalorimeter/LArCafJobs/src/LArShapeDumperTool.cxx
+++ b/LArCalorimeter/LArCafJobs/src/LArShapeDumperTool.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "LArCafJobs/LArShapeDumperTool.h"
 #include "LArRawEvent/LArDigit.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArElecCalib/ILArShape.h"
 
 #include "LArRawConditions/LArPhysWave.h"
@@ -44,10 +44,11 @@ StatusCode LArShapeDumperTool::initialize() {
   //ATH_MSG_DEBUG("in initialize()");
   ATH_CHECK(detStore()->retrieve(m_caloDetDescrMgr));
 
-  const CaloIdManager* caloIdMgr = CaloIdManager::instance() ;
-  m_emId   = caloIdMgr->getEM_ID();
-  m_hecId  = caloIdMgr->getHEC_ID();
-  m_fcalId = caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId   = idHelper->em_idHelper();
+  m_hecId  = idHelper->hec_idHelper();
+  m_fcalId = idHelper->fcal_idHelper();
 
   ATH_CHECK(detStore()->retrieve(m_onlineHelper, "LArOnlineID"));
 
-- 
GitLab


From 75b8a9fc2f93de63d4e659be57e1bceb4c18b9f6 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 5 Mar 2019 14:55:23 +0100
Subject: [PATCH 250/404] Update syntax of ITRT_LocalOccupancy.h

Use recommended `DeclareInterface(...)` syntax.
---
 .../ITRT_LocalOccupancy.h                     | 29 +++++++------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_LocalOccupancy.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_LocalOccupancy.h
index acb34dda620..6adf7b61a63 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_LocalOccupancy.h
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/ITRT_LocalOccupancy.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,34 +21,31 @@ class Identifier;
 
 namespace Trk { class Track ; }
 
-  /** @class ITRT_LocalOccupancy 
+  /** @class ITRT_LocalOccupancy
       @author  Alejandro Alonso: <Alejandro.Alonso@cern.ch>
   */
 
 namespace InDet
 {
- /** Declaration of the interface ID ( interface id, major version, minor version) */
- static const InterfaceID IID_ITRT_LocalOccupancy("InDet::ITRT_LocalOccupancy", 1 , 0); 
 
   class ITRT_LocalOccupancy : virtual public IAlgTool {
   public:
-   /** AlgTool interface methods */
-   static const InterfaceID& interfaceID() ; 
 
    /** Virtual destructor */
    virtual ~ITRT_LocalOccupancy(){};
-   virtual StatusCode initialize() = 0;
-   virtual StatusCode finalize()   = 0;
 
-   /** Return the local occupancy for the sectors crossed by a given track */ 
+   /// Creates the InterfaceID and interfaceID() method
+   DeclareInterfaceID(ITRT_LocalOccupancy, 1, 0);
+
+   /** Return the local occupancy for the sectors crossed by a given track */
    virtual float LocalOccupancy( const Trk::Track& track) const = 0;
    virtual float LocalOccupancy(const double eta, const double phi) const = 0;
-    
+
    /** Return a map of the occupancy in the barrel (-1,+1) and endcaps (-2,+2) */
    virtual std::map<int, double>  getDetectorOccupancy( const TRT_RDO_Container* p_trtRDOContainer ) const  = 0;
-     
 
-   /** Return the global occupancy of the event*/ 
+
+   /** Return the global occupancy of the event*/
    virtual std::vector<float> GlobalOccupancy( ) const = 0 ;
 
    /* virtual int **getOccLocalWheel()   = 0; */
@@ -67,11 +64,7 @@ namespace InDet
    /* virtual int **getOccLocalPrivate() = 0; */
    /* virtual int **getHitLocalPrivate() = 0; */
    /* virtual int **getStwLocalPrivate() = 0; */
-  }; 
+  };
 
-  inline const InterfaceID& InDet::ITRT_LocalOccupancy::interfaceID()
-  { 
-    return IID_ITRT_LocalOccupancy;
-  }
 }
-#endif 
+#endif
-- 
GitLab


From 785c132cd02cd519d55f88d4eee3b0c506430966 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 5 Mar 2019 16:17:15 +0100
Subject: [PATCH 251/404] LArCalibTools: Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../LArCalibTools/LArAverages2Ntuple.h         |  1 -
 .../LArCalibTools/LArReadParamsFromFile.h      |  2 +-
 .../LArCalibTools/LArReadParamsFromFile.icc    |  9 +++++----
 .../src/LArAutoCorrFromStdNtuple.cxx           |  8 ++++----
 .../LArCalibTools/src/LArAverages2Ntuple.cxx   |  6 ++++--
 .../LArCalibTools/src/LArCond2NtupleBase.cxx   | 18 ++++++++----------
 .../LArCalibTools/src/LArOFCBinAlg.cxx         | 14 ++++++--------
 .../LArCalibTools/src/LArRamps2Ntuple.cxx      |  4 +---
 8 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArAverages2Ntuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArAverages2Ntuple.h
index 2294599dd0f..1c79d78a1a4 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArAverages2Ntuple.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArAverages2Ntuple.h
@@ -25,7 +25,6 @@
 #include "GaudiKernel/ToolHandle.h"
 
 #include "CaloIdentifier/LArEM_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "LArRecConditions/LArCalibLineMapping.h"
diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
index 703219f7ee0..72c356d4c67 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.h
@@ -17,7 +17,7 @@
 #define LARREADPARAMSFROMFILE_H
 #include "AthenaBaseComps/AthAlgorithm.h"
 //#include "GaudiKernel/SmartDataPtr.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 #include <fstream>
 #include <stdio.h>
diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
index b39eb1b77ce..405e7163a4c 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArReadParamsFromFile.icc
@@ -59,10 +59,11 @@ StatusCode LArReadParamsFromFile<DATA>::initialize() {
     return StatusCode::FAILURE ;
   }
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId   = caloIdMgr->getEM_ID();
-  m_hecId  = caloIdMgr->getHEC_ID();
-  m_fcalId = caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId   = idHelper->em_idHelper();
+  m_hecId  = idHelper->hec_idHelper();
+  m_fcalId = idHelper->fcal_idHelper();
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx b/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx
index 75317ad3438..138df466cf6 100644
--- a/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArAutoCorrFromStdNtuple.cxx
@@ -6,7 +6,7 @@
 
 #include "LArIdentifier/LArOnlineID.h"
 #include "CaloIdentifier/CaloGain.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
 #include "LArRawConditions/LArAutoCorrMC.h"
 #include "LArRawConditions/LArAutoCorrComplete.h"
@@ -92,9 +92,9 @@ StatusCode LArAutoCorrFromStdNtuple::stop()
   const LArOnlineID* onlineHelper = nullptr;
   ATH_CHECK( detStore()->retrieve(onlineHelper, "LArOnlineID") );
   // and helper for FCAL
-  const CaloIdManager* caloId_mgr;
-  ATH_CHECK( detStore()->retrieve(caloId_mgr, "CaloIdManager") );
-  const LArFCAL_ID* fcal_id = caloId_mgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArFCAL_ID* fcal_id = idHelper->fcal_idHelper();
 
   SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
   const LArOnOffIdMapping* cabling{*cablingHdl};
diff --git a/LArCalorimeter/LArCalibTools/src/LArAverages2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArAverages2Ntuple.cxx
index bf2b7ef96aa..e5f01dbe3e5 100644
--- a/LArCalorimeter/LArCalibTools/src/LArAverages2Ntuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArAverages2Ntuple.cxx
@@ -5,6 +5,7 @@
 #include "LArCalibTools/LArAverages2Ntuple.h"
 
 #include "LArRawEvent/LArAccumulatedCalibDigitContainer.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 #include "GaudiKernel/ToolHandle.h"
 
@@ -27,8 +28,9 @@ StatusCode LArAverages2Ntuple::initialize()
 {
   ATH_MSG_INFO ( "in initialize" );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId = idHelper->em_idHelper();
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
index 5d2a0667156..4e557d57421 100644
--- a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
@@ -6,7 +6,6 @@
 
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArOnline_SuperCellID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 
 LArCond2NtupleBase::LArCond2NtupleBase(const std::string& name, ISvcLocator* pSvcLocator): 
@@ -64,18 +63,17 @@ StatusCode LArCond2NtupleBase::initialize() {
 
   m_detStore= &(*detStore()); //for backward compatiblity 
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
+  const CaloCell_ID* idHelper = nullptr;
   if ( m_isSC ){
-  m_emId=caloIdMgr->getEM_SuperCell_ID();
-  m_fcalId=caloIdMgr->getFCAL_SuperCell_ID();
-  m_hecId=caloIdMgr->getHEC_SuperCell_ID();
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_SuperCell_ID") );
   }
-  else{
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
-  m_caloId=caloIdMgr->getCaloCell_ID();
+  else {
+    ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+    ATH_CHECK( detStore()->retrieve (m_caloId, "CaloCell_ID") );
   }
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
   if (!m_emId) {
     msg(MSG::ERROR) << "Could not access lar EM ID helper" << endmsg;
diff --git a/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx b/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
index e8d20445968..5c70fd7fe62 100644
--- a/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
@@ -4,7 +4,7 @@
 
 #include "LArCalibTools/LArOFCBinAlg.h"
 #include "LArRawConditions/LArOFCBinComplete.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 //#include <ifstream>
 #include <fstream>
@@ -104,13 +104,11 @@ StatusCode LArOFCBinAlg::execute() {
      ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
      return StatusCode::FAILURE;
   }
-  const LArEM_Base_ID* emId;
-  const LArHEC_Base_ID* hecId;
-  const LArFCAL_Base_ID* fcalId;
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance();
-  emId=caloIdMgr->getEM_ID();
-  fcalId=caloIdMgr->getFCAL_ID();
-  hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_Base_ID* emId = idHelper->em_idHelper();
+  const LArHEC_Base_ID* hecId = idHelper->hec_idHelper();
+  const LArFCAL_Base_ID* fcalId = idHelper->fcal_idHelper();
 
   for (int gain=0;gain<3;++gain) {
     msg(MSG::INFO) << "Working on gain " << gain << endmsg;
diff --git a/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx
index 89676728907..22e4567a181 100755
--- a/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.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 "LArCalibTools/LArRamps2Ntuple.h"
@@ -7,8 +7,6 @@
 #include "LArRawConditions/LArRampComplete.h"
 #include "LArRawConditions/LArRampSym.h"
 
-//#include "CaloIdentifier/CaloIdManager.h"
-
 #include <math.h>
 
 LArRamps2Ntuple::LArRamps2Ntuple(const std::string& name, ISvcLocator* pSvcLocator): 
-- 
GitLab


From 01974f510a40696d40fc9897ee2e30127a3ab8d8 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 5 Mar 2019 15:03:01 +0100
Subject: [PATCH 252/404] Update TRT_LocalOccupancy to use extends <...> syntax

---
 .../TRT_ElectronPidTools/TRT_LocalOccupancy.h                | 5 ++---
 .../TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx          | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h
index 00b5500c45d..635e72a6687 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -50,8 +50,7 @@ namespace InDet
       @author  Alejandro Alonso: <Alejandro.Alonso@cern.ch>
   */
 
-  class TRT_LocalOccupancy : public AthAlgTool,
-				 virtual public ITRT_LocalOccupancy{
+  class TRT_LocalOccupancy : public extends <AthAlgTool, ITRT_LocalOccupancy> {
   public:
    TRT_LocalOccupancy(const std::string&,const std::string&,const IInterface*);
 
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
index 8ce810d8c21..aca757faf83 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
@@ -43,12 +43,11 @@ TRT_LocalOccupancy::TRT_LocalOccupancy(const std::string& t,
 			  const std::string& n,
 			  const IInterface*  p )
   :
-  AthAlgTool(t,n,p),
+  base_class(t,n,p),
   m_TRTHelper(nullptr),
   m_TRTStrawStatusSummarySvc("InDetTRTStrawStatusSummarySvc", n),
   m_driftFunctionTool("TRT_DriftFunctionTool")  
 {
- declareInterface<ITRT_LocalOccupancy>(this);
   //declareProperty("isData", m_DATA = true);
  declareProperty("TRTStrawSummarySvc",   m_TRTStrawStatusSummarySvc);
  declareProperty("isTrigger",            m_isTrigger = false);
-- 
GitLab


From dd8377540cfb3ffd6384aa594e5aafed05e97907 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 5 Mar 2019 16:17:33 +0100
Subject: [PATCH 253/404] LArCalibUtils: Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.

Also migrate some classes to handles and other cleanups.
---
 .../LArCalibUtils/LArCaliWaveAverage.h        |  1 -
 .../LArDigitOscillationCorrTool.h             |  2 -
 .../LArCalibUtils/LArCalibUtils/LArFill.h     |  5 --
 .../LArCalibUtils/LArCalibUtils/LArOFCAlg.h   |  1 -
 .../LArCalibUtils/LArOFPhaseFill.h            |  1 -
 .../LArCalibUtils/LArPhysWaveBuilder.h        |  5 +-
 .../LArCalibUtils/LArPhysWaveTool.h           |  3 +-
 .../LArCalibUtils/LArRampBuilder.h            |  3 -
 .../LArCalibUtils/LArTCMFitterTool.h          |  4 +-
 .../LArCalibUtils/LArTimeTuning.h             | 36 ++++++---
 .../LArCalibUtils/LArTimeTuningNtuple.h       | 20 +++--
 .../LArCalibUtils/LArWFParamTool.h            |  1 -
 .../LArAccumulatedCalibDigitContSplitter.cxx  |  1 -
 .../LArCalibUtils/src/LArCaliWaveAverage.cxx  |  9 ++-
 .../src/LArCaliWaveBuilderXtalk.cxx           |  1 -
 .../LArCalibUtils/src/LArCaliWaveSelector.cxx |  7 +-
 .../LArCalibUtils/src/LArCalibDigitMaker.cxx  |  5 +-
 .../src/LArDigitOscillationCorrTool.cxx       | 11 +--
 .../LArCalibUtils/src/LArDumpShapes.cxx       |  9 ++-
 .../src/LArMasterWaveBuilder.cxx              |  7 +-
 .../src/LArPedestalInPhysicsMaker.cxx         | 17 ++---
 .../LArCalibUtils/src/LArPhaseToolMC.cxx      |  5 +-
 .../LArCalibUtils/src/LArPhysWaveBuilder.cxx  | 27 +++----
 .../src/LArPhysWavePredictor.cxx              |  7 +-
 .../LArCalibUtils/src/LArRampBuilder.cxx      |  9 ++-
 .../src/LArTCMPhysWavePredictor.cxx           |  8 +-
 .../src/LArTimePhysPrediction.cxx             | 13 ++--
 .../LArCalibUtils/src/LArTimeTuning.cxx       | 70 +++++++++---------
 .../LArCalibUtils/src/LArTimeTuningNtuple.cxx | 74 +++++++++----------
 29 files changed, 175 insertions(+), 187 deletions(-)

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCaliWaveAverage.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCaliWaveAverage.h
index 847db4e91e8..d5a8b73d1b9 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCaliWaveAverage.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCaliWaveAverage.h
@@ -11,7 +11,6 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ICondSvc.h"
 #include "StoreGate/StoreGateSvc.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "Identifier/HWIdentifier.h"
 #include "LArRawConditions/LArCaliWave.h"
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArDigitOscillationCorrTool.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArDigitOscillationCorrTool.h
index bb902f0ec8f..73d87a16f9d 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArDigitOscillationCorrTool.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArDigitOscillationCorrTool.h
@@ -16,8 +16,6 @@
 #include "GaudiKernel/IIncidentListener.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "StoreGate/DataHandle.h"
-
 #include "LArElecCalib/ILArDigitOscillationCorrTool.h"
 #include "LArElecCalib/ILArH6Oscillation.h"
 #include "LArElecCalib/ILArRamp.h"
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArFill.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArFill.h
index a88dd674d2c..e295ac88af7 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArFill.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArFill.h
@@ -25,7 +25,6 @@ CREATED:  Jan. 2004
 #include "LArElecCalib/ILArDAC2uA.h" 
 #include "LArElecCalib/ILAruA2MeV.h" 
 
-#include "StoreGate/DataHandle.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "AthenaKernel/IOVSvcDefs.h" 
 
@@ -53,10 +52,6 @@ class LArFill : public AthAlgorithm
   LArDAC2uAComplete* m_dac2ua; 
   LAruA2MeVComplete* m_ua2mev; 
 
-  const DataHandle<ILArRamp>   m_dd_ADC2DAC; 
-  const DataHandle<ILArDAC2uA> m_dd_DAC2uA; 
-  const DataHandle<ILAruA2MeV> m_dd_uA2MeV; 
-
   std::string m_ADC2MeVToolName; 
   std::string m_keyADC2DAC, m_keyDAC2uA, m_keyuA2MeV; 
   ILArADC2MeVTool* m_ADC2MeVtool;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
index f7274f8ece4..1d7a06e3950 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
@@ -26,7 +26,6 @@
 
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "StoreGate/ReadCondHandleKey.h"
-#include "StoreGate/DataHandle.h"
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFPhaseFill.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFPhaseFill.h
index f979e1f6ac9..0c2a01e8ad3 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFPhaseFill.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFPhaseFill.h
@@ -22,7 +22,6 @@ Use a Tshaper raw conditions - reusing existing class instead of writing new
 
 #include "LArRawConditions/LArOFCBinComplete.h"
 
-#include "StoreGate/DataHandle.h"
 #include "AthenaKernel/IOVSvcDefs.h" 
 
 
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveBuilder.h
index 279ed15e8af..f8ba0096535 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveBuilder.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveBuilder.h
@@ -24,9 +24,11 @@
 
 #ifndef LARPHYSWAVEBUILDER_H
 #define LARPHYSWAVEBUILDER_H
+#include "LArRawEvent/LArDigitContainer.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "Identifier/Identifier.h"
 #include "Identifier/HWIdentifier.h"
+#include "StoreGate/ReadHandleKey.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 
@@ -96,7 +98,8 @@ private:
 
   /// === Algorithm properties.
   /// Storegate key for the @c LArDigitContainer of interest.
-  std::string m_gainCont;
+  SG::ReadHandleKey<LArDigitContainer> m_gainCont
+    { this, "GainCont", "FREE", "" };
 
   /// Number of bins per sample to record.
   int m_bins_per_sample;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveTool.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveTool.h
index bdb6c0ecb4a..a4cab18585c 100755
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveTool.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWaveTool.h
@@ -1,7 +1,7 @@
 //Dear emacs, this is -*- 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
 */
 
 
@@ -9,7 +9,6 @@
 #define LARPHYSWAVETOOL_H
 
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/DataHandle.h" 
 
 #include "LArRawConditions/LArWFParams.h"
 #include "LArRawConditions/LArCaliWave.h"
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
index 434555f3d7e..cb6c94aadcb 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
@@ -133,9 +133,6 @@ private:
   bool m_dac0sub, m_saveRawRamp,m_saveRecRamp, m_longNtuple, m_satSlope;
   IntegerProperty m_minDAC;
 
-  // datahandle for LArCaliWaveContainer
-  const DataHandle<LArCaliWaveContainer> m_caliWaveContainer;
-
   int m_DeadChannelCut;
   std::string m_folderName;
   int m_shapeMethodDAC;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTCMFitterTool.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTCMFitterTool.h
index 73edc28e4b3..7ca574e9106 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTCMFitterTool.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTCMFitterTool.h
@@ -1,7 +1,7 @@
 //Dear emacs, this is -*- 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
 */
 
 
@@ -15,8 +15,6 @@
 
 #include "AthenaBaseComps/AthAlgTool.h"
 
-#include "StoreGate/DataHandle.h" 
-
 #include "LArRawConditions/LArCaliWave.h"
 #include "LArRawConditions/LArPhysWave.h"
 
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuning.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuning.h
index 81fd78c866a..d51c6ea9a22 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuning.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuning.h
@@ -5,8 +5,8 @@
 */
 
 
-#ifndef LARTIMETUNING
-#define LARTIMETUNING
+#ifndef LARCALIBUTILS_LARTIMETUNING_H
+#define LARCALIBUTILS_LARTIMETUNING_H
 
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "LArElecCalib/ILArOFCTool.h"
@@ -18,9 +18,16 @@
 #include "GaudiKernel/Bootstrap.h"
 
 #include "LArIdentifier/LArOnlineID.h"
+#include "LArRawEvent/LArDigitContainer.h"
+#include "TBEvent/TBPhase.h"
+#include "LArRawConditions/LArGlobalTimeOffset.h"
+#include "LArRawConditions/LArFEBTimeOffset.h"
+#include "LArRawConditions/LArCellTimeOffset.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArEM_ID.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
 
 class LArTimeTuning : public AthAlgorithm
 {
@@ -28,17 +35,26 @@ class LArTimeTuning : public AthAlgorithm
 public:
 
   LArTimeTuning (const std::string& name, ISvcLocator* pSvcLocator);
-  ~LArTimeTuning();
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode stop();
-  StatusCode finalize(){return StatusCode::SUCCESS;}
+  virtual ~LArTimeTuning();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode stop() override;
 
 private:
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
   const LArOnlineID* m_onlineHelper;
-  std::string m_DataLocation;
-  std::string m_globalTimeOffsetOut, m_febTimeOffsetOut, m_cellTimeOffsetOut;
+  SG::ReadHandleKey<LArDigitContainer> m_DataLocation
+    { this, "DataLocation", "FREE", "" };
+  SG::ReadHandleKey<TBPhase> m_tbPhaseReadKey
+    { this, "TBPhaseReadKey", "TBPhase", "" };
+  SG::WriteHandleKey<LArGlobalTimeOffset>  m_globalTimeOffsetOut
+    { this, "GlobalTimeOffsetOutKey", "GlobalTimeOffset", "" };
+  SG::WriteHandleKey<LArFEBTimeOffset>  m_febTimeOffsetOut
+    { this, "FebTimeOffsetOutKey", "FebTimeOffset", "" };
+  SG::WriteHandleKey<LArCellTimeOffset>  m_cellTimeOffsetOut
+    { this, "CellTimeOffsetOutKey", "CellTimeOffset", "" };
+  SG::WriteHandleKey<TBPhase>  m_tbPhaseWriteKey
+    { this, "TBPhaseWriteKey", "TBPhase", "" };
 
   short m_AdcCut;
   short m_AdcMax;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuningNtuple.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuningNtuple.h
index 9dd1066393b..d6b40be5b54 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuningNtuple.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArTimeTuningNtuple.h
@@ -12,6 +12,7 @@
 #include "GaudiKernel/INTupleSvc.h"
 #include "GaudiKernel/NTuple.h"
 #include "GaudiKernel/SmartDataPtr.h"
+#include "StoreGate/ReadHandleKey.h"
 #include "LArRawConditions/LArGlobalTimeOffset.h"
 #include "LArRawConditions/LArFEBTimeOffset.h"
 #include "LArRawConditions/LArCellTimeOffset.h"
@@ -29,20 +30,23 @@ class LArTimeTuningNtuple : public AthAlgorithm
 {
  public:
   LArTimeTuningNtuple(const std::string & name, ISvcLocator * pSvcLocator);
-  ~LArTimeTuningNtuple();
+  virtual ~LArTimeTuningNtuple();
 
   //standard algorithm methods
-  StatusCode initialize(); 
-  StatusCode execute();
-  StatusCode stop();
-  StatusCode finalize(){return StatusCode::SUCCESS;}
+  virtual StatusCode initialize() override; 
+  virtual StatusCode execute() override;
+  virtual StatusCode stop() override;
  private:
 
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
   SG::ReadCondHandleKey<LArCalibLineMapping>  m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};
-  std::string m_TBPhaseKey;
-  std::string m_GlobalTimeKey;
-  std::string m_FebTimeKey;
+  SG::ReadHandleKey<TBPhase> m_TBPhaseKey
+    { this, "TBPhaseKey", "", "" };
+  SG::ReadHandleKey<LArGlobalTimeOffset> m_GlobalTimeKey
+    { this, "GlobalTimeOffsetKey", "", "" };
+  SG::ReadHandleKey<LArFEBTimeOffset> m_FebTimeKey
+    { this, "FebTimeOffsetKey", "", "" };
+
   std::string m_CellTimeOffsetKey;
   
   NTuple::Item<float> m_phaseNt;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
index 8442c03ef75..0496182c9f0 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
@@ -12,7 +12,6 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/StoreGateSvc.h"
-#include "StoreGate/DataHandle.h" 
 
 #include "CaloIdentifier/CaloGain.h"
 #include "LArRawConditions/LArWFParams.h"
diff --git a/LArCalorimeter/LArCalibUtils/src/LArAccumulatedCalibDigitContSplitter.cxx b/LArCalorimeter/LArCalibUtils/src/LArAccumulatedCalibDigitContSplitter.cxx
index a871b5ac74c..e5c3770a083 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArAccumulatedCalibDigitContSplitter.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArAccumulatedCalibDigitContSplitter.cxx
@@ -7,7 +7,6 @@
 #include "GaudiKernel/IIncidentSvc.h"
 #include "GaudiKernel/MsgStream.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "LArIdentifier/LArOnlineID.h"
 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveAverage.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveAverage.cxx
index 93f50230f4e..2704b113ce7 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveAverage.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveAverage.cxx
@@ -32,18 +32,19 @@ LArCaliWaveAverage::LArCaliWaveAverage(const std::string& name, ISvcLocator* pSv
 LArCaliWaveAverage::~LArCaliWaveAverage() {}
 
 StatusCode LArCaliWaveAverage::initialize() {
-  const CaloIdManager *caloIdMgr = CaloIdManager::instance();
-  m_emId = caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId = idHelper->em_idHelper();
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not get lar EM ID helper!" );
     return StatusCode::FAILURE;
   }
-  m_fcalId=caloIdMgr->getFCAL_ID();
+  m_fcalId=idHelper->fcal_idHelper();
   if (!m_fcalId) {
     ATH_MSG_ERROR ( "Could not get lar FCAL ID helper" );
     return StatusCode::FAILURE;
   }
-  m_hecId=caloIdMgr->getHEC_ID();
+  m_hecId=idHelper->hec_idHelper();
   if (!m_hecId) {
     ATH_MSG_ERROR ( "Could not get lar HEC ID helper" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
index 7dc3e30788e..faccf5b5dd3 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilderXtalk.cxx
@@ -9,7 +9,6 @@
 
 #include "LArRawConditions/LArWaveHelper.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "Identifier/IdentifierHash.h"
 
 #include "TString.h"
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveSelector.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveSelector.cxx
index 9fd0101ed79..762099e8ac8 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveSelector.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveSelector.cxx
@@ -9,7 +9,6 @@
 
 #include "AthenaKernel/errorcheck.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "CaloIdentifier/CaloGain.h"
@@ -47,11 +46,7 @@ StatusCode LArCaliWaveSelector::initialize()
   if (!m_keyList.size()) { m_keyList.push_back("LArCaliWave"); }
   parseSelection();
 
-  // retrieve CaloMgr
-  const CaloIdManager* caloMgr = nullptr;
-  ATH_CHECK( detStore()->retrieve(caloMgr) );
-
-  m_cellID = caloMgr->getCaloCell_ID();
+  ATH_CHECK( detStore()->retrieve (m_cellID, "CaloCell_ID") );
   if (!m_cellID) {
     ATH_MSG_ERROR ( "Could not access CaloCell_ID helper" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx
index 9baf3033223..18db2b16766 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArCalibDigitMaker.cxx
@@ -8,7 +8,6 @@
 
 #include "xAODEventInfo/EventInfo.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CLHEP/Units/SystemOfUnits.h"
 
 #include "LArRawEvent/LArCalibDigitContainer.h"
@@ -91,6 +90,8 @@ StatusCode LArCalibDigitMaker::execute() {
 
  if (m_dontRun) return StatusCode::SUCCESS;
 
+ const EventContext& ctx = Gaudi::Hive::currentContext();
+
  SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey};
  const LArCalibLineMapping* clcabling{*clHdl};
  if(!clcabling) {
@@ -102,7 +103,7 @@ StatusCode LArCalibDigitMaker::execute() {
  ATH_CHECK( evtStore()->retrieve(thisEventInfo) );
  // Modif J. Labbe from JF. Marchand - Nov. 2009
  //  const unsigned eventNb=thisEventInfo->event_ID()->event_number();
- const unsigned eventNb=(thisEventInfo->eventNumber())&0xffffff ;
+ const unsigned eventNb=(ctx.eventID().event_number())&0xffffff ;
  ATH_MSG_DEBUG ( "======== executing event "<< eventNb << " ========" );
  
  const LArCalibParams* calibParams = nullptr;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
index ba4a6a4ad62..277bc048de8 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArDigitOscillationCorrTool.cxx
@@ -12,7 +12,7 @@
 #include "LArElecCalib/ILArPedestal.h"
 #include "LArElecCalib/ILArH6Oscillation.h"
 #include "LArRawEvent/LArDigitContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 #include <sstream>
 #include <iostream>
@@ -47,10 +47,11 @@ StatusCode LArDigitOscillationCorrTool::initialize()
   
   ATH_CHECK( detStore()->retrieve(m_lar_on_id,"LArOnlineID") );
   
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance();
-  m_emId   = caloIdMgr->getEM_ID();
-  m_fcalId = caloIdMgr->getFCAL_ID();
-  m_hecId  = caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId   = idHelper->em_idHelper();
+  m_fcalId = idHelper->fcal_idHelper();
+  m_hecId  = idHelper->hec_idHelper();
   
   ATH_CHECK( m_cablingKey.initialize() );
   
diff --git a/LArCalorimeter/LArCalibUtils/src/LArDumpShapes.cxx b/LArCalorimeter/LArCalibUtils/src/LArDumpShapes.cxx
index b570e38e1c4..4db34ba9fb1 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArDumpShapes.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArDumpShapes.cxx
@@ -12,10 +12,9 @@
 
 #include "LArCalibUtils/LArDumpShapes.h"
 #include "LArElecCalib/ILArShape.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloGain.h"
 #include "StoreGate/StoreGateSvc.h"
-#include "StoreGate/DataHandle.h"
 #include "AthenaKernel/errorcheck.h"
 #include "TFile.h"
 #include "TH1.h"
@@ -59,7 +58,7 @@ StatusCode LArDumpShapes::execute()
     return StatusCode::SUCCESS;
 
   // Get the shapes from the detector store.
-  const DataHandle<ILArShape> dd_shape;
+  const ILArShape* dd_shape;
   CHECK( detStore()->retrieve (dd_shape) );
 
   SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
@@ -69,7 +68,9 @@ StatusCode LArDumpShapes::execute()
      return StatusCode::FAILURE;
   }
   // Get the calorimeter identifier helper.
-  const LArEM_ID* em_id = CaloIdManager::instance()->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* em_id = idHelper->em_idHelper();
 
   // Open the ROOT file.
   TFile f (m_filename.c_str(), "RECREATE");
diff --git a/LArCalorimeter/LArCalibUtils/src/LArMasterWaveBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArMasterWaveBuilder.cxx
index 2f6e0ca435a..6ba796b5d5c 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArMasterWaveBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArMasterWaveBuilder.cxx
@@ -6,7 +6,7 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "LArRawConditions/LArCaliWaveContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloGain.h"
 
 #include <stdio.h>
@@ -150,8 +150,9 @@ StatusCode LArMasterWaveBuilder::stop()
   }
   ATH_CHECK(  detStore()->retrieve(onlineHelper, "LArOnlineID") );
   
-  const CaloIdManager* caloIdMgr=CaloIdManager::instance();
-  emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  emId = idHelper->em_idHelper();
 
   msg() << MSG::INFO << "Check on ADC saturation: " ;
   if ( m_ADCsatur > 0 ) {
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPedestalInPhysicsMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArPedestalInPhysicsMaker.cxx
index d1ae6ffefe2..4a492c9aefc 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArPedestalInPhysicsMaker.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArPedestalInPhysicsMaker.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
 */
 
 /********************************************************************
@@ -25,7 +25,6 @@
 //#include "GaudiKernel/ListItem.h"
 #include "GaudiKernel/IIncidentSvc.h"
 
-#include "StoreGate/DataHandle.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "xAODEventInfo/EventInfo.h"
 
@@ -101,6 +100,7 @@ StatusCode LArPedestalInPhysicsMaker::initialize()
 StatusCode LArPedestalInPhysicsMaker::execute()
 //---------------------------------------------------------------------------
 {
+  const EventContext& ctx = Gaudi::Hive::currentContext();
   int write=0;
   if (m_keylist.size()==0) {
     ATH_MSG_ERROR ( "Key list is empty! No containers to process!" );
@@ -108,15 +108,8 @@ StatusCode LArPedestalInPhysicsMaker::execute()
   } 
 
   // Retrieve EventInfo
-  const DataHandle<xAOD::EventInfo> thisEventInfo;
-  StatusCode sc=evtStore()->retrieve(thisEventInfo);
-  int eventnumber=0;
-  if (sc!=StatusCode::SUCCESS)
-    ATH_MSG_WARNING ( "No EventInfo object found!" );
-  else {
-    if(m_run==0) m_run=thisEventInfo->runNumber();
-    eventnumber=thisEventInfo->eventNumber();
-  }
+  if(m_run==0) m_run = ctx.eventID().run_number();
+  int eventnumber = ctx.eventID().event_number();
 
 //  // Retrieve the TBScintillators
 // const TBScintillatorCont * theTBScint;
@@ -166,7 +159,7 @@ StatusCode LArPedestalInPhysicsMaker::execute()
 
   //Retrieve the TBTriggerPatternUnit
   const TBTriggerPatternUnit* theTBTriggerPatternUnit;
-  sc = evtStore()->retrieve(theTBTriggerPatternUnit, "TBTrigPat");
+  StatusCode sc = evtStore()->retrieve(theTBTriggerPatternUnit, "TBTrigPat");
   unsigned int trigger=1;
 
   if (sc.isFailure()) {
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhaseToolMC.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhaseToolMC.cxx
index 212fb6b13d2..f798e2e2bf5 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArPhaseToolMC.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArPhaseToolMC.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
 */
 
 // $Id: LArPhaseToolMC.cxx,v 1.1 2006-06-27 18:32:08 ssnyder Exp $
@@ -16,7 +16,6 @@
 #include "LArSimEvent/LArHitContainer.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "StoreGate/DataHandle.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "AthenaKernel/ITriggerTime.h"
 #include "AthenaKernel/errorcheck.h"
@@ -132,7 +131,7 @@ StatusCode LArPhaseToolMC::fill_phases ()
 
   // Scan over all hit containers.
   for (unsigned int icont=0; icont < m_container_names.size(); ++icont) {
-    const DataHandle<LArHitContainer> hit_container;
+    const LArHitContainer* hit_container = nullptr;
     if (evtStore()->retrieve (hit_container,
                               m_container_names[icont]) . isSuccess())
     {
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveBuilder.cxx
index a6ee439f3cf..03918b5072d 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveBuilder.cxx
@@ -15,13 +15,14 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "LArRawEvent/LArDigit.h"
 #include "LArRawEvent/LArDigitContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloGain.h"
 #include "LArRawConditions/LArPhysWaveContainer.h"
 #include "LArRecUtils/LArParabolaPeakRecoTool.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
 #include "LArElecCalib/ILArPhaseTool.h"
 #include "LArElecCalib/ILArPedestal.h"
+#include "StoreGate/ReadHandle.h"
 #include "Identifier/HWIdentifier.h"
 #include "AthenaKernel/errorcheck.h"
 #include "CLHEP/Units/SystemOfUnits.h"
@@ -195,9 +196,6 @@ LArPhysWaveBuilder::LArPhysWaveBuilder (const std::string& name,
 
   /// Algorithm properties.
 
-  // Storegate key for the @c LArDigitContainer of interest.
-  declareProperty("GainCont", m_gainCont = "FREE");
-
   // Number of bins per sample to record.
   declareProperty("BinsPerSample", m_bins_per_sample = 24);
 
@@ -289,6 +287,8 @@ StatusCode LArPhysWaveBuilder::initialize()
     m_hlaymax[i] = new TH1F (buf, buf, 500, 0, 500);
   }
 
+  ATH_CHECK( m_gainCont.initialize() );
+
   return StatusCode::SUCCESS;
 }
 
@@ -298,6 +298,7 @@ StatusCode LArPhysWaveBuilder::initialize()
  */
 StatusCode LArPhysWaveBuilder::execute()
 {
+  const EventContext& ctx = Gaudi::Hive::currentContext();
   ATH_MSG_DEBUG ( "LArPhysWaveBuilder in execute()" );
 
   // Retrieve cabling
@@ -309,11 +310,12 @@ StatusCode LArPhysWaveBuilder::execute()
   }
 
   // Get the identifier helper.
-  const LArEM_ID* emId = CaloIdManager::instance()->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* emId = idHelper->em_idHelper();
 
   // Our input data.
-  const LArDigitContainer* digcontainer =
-    evtStore()->retrieve<const LArDigitContainer> (m_gainCont);
+  SG::ReadHandle<LArDigitContainer> digcontainer (m_gainCont, ctx);
 
   // Get the pedestal information.
   const ILArPedestal* larPedestal =
@@ -323,18 +325,15 @@ StatusCode LArPhysWaveBuilder::execute()
   const LArOnlineID* online_helper =
     detStore()->retrieve<const LArOnlineID> ("LArOnlineID");
 
-  if (!digcontainer || !online_helper) {
+  if (!online_helper) {
     REPORT_ERROR (StatusCode::FAILURE) << "Cannot find storegate inputs";
     return StatusCode::SUCCESS;
   }
 
   // Loop on LArDigits
-  LArDigitContainer::const_iterator iterd = digcontainer->begin();
-  LArDigitContainer::const_iterator iendd = digcontainer->end();
-  for(; iterd != iendd; iterd++) {
+  for (const LArDigit* p_lardigit : *digcontainer) {
 
     // Get data from LArDigit
-    const LArDigit* p_lardigit = *iterd;
     HWIdentifier chid = p_lardigit->hardwareID();  
 
     // Convert the gain from an enum to an index in our tables.
@@ -657,7 +656,9 @@ StatusCode
 LArPhysWaveBuilder::write_root (LArPhysWaveContainer* larPhysWaveContainer)
 {
   // Get ID translators.
-  const LArEM_ID* emId = CaloIdManager::instance()->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* emId = idHelper->em_idHelper();
 
   // Retrieve cabling
   SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx
index f935343acd2..574ca4e3a1c 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx
@@ -6,7 +6,7 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "LArRecConditions/ILArBadChannelMasker.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 #include "LArRawConditions/LArCaliWave.h"
 #include "LArRawConditions/LArCaliWaveContainer.h"
@@ -187,8 +187,9 @@ StatusCode LArPhysWavePredictor::stop()
       return sc;
     }}
 
-  const CaloIdManager *caloIdMgr = CaloIdManager::instance() ;
-  const LArEM_ID* emId = caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* emId = idHelper->em_idHelper();
   if (!emId) {
       ATH_MSG_ERROR( "Could not access lar EM ID helper" );
       return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
index 8bdaac7ec79..2641cd8e0fd 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
@@ -3,7 +3,6 @@
 */
 
 #include "LArCalibUtils/LArRampBuilder.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "LArRawEvent/LArFebErrorSummary.h"
 #include "LArCalibTriggerAccumulator.h"
 #include "LArRawConditions/LArRampComplete.h"
@@ -140,8 +139,10 @@ void LArRampBuilder::chooseRecoMode()  {
     
     if(m_correctBias){
       // if using parabola, get offlineID helper to obtain the layer (needed for correction) 
-      const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-      m_emId=caloIdMgr->getEM_ID();
+      const CaloCell_ID* idHelper = nullptr;
+      if ( detStore()->retrieve (idHelper, "CaloCell_ID").isSuccess() ) {
+        m_emId = idHelper->em_idHelper();
+      }
       if (!m_emId) {
 	ATH_MSG_ERROR( "Could not access lar EM ID helper" );
 	return ;
@@ -300,7 +301,7 @@ StatusCode LArRampBuilder::execute()
       ATH_MSG_WARNING("Cannot remove LArCaliWaveContainer from StoreGate ! ");
       return StatusCode::FAILURE;
     }
-    ATH_MSG_DEBUG("Succefully removed LArCaliWaveContainer from StoreGate ");
+    ATH_MSG_DEBUG("Successfully removed LArCaliWaveContainer from StoreGate ");
     
   } // m_ipassShape
   
diff --git a/LArCalorimeter/LArCalibUtils/src/LArTCMPhysWavePredictor.cxx b/LArCalorimeter/LArCalibUtils/src/LArTCMPhysWavePredictor.cxx
index b5eeb288433..07f59464eee 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArTCMPhysWavePredictor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArTCMPhysWavePredictor.cxx
@@ -10,8 +10,6 @@
 #include "LArRawConditions/LArCaliWaveContainer.h"
 #include "LArRawConditions/LArPhysWaveContainer.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
-
 #include <iostream>
 #include <fstream>
 #include "TFile.h"
@@ -79,10 +77,10 @@ StatusCode LArTCMPhysWavePredictor::stop()
   
   larTCMFitterTool->setminuitoutputlevel(m_minuitoutputlevel);
   
-  const LArEM_ID* emId;
    
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  emId = caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* emId = idHelper->em_idHelper();
   if (!emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
     return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArTimePhysPrediction.cxx b/LArCalorimeter/LArCalibUtils/src/LArTimePhysPrediction.cxx
index e7fe62465b4..2365408c544 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArTimePhysPrediction.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArTimePhysPrediction.cxx
@@ -9,7 +9,6 @@
 #include "LArRawConditions/LArWaveHelper.h"
 #include "CaloDetDescr/CaloDepthTool.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescriptor.h"
@@ -176,7 +175,8 @@ StatusCode LArTimePhysPrediction::stop()
   
   //Calo DDM gives "detector description"
   //including real positions of cells
-  const CaloDetDescrManager* caloDDM = CaloDetDescrManager::instance() ;
+  const CaloDetDescrManager* caloDDM = nullptr;
+  ATH_CHECK( detStore()->retrieve (caloDDM, "CaloMgr") );
   if ( ! caloDDM->isInitialized() )
     {
       ATH_MSG_ERROR
@@ -184,13 +184,12 @@ StatusCode LArTimePhysPrediction::stop()
       return StatusCode::FAILURE;
     }
     
-  //const CaloCell_ID* m_caloCID = m_caloDDM->getCaloCell_ID();
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
+  const CaloCell_ID* caloCID = caloDDM->getCaloCell_ID();
   
   //Get identifiers
-  const LArEM_ID* emId = caloIdMgr->getEM_ID();
-  const LArHEC_ID* hecId = caloIdMgr->getHEC_ID();
-  const LArFCAL_ID* fcalId = caloIdMgr->getFCAL_ID();
+  const LArEM_ID* emId = caloCID->em_idHelper();
+  const LArHEC_ID* hecId = caloCID->hec_idHelper();
+  const LArFCAL_ID* fcalId = caloCID->fcal_idHelper();
   
   //------------------------------------------------------------------------------------------------------------------------------
   //--------------Start to loop on the LArCaliWaveContainer------------------------------------------------------------------------
diff --git a/LArCalorimeter/LArCalibUtils/src/LArTimeTuning.cxx b/LArCalorimeter/LArCalibUtils/src/LArTimeTuning.cxx
index 1aa9583f09b..42c69bb8ca6 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArTimeTuning.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArTimeTuning.cxx
@@ -6,6 +6,8 @@
 
 #include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
 
 #include "LArRawEvent/LArDigitContainer.h"
 #include "TBEvent/TBPhase.h"
@@ -30,7 +32,6 @@ using CLHEP::megahertz;
 LArTimeTuning::LArTimeTuning (const std::string& name, ISvcLocator* pSvcLocator):
   AthAlgorithm(name, pSvcLocator),
   m_onlineHelper(0),
-  m_DataLocation("FREE"),
   m_AdcCut(1300),
   m_AdcMax(4095),
   m_Nevents(0),
@@ -45,8 +46,6 @@ LArTimeTuning::LArTimeTuning (const std::string& name, ISvcLocator* pSvcLocator)
   m_gain(),
   m_scope(GLOBAL)
 {
-  declareProperty("DataLocation", m_DataLocation );
-  
   declareProperty("ADCCut", m_AdcCut );
   declareProperty("ADCMax", m_AdcMax );
   
@@ -68,10 +67,6 @@ LArTimeTuning::LArTimeTuning (const std::string& name, ISvcLocator* pSvcLocator)
   declareProperty("CorrectionSign",     m_corrSign = +1);
   declareProperty("GainSelection",      m_gainSel  = "NO");
   declareProperty("LayerSelection",     m_layerSel = -1  );
-  //StoreGateKeys
-  declareProperty("GlobalTimeOffsetOutKey",m_globalTimeOffsetOut = "GlobalTimeOffset");
-  declareProperty("FebTimeOffsetOutKey",   m_febTimeOffsetOut    = "FebTimeOffset");
-  declareProperty("CellTimeOffsetOutKey",  m_cellTimeOffsetOut   = "CellTimeOffset");
 }
 
 LArTimeTuning::~LArTimeTuning() 
@@ -82,8 +77,9 @@ StatusCode LArTimeTuning::initialize(){
 
   ATH_CHECK( m_cablingKey.initialize() );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId = caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId = idHelper->em_idHelper();
   if (!m_emId) {
     ATH_MSG_ERROR ( "Could not access lar EM ID helper" );
     return StatusCode::FAILURE;
@@ -134,7 +130,14 @@ StatusCode LArTimeTuning::initialize(){
   ATH_MSG_INFO ( " *** Sampling Periode Limits: ( " << m_SamplingPeriodeLowerLimit
                  << ", " << m_SamplingPeriodeUpperLimit << " ) ns" );
   
-  m_nIterAverage = 0 ; 
+  m_nIterAverage = 0 ;
+
+  ATH_CHECK( m_DataLocation.initialize() );
+  ATH_CHECK( m_tbPhaseReadKey.initialize (m_scope != PHASE) );
+  ATH_CHECK( m_globalTimeOffsetOut.initialize (m_scope == GLOBAL) );
+  ATH_CHECK( m_febTimeOffsetOut.initialize (m_scope == FEB) );
+  ATH_CHECK( m_cellTimeOffsetOut.initialize (m_scope == FEB) );
+  ATH_CHECK( m_tbPhaseWriteKey.initialize (m_scope == CELL) );
 
   return StatusCode::SUCCESS;
 }
@@ -142,14 +145,12 @@ StatusCode LArTimeTuning::initialize(){
 
 
 StatusCode LArTimeTuning::execute() {
+  const EventContext& ctx = Gaudi::Hive::currentContext();
   m_Nevents++;
 
-  const LArDigitContainer* larDigitContainer=NULL;
   const ILArPedestal* larPedestal;
   const ILArOFC* larOFC;
   
-  TBPhase *theTBPhase;
-
   LArGlobalTimeOffset *larGlobalTimeOffset;
   LArGlobalTimeOffset *larGlobalTimeOffset_corr;
   
@@ -170,7 +171,7 @@ StatusCode LArTimeTuning::execute() {
   std::map<HWIdentifier,double> cellTimeOffset;
 
   // DigitContainer
-  ATH_CHECK( evtStore()->retrieve(larDigitContainer,m_DataLocation) );
+  SG::ReadHandle<LArDigitContainer> larDigitContainer (m_DataLocation, ctx);
   
   ATH_CHECK( detStore()->retrieve(larPedestal) );
   ATH_CHECK( detStore()->retrieve(larOFC) );
@@ -182,8 +183,9 @@ StatusCode LArTimeTuning::execute() {
   }
 
   if (m_scope==GLOBAL) {
-    larGlobalTimeOffset_corr = new LArGlobalTimeOffset();
-    ATH_CHECK( evtStore()->record(larGlobalTimeOffset_corr,m_globalTimeOffsetOut) );
+    auto larGlobalTimeOffset_p = std::make_unique<LArGlobalTimeOffset>();
+    larGlobalTimeOffset_corr = larGlobalTimeOffset_p.get();
+    ATH_CHECK( SG::makeHandle (m_globalTimeOffsetOut, ctx).record (std::move (larGlobalTimeOffset_p)) );
   }
   else
     larGlobalTimeOffset_corr = &dummyGlobalTimeOffset;
@@ -196,16 +198,17 @@ StatusCode LArTimeTuning::execute() {
 
   if (m_scope==FEB) {
     //Get Feb to Feb Time Offset
-    larFebTimeOffset_corr = new LArFEBTimeOffset();
-    ATH_CHECK( evtStore()->record(larFebTimeOffset_corr,m_febTimeOffsetOut) );
+    auto larFebTimeOffset_p = std::make_unique<LArFEBTimeOffset>();
+    larFebTimeOffset_corr = larFebTimeOffset_p.get();
+    ATH_CHECK( SG::makeHandle (m_febTimeOffsetOut, ctx).record (std::move (larFebTimeOffset_p)) );
   }
   else
     larFebTimeOffset_corr = &dummyFebTimeOffset;
 
   if (m_scope!=PHASE) {
-    //Get TB TDC Phase    
-    sc = evtStore()->retrieve(theTBPhase,"TBPhase");
-    if (sc.isFailure()) {
+    //Get TB TDC Phase
+    SG::ReadHandle<TBPhase> theTBPhase (m_tbPhaseReadKey, ctx);
+    if (!theTBPhase.isValid()) {
       // this should be only a 'warning', since TBPhase can miss due to Guard Cut...
       ATH_MSG_WARNING ( "cannot allocate TBPhase with key <TBPhase>. Exiting.");
       if (m_scope==GLOBAL) {
@@ -250,18 +253,15 @@ StatusCode LArTimeTuning::execute() {
     err_timePeak = 0;
     err_Peak     = 0;
     
-    LArDigitContainer::const_iterator cell_it=larDigitContainer->begin();
-    LArDigitContainer::const_iterator cell_it_e=larDigitContainer->end();
-    
     //Loop over all cells
-    for (;cell_it!=cell_it_e;cell_it++) {
+    for (const LArDigit* digit : *larDigitContainer) {
       
       int OFCTimeBin=0;
       
-      const std::vector<short>& samples=(*cell_it)->samples();
+      const std::vector<short>& samples=digit->samples();
       const unsigned nSamples=samples.size(); 
-      const HWIdentifier chid=(*cell_it)->channelID();
-      const CaloGain::CaloGain gain=(*cell_it)->gain();
+      const HWIdentifier chid=digit->channelID();
+      const CaloGain::CaloGain gain=digit->gain();
       const HWIdentifier febid=m_onlineHelper->feb_Id(chid);
 
       if ( m_layerSel >=0 ) {
@@ -426,7 +426,7 @@ StatusCode LArTimeTuning::execute() {
       ATH_MSG_DEBUG ( "Channel: " << MSG::hex << chid.get_compact() << MSG::dec 
                       << " - TimeOffsetSum = " << timeOffsetSum 
                       << " - TimeSampleShift = " << timeSampleShift << " timeOffsetSteps=" <<timeOffsetSteps 
-                      << " Corr: " << tauPeak/ADCPeak << " Peak=" << (int)ADCPeak << " G=" << (*cell_it)->gain() );
+                      << " Corr: " << tauPeak/ADCPeak << " Peak=" << (int)ADCPeak << " G=" << digit->gain() );
 
       //remaining error (for loop conditions)
       err_Peak     += ADCPeak;
@@ -524,10 +524,8 @@ StatusCode LArTimeTuning::execute() {
     
     if(m_scope==PHASE) { 
        const short phaseIndex=(int)round(phaseTime/m_NOFCTimeBins);
-       TBPhase* thePhase=new TBPhase(phaseTime,phaseIndex);
-       sc=evtStore()->record(thePhase,"TBPhase");
-       if (sc.isFailure())
- 	 ATH_MSG_ERROR ( "Could not record TBPhase with key 'TBPhase' to StoreGate" );
+       auto thePhase = std::make_unique<TBPhase>(phaseTime,phaseIndex);
+       ATH_CHECK( SG::makeHandle(m_tbPhaseWriteKey, ctx).record (std::move (thePhase)) );
     }     
     else if (m_scope==CELL) { //Fill cell time offset map member variable
       WeightedAverageMAP::const_iterator it=CellTimeMap.begin();
@@ -549,7 +547,7 @@ StatusCode LArTimeTuning::execute() {
 StatusCode LArTimeTuning::stop()
 {
  if (m_scope==CELL) {
-   LArCellTimeOffset *cellTimeOffset=new LArCellTimeOffset();
+   auto cellTimeOffset = std::make_unique<LArCellTimeOffset>();
    WeightedAverageMAP::const_iterator it=m_CellTimeAverage.begin();
    WeightedAverageMAP::const_iterator it_e=m_CellTimeAverage.end();
    for (;it!=it_e;it++) {
@@ -557,9 +555,7 @@ StatusCode LArTimeTuning::stop()
      ATH_MSG_DEBUG ( "Ch = " << std::hex << it->first.get_compact() << std::dec
                      << " Time = " << cellTimeOffset->TimeOffset(it->first) );
    }
-   StatusCode sc=evtStore()->record(cellTimeOffset,m_cellTimeOffsetOut);
-   if (sc.isFailure())
-     ATH_MSG_ERROR ( "Could not record LArCellTimeOffset with key '" << m_cellTimeOffsetOut << "' to StoreGate" );
+   ATH_CHECK( SG::makeHandle(m_cellTimeOffsetOut).record (std::move (cellTimeOffset)) );
 
  }
  
diff --git a/LArCalorimeter/LArCalibUtils/src/LArTimeTuningNtuple.cxx b/LArCalorimeter/LArCalibUtils/src/LArTimeTuningNtuple.cxx
index b424a5a7cae..e4712138d93 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArTimeTuningNtuple.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArTimeTuningNtuple.cxx
@@ -4,16 +4,14 @@
 
 #include "LArCalibUtils/LArTimeTuningNtuple.h"
 #include "CaloIdentifier/LArEM_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
+#include "StoreGate/ReadHandle.h"
 
 LArTimeTuningNtuple::LArTimeTuningNtuple (const std::string& name, ISvcLocator* pSvcLocator):
   AthAlgorithm(name, pSvcLocator),
   m_ntuplePtr(0),
   m_larOnlineHelper(0)
 {
-  declareProperty("TBPhaseKey",m_TBPhaseKey="");
-  declareProperty("GlobalTimeOffsetKey",m_GlobalTimeKey="");
-  declareProperty("FebTimeOffsetKey",m_FebTimeKey="");
   declareProperty("CellTimeOffsetKey",m_CellTimeOffsetKey);
 }
 
@@ -34,13 +32,13 @@ StatusCode LArTimeTuningNtuple::initialize(){
     ATH_MSG_ERROR ( "Booking of NTuple failed" );
     return StatusCode::FAILURE;
   }
-  if (m_GlobalTimeKey.length()>0) {
+  if (!m_GlobalTimeKey.empty()) {
     ATH_CHECK( nt->addItem("GlobalTimeOffset",m_globalTimeNt,-100.0,100.0) );
   }
-  if (m_TBPhaseKey.length()) {
+  if (!m_TBPhaseKey.empty()) {
     ATH_CHECK( nt->addItem("PhaseTimeOffset",m_phaseNt,-100.0,100.0) );
   }
-  if (m_FebTimeKey.length()) {
+  if (!m_FebTimeKey.empty()) {
     ATH_CHECK( nt->addItem("FebIndex",m_nFebNt,0,1500) );
     ATH_CHECK( nt->addItem("FebTimeOffset",m_nFebNt,m_febTimeNt) );
     ATH_CHECK( nt->addItem("FebSlot",m_nFebNt,m_febSlotNt) );
@@ -48,7 +46,7 @@ StatusCode LArTimeTuningNtuple::initialize(){
     ATH_CHECK( nt->addItem("FebID",m_nFebNt,m_febIDNt) );
   }
   
-  if (m_CellTimeOffsetKey.length()) {
+  if (!m_CellTimeOffsetKey.empty()) {
     ATH_CHECK( nt->addItem("CellIndex",m_nCellNt,0,1500) );
     ATH_CHECK( nt->addItem("CellTimeOffset",m_nCellNt,m_cellTimeNt) );
     ATH_CHECK( nt->addItem("CellSlot",m_nCellNt,m_cellSlotNt) );
@@ -62,7 +60,12 @@ StatusCode LArTimeTuningNtuple::initialize(){
     ATH_CHECK( nt->addItem("CellChannel",m_nCellNt,m_cellChannelNt) );
     ATH_CHECK( nt->addItem("CellCalibLine",m_nCellNt,m_cellCalibLineNt) );
   }
-  
+
+
+  ATH_CHECK( m_GlobalTimeKey.initialize (SG::AllowEmpty) );
+  ATH_CHECK( m_TBPhaseKey.initialize (SG::AllowEmpty) );
+  ATH_CHECK( m_FebTimeKey.initialize (SG::AllowEmpty) );
+
   m_ntuplePtr=nt;
 
   ATH_CHECK( m_cablingKey.initialize() );
@@ -73,41 +76,34 @@ StatusCode LArTimeTuningNtuple::initialize(){
 
 
 StatusCode LArTimeTuningNtuple::execute()
-{  
-  if (m_GlobalTimeKey.length()>0) {
-    const LArGlobalTimeOffset* larGlobalTimeOffset;
-    StatusCode sc=evtStore()->retrieve(larGlobalTimeOffset,m_GlobalTimeKey);
-    if (sc.isSuccess()) {
-      m_globalTimeNt=larGlobalTimeOffset->TimeOffset();
-      //std::cout << "Global Time Offset= " << m_globalTimeNt << std::endl;
-    }
-    else {
-      ATH_MSG_WARNING ( "Could not retrieve LArGlobalTimeOffset with key '" << m_GlobalTimeKey << "'" );
-      m_globalTimeNt=-999;
-    }
+{
+  const EventContext& ctx = Gaudi::Hive::currentContext();
+  if (!m_GlobalTimeKey.empty()) {
+    SG::ReadHandle<LArGlobalTimeOffset> larGlobalTimeOffset
+      (m_GlobalTimeKey, ctx);
+    m_globalTimeNt = larGlobalTimeOffset->TimeOffset();
+    //std::cout << "Global Time Offset= " << m_globalTimeNt << std::endl;
+  }
+  else {
+    m_globalTimeNt = -1;
   }
   
-  if (m_TBPhaseKey.length()>0) {
-    const TBPhase* tbPhase;
-    StatusCode sc=evtStore()->retrieve(tbPhase,m_TBPhaseKey);
-    if (sc.isSuccess()) 
-      m_phaseNt=tbPhase->getPhase();
-    else {
-      ATH_MSG_WARNING ( "Could not retrieve TBPhase with key '" << m_TBPhaseKey << "'" );
-      m_phaseNt=-999;
-    }  
+  if (!m_TBPhaseKey.empty()) {
+    SG::ReadHandle<TBPhase> tbPhase (m_TBPhaseKey, ctx);
+    m_phaseNt = tbPhase->getPhase();
+  }
+  else {
+    m_phaseNt = -999;
   }
     
-  if (m_FebTimeKey.length()>0) {
-    LArFEBTimeOffset* larFebTimeOffset;
-    StatusCode sc=evtStore()->retrieve(larFebTimeOffset,m_FebTimeKey);
-    if (sc.isSuccess() && larFebTimeOffset->size()>0) {
-      larFebTimeOffset->setDefaultReturnValue(-999);
+  if (!m_FebTimeKey.empty()) {
+    SG::ReadHandle<LArFEBTimeOffset> larFebTimeOffset (m_FebTimeKey, ctx);
+    if (larFebTimeOffset->size()>0) {
       std::vector<HWIdentifier>::const_iterator it=m_larOnlineHelper->feb_begin();
       std::vector<HWIdentifier>::const_iterator it_e=m_larOnlineHelper->feb_end();
       m_nFebNt=0;
       for (;it!=it_e;it++) {
-	m_febTimeNt[m_nFebNt] = larFebTimeOffset->TimeOffset(*it);
+	m_febTimeNt[m_nFebNt] = larFebTimeOffset->TimeOffset(*it, -999);
 	m_febSlotNt[m_nFebNt] = m_larOnlineHelper->slot(*it);
 	m_febFTNt[m_nFebNt]   = m_larOnlineHelper->feedthrough(*it);
 	m_febIDNt[m_nFebNt]   = (*it).get_identifier32().get_compact();
@@ -125,9 +121,9 @@ StatusCode LArTimeTuningNtuple::execute()
 
 StatusCode LArTimeTuningNtuple::stop(){
 
-  const LArEM_ID* emId;
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  const LArEM_ID* emId = idHelper->em_idHelper();
   if (!emId) {
     ATH_MSG_ERROR ( "Could not get lar EM ID helper" );
     return StatusCode::FAILURE;
-- 
GitLab


From 39493bfc1e119f006bac40c95c9af10921e6d63f Mon Sep 17 00:00:00 2001
From: Alexander Solodkov <Sanya.Solodkov@cern.ch>
Date: Tue, 5 Mar 2019 23:23:51 +0100
Subject: [PATCH 254/404] updating jobOptions for 2019 data

---
 .../TileRecEx/share/jobOptions_TileTBDump.py        | 13 +++----------
 .../TileRecEx/share/jobOptions_TileTBStat.py        | 13 +++----------
 2 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
index 69b384fb9ac..4fbada33a36 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBDump.py
@@ -110,8 +110,10 @@ if not 'InputDirectory' in dir():
             Year = 2016
         elif RunNumber < 342540:
             Year = 2017
-        else:
+        elif RunNumber < 367980:
             Year = 2018
+        else:
+            Year = 2019
 
 
         if 'RunStream' in dir():
@@ -297,15 +299,6 @@ tileInfoConfigurator.OutputLevel = OutputLevel
 
 from AthenaCommon.AppMgr import ToolSvc
 from TileConditions.TileCondToolConf import *
-if TileLasPulse:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','LAS')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'LAS')
-elif TileCisPulse:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','CIS')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'CIS')
-else:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','PHY')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'PHY')
 
 print tileInfoConfigurator
 
diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
index 991aeb5e1bc..741868998ab 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileTBStat.py
@@ -111,8 +111,10 @@ if not 'InputDirectory' in dir():
             Year = 2016
         elif RunNumber < 342540:
             Year = 2017
-        else:
+        elif RunNumber < 367980:
             Year = 2018
+        else:
+            Year = 2019
 
 
         if 'RunStream' in dir():
@@ -300,15 +302,6 @@ tileInfoConfigurator.OutputLevel = OutputLevel
 
 from AthenaCommon.AppMgr import ToolSvc
 from TileConditions.TileCondToolConf import *
-if TileLasPulse:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','LAS')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'LAS')
-elif TileCisPulse:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','CIS')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'CIS')
-else:
-    tileInfoConfigurator.TileCondToolTiming = getTileCondToolTiming( 'COOL','PHY')
-    ToolSvc += getTileCondToolOfcCool('COOL', 'PHY')
 
 print tileInfoConfigurator
 
-- 
GitLab


From 51fcc33d183883c169532451c098e81bbdd258a5 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 6 Mar 2019 00:05:48 +0100
Subject: [PATCH 255/404] ByteStreamTest: Update reference file.

Fix test failure in master.
---
 .../share/ByteStreamTestMetaWrite.ref         | 121 +++++++++---------
 1 file changed, 61 insertions(+), 60 deletions(-)

diff --git a/Event/ByteStreamTest/share/ByteStreamTestMetaWrite.ref b/Event/ByteStreamTest/share/ByteStreamTestMetaWrite.ref
index cfea0267456..2cc12cacd92 100644
--- a/Event/ByteStreamTest/share/ByteStreamTestMetaWrite.ref
+++ b/Event/ByteStreamTest/share/ByteStreamTestMetaWrite.ref
@@ -18,18 +18,19 @@ AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ByteStreamInputSvc  DEBUG Recorded ByteStreamMetadata in InputMetadataStore
 ByteStreamInputSvc  DEBUG  run parameters  =  
 ByteStreamInputSvc  DEBUG Number of Free meta data strings: 0
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1038508
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17506000
 ByteStreamInputSvc  DEBUG switched to next event in slot INVALID
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 1324
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
+ByteStreamEvent...   INFO No ByteStreamMetadata in InputMetaDataStore
 ByteStreamAttLi...   INFO ByteStreamAttListMetadataSvc::toBSMetadata
 ByteStreamAttLi...   INFO Found RunEventTag in DetectorStore
 ByteStreamAttLi...  DEBUG  name RunNumber type unsigned int value 88
@@ -40,229 +41,229 @@ ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1000648
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d12000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17604000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 0
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 1039848
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 965292
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17506000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 1
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 2040512
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1014472
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x18146000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x178b6000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 2
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 3005820
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1104432
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 3
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 4020308
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1037592
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d22000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17ba4000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 4
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 5124756
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1045524
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 5
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 6162364
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1126828
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17b96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 6
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 7207904
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1074584
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17e28000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17506000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 7
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 8334748
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1361908
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17922000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 8
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 9409348
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1168392
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d62000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 9
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 10771272
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1052428
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17bb4000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 10
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 11939680
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1103056
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d16000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 11
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 12992124
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1110836
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17e24000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17ba4000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 12
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 14095196
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1058732
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 13
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 15206048
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1156428
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d18000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17b9a000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 14
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 16264796
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1093640
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17e34000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17506000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 15
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 17421240
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1149620
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17934000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 16
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 18514896
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1051544
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17d2e000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17a96000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 17
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 19664532
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG nextEvent _above_ high water mark
 ByteStreamInputSvc  DEBUG Event Size 1050384
 ByteStreamInputSvc  DEBUG First word of the fragment aa1234aa
 ByteStreamInputSvc  DEBUG Format version 500
-ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17c14000
+ByteStreamInputSvc  DEBUG Made an FullEventFragment from ES 0x17b98000
 ByteStreamInputSvc  DEBUG switched to next event in slot s: 0  e: 18
 ByteStreamInputSvc  DEBUG ByteStream File GUID:1C43C4AA-2555-E711-BB1F-02163E01794D
 ByteStreamInputSvc  DEBUG ByteStream Event Position in File: 20716092
 StoreDump            INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> 
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bce940 --- key: RunEventTag
- flags: (  valid, UNLOCKED,  reset) --- data: 0x17bcc320 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x174afa90 --- key: RunEventTag
+ flags: (  valid, UNLOCKED,  reset) --- data: 0x1737cc10 --- key: RunEventTag
 StoreDump            INFO AttributeList has size 2
 ByteStreamInputSvc  DEBUG Calling ByteStreamInputSvc::stop()
 ByteStreamEvent...   INFO number of events written: 20
-- 
GitLab


From 2f7b4e024fb3192ca769b50bcd58d726d0819674 Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <john.kenneth.anders@cern.ch>
Date: Tue, 5 Mar 2019 16:44:40 +0000
Subject: [PATCH 256/404] Merge branch '21.0-HijingEventParsStreamFix' into
 '21.0'

21.0 SimulationJobOptions: Fix in postInclude.HijingPars.py to get output streams from correct locations

See merge request atlas/athena!21587

(cherry picked from commit dce5a7f322edfa943b8a7f000298af2716b4dc95)

6ed93445 Fix in postInclude.HijingPars.py to get output streams from correct locations:
---
 .../share/heavyIons/postInclude.HijingPars.py         | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py b/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py
index 1bbfad8d37e..63306936398 100644
--- a/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py
+++ b/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py
@@ -39,7 +39,10 @@ else:
 streamAlgs = ['StreamHITS','StreamRDO','StreamESD','StreamAOD']
 streamSeq = AlgSequence("Streams")
 for stream in streamAlgs:
-    outStream =  getattr(streamSeq, stream, None)
-    if outStream is not None:
-        outStream.ItemList += [ "HijingEventParams#Hijing_event_params" ]
-
+    sSoutStream = getattr(streamSeq, stream, None)
+    tSoutStream = getattr(topSequence, stream, None)
+    if tSoutStream is not None:
+        tSoutStream.ItemList += [ "HijingEventParams#Hijing_event_params" ]
+    else:
+        if sSoutStream is not None:
+            sSoutStream.ItemList += [ "HijingEventParams#Hijing_event_params" ]
-- 
GitLab


From dc163a86c0903575f1747c3df46a8d273cbe8120 Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <john.kenneth.anders@cern.ch>
Date: Tue, 5 Mar 2019 16:45:16 +0000
Subject: [PATCH 257/404] Merge branch 'overlay_HI2018PbPb' into '21.0'

2018PbPb overlay config update

See merge request atlas/athena!21577

(cherry picked from commit 379c2297b84cb3798147cacd24b2cbb9760230b2)

5969c627 2018PbPb overlay config update
---
 .../share/Rt_override_OFLCOND-MC16-SDR-26.py  | 224 +++++++++++++++++
 ...verride_OFLCOND-MC16-SDR-26_folders100M.py | 236 ++++++++++++++++++
 .../share/blockFoldersHI_ESDtoAOD.py          |   3 +
 .../share/blockFoldersHI_OverlayBS.py         |   3 +
 .../share/muAlign_HI2018Pb_reco.py            |  44 ++++
 5 files changed, 510 insertions(+)
 create mode 100644 Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
 create mode 100644 Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
 create mode 100644 Event/EventOverlay/EventOverlayJobTransforms/share/muAlign_HI2018Pb_reco.py

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
new file mode 100644
index 00000000000..2f77f1bc325
--- /dev/null
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
@@ -0,0 +1,224 @@
+from IOVDbSvc.CondDB import conddb
+from AthenaCommon.DetFlags import DetFlags
+from RecExConfig.RecAlgsFlags import recAlgs
+########################################
+
+#use MC MDT RT functions
+#conddb.blockFolder("/MDT/RT")
+#conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True)
+conddb.blockFolder("/MDT/RTBLOB")
+conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True)
+
+#from Guillaume
+conddb.blockFolder("/LAR/LArCellPositionShift");
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
+conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
+svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
+
+conddb.blockFolder("/PIXEL/ReadoutSpeed")
+conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True)
+
+conddb.blockFolder("/TRT/Cond/DigVers")
+conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True)
+
+
+###################################################
+print "RT OVERRIDE, for OFLCOND-MC16-SDR-26 MC condition tag "
+#See https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/rBR_CB_Report.php?CBAction=GlobalTagReport&cbgt=OFLCOND-MC16-SDR-26
+# https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/rBR_CB_Report.php?CBAction=GlobalTagReport&cbgt=CONDBR2-BLKPA-2018-12
+
+conddb.blockFolder("/LAR/BadChannels/BadChannels");
+conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels");
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True);
+conddb.blockFolder("/LAR/BadChannels/MissingFEBs");
+conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs");
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True)
+
+if not "EOJT_alignMC" in globals():
+    print "EOJT_alignMC not found in globals(), so aligning ID to data conditions"
+    #conddb.blockFolder("/TRT/Align")
+    #conddb.addFolderWithTag("TRT_OFL","/TRT/Align","TRTAlign-RUN2-BLK-UPD4-10",force=True,forceData=True)
+    #conddb.blockFolder("/LAR/Align")
+    #conddb.addFolderWithTag("LAR_ONL","/LAR/Align","LARAlign-RUN2-UPD4-02",force=True,forceData=True)
+    #conddb.blockFolder("/Indet/Align")
+    #conddb.addFolderWithTag("INDET_OFL","/Indet/Align","InDetAlign-RUN2-BLK-UPD4-13",force=True,forceData=True)
+else:
+    print "EOJT_alignMC found in globals(), so aligning ID to MC conditions"
+    conddb.blockFolder("/TRT/Align")
+    conddb.addFolderWithTag("TRT_OFL","/TRT/Align","TRTAlign-RUN2-BLK-UPD4-13",force=True,forceMC=True)
+    conddb.blockFolder("/LAR/Align")
+    conddb.addFolderWithTag("LAR_OFL","/LAR/Align","LARAlign-RUN2-UPD4-03",force=True,forceMC=True)
+    conddb.blockFolder("/Indet/Align")
+    conddb.addFolderWithTag("INDET_OFL","/Indet/Align","InDetAlign-RUN2-BLK-UPD4-16",force=True,forceMC=True) #InDetAlign_IOVDEP-03
+
+#to set beam spot from MC
+#conddb.blockFolder("/Indet/Beampos")
+#conddb.addFolderWithTag("INDET_OFL","/Indet/Beampos","IndetBeampos-RunDep-MC15-BestKnowledge-002",force=True,forceMC=True)
+
+#to run overlay chain with trigger                      
+if (hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE") or (hasattr(recAlgs,'doTrigger') and recAlgs.doTrigger() and DetFlags.LVL1_on()):
+    print "running with trigger  " 
+    conddb.addOverride("/GLOBAL/Onl/BTagCalib/RUN12","BTagCalibRUN12Onl-08-40")
+else:
+    print "running with no trigger  "
+
+if DetFlags.writeRDOPool.pixel_on():
+    conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco")
+
+conddb.blockFolder("/PIXEL/PixdEdx")
+conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True)
+mcIDoverlay=False
+if mcIDoverlay:
+    print "ACH777: Using MC overlay Lorentz DB settings"
+    conddb.blockFolder("/PIXEL/DCS/HV")
+    conddb.addFolderWithTag("DCS_OFL","/PIXEL/DCS/HV","PixDCSHV-SIM-MC16-000-07",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/DCS/TEMPERATURE")
+    conddb.addFolderWithTag("DCS_OFL","/PIXEL/DCS/TEMPERATURE","PixDCSTemp-SIM-MC16-000-09",force=True,forceMC=True)
+    conddb.blockFolder("/SCT/DCS/HV")
+    conddb.addFolderWithTag("DCS_OFL","/SCT/DCS/HV","SctDcsHv-MC16",force=True,forceMC=True)
+    conddb.blockFolder("/SCT/DCS/MODTEMP")
+    conddb.addFolderWithTag("DCS_OFL","/SCT/DCS/MODTEMP","SctDcsModtemp-MC16",force=True,forceMC=True)
+mcIDoverlay2=False
+if mcIDoverlay2:
+    print "ACH777: Using more MC overlay ID DB settings"
+    conddb.blockFolder("/Indet/PixelDist")
+    conddb.addFolderWithTag("INDET_OFL","/Indet/PixelDist","InDetPixelDist-nominal",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/PixelClustering/PixelClusNNCalib")
+    conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixelClustering/PixelClusNNCalib","PixelClusNNCalib-SIM-RUN12-000-06",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/LorentzAngleScale")
+    conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/LorentzAngleScale","PixLorentzAngleScale-SIM-RUN124-000-00",force=True,forceMC=True)
+
+conddb.blockFolder("/MUONALIGN/MDT/BARREL")
+conddb.blockFolder("/MUONALIGN/MDT/ENDCAP/SIDEA")
+conddb.blockFolder("/MUONALIGN/MDT/ENDCAP/SIDEC")
+conddb.blockFolder("/MUONALIGN/TGC/SIDEA")
+conddb.blockFolder("/MUONALIGN/TGC/SIDEC")
+
+#use updated muon alignments
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/BARREL","MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_09-BLKP-UPD4-00",force=True,forceData=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/ENDCAP/SIDEA","MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_02_01-UPD4-02",force=True,forceData=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/ENDCAP/SIDEC","MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_02_01-UPD4-02",force=True,forceData=True)
+    
+#the TGC alignments had overlap issues... caused G4 crash
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndCapAAlign-0001-DEFAULT",force=True,forceMC=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True)
+
+conddb.blockFolder("/SCT/DAQ/Config/Chip")
+conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True)
+conddb.blockFolder("/SCT/DAQ/Config/Module")
+conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True)
+
+dofolderoverrides = True
+runN=365681
+lumiBlock=500
+if dofolderoverrides:
+	print "ACH - overriding folder access patterns"
+	conddb.dumpFolderTags('myconddb.txt',True)
+
+overlaylongfolders = []
+def setrunforfolder(name):
+	if conddb.folderRequested(name):
+            print "setting run to "+str(runN)+" and lumiblock "+str(lumiBlock)
+            frnTag="<forceRunNumber>"+str(runN)+"</forceRunNumber>"
+            flbTag="<forceLumiblockNumber>"+str(lumiBlock)+"</forceLumiblockNumber>"
+            conddb.addMarkup(name,frnTag)
+            conddb.addMarkup(name,flbTag)
+            global overlaylongfolders
+            overlaylongfolders += [name]
+
+if dofolderoverrides:
+	setrunforfolder("/CALO/CaloSwClusterCorrections/calhits")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/clcon")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/deadOTXback")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/deadOTXps")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/etamod")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/etaoff")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/gap")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/larupdate")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/lwc")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/phimod")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/phioff")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/rfac")
+	setrunforfolder("/CALO/CaloSwClusterCorrections/trcorr")
+	setrunforfolder("/CALO/H1Weights/H1WeightsCone4Topo")
+	setrunforfolder("/CALO/Identifier/CaloTTOnAttrIdMapAtlas")
+	setrunforfolder("/CALO/Identifier/CaloTTOnOffIdMapAtlas")
+	setrunforfolder("/CALO/Identifier/CaloTTPpmRxIdMapAtlas")
+	setrunforfolder("/CALO/JetCalib/EtaMassEnergyCorr")
+	setrunforfolder("/CALO/JetCalib/JetPropertyInvertResponseTool")
+	setrunforfolder("/CALO/JetCalib/MCNumInversionResponse")
+	setrunforfolder("/CALO/JetCalib/OffsetCorrection")
+	setrunforfolder("/CALO/JetCalib/TrackAngularCorrection")
+	setrunforfolder("/CALO/JetCalib/TrackBasedResponseCorrection")
+	setrunforfolder("/CALO/Ofl/Pedestal/CellPedestal")
+	setrunforfolder("/CALO/Pedestal/CellPedestal")
+	setrunforfolder("/CSC/PSLOPE")
+	setrunforfolder("/CSC/RMS")
+	setrunforfolder("/CSC/T0BASE")
+	setrunforfolder("/CSC/T0PHASE")
+	setrunforfolder("/GLOBAL/DETSTATUS/DEFECTLOGIC")
+	setrunforfolder("/Indet/TrkErrorScaling")
+	setrunforfolder("/LAR/CellCorrOfl/deadOTX")
+	setrunforfolder("/LAR/ElecCalibOfl/LArPileupShape")
+	setrunforfolder("/MDT/CABLING/MAP_SCHEMA")
+	setrunforfolder("/MDT/CABLING/MEZZANINE_SCHEMA")
+	setrunforfolder("/MUONALIGN/MDT/ASBUILTPARAMS")
+	setrunforfolder("/MUONALIGN/TGC/SIDEA")
+	setrunforfolder("/MUONALIGN/TGC/SIDEC")
+	setrunforfolder("/PIXEL/LorentzAngleScale")
+	setrunforfolder("/PIXEL/NoiseMapLong")
+	setrunforfolder("/PIXEL/PixMapLong")
+	setrunforfolder("/PIXEL/PixMapShort")
+	setrunforfolder("/PIXEL/PixdEdx")
+	setrunforfolder("/PIXEL/PixelClustering/PixelClusNNCalib")
+	setrunforfolder("/PIXEL/PixelClustering/PixelCovCorr")
+	setrunforfolder("/RPC/CABLING/MAP_SCHEMA")
+	setrunforfolder("/RPC/CABLING/MAP_SCHEMA_CORR")
+	setrunforfolder("/RPC/DQMF/ELEMENT_STATUS")
+	setrunforfolder("/TGC/CABLING/MAP_SCHEMA")
+	setrunforfolder("/TILE/OFL02/CALIB/CIS/NLN")
+	setrunforfolder("/TILE/OFL02/CALIB/EMS")
+	setrunforfolder("/TILE/OFL02/CALIB/LAS/FIBER")
+	setrunforfolder("/TILE/OFL02/CALIB/LAS/NLN")
+	setrunforfolder("/TILE/OFL02/NOISE/AUTOCR")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/CIS/LEAK100")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/CIS/LEAK5P2")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/CIS/PULSE100")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/CIS/PULSE5P2")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/LAS")
+	setrunforfolder("/TILE/OFL02/PULSESHAPE/PHY")
+	setrunforfolder("/TILE/OFL02/TIME/CHANNELOFFSET/CIS")
+	setrunforfolder("/TRT/Calib/DX")
+	setrunforfolder("/TRT/Calib/HTCalib")
+	setrunforfolder("/TRT/Calib/PID")
+	setrunforfolder("/TRT/Calib/PID_RToT")
+	setrunforfolder("/TRT/Calib/PID_RToTver_New")
+	setrunforfolder("/TRT/Calib/PID_vector")
+	setrunforfolder("/TRT/Calib/PIDver_New")
+	setrunforfolder("/TRT/Calib/ToT/ToTValue")
+	setrunforfolder("/TRT/Calib/ToT/ToTVectors")
+	setrunforfolder("/TRT/Calib/ToTCalib")
+	setrunforfolder("/TRT/Calib/errors")
+	setrunforfolder("/TRT/Calib/errors2d")
+	setrunforfolder("/TRT/Calib/slopes")
+	setrunforfolder("/CSC/FTHOLD")
+	setrunforfolder("/CSC/NOISE")
+	setrunforfolder("/CSC/PED")
+	setrunforfolder("/GLOBAL/BTagCalib/Onl/RUN12")
+	setrunforfolder("/Indet/PixelDist")
+	setrunforfolder("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples3bins17phases")
+	setrunforfolder("/LAR/ElecCalibOfl/Shape/RTM/4samples3bins17phases")
+	setrunforfolder("/PIXEL/CablingMap")
+	setrunforfolder("/PIXEL/NoiseMapShort")
+	setrunforfolder("/PIXEL/PixReco")
+	setrunforfolder("/Indet/AlignL3")
+	setrunforfolder("/MUONALIGN/ERRS")
+	setrunforfolder("/RPC/TRIGGER/CM_THR_ETA")
+	setrunforfolder("/RPC/TRIGGER/CM_THR_PHI")
+	setrunforfolder("/TRT/AlignL2")
+
+print "set run "+str(runN)+" and lumiblock "+str(lumiBlock)+" for folders: ", overlaylongfolders
+
+
+
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
new file mode 100644
index 00000000000..74e01f9bc60
--- /dev/null
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
@@ -0,0 +1,236 @@
+from IOVDbSvc.CondDB import conddb
+from AthenaCommon.DetFlags import DetFlags
+from RecExConfig.RecAlgsFlags import recAlgs
+########################################
+
+#use MC MDT RT functions
+#conddb.blockFolder("/MDT/RT")
+#conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True)
+conddb.blockFolder("/MDT/RTBLOB")
+conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True)
+
+#from Guillaume
+conddb.blockFolder("/LAR/LArCellPositionShift");
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
+conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
+svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
+
+conddb.blockFolder("/PIXEL/ReadoutSpeed")
+conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed",force=True)
+
+conddb.blockFolder("/TRT/Cond/DigVers")
+conddb.addFolderWithTag("TRT_OFL","/TRT/Cond/DigVers","TRTCondDigVers-Collisions-01",force=True,forceMC=True)
+
+
+###################################################
+print "RT OVERRIDE, for OFLCOND-MC16-SDR-26 "
+#See https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/rBR_CB_Report.php?CBAction=GlobalTagReport&cbgt=OFLCOND-MC16-SDR-26
+# https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/rBR_CB_Report.php?CBAction=GlobalTagReport&cbgt=CONDBR2-BLKPA-2018-12
+
+conddb.blockFolder("/LAR/BadChannels/BadChannels");
+conddb.blockFolder("/LAR/BadChannelsOfl/BadChannels");
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/BadChannels","LArBadChannelsBadChannels-IOVDEP-08",force=True,forceMC=True);
+conddb.blockFolder("/LAR/BadChannels/MissingFEBs");
+conddb.blockFolder("/LAR/BadChannelsOfl/MissingFEBs");
+conddb.addFolderWithTag("LAR_OFL","/LAR/BadChannels/MissingFEBs","LArBadChannelsMissingFEBs-IOVDEP-04",force=True,forceMC=True)
+
+if not "EOJT_alignMC" in globals():
+    print "EOJT_alignMC not found in globals(), so aligning ID to data conditions"
+    #conddb.blockFolder("/TRT/Align")
+    #conddb.addFolderWithTag("TRT_OFL","/TRT/Align","TRTAlign-RUN2-BLK-UPD4-10",force=True,forceData=True)
+    #conddb.blockFolder("/LAR/Align")
+    #conddb.addFolderWithTag("LAR_ONL","/LAR/Align","LARAlign-RUN2-UPD4-02",force=True,forceData=True)
+    #conddb.blockFolder("/Indet/Align")
+    #conddb.addFolderWithTag("INDET_OFL","/Indet/Align","InDetAlign-RUN2-BLK-UPD4-13",force=True,forceData=True)
+else:
+    print "EOJT_alignMC found in globals(), so aligning ID to MC conditions"
+    conddb.blockFolder("/TRT/Align")
+    conddb.addFolderWithTag("TRT_OFL","/TRT/Align","TRTAlign-RUN2-BLK-UPD4-13",force=True,forceMC=True)
+    conddb.blockFolder("/LAR/Align")
+    conddb.addFolderWithTag("LAR_OFL","/LAR/Align","LARAlign-RUN2-UPD4-03",force=True,forceMC=True)
+    conddb.blockFolder("/Indet/Align")
+    conddb.addFolderWithTag("INDET_OFL","/Indet/Align","InDetAlign-RUN2-BLK-UPD4-16",force=True,forceMC=True) #InDetAlign_IOVDEP-03
+
+#to set beam spot from MC
+#conddb.blockFolder("/Indet/Beampos")
+#conddb.addFolderWithTag("INDET_OFL","/Indet/Beampos","IndetBeampos-RunDep-MC15-BestKnowledge-002",force=True,forceMC=True)
+
+#to run overlay chain with trigger                      
+if (hasattr(runArgs, "triggerConfig") and runArgs.triggerConfig!="NONE") or (hasattr(recAlgs,'doTrigger') and recAlgs.doTrigger() and DetFlags.LVL1_on()):
+    print "running with trigger  " 
+    conddb.addOverride("/GLOBAL/Onl/BTagCalib/RUN12","BTagCalibRUN12Onl-08-40")
+else:
+    print "running with no trigger  "
+
+if DetFlags.writeRDOPool.pixel_on():
+    conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco")
+
+conddb.blockFolder("/PIXEL/PixdEdx")
+conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixdEdx","PixdEdx-SIM-RUN124-000-00",force=True,forceMC=True)
+mcIDoverlay=False
+if mcIDoverlay:
+    print "ACH777: Using MC overlay Lorentz DB settings"
+    conddb.blockFolder("/PIXEL/DCS/HV")
+    conddb.addFolderWithTag("DCS_OFL","/PIXEL/DCS/HV","PixDCSHV-SIM-MC16a-000-07",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/DCS/TEMPERATURE")
+    conddb.addFolderWithTag("DCS_OFL","/PIXEL/DCS/TEMPERATURE","PixDCSTemp-SIM-MC16a-000-09",force=True,forceMC=True)
+    conddb.blockFolder("/SCT/DCS/HV")
+    conddb.addFolderWithTag("DCS_OFL","/SCT/DCS/HV","SctDcsHv-MC16",force=True,forceMC=True)
+    conddb.blockFolder("/SCT/DCS/MODTEMP")
+    conddb.addFolderWithTag("DCS_OFL","/SCT/DCS/MODTEMP","SctDcsModtemp-MC16",force=True,forceMC=True)
+mcIDoverlay2=False
+if mcIDoverlay2:
+    print "ACH777: Using more MC overlay ID DB settings"
+    conddb.blockFolder("/Indet/PixelDist")
+    conddb.addFolderWithTag("INDET_OFL","/Indet/PixelDist","InDetPixelDist-nominal",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/PixelClustering/PixelClusNNCalib")
+    conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/PixelClustering/PixelClusNNCalib","PixelClusNNCalib-SIM-RUN12-000-06",force=True,forceMC=True)
+    conddb.blockFolder("/PIXEL/LorentzAngleScale")
+    conddb.addFolderWithTag("PIXEL_OFL","/PIXEL/LorentzAngleScale","PixLorentzAngleScale-SIM-RUN124-000-00",force=True,forceMC=True)
+
+conddb.blockFolder("/MUONALIGN/MDT/BARREL")
+conddb.blockFolder("/MUONALIGN/MDT/ENDCAP/SIDEA")
+conddb.blockFolder("/MUONALIGN/MDT/ENDCAP/SIDEC")
+conddb.blockFolder("/MUONALIGN/TGC/SIDEA")
+conddb.blockFolder("/MUONALIGN/TGC/SIDEC")
+
+#use updated muon alignments
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/BARREL","MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_09-BLKP-UPD4-00",force=True,forceData=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/ENDCAP/SIDEA","MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_02_01-UPD4-02",force=True,forceData=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/MDT/ENDCAP/SIDEC","MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_02_01-UPD4-02",force=True,forceData=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEA","MuonAlignTGCEndCapAAlign-0001-DEFAULT",force=True,forceMC=True)
+conddb.addFolderWithTag("MUONALIGN_OFL","/MUONALIGN/TGC/SIDEC","MuonAlignTGCEndCapCAlign-0001-DEFAULT",force=True,forceMC=True)
+
+conddb.blockFolder("/SCT/DAQ/Config/Chip")
+conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Chip","/SCT/DAQ/Config/Chip",force=True)
+conddb.blockFolder("/SCT/DAQ/Config/Module")
+conddb.addFolderSplitMC("SCT","/SCT/DAQ/Config/Module","/SCT/DAQ/Config/Module",force=True)
+
+dofolderoverrides = True
+if dofolderoverrides:
+	print "ACH - overriding folder access patterns"
+	conddb.dumpFolderTags('myconddb.txt',True)
+
+overlaylongfolders = []
+def adjustlongfolder(name):
+	if conddb.folderRequested(name):
+		print "setting "+name+" to 100000000s cache"
+		conddb.addMarkup(name,"<cache>100000000</cache>")
+		global overlaylongfolders
+		overlaylongfolders += [name]
+
+if dofolderoverrides:
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/calhits")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/clcon")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/deadOTXback")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/deadOTXps")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/etamod")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/etaoff")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/gap")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/larupdate")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/lwc")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/phimod")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/phioff")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/rfac")
+	adjustlongfolder("/CALO/CaloSwClusterCorrections/trcorr")
+	adjustlongfolder("/CALO/H1Weights/H1WeightsCone4Topo")
+	adjustlongfolder("/CALO/Identifier/CaloTTOnAttrIdMapAtlas")
+	adjustlongfolder("/CALO/Identifier/CaloTTOnOffIdMapAtlas")
+	adjustlongfolder("/CALO/Identifier/CaloTTPpmRxIdMapAtlas")
+	adjustlongfolder("/CALO/JetCalib/EtaMassEnergyCorr")
+	adjustlongfolder("/CALO/JetCalib/JetPropertyInvertResponseTool")
+	adjustlongfolder("/CALO/JetCalib/MCNumInversionResponse")
+	adjustlongfolder("/CALO/JetCalib/OffsetCorrection")
+	adjustlongfolder("/CALO/JetCalib/TrackAngularCorrection")
+	adjustlongfolder("/CALO/JetCalib/TrackBasedResponseCorrection")
+	adjustlongfolder("/CALO/Ofl/Pedestal/CellPedestal")
+	adjustlongfolder("/CALO/Pedestal/CellPedestal")
+	adjustlongfolder("/CSC/PSLOPE")
+	adjustlongfolder("/CSC/RMS")
+	adjustlongfolder("/CSC/T0BASE")
+	adjustlongfolder("/CSC/T0PHASE")
+	adjustlongfolder("/GLOBAL/DETSTATUS/DEFECTLOGIC")
+	adjustlongfolder("/Indet/TrkErrorScaling")
+	adjustlongfolder("/LAR/CellCorrOfl/deadOTX")
+	adjustlongfolder("/LAR/ElecCalibOfl/LArPileupShape")
+	adjustlongfolder("/MDT/CABLING/MAP_SCHEMA")
+	adjustlongfolder("/MDT/CABLING/MEZZANINE_SCHEMA")
+	adjustlongfolder("/MUONALIGN/MDT/ASBUILTPARAMS")
+	adjustlongfolder("/MUONALIGN/TGC/SIDEA")
+	adjustlongfolder("/MUONALIGN/TGC/SIDEC")
+	adjustlongfolder("/PIXEL/LorentzAngleScale")
+	adjustlongfolder("/PIXEL/NoiseMapLong")
+	adjustlongfolder("/PIXEL/PixMapLong")
+	adjustlongfolder("/PIXEL/PixMapShort")
+	adjustlongfolder("/PIXEL/PixdEdx")
+	adjustlongfolder("/PIXEL/PixelClustering/PixelClusNNCalib")
+	adjustlongfolder("/PIXEL/PixelClustering/PixelCovCorr")
+	adjustlongfolder("/RPC/CABLING/MAP_SCHEMA")
+	adjustlongfolder("/RPC/CABLING/MAP_SCHEMA_CORR")
+	adjustlongfolder("/RPC/DQMF/ELEMENT_STATUS")
+	adjustlongfolder("/TGC/CABLING/MAP_SCHEMA")
+	adjustlongfolder("/TILE/OFL02/CALIB/CIS/NLN")
+	adjustlongfolder("/TILE/OFL02/CALIB/EMS")
+	adjustlongfolder("/TILE/OFL02/CALIB/LAS/FIBER")
+	adjustlongfolder("/TILE/OFL02/CALIB/LAS/NLN")
+	adjustlongfolder("/TILE/OFL02/NOISE/AUTOCR")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/CIS/LEAK100")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/CIS/LEAK5P2")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/CIS/PULSE100")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/CIS/PULSE5P2")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/LAS")
+	adjustlongfolder("/TILE/OFL02/PULSESHAPE/PHY")
+	adjustlongfolder("/TILE/OFL02/TIME/CHANNELOFFSET/CIS")
+	adjustlongfolder("/TRT/Calib/DX")
+	adjustlongfolder("/TRT/Calib/HTCalib")
+	adjustlongfolder("/TRT/Calib/PID")
+	adjustlongfolder("/TRT/Calib/PID_RToT")
+	adjustlongfolder("/TRT/Calib/PID_RToTver_New")
+	adjustlongfolder("/TRT/Calib/PID_vector")
+	adjustlongfolder("/TRT/Calib/PIDver_New")
+	adjustlongfolder("/TRT/Calib/ToT/ToTValue")
+	adjustlongfolder("/TRT/Calib/ToT/ToTVectors")
+	adjustlongfolder("/TRT/Calib/ToTCalib")
+	adjustlongfolder("/TRT/Calib/errors")
+	adjustlongfolder("/TRT/Calib/errors2d")
+	adjustlongfolder("/TRT/Calib/slopes")
+	adjustlongfolder("/CSC/FTHOLD")
+	adjustlongfolder("/CSC/NOISE")
+	adjustlongfolder("/CSC/PED")
+	adjustlongfolder("/GLOBAL/BTagCalib/Onl/RUN12")
+	adjustlongfolder("/Indet/PixelDist")
+	adjustlongfolder("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples3bins17phases")
+	adjustlongfolder("/LAR/ElecCalibOfl/Shape/RTM/4samples3bins17phases")
+	adjustlongfolder("/PIXEL/CablingMap")
+	adjustlongfolder("/PIXEL/NoiseMapShort")
+	adjustlongfolder("/PIXEL/PixReco")
+	adjustlongfolder("/Indet/AlignL3")
+	adjustlongfolder("/MUONALIGN/ERRS")
+	adjustlongfolder("/RPC/TRIGGER/CM_THR_ETA")
+	adjustlongfolder("/RPC/TRIGGER/CM_THR_PHI")
+	adjustlongfolder("/TRT/AlignL2")
+
+print "overlaylongfolders: ", overlaylongfolders
+
+def adjustshortfolder(name):
+	global overlaylongfolders 
+	if name in overlaylongfolders:
+		print "already made "+name+" long"
+	else:
+		if conddb.folderRequested(name):
+        	        print "setting "+name+" to 10s cache"
+                	conddb.addMarkup(name,"<cache>10</cache>")
+		else:
+			print "folder "+name+" was not requested?!"
+
+if dofolderoverrides:
+	with open("myconddb.txt") as f:
+		for l in f:
+			ls=l.split(" ")
+			if ls[0].startswith("--folder"):
+				ls1=ls[1].rstrip('\r\n')
+				ls11=ls1.rstrip('\n')
+				adjustshortfolder(ls11)
+
+
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_ESDtoAOD.py b/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_ESDtoAOD.py
index 603a01e9284..b991161ab1e 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_ESDtoAOD.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_ESDtoAOD.py
@@ -10,3 +10,6 @@ conddb.blockFolder("/TRT/Cond/Status");
 conddb.blockFolder("/TRT/Cond/StatusHT");
 conddb.blockFolder("/TRT/Cond/StatusPermanent");
 conddb.blockFolder("/LAR/Identifier/LArTTCellMapAtlas");
+conddb.blockFolder("/LAR/BadChannels/BadChannels");
+conddb.blockFolder("/LAR/BadChannels/MissingFEBs");
+conddb.blockFolder("/TRT/Cond/Status");
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_OverlayBS.py b/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_OverlayBS.py
index 1743eec25d7..6287b79ffba 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_OverlayBS.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/blockFoldersHI_OverlayBS.py
@@ -3,6 +3,9 @@ conddb.blockFolder("/LAR/BadChannelsOfl/KnownBADFEBs");
 conddb.blockFolder("/LAR/BadChannelsOfl/KnownMNBFEBs");
 conddb.blockFolder("/SCT/DAQ/Calibration/NPtGainDefects");
 conddb.blockFolder("/SCT/DAQ/Calibration/NoiseOccupancyDefects");
+conddb.blockFolder("/SCT/DCS/CHANSTAT");
+conddb.blockFolder("/SCT/HLT/DCS/HV");
+conddb.blockFolder("/SCT/HLT/DCS/MODTEMP");
 conddb.blockFolder("/TRT/Calib/PID");
 conddb.blockFolder("/TRT/Calib/PID_RToT");
 conddb.blockFolder("/TRT/Calib/PID_RToTver_New");
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/muAlign_HI2018Pb_reco.py b/Event/EventOverlay/EventOverlayJobTransforms/share/muAlign_HI2018Pb_reco.py
new file mode 100644
index 00000000000..3af7793ad45
--- /dev/null
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/muAlign_HI2018Pb_reco.py
@@ -0,0 +1,44 @@
+
+#use muon alignments
+print "Haas: Reading muon alignment constants from DB for reco"
+
+from IOVDbSvc.CondDB import conddb
+
+MGM_AlignmentDbTool = ToolSvc.MGM_AlignmentDbTool
+#MGM_AlignmentDbTool.OutputLevel=DEBUG
+#print MGM_AlignmentDbTool
+from AtlasGeoModel.MuonGM import GeoModelSvc
+MuonDetectorTool = GeoModelSvc.DetectorTools[ "MuonDetectorTool" ]
+MuonDetectorTool.UseConditionDb = 1
+#MuonDetectorTool.OutputLevel=DEBUG
+
+MuonDetectorTool.EnableFineClashFixing = 0 #this should be on for g4?
+#print MuonDetectorTool
+#print GeoModelSvc
+#print ToolSvc
+
+#Now use MC T0 for TRT during overlay digi, but MC or data T0/Rt during reco, depending on where digit came from... so this stuff is just for reco
+conddb.blockFolder("/TRT/Calib/MC/RT")
+conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/MC/RT","TrtCalibRt-R2-MC-run2-scenario1_04-03",force=True,forceData=True)
+conddb.addMarkup("/TRT/Calib/MC/RT","<forceRunNumber>313000</forceRunNumber>")
+conddb.blockFolder("/TRT/Calib/MC/T0")
+conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/MC/T0","TrtCalibT0-R2-MC-run2-scenario1_04-03",force=True,forceData=True)
+conddb.addMarkup("/TRT/Calib/MC/T0","<forceRunNumber>313000</forceRunNumber>")
+
+from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
+TRTMCCalibDBSvc=TRT_CalDbSvc(name="TRTMCCalibDBSvc",RtFolderName="/TRT/Calib/MC/RT",T0FolderName="/TRT/Calib/MC/T0",ErrorSlopeFolderName="/TRT/Calib/slopes",ErrorFolderName ="/TRT/Calib/errors2d")
+ServiceMgr += TRTMCCalibDBSvc
+
+#This would add another trtdriftfuntiontool, using the new trtcaldb
+ToolSvc.InDetTRT_DriftFunctionTool.IsOverlay=True
+ToolSvc.InDetTRT_DriftFunctionTool.TRTCalDbTool2=TRTMCCalibDBSvc
+
+if "EOJT_noLorentz" in globals():
+    print "EOJT_noLorentz found in globals(), so not doing Lorentz corrections"
+    svcMgr.PixelSiliconConditionsSvc.ForceUseGeoModel=True
+    svcMgr.PixelSiliconConditionsSvc.CheckGeoModel=True
+    svcMgr.PixelSiliconConditionsSvc.UseDBForHV=False
+    svcMgr.PixelLorentzAngleSvc.usePixelDefaults=True
+else:
+    print "EOJT_noLorentz not found in globals(), so doing standard Lorentz corrections"
+
-- 
GitLab


From a76847d3d2f560cf5698acd818720405f290fac8 Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <john.kenneth.anders@cern.ch>
Date: Tue, 5 Mar 2019 16:55:07 +0000
Subject: [PATCH 258/404] Merge branch 'QballSimFix_ALTMCPROD-6719_21.0' into
 '21.0'

Fixes for Qball simulation configuration

See merge request atlas/athena!21422

(cherry picked from commit 35bdc9fea6a99bdee9cb226eaf27440a8716ca3b)

57e41aa4 ISF_GenParticleInteractingFilter configuration fix
40c1c6f0 Patch preInclude.Qball.py to work-around missing specialConfiguration metadata
---
 .../ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py        | 4 ++--
 .../share/specialConfig/preInclude.Monopole.py             | 2 +-
 .../share/specialConfig/preInclude.Qball.py                | 7 +++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py
index 87d00a7c3f6..0bc48a4f18a 100644
--- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py
+++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py
@@ -91,9 +91,9 @@ def getGenParticleInteractingFilter(name="ISF_GenParticleInteractingFilter", **k
     from G4AtlasApps.SimFlags import simFlags
     simdict = simFlags.specialConfiguration.get_Value()
     if simdict is not None and "InteractingPDGCodes" in simdict:
-        kwargs.setdefault('AdditionalInteractingParticleTypes', simdict["InteractingPDGCodes"])
+        kwargs.setdefault('AdditionalInteractingParticleTypes', eval(simdict["InteractingPDGCodes"]))
     if simdict is not None and "NonInteractingPDGCodes" in simdict:
-        kwargs.setdefault('AdditionalNonInteractingParticleTypes', simdict["InteractingNonPDGCodes"])
+        kwargs.setdefault('AdditionalNonInteractingParticleTypes', eval(simdict["InteractingNonPDGCodes"]))
     return CfgMgr.ISF__GenParticleInteractingFilter(name, **kwargs)
 
 def getEtaPhiFilter(name="ISF_EtaPhiFilter", **kwargs):
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
index b9af8ac2960..eff6164861f 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
@@ -48,7 +48,7 @@ try:
     else:
         from G4AtlasApps.SimFlags import simFlags
         if not "InteractingPDGCodes" in simFlags.specialConfiguration.get_Value():
-            simFlags.specialConfiguration.get_Value()['InteractingPDGCodes'] = [4110000,-4110000]
+            simFlags.specialConfiguration.get_Value()['InteractingPDGCodes'] = str([4110000,-4110000])
         simdict = simFlags.specialConfiguration.get_Value()
 except:
     from G4AtlasApps.SimFlags import simFlags
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
index 723fe396f29..5b686b1ad2c 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
@@ -37,6 +37,8 @@ def load_files_for_qball_scenario(MASS, CHARGE):
     del BLINE1
     del BLINE2
 
+assert "MASS" in simdict
+assert "CHARGE" in simdict
 doG4SimConfig = True
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 import PyUtils.AthFile as af
@@ -49,13 +51,14 @@ try:
         doG4SimConfig = False
     else:
         from G4AtlasApps.SimFlags import simFlags
+        if not "InteractingPDGCodes" in simFlags.specialConfiguration.get_Value():
+            CODE=10000000+int(float(simdict["CHARGE"])*100)
+            simFlags.specialConfiguration.get_Value()['InteractingPDGCodes'] = str([CODE,-1*CODE])
         simdict = simFlags.specialConfiguration.get_Value()
 except:
     from G4AtlasApps.SimFlags import simFlags
     simdict = simFlags.specialConfiguration.get_Value()
 
-assert "MASS" in simdict
-assert "CHARGE" in simdict
 load_files_for_qball_scenario(simdict["MASS"], simdict["CHARGE"])
 
 if doG4SimConfig:
-- 
GitLab


From cd2c3bd150fdf081a508b6880da5b6ef996619f1 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Wed, 6 Mar 2019 08:08:51 +0100
Subject: [PATCH 259/404] TileGeoG4Calib: Adapted to updated ITileCalculator

TileGeoG4CalibSD has been adapted to updated ITileCalculator for AthenaMT.
---
 .../TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD.cc            | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD.cc b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD.cc
index 5ea892a0a56..29fab721b69 100644
--- a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD.cc
+++ b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileGeoG4CalibSD.cc
@@ -284,8 +284,9 @@ G4bool TileGeoG4CalibSD::ProcessHits(G4Step* step, G4TouchableHistory* /*ROhist*
       //BESIDE A CALIBRATION HIT THERE ORDINARY
       //HITS SHOULD BE ALSO CREATED OR UPDATED
       if (normalHit) {
-        m_calc->MakePmtEdepTime(m_aStep, hitData);  //calculation of pmtID, edep and scin_Time with aStep
-        m_calc->ManageScintHit(hitData);//create or update ordinary hit object in the collection
+        double deltaTime(0);
+        m_calc->MakePmtEdepTime(m_aStep, hitData, deltaTime);  //calculation of pmtID, edep and scin_Time with aStep
+        m_calc->ManageScintHit(hitData, deltaTime);//create or update ordinary hit object in the collection
       }
       this->ScintIDCalculator(hitData);
     } else {
-- 
GitLab


From 0c3306f8abf71b17a72dddaac19c2f4a61edaadf Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 6 Mar 2019 10:16:38 +0000
Subject: [PATCH 260/404] Add ATLAS_CHECK_THREAD_SAFETY to
 InDetCompetingRIOsOnTrack(Tool) packages

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../CompetingPixelClustersOnTrack.h           |  9 +++----
 .../CompetingTRT_DriftCirclesOnTrack.h        |  9 +++----
 .../src/CompetingPixelClustersOnTrack.cxx     |  2 +-
 .../src/CompetingTRT_DriftCirclesOnTrack.cxx  | 22 ++++++++---------
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../CompetingTRT_DriftCirclesOnTrackTool.cxx  |  2 +-
 .../CompetingRIOsOnTrack.h                    |  9 +++----
 .../src/CompetingRIOsOnTrack.cxx              | 24 +++++++++----------
 .../CompetingRIOsOnTrackCnv_p1.cxx            |  8 +++----
 .../test/CompetingRIOsOnTrackCnv_p1_test.cxx  |  2 +-
 11 files changed, 47 insertions(+), 42 deletions(-)
 create mode 100644 InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/InDetCompetingRIOsOnTrackTool/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..8695c4f43e3
--- /dev/null
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
index fd32d023039..e6f25e1470c 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -12,6 +12,7 @@
 // Trk
 #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
 #include "InDetRIO_OnTrack/PixelClusterOnTrack.h" // cannot forward declare
+#include <atomic>
 #include <iosfwd>
 
 class MsgStream;
@@ -103,7 +104,7 @@ private:
 
 
     /** The global Position */
-    mutable const Amg::Vector3D*        m_globalPosition;
+    mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
 
     /** The vector of contained InDet::PixelClusterOnTrack objects */
     std::vector<const InDet::PixelClusterOnTrack*>*   m_containedChildRots;
@@ -138,9 +139,9 @@ inline const InDet::PixelClusterOnTrack& CompetingPixelClustersOnTrack::rioOnTra
 
  inline const Amg::Vector3D& CompetingPixelClustersOnTrack::globalPosition() const {
     if (m_globalPosition)
-        return (*m_globalPosition);
+        return (*m_globalPosition.load());
     m_globalPosition = associatedSurface().localToGlobal(localParameters());
-    return (*m_globalPosition);
+    return (*m_globalPosition.load());
 }
 
 inline unsigned int CompetingPixelClustersOnTrack::numberOfContainedROTs() const {
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
index bb8cf796900..8ff11116217 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -12,6 +12,7 @@
 // Trk
 #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h"
 #include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
+#include <atomic>
 #include <iosfwd>
 
 class MsgStream;
@@ -105,10 +106,10 @@ namespace InDet {
     //! private method to clear the Trk::RIO_OnTrack vector
     void                               clearChildRotVector();
     //! The surface to which the competingROTs parameters are expressed to
-    mutable const Trk::Surface*             m_associatedSurface;
+    mutable std::atomic<const Trk::Surface*> m_associatedSurface;
 
     //! The global Position
-    mutable const Amg::Vector3D*        m_globalPosition;
+    mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
 
     //! The vector of contained InDet::TRT_DriftCircleOnTrack objects
     std::vector<const InDet::TRT_DriftCircleOnTrack*>*   m_containedChildRots;
@@ -120,7 +121,7 @@ namespace InDet {
 	are checked.
 	- interface  from CompetingRIOsOnTrack */
     bool ROTsHaveCommonSurface(const bool withNonVanishingAssignProb=true) const;
-    mutable int m_ROTsHaveCommonSurface;
+    mutable std::atomic_int m_ROTsHaveCommonSurface;
 
 
   };
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
index 62ab26a92dc..ac6808c43ca 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
@@ -73,7 +73,7 @@ InDet::CompetingPixelClustersOnTrack& InDet::CompetingPixelClustersOnTrack::oper
         m_containedChildRots = compROT.m_containedChildRots;
         compROT.m_containedChildRots = nullptr;
 
-        m_globalPosition = compROT.m_globalPosition;
+        m_globalPosition = compROT.m_globalPosition.load();
         compROT.m_globalPosition = nullptr;
     }
     return (*this);
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
index 950112b7879..9a85e67f61c 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -27,12 +27,12 @@ InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack():
 // 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) : 0),
+  m_globalPosition(compROT.m_globalPosition ? new Amg::Vector3D(*(compROT.m_globalPosition.load())) : 0),
   m_containedChildRots(0),
-  m_ROTsHaveCommonSurface(compROT.m_ROTsHaveCommonSurface) {
+  m_ROTsHaveCommonSurface(compROT.m_ROTsHaveCommonSurface.load()) {
   if (compROT.m_associatedSurface) {
     // copy only if surface is not one owned by a detector Element
-    m_associatedSurface = (!compROT.m_associatedSurface->associatedDetectorElement()) ? compROT.m_associatedSurface->clone() : compROT.m_associatedSurface;
+    m_associatedSurface = (!compROT.m_associatedSurface.load()->associatedDetectorElement()) ? compROT.m_associatedSurface.load()->clone() : compROT.m_associatedSurface.load();
   } else {
     m_associatedSurface = 0;
   }
@@ -77,17 +77,17 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
     delete m_containedChildRots;
     delete m_globalPosition;
     // delete surface if not owned by detElement
-    if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement())
+    if (m_associatedSurface && !m_associatedSurface.load()->associatedDetectorElement())
       delete m_associatedSurface;
     m_containedChildRots = new std::vector<const InDet::TRT_DriftCircleOnTrack*>;
     if (compROT.m_associatedSurface) {
       // copy only if surface is not one owned by a detector Element
-      m_associatedSurface = (!compROT.m_associatedSurface->associatedDetectorElement()) ? compROT.m_associatedSurface->clone() : compROT.m_associatedSurface;
+      m_associatedSurface = (!compROT.m_associatedSurface.load()->associatedDetectorElement()) ? compROT.m_associatedSurface.load()->clone() : compROT.m_associatedSurface.load();
     } else {
       m_associatedSurface = 0;
     }
     m_globalPosition     = compROT.m_globalPosition ? new Amg::Vector3D(*compROT.m_globalPosition) : 0;
-    m_ROTsHaveCommonSurface     = compROT.m_ROTsHaveCommonSurface;
+    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)
       m_containedChildRots->push_back((*rotIter)->clone());
@@ -97,7 +97,7 @@ 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.load()->associatedDetectorElement())
     delete m_associatedSurface;
   delete m_globalPosition;
   clearChildRotVector();
@@ -162,15 +162,15 @@ const Amg::Vector3D& InDet::CompetingTRT_DriftCirclesOnTrack::globalPosition() c
     
   // FIXME: introduce a special function in base class, which returns the sum of assignment probabilities
   double assgnProbSum = 0.;
-  std::vector<AssignmentProb>::const_iterator assgnProbIter = m_assignProb->begin();
-  for (; assgnProbIter != m_assignProb->end(); ++assgnProbIter) {
+  std::vector<AssignmentProb>::const_iterator assgnProbIter = m_assignProb.load()->begin();
+  for (; assgnProbIter != m_assignProb.load()->end(); ++assgnProbIter) {
     assgnProbSum += (*assgnProbIter);
   }
 
   Amg::Vector3D globalPos(0.,0.,0.);
   if (assgnProbSum > 0.) {
     std::vector< const InDet::TRT_DriftCircleOnTrack* >::const_iterator rotIter = m_containedChildRots->begin();
-    assgnProbIter = m_assignProb->begin();
+    assgnProbIter = m_assignProb.load()->begin();
     for (; rotIter != m_containedChildRots->end(); ++rotIter, ++assgnProbIter) {
       globalPos += ( ((*assgnProbIter)/assgnProbSum) * ((*rotIter)->globalPosition()) );
     }
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/InDetCompetingRIOsOnTrackTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/InDetCompetingRIOsOnTrackTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..b86ad13e899
--- /dev/null
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/InDetCompetingRIOsOnTrackTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
index 98a6875369b..a66a6c5452b 100755
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
@@ -714,7 +714,7 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT(
     // update maximum assign prob index:
     compROT->m_indexMaxAssignProb = maximumAssignProbIndex;
     // update surface
-    if (!compROT->m_associatedSurface->associatedDetectorElement())
+    if (!compROT->m_associatedSurface.load()->associatedDetectorElement())
         delete compROT->m_associatedSurface;
     compROT->m_associatedSurface=assocSurface;
     // delete global position (will be recreated in competingROT itself
diff --git a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
index da22b4b07b0..35c0d678906 100755
--- a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
+++ b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -18,6 +18,7 @@
 //#include "TrkEventPrimitives/GlobalPosition.h"
 //#include "TrkEventPrimitives/ErrorMatrix.h"
 #include "TrkMeasurementBase/MeasurementBase.h"
+#include <atomic>
 #include <ostream>
 #include <cassert>
 
@@ -109,10 +110,10 @@ protected:
     friend class ::CompetingRIOsOnTrackCnv_p1;
 
     //! index of hightest assignment probability
-    mutable unsigned int           m_indexMaxAssignProb;
+    mutable std::atomic_uint m_indexMaxAssignProb;
 
     //! assignment probabilities of the ROTs
-    mutable const std::vector<AssignmentProb>*   m_assignProb;
+    mutable std::atomic<const std::vector<AssignmentProb>*> m_assignProb;
 
     //! used to flag that the m_indexMaxAssignProb hasn't been calculated yet
     bool                            m_maxProbCalculated;
@@ -133,7 +134,7 @@ protected:
 inline CompetingRIOsOnTrack::AssignmentProb CompetingRIOsOnTrack::assignmentProbability(unsigned int indx) const {
     assert ( indx < numberOfContainedROTs() );
     if (indx < numberOfContainedROTs() )
-        return m_assignProb->operator[](indx);
+        return m_assignProb.load()->operator[](indx);
     return 0; // could consider throwing an exception here - EJWM
 }
 
diff --git a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
index e010e7a774b..0fa42ac31eb 100755
--- a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
+++ b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -26,11 +26,11 @@ Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack():
 // copy constructor
 Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack(const Trk::CompetingRIOsOnTrack& compROT)
     :
-    Trk::MeasurementBase(compROT),
-    m_indexMaxAssignProb(compROT.m_indexMaxAssignProb),
-    m_assignProb(compROT.m_assignProb ? new std::vector<AssignmentProb>(*compROT.m_assignProb) : 0),
-    m_maxProbCalculated(compROT.m_maxProbCalculated)
+    Trk::MeasurementBase(compROT)
 {
+  m_indexMaxAssignProb = compROT.m_indexMaxAssignProb.load();
+  m_assignProb = compROT.m_assignProb ? new std::vector<AssignmentProb>(*compROT.m_assignProb.load()) : 0;
+  m_maxProbCalculated = compROT.m_maxProbCalculated;
 }
 
 // constructor with parameters
@@ -49,7 +49,7 @@ Trk::CompetingRIOsOnTrack& Trk::CompetingRIOsOnTrack::operator=(const Trk::Compe
         delete m_assignProb;
 
 	Trk::MeasurementBase::operator=(compROT);
-        m_indexMaxAssignProb = compROT.m_indexMaxAssignProb;
+        m_indexMaxAssignProb = compROT.m_indexMaxAssignProb.load();
         m_assignProb         = compROT.m_assignProb ? new std::vector<AssignmentProb>(*compROT.m_assignProb) : 0;
         m_maxProbCalculated  = compROT.m_maxProbCalculated;
     }
@@ -61,10 +61,10 @@ Trk::CompetingRIOsOnTrack& Trk::CompetingRIOsOnTrack::operator=(Trk::CompetingRI
       Trk::MeasurementBase::operator=(std::move(compROT));
 
       delete m_assignProb;
-      m_assignProb = compROT.m_assignProb;
+      m_assignProb = compROT.m_assignProb.load();
       compROT.m_assignProb = nullptr;
 
-      m_indexMaxAssignProb = compROT.m_indexMaxAssignProb;
+      m_indexMaxAssignProb = compROT.m_indexMaxAssignProb.load();
       m_maxProbCalculated  = compROT.m_maxProbCalculated;
     }
     return (*this);
@@ -141,9 +141,9 @@ Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb() const {
         // No, so work it out.
         double maxAssgnProb = 0;
         for (unsigned int i=0; i<numberOfContainedROTs(); i++) {
-            if (m_assignProb->operator[](i) >= maxAssgnProb) {
+            if (m_assignProb.load()->operator[](i) >= maxAssgnProb) {
                 m_indexMaxAssignProb=i;
-                maxAssgnProb = m_assignProb->operator[](i);
+                maxAssgnProb = m_assignProb.load()->operator[](i);
             }
         }
         //m_maxProbCalculated = true;
@@ -178,7 +178,7 @@ MsgStream& Trk::CompetingRIOsOnTrack::dump( MsgStream& out ) const
       out <<"  "<<std::setw(10)<< this->rioOnTrack(i).localParameters()[Trk::locY]
           <<"  "<< 1/this->rioOnTrack(i).localCovariance()(Trk::locY,Trk::locY)<<"  ";
     else out << "                         ";
-    out <<"  "<< m_assignProb->at(i)
+    out <<"  "<< m_assignProb.load()->at(i)
         << (m_indexMaxAssignProb == i ? " **|":"   |");
   }
 /*  out << std::resetiosflags(std::ios::right)<<std::resetiosflags(std::ios::adjustfield)
@@ -213,7 +213,7 @@ std::ostream& Trk::CompetingRIOsOnTrack::dump( std::ostream& out ) const
       out << "  "<<std::setw(10)<< this->rioOnTrack(i).localParameters()[Trk::locY]
           <<"  "<< 1/this->rioOnTrack(i).localCovariance()(Trk::locY,Trk::locY)<<"  ";
     else out << "                         ";
-    out << "  " << m_assignProb->at(i)
+    out << "  " << m_assignProb.load()->at(i)
         << (m_indexMaxAssignProb == i ? " **|":"   |");
   }
 //   out << std::resetiosflags(std::ios::right)<<std::resetiosflags(std::ios::adjustfield)
diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx b/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
index 519567ab784..4ae4616e636 100644
--- a/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
+++ b/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
@@ -32,9 +32,9 @@ void CompetingRIOsOnTrackCnv_p1::persToTrans( const Trk::CompetingRIOsOnTrack_p1
 
     // find max assignment index again
   double maxAssgnProb = 0;
-  unsigned int max = transObj->m_assignProb->size();
+  unsigned int max = transObj->m_assignProb.load()->size();
   typedef std::vector< Trk::CompetingRIOsOnTrack::AssignmentProb > t_probVec;
-  t_probVec& tProbVec = *(const_cast<t_probVec*>(transObj->m_assignProb));
+  t_probVec& tProbVec = *(const_cast<t_probVec*>(transObj->m_assignProb.load()));
   for (unsigned int i=0; i<max; i++) {
     if ( tProbVec[i] >= maxAssgnProb) {
       transObj->m_indexMaxAssignProb=i;
@@ -51,6 +51,6 @@ void CompetingRIOsOnTrackCnv_p1::transToPers( const Trk::CompetingRIOsOnTrack *
     EigenHelpers::eigenMatrixToVector(pMat.values, transObj->m_localCovariance, "CompetingRIOsOnTrackCnv_p1");
     persObj->m_localErrorMatrix = toPersistent( &m_errorMxCnv, &pMat, log ); 
 
-    persObj->m_assignProb.assign (transObj->m_assignProb->begin(),
-                                  transObj->m_assignProb->end());
+    persObj->m_assignProb.assign (transObj->m_assignProb.load()->begin(),
+                                  transObj->m_assignProb.load()->end());
 }
diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
index 1d18904707d..054c88e5d29 100644
--- a/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
+++ b/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
@@ -30,7 +30,7 @@ public:
                             const std::vector<double>& probs);
   
   virtual unsigned int numberOfContainedROTs() const override
-  { return m_assignProb->size(); }
+  { return m_assignProb.load()->size(); }
 
   virtual const Trk::Surface& associatedSurface() const override
   { std::abort(); }
-- 
GitLab


From ff77c6c13c7e78feb3a97f81d2aa2d9524f8f999 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 6 Mar 2019 10:24:41 +0000
Subject: [PATCH 261/404] Add ATLAS_CHECK_THREAD_SAFETY to SiClusterizationTool
 package

---
 .../SiClusterizationTool/CMakeLists.txt       |  3 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../SiClusterizationTool/ClusterMakerTool.h   |  6 ++++
 .../SiClusterizationTool/MergedPixelsTool.h   | 33 ++++++-------------
 .../NnClusterizationFactory.h                 |  5 ++-
 .../TruthClusterizationFactory.h              |  3 +-
 .../src/ClusterMakerTool.cxx                  | 20 +++++------
 .../src/MergedPixelsTool.cxx                  |  9 ++---
 .../src/NnClusterizationFactory.cxx           | 17 ++++++++--
 .../src/TruthClusterizationFactory.cxx        |  4 +--
 10 files changed, 56 insertions(+), 45 deletions(-)
 create mode 100644 InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
index 4e316f6c687..d21cd07c945 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/CMakeLists.txt
@@ -27,6 +27,7 @@ atlas_depends_on_subdirs(
    Tracking/TrkEvent/TrkParameters
    Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils
    PRIVATE
+   Control/CxxUtils
    Database/AthenaPOOL/AthenaPoolUtilities
    Database/AthenaPOOL/PoolSvc
    Database/APR/FileCatalog
@@ -52,7 +53,7 @@ atlas_add_library( SiClusterizationToolLib
    LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives
    Identifier EventPrimitives GaudiKernel InDetSimData InDetIdentifier
    InDetReadoutGeometry InDetRawData InDetPrepRawData InDetRecToolInterfaces
-   TrkParameters TrkNeuralNetworkUtilsLib PixelConditionsData
+   TrkParameters TrkNeuralNetworkUtilsLib CxxUtils PixelConditionsData
    PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaPoolUtilities FileCatalog AtlasDetDescr
    TrkSurfaces TrkEventPrimitives VxVertex PixelGeoModelLib )
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e772806066a
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/SiClusterizationTool
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h
index ca84dd81066..4e0505a0bcc 100755
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/ClusterMakerTool.h
@@ -29,6 +29,8 @@
 #include "PixelConditionsData/PixelOfflineCalibData.h"
 #include "StoreGate/ReadCondHandleKey.h"
 
+#include <atomic>
+
 class IPixelCalibSvc;
 template <class T> class ServiceHandle;
 class Identifier;
@@ -142,6 +144,10 @@ private:
 
   //  mutable MsgStream m_log;
   bool m_calibrateCharge;
+  mutable std::atomic_bool m_issueErrorA;
+  mutable std::atomic_bool m_forceErrorStrategy1A;
+  mutable std::atomic_bool m_issueErrorB;
+  mutable std::atomic_bool m_forceErrorStrategy1B;
   ServiceHandle<IPixelCalibSvc> m_calibSvc;
   ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "SiLorentzAngleTool/PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"};
   ToolHandle<ISiLorentzAngleTool> m_sctLorentzAngleTool{this, "SCTLorentzAngleTool", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retreive Lorentz angle of SCT"};
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
index a5f18590501..437e86a6460 100755
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/MergedPixelsTool.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,13 +21,15 @@
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
 
 #include "Identifier/Identifier.h"
-#include <vector>
 
 #include "GaudiKernel/ServiceHandle.h"
 
 // forward declare not possible (typedef)
 #include "InDetPrepRawData/PixelClusterCollection.h"
 
+#include <atomic>
+#include <vector>
+
 class IIncidentSvc;
 class PixelID;
 //class StoreGateSvc;
@@ -173,11 +175,12 @@ namespace InDet {
 	
         std::string                                         m_splitClusterMapName;//No longer used Remove later //!< split cluster ambiguity map
 
-        mutable unsigned int                                m_processedClusters;    //!< statistics output
-        mutable unsigned int                                m_modifiedOrigClusters; //!< statistics output
-        mutable unsigned int                                m_splitOrigClusters;    //!< statistics output
-        mutable unsigned int                                m_splitProdClusters;    //!< statistics output
-        mutable unsigned int                                m_largeClusters;        //!< statistics output
+        mutable std::atomic_uint                            m_processedClusters;    //!< statistics output
+        mutable std::atomic_uint                            m_modifiedOrigClusters; //!< statistics output
+        mutable std::atomic_uint                            m_splitOrigClusters;    //!< statistics output
+        mutable std::atomic_uint                            m_splitProdClusters;    //!< statistics output
+        mutable std::atomic_uint                            m_largeClusters;        //!< statistics output
+        mutable std::atomic_bool                            m_printw;
         std::vector<int>          			    m_minToT;               /**< ToT cut */
         //ServiceHandle< StoreGateSvc >                       m_detStore;
         //const PixelID*                                      m_idHelper;
@@ -186,19 +189,3 @@ namespace InDet {
 }
 
 #endif // SICLUSTERIZATIONTOOL_MERGEDPIXELSALG_H
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
index e2424bd06f5..c1a1bfcef9b 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h
@@ -39,6 +39,9 @@
 #include "SiClusterizationTool/TTrainedNetworkCollection.h"
 #include "PixelConditionsServices/IPixelCalibSvc.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
+
  class TTrainedNetwork;
  class TH1;
  class ICoolHistSvc;
@@ -189,7 +192,7 @@ namespace InDet {
                         kErrorXNN,
                         kErrorYNN,
                         kNNetworkTypes};
-    static const char *s_nnTypeNames[kNNetworkTypes];
+    static const char* const s_nnTypeNames[kNNetworkTypes];
     std::vector<unsigned int> m_nParticleGroup;
     std::vector<std::regex>   m_nnNames;
 
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
index 3e4e2834b5b..9422c4103cd 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
@@ -18,6 +18,7 @@
  #include "GaudiKernel/ToolHandle.h"
  #include "GaudiKernel/IIncidentSvc.h"
 
+ #include <atomic>
  #include <vector>
  #include <string>
  #include <map>
@@ -73,7 +74,7 @@ namespace InDet {
 	/** IncidentSvc to catch begining of event and end of event */   
     ServiceHandle<IIncidentSvc>           m_incidentSvc;   	
     SG::ReadHandleKey<InDetSimDataCollection> m_simDataCollectionName {this, "InputSDOMap", "PixelSDO_Map", "sim data collection name"};
-    mutable const InDetSimDataCollection*   m_simDataCollection;        //!< sim data collection - refreshed at BeginEvent incident
+    mutable std::atomic<const InDetSimDataCollection*> m_simDataCollection; //!< sim data collection - refreshed at BeginEvent incident
 
   protected:
     ServiceHandle<IAtRndmGenSvc> m_rndmSvc;
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx
index b383a7af866..2d135491b0b 100755
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx
@@ -47,6 +47,10 @@ ClusterMakerTool::ClusterMakerTool(const std::string& t,
                                    const std::string& n,
                                    const IInterface* p) :
   AthAlgTool(t,n,p),
+  m_issueErrorA(true),
+  m_forceErrorStrategy1A(false),
+  m_issueErrorB(true),
+  m_forceErrorStrategy1B(false),
   m_calibSvc("PixelCalibSvc", n)
 { 
   declareInterface<ClusterMakerTool>(this);
@@ -146,10 +150,8 @@ PixelCluster* ClusterMakerTool::pixelCluster(
          			           bool split,
                          double splitProb1,
                          double splitProb2) const{
-  static bool issueError = true;
-  static bool forceErrorStrategy1 = false;
-  if ( errorStrategy==2 && issueError ) {
-    issueError=false;
+  if ( errorStrategy==2 && m_issueErrorA ) {
+    m_issueErrorA=false;
   }
   
   const AtlasDetectorID* aid = element->getIdHelper();
@@ -159,7 +161,7 @@ PixelCluster* ClusterMakerTool::pixelCluster(
   	return nullptr;
   }
   
-  if ( errorStrategy==2 && forceErrorStrategy1 ) errorStrategy=1;
+  if ( errorStrategy==2 && m_forceErrorStrategy1A ) errorStrategy=1;
   // Fill vector of charges
   std::vector<float> chargeList;
   if (m_calibrateCharge) {
@@ -294,12 +296,10 @@ PixelCluster* ClusterMakerTool::pixelCluster(
 	
  
   if (msgLvl(MSG::VERBOSE)) msg() << "ClusterMakerTool called, number " << endmsg;
-  static bool issueError = true;
-  static bool forceErrorStrategy1 = false;
-  if ( errorStrategy==2 && issueError ) {
-    issueError=false;
+  if ( errorStrategy==2 && m_issueErrorB ) {
+    m_issueErrorB=false;
   }
-  if ( errorStrategy==2 && forceErrorStrategy1 ) errorStrategy=1;
+  if ( errorStrategy==2 && m_forceErrorStrategy1B ) errorStrategy=1;
 
   // Fill vector of charges and compute charge balance
   const InDetDD::PixelModuleDesign* design = (dynamic_cast<const InDetDD::PixelModuleDesign*>(&element->design()));
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
index 454cbf01ad6..4c5c9564b28 100755
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -74,6 +74,7 @@ namespace InDet {
     m_splitOrigClusters(0),   
     m_splitProdClusters(0),   
     m_largeClusters(0),
+    m_printw(true),
     m_minToT({0,0,0,0,0,0,0})
     //m_detStore("DetectorStore", name),
     //m_idHelper(0)
@@ -786,10 +787,10 @@ PixelCluster* MergedPixelsTool::makeCluster
     if(m_posStrategy == 10 && !hasGanged  && etaRow>0 && etaCol > 0){
     // recFlag == 10 (CTB simulation)
     // use parametrization studied on CTB data by I. Reisinger (Dortmund)
-        static bool printw=true;
-        if (printw) {
+        if (m_printw) {
             ATH_MSG_ERROR("Detected position strategy = 10, this is an obsolete setting for CTB analysis and is not supported anymore since Athena 15.4.0"); 
-            ATH_MSG_ERROR("...reverting to default setting: position strategy = 0");        printw=false;
+            ATH_MSG_ERROR("...reverting to default setting: position strategy = 0");
+            m_printw=false;
         }
     } 
     // Endcap SR1 Cosmics
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
index be010465cd5..1de39a533d9 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.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
 */
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -46,11 +46,22 @@
 #include <cmath>
 #include <regex>
 
-
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
+// The following warning message appears four times and the check is disabled for this file.
+// InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx:
+// In member function 'std::vector<double> InDet::NnClusterizationFactory::
+// estimateNumberOfParticles(const InDet::PixelCluster&, Amg::Vector3D&, int, int) const':
+// InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx:307:77:
+// warning: Const discarded from expression '<unknown>' of type
+// const InDet::NnClusterizationFactory* const' within function 'std::vector<double>
+// InDet::NnClusterizationFactory::estimateNumberOfParticles
+// (const InDet::PixelCluster&, Amg::Vector3D&, int, int) const'; may not be thread-safe.
+// std::vector<double> inputData=(this->*m_assembleInput)(input,sizeX,sizeY);
 
 namespace InDet {
 
-  const char *NnClusterizationFactory::s_nnTypeNames[]={
+  const char * const NnClusterizationFactory::s_nnTypeNames[]={
     "NumberParticlesNN",
     "PositionNN",
     "ErrorXNN",
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
index 553db1e4795..6067167563d 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
@@ -111,8 +111,8 @@ namespace InDet {
 	//Loop over all elements (pixels/strips) in the cluster
 	for (auto rdoIter :  rdos){
 		if (m_simDataCollection){
-			auto simDataIter = m_simDataCollection->find(rdoIter);
-			if (simDataIter != m_simDataCollection->end()){
+                       auto simDataIter = m_simDataCollection.load()->find(rdoIter);
+                       if (simDataIter != m_simDataCollection.load()->end()){
                 		crazycluster = false;
 				// get the SimData and count the individual contributions
 				auto simData = (simDataIter->second);
-- 
GitLab


From 1050024c0767a1cff9409617c87a79a0bb365c12 Mon Sep 17 00:00:00 2001
From: Jack Cranshaw <cranshaw@anl.gov>
Date: Wed, 6 Mar 2019 10:27:01 +0000
Subject: [PATCH 262/404] Clean up and improve comments for GenericMetadataTool

---
 .../AthenaKernel/GenericMetadataTool.h        | 29 +++++++++++++--
 .../AthenaKernel/GenericMetadataTool.icc      | 37 +++++++++----------
 .../AthenaKernel/GenericMetadataToolNoAux.h   | 29 +++++++++++++--
 .../AthenaKernel/GenericMetadataToolNoAux.icc | 33 ++---------------
 .../src/ByteStreamMetadataTool.h              |  7 ++--
 .../EventBookkeeperTools/BookkeeperTool.h     |  9 ++---
 .../Root/BookkeeperTool.cxx                   |  8 +++-
 .../src/EventFormatMetaDataTool.h             |  2 -
 8 files changed, 85 insertions(+), 69 deletions(-)

diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
index a7deac3027f..f2ce54871dd 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.h
@@ -34,30 +34,47 @@ public: // Constructor and Destructor
    virtual ~GenericMetadataTool();
 
 public:
+   /// IMetaDataTool interface method
    virtual StatusCode metaDataStop() override;
+   /// IMetaDataTool interface method
    virtual StatusCode beginInputFile(const SG::SourceID& sid = "Serial") override;
+   /// IMetaDataTool interface method
    virtual StatusCode endInputFile(const SG::SourceID& sid = "Serial") override;
+
+   /// AthAlgTool methods
    virtual StatusCode initialize() override;
    virtual StatusCode finalize() override;
 
 protected:
+   /// Method to retrieve handle to input metadata store
+   //  Note that these tools operate outside an event context
    ServiceHandle<StoreGateSvc> inputMetaStore() const;
+   /// Method to retrieve handle to output metadata store
    ServiceHandle<StoreGateSvc> outputMetaStore() const;
 
+   // Utility methods to implement the general logic of a metadata tool
    /// Helper class to update a container with information from another one
+   //  i.e. this is the 'merge' method
    virtual StatusCode updateContainer( T* contToUpdate,
                                  const T* otherCont ) = 0;
 
+   // Utility methods to implement the general logic of a metadata tool
+   // 
+   // Initialize container in output store, link aux to interface
    StatusCode initOutputContainer(const std::string& sgkey);
-
+   /// Put input metadata in a MetaCont[sid]
+   //  so that it can be accessed by event context aware handles
    StatusCode buildAthenaInterface(const std::string& inputName,
                                    const std::string& outputName,
                                    const SG::SourceID& sid);
 
-   /// Fill Cutflow information
+   /// Add any information which has been collected during processing
+   //  Metadata to be added must be placed in the output metadata store 
+   //     and the appropriate key declared to the tool. Otherwise the 
+   //     additional metadata can be created however needed. 
    StatusCode addProcessMetadata();
  
-   /// Pointer to cut flow svc 
+   /// Cached handles to the metadata stores
    ServiceHandle<StoreGateSvc> m_inputMetaStore;
    ServiceHandle<StoreGateSvc> m_outputMetaStore;
 
@@ -68,12 +85,18 @@ protected:
    /// The name of the process Container
    std::string m_procMetaName;
 
+   /// Flag for internal use to avoid writing process metadata twice
    bool m_processMetadataTaken;
+   /// Flag settable by property on whether to do Filekeeping
    bool m_markIncomplete;
 
+   //  List of source ids for doing garbage collection 
+   //
    /// List of source ids which have reached end file
    std::set<SG::SourceID> m_fullreads;
+   /// List of source ids which have been opened
    std::set<SG::SourceID> m_read;
+   /// List of source ids which have been written
    std::set<SG::SourceID> m_written;
 
 };
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
index 090d157df0e..7faa6a77381 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
@@ -5,7 +5,7 @@
 */
 
 // Implementation file for class GenericMetadataTool
-// Authors: Joao Firmino da Costa <joao.costa@cern.ch> and David Cote <david.cote@cern.ch>
+// Authors: Jack Cranshaw <Jack.Cranshaw@cern.ch>
 ///////////////////////////////////////////////////////////////////
 
 // STL include
@@ -96,9 +96,10 @@ StatusCode GenericMetadataTool<T,U>::beginInputFile(const SG::SourceID& sid)
     ATH_MSG_INFO("No input name");
   }
 
-  // reset cutflow taken marker
+  // reset process metadata taken marker for new input
   m_processMetadataTaken = false;
 
+  // mark that a new source id has been opened
   m_read.insert(sid);
   
   return StatusCode::SUCCESS;
@@ -131,15 +132,15 @@ StatusCode GenericMetadataTool<T,U>::metaDataStop()
     const MetaCont<T>* tmp;
     ATH_CHECK(outputMetaStore()->retrieve(tmp,tmp_name));
     T* outcom = new T();
-    U* outcom_aux = new U();
-    outcom->setStore(outcom_aux);
+    U* outcom_aux = new U();             // AUX PART
+    outcom->setStore(outcom_aux);        // AUX PART
 
     if (m_markIncomplete) {
       std::string inc_name = storename+"Incomplete"+m_outputCollName+"Cont"; 
       // Build incomplete container to fill
       T* outinc = new T();
-      U* outinc_aux = new U();
-      outinc->setStore(outinc_aux);
+      U* outinc_aux = new U();           // AUX PART
+      outinc->setStore(outinc_aux);      // AUX PART
       // Check if there were any incomplete inputs
       const MetaCont<T>* inc;
       if(outputMetaStore()->retrieve(inc,inc_name).isSuccess()) {
@@ -186,14 +187,14 @@ StatusCode GenericMetadataTool<T,U>::metaDataStop()
         ATH_MSG_INFO("Cleaning up class for " << incout_name);
         const T* tmpBook(nullptr);
         if ( outputMetaStore()->retrieve(tmpBook,incout_name).isSuccess() ) {
-          const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+          const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore(); // AUX PART
           ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
-          ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+          ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));    // AUX PART
         }
         else ATH_MSG_INFO("StoreGate failed retrieve");
       }
       ATH_CHECK(outputMetaStore()->record(outinc,incout_name));
-      ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux."));
+      ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux.")); // AUX PART
     }  // markIncomplete
     else {
       auto sids_tmp = tmp->sources();
@@ -214,14 +215,14 @@ StatusCode GenericMetadataTool<T,U>::metaDataStop()
       ATH_MSG_INFO("Cleaning up class for " << m_outputCollName);
       const T* tmpBook(nullptr);
       if ( outputMetaStore()->retrieve(tmpBook,m_outputCollName).isSuccess() ) {
-        const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+        const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();  // AUX PART
         ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
-        ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+        ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));     // AUX PART
       }
       else ATH_MSG_ERROR("StoreGate failed retrieve");
     }
     ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName));
-    ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux."));
+    ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux.")); // AUX PART
   } // inputCollName if
 
   if (!m_processMetadataTaken) {
@@ -238,14 +239,12 @@ StatusCode GenericMetadataTool<T,U>::metaDataStop()
 
   if (m_inputCollName != "") {  // are there inputs
     // Copy read files into written files
-    //std::copy(m_read.begin(),m_read.end(),back_inserter(m_written));
     for (auto it = m_read.begin(); it != m_read.end(); ++it) {
       m_written.insert(*it);
     }
     // Remove completes from read
     for (auto it = m_fullreads.begin(); it != m_fullreads.end(); ++it) {
       m_read.erase(*it);
-      //std::remove(m_read.begin(); m_read.end(), *it);
     }
     m_fullreads.clear();
   } // inputCollName if
@@ -271,13 +270,11 @@ StatusCode GenericMetadataTool<T,U>::initOutputContainer( const std::string& sgk
   // Put it in a MetaCont
   MetaCont<T>* mcont = new MetaCont<T>(DataObjID(ClassID_traits<T>::ID(),key));
   // Do the same for the auxiliary container
-  std::string auxkey(key+"Aux.");
-  //MetaCont<U>* acont = new MetaCont<U>(DataObjID(ClassID_traits<U>::ID(),auxkey)); // fails on symlink, Failure
-  //MetaCont<SG::IConstAuxStore>* acont = new MetaCont<SG::IConstAuxStore>(DataObjID(ClassID_traits<SG::IConstAuxStore>::ID(),auxkey)); // fails on symlink, exception
-  DataObjID obj(ClassID_traits<SG::IConstAuxStore>::ID(),auxkey);
-  MetaCont<SG::IConstAuxStore>* acont = new MetaCont<SG::IConstAuxStore>(obj); 
+  std::string auxkey(key+"Aux.");    // AUX PART
+  DataObjID obj(ClassID_traits<SG::IConstAuxStore>::ID(),auxkey); // AUX PART
+  MetaCont<SG::IConstAuxStore>* acont = new MetaCont<SG::IConstAuxStore>(obj); // AUX PART 
   ATH_CHECK(outputMetaStore()->record(std::move(mcont),key));
-  ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey));
+  ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey));  // AUX PART
   // Create a symlink
   // so that proxy references to <Aux>#auxkey find it in MetaCont<Aux>#auxkey
   try {
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
index a64cc062ac2..afbceff9446 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.h
@@ -34,30 +34,47 @@ public: // Constructor and Destructor
    virtual ~GenericMetadataToolNoAux();
 
 public:
+   /// IMetaDataTool interface method
    virtual StatusCode metaDataStop() override;
+   /// IMetaDataTool interface method
    virtual StatusCode beginInputFile(const SG::SourceID& sid = "Serial") override;
+   /// IMetaDataTool interface method
    virtual StatusCode endInputFile(const SG::SourceID& sid = "Serial") override;
+
+   /// AthAlgTool methods
    virtual StatusCode initialize() override;
    virtual StatusCode finalize() override;
 
 protected:
+   /// Method to retrieve handle to input metadata store
+   //  Note that these tools operate outside an event context
    ServiceHandle<StoreGateSvc> inputMetaStore() const;
+   /// Method to retrieve handle to output metadata store
    ServiceHandle<StoreGateSvc> outputMetaStore() const;
 
+   // Utility methods to implement the general logic of a metadata tool
    /// Helper class to update a container with information from another one
+   //  i.e. this is the 'merge' method
    virtual StatusCode updateContainer( T* contToUpdate,
                                  const T* otherCont ) = 0;
 
+   // Utility methods to implement the general logic of a metadata tool
+   //
+   // Initialize container in output store
    StatusCode initOutputContainer(const std::string& sgkey);
-
+   /// Put input metadata in a MetaCont[sid]
+   //  so that it can be accessed by event context aware handles
    StatusCode buildAthenaInterface(const std::string& inputName,
                                    const std::string& outputName,
                                    const SG::SourceID& sid);
 
-   /// Fill Cutflow information
+   /// Add any information which has been collected during processing
+   //  Metadata to be added must be placed in the output metadata store 
+   //     and the appropriate key declared to the tool. Otherwise the 
+   //     additional metadata can be created however needed. 
    StatusCode addProcessMetadata();
  
-   /// Pointer to cut flow svc 
+   /// Cached handles to the metadata stores
    ServiceHandle<StoreGateSvc> m_inputMetaStore;
    ServiceHandle<StoreGateSvc> m_outputMetaStore;
 
@@ -68,12 +85,18 @@ protected:
    /// The name of the process Container
    std::string m_procMetaName;
 
+   /// Flag for internal use to avoid writing process metadata twice
    bool m_processMetadataTaken;
+   /// Flag settable by property on whether to do Filekeeping
    bool m_markIncomplete;
 
+   //  List of source ids for doing garbage collection 
+   //
    /// List of source ids which have reached end file
    std::set<SG::SourceID> m_fullreads;
+   /// List of source ids which have been opened
    std::set<SG::SourceID> m_read;
+   /// List of source ids which have been written
    std::set<SG::SourceID> m_written;
 
 };
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
index e5bc970b222..0ac316e42a2 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
@@ -5,7 +5,7 @@
 */
 
 // Implementation file for class GenericMetadataToolNoAux
-// Authors: Joao Firmino da Costa <joao.costa@cern.ch> and David Cote <david.cote@cern.ch>
+// Authors: Jack Cranshaw <Jack.Cranshaw@cern.ch>
 ///////////////////////////////////////////////////////////////////
 
 // STL include
@@ -96,9 +96,10 @@ StatusCode GenericMetadataToolNoAux<T>::beginInputFile(const SG::SourceID& sid)
     ATH_MSG_INFO("No input name");
   }
 
-  // reset cutflow taken marker
+  // reset process metadata taken marker for new input
   m_processMetadataTaken = false;
 
+  // mark that a new source id has been opened
   m_read.insert(sid);
   
   return StatusCode::SUCCESS;
@@ -131,15 +132,11 @@ StatusCode GenericMetadataToolNoAux<T>::metaDataStop()
     const MetaCont<T>* tmp;
     ATH_CHECK(outputMetaStore()->retrieve(tmp,tmp_name));
     T* outcom = new T();
-    //U* outcom_aux = new U();
-    //outcom->setStore(outcom_aux);
 
     if (m_markIncomplete) {
       std::string inc_name = storename+"Incomplete"+m_outputCollName+"Cont"; 
       // Build incomplete container to fill
       T* outinc = new T();
-      //U* outinc_aux = new U();
-      //outinc->setStore(outinc_aux);
       // Check if there were any incomplete inputs
       const MetaCont<T>* inc;
       if(outputMetaStore()->retrieve(inc,inc_name).isSuccess()) {
@@ -186,14 +183,11 @@ StatusCode GenericMetadataToolNoAux<T>::metaDataStop()
         ATH_MSG_INFO("Cleaning up class for " << incout_name);
         const T* tmpBook(nullptr);
         if ( outputMetaStore()->retrieve(tmpBook,incout_name).isSuccess() ) {
-          //const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
           ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
-          //ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
         }
         else ATH_MSG_INFO("StoreGate failed retrieve");
       }
       ATH_CHECK(outputMetaStore()->record(outinc,incout_name));
-      //ATH_CHECK(outputMetaStore()->record(outinc_aux,incout_name+"Aux."));
     }  // markIncomplete
     else {
       auto sids_tmp = tmp->sources();
@@ -214,14 +208,11 @@ StatusCode GenericMetadataToolNoAux<T>::metaDataStop()
       ATH_MSG_INFO("Cleaning up class for " << m_outputCollName);
       const T* tmpBook(nullptr);
       if ( outputMetaStore()->retrieve(tmpBook,m_outputCollName).isSuccess() ) {
-        //const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
         ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
-        //ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
       }
       else ATH_MSG_ERROR("StoreGate failed retrieve");
     }
     ATH_CHECK(outputMetaStore()->record(outcom,m_outputCollName));
-    //ATH_CHECK(outputMetaStore()->record(outcom_aux,m_outputCollName+"Aux."));
   } // inputCollName if
 
   if (!m_processMetadataTaken) {
@@ -238,14 +229,12 @@ StatusCode GenericMetadataToolNoAux<T>::metaDataStop()
 
   if (m_inputCollName != "") {  // are there inputs
     // Copy read files into written files
-    //std::copy(m_read.begin(),m_read.end(),back_inserter(m_written));
     for (auto it = m_read.begin(); it != m_read.end(); ++it) {
       m_written.insert(*it);
     }
     // Remove completes from read
     for (auto it = m_fullreads.begin(); it != m_fullreads.end(); ++it) {
       m_read.erase(*it);
-      //std::remove(m_read.begin(); m_read.end(), *it);
     }
     m_fullreads.clear();
   } // inputCollName if
@@ -270,23 +259,7 @@ StatusCode GenericMetadataToolNoAux<T>::initOutputContainer( const std::string&
   // Create the primary container
   // Put it in a MetaCont
   MetaCont<T>* mcont = new MetaCont<T>(DataObjID(ClassID_traits<T>::ID(),key));
-  // Do the same for the auxiliary container
-  //std::string auxkey(key+"Aux.");
-  //MetaCont<U>* acont = new MetaCont<U>(DataObjID(ClassID_traits<U>::ID(),auxkey));
   ATH_CHECK(outputMetaStore()->record(std::move(mcont),key));
-  //ATH_CHECK(outputMetaStore()->record(std::move(acont),auxkey));
-  //StatusCode sc(StatusCode::SUCCESS);
-/*
-  StatusCode sc = outputMetaStore()->symLink
-          (
-            ClassID_traits<MetaCont<SG::IConstAuxStore> >::ID(),
-            auxkey,
-            ClassID_traits<SG::IConstAuxStore>::ID()
-          );
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR("Unable to symlink " << auxkey);
-  }
-*/
 
   return StatusCode::SUCCESS;
 }
diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
index 5a1026d5068..6f753dbc6cc 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
@@ -1,12 +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
 */
 
 #ifndef BYTESTREAMMETADATATOOL_H
 #define BYTESTREAMMETADATATOOL_H
 
 /** @file ByteStreamMetadataTool.h
- *  @brief This file contains the class definition for the ByteStreamMetadataTool class.
+ *  @brief This class is an implementation of the GenericMetadataToolNoAux
+ *  for the ByteStreamMetadataContainer.
  *  @author Peter van Gemmeren <gemmeren@anl.gov>
  *  $Id: $
  **/
@@ -34,7 +35,7 @@ public:
    /// Gaudi Service Interface method implementations:
    StatusCode initialize() override;
    StatusCode finalize() override;
-   /// Helper class to update a container with information from another one
+   /// Virtual method to update a container with information from another one
    virtual StatusCode updateContainer(ByteStreamMetadataContainer* bsmdc_out,
                                 const ByteStreamMetadataContainer* bsmdc_in );
 };
diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
index 6bf4a4ba6c0..a905dcbec04 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
@@ -6,7 +6,8 @@
 #define BOOKKEEPERTOOL_H
 
 /** @file BookkeeperTool.h
- *  @brief This file contains the class definition for the BookkeeperTool class.
+ *  @brief This class is an implementation of the GenericMetadataTool
+ *  for the xAOD::CutBookkeeperContainer.
  *  @author Jack Cranshaw <cranshaw@anl.gov>
  *  $Id: $
  **/
@@ -19,10 +20,6 @@
 
 #include <string>
 
-/** @class BookkeeperTool
- *  @brief This class provides an example for reading with a ISelectorTool to veto events on AttributeList.
- **/
-
 
 class BookkeeperTool : public GenericMetadataTool <xAOD::CutBookkeeperContainer, xAOD::CutBookkeeperAuxContainer> 
 {
@@ -37,7 +34,7 @@ public:
 
 private:
   
-  /// Helper class to update a container with information from another one
+  /// Virtual method to update a container with information from another one
   virtual StatusCode updateContainer(xAOD::CutBookkeeperContainer* contToUpdate,
                                const xAOD::CutBookkeeperContainer* otherCont );
 
diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
index 7da02c01aaf..d3fb8a16b35 100644
--- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
+++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
@@ -5,7 +5,7 @@
 */
 
 // Implementation file for class BookkeeperTool
-// Authors: Joao Firmino da Costa <joao.costa@cern.ch> and David Cote <david.cote@cern.ch>
+// Authors: Jack Cranshaw <Jack.Cranshaw@cern.ch>
 ///////////////////////////////////////////////////////////////////
 
 #include "EventBookkeeperTools/BookkeeperTool.h"
@@ -72,7 +72,11 @@ resolveLink (const xAOD::CutBookkeeper* old,
 
 } // anonymous namespace
 
-
+//
+// (Merge) method required by base clase GenericMetdataTool
+//   Note that the implementation of the IMetaDataTool interface 
+//   is done in GenericMetadataTool and configured by properties 
+//   of that class
 StatusCode
 BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
                              const xAOD::CutBookkeeperContainer* otherCont ) 
diff --git a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
index 78067e4aa77..ca0afb8e779 100644
--- a/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
+++ b/Event/xAOD/xAODEventFormatCnv/src/EventFormatMetaDataTool.h
@@ -1,5 +1,3 @@
-// Dear emacs, this is -*- c++ -*-
-
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-- 
GitLab


From 7bb950f304aab7f3f1ed9833cc01611bf2dc1768 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 6 Mar 2019 10:29:41 +0000
Subject: [PATCH 263/404] 22.0-unit_tests-IOVDbSvc

---
 Database/IOVDbSvc/CMakeLists.txt              |   3 +-
 Database/IOVDbSvc/share/IOVDbSvc_test.ref     |  16 +-
 Database/IOVDbSvc/share/IOVDbSvc_test.txt     |   2 +-
 Database/IOVDbSvc/src/IOVDbFolder.cxx         |   2 +-
 .../IOVDbSvc/test/IOVDbCoolFunctions_test.cxx |   6 +-
 Database/IOVDbSvc/test/IOVDbFolder_test.cxx   |  11 +-
 .../IOVDbSvc/test/IOVDbSvc_Boost_test.cxx     | 146 +++++++++---------
 Database/IOVDbSvc/test/IOVDbSvc_test.cxx      |  11 +-
 Database/IOVDbSvc/test/TestFolderFixture.h    |   6 +-
 9 files changed, 107 insertions(+), 96 deletions(-)

diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 4c3dd346912..4aa82c1ebdf 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -51,6 +51,7 @@ atlas_add_component( IOVDbSvc
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
+atlas_install_joboptions( share/*.txt )
 
 
 atlas_add_test( IOVDbSvc_test
@@ -59,7 +60,7 @@ atlas_add_test( IOVDbSvc_test
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS}
                 LINK_LIBRARIES AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES}
                 PROPERTIES TIMEOUT 300
-                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG |Warning in <TFile::Init>: no" 
+                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG |Warning in <TFile::Init>: no |Initializing" 
                 ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
                 
 atlas_add_test( IOVDbSvc_Boost_test                
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_test.ref b/Database/IOVDbSvc/share/IOVDbSvc_test.ref
index 2a02bdebc65..01fe30e1b08 100644
--- a/Database/IOVDbSvc/share/IOVDbSvc_test.ref
+++ b/Database/IOVDbSvc/share/IOVDbSvc_test.ref
@@ -1,7 +1,7 @@
 IOVDbSvc_test
 
 
-Initializing Gaudi ApplicationMgr using job opts ../share/IOVDbSvc_test.txt
+Initializing Gaudi ApplicationMgr using job opts user_path/athena/Database/IOVDbSvc/share/IOVDbSvc_test.txt
 JobOptionsSvc        INFO # =======> user_path/athena/Database/IOVDbSvc/share/../share/IOVDbSvc_test.txt
 JobOptionsSvc        INFO # (1,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
 JobOptionsSvc        INFO # (2,1): IOVDbSvc.Folders = ["/key1", "/key2<extensible/>"]
@@ -33,18 +33,18 @@ Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All]
 IOVDbSvc             INFO Opened read transaction for POOL PersistencySvc
 IOVDbSvc             INFO Only 5 POOL conditions files will be open at once
 IOVDbFolder          INFO Extensible folder /key2
-IOVDbSvc             INFO Initialised with 1 connections and 2 folders
+IOVDbSvc             INFO Initialised with 2 connections and 2 folders
 IOVDbSvc             INFO Service IOVDbSvc initialised successfully
-IOVDbSvc             INFO Opening COOL connection for sqlite://;schema=cooldummy.db;dbname=OFLP200
+IOVDbSvc             INFO Opening COOL connection for sqlite://none;schema=mytest.db;dbname=OFLP200
 IOVSvc               INFO No IOVSvcTool associated with store "StoreGateSvc"
 IOVSvcTool           INFO IOVRanges will be checked at every Event
-IOVDbSvc             INFO Disconnecting from sqlite://;schema=cooldummy.db;dbname=OFLP200
+IOVDbSvc             INFO Disconnecting from sqlite://none;schema=mytest.db;dbname=OFLP200
 test1
-IOVDbSvc             INFO Opening COOL connection for sqlite://;schema=cooldummy.db;dbname=OFLP200
-IOVDbSvc             INFO Disconnecting from sqlite://;schema=cooldummy.db;dbname=OFLP200
+IOVDbSvc             INFO Opening COOL connection for sqlite://none;schema=mytest.db;dbname=OFLP200
+IOVDbSvc             INFO Disconnecting from sqlite://none;schema=mytest.db;dbname=OFLP200
 AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 IOVDbFolder          INFO Increase cache length (step 1) for folder /key2 to 8589934590 at validityKey 85899345935
-IOVDbSvc             INFO Opening COOL connection for sqlite://;schema=cooldummy.db;dbname=OFLP200
-IOVDbSvc             INFO Disconnecting from sqlite://;schema=cooldummy.db;dbname=OFLP200
+IOVDbSvc             INFO Opening COOL connection for sqlite://none;schema=mytest.db;dbname=OFLP200
+IOVDbSvc             INFO Disconnecting from sqlite://none;schema=mytest.db;dbname=OFLP200
 
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_test.txt b/Database/IOVDbSvc/share/IOVDbSvc_test.txt
index 16d0366b1a7..114f072e21a 100644
--- a/Database/IOVDbSvc/share/IOVDbSvc_test.txt
+++ b/Database/IOVDbSvc/share/IOVDbSvc_test.txt
@@ -1,3 +1,3 @@
 ApplicationMgr.CreateSvc += { "StoreGateSvc/DetectorStore" };
-IOVDbSvc.Folders = { "/key1", "/key2<extensible/>" };
+IOVDbSvc.Folders = { "<db>sqlite://none;schema=mytest.db;dbname=OFLP200</db> /key1", "<db>sqlite://none;schema=mytest.db;dbname=OFLP200</db> /key2<extensible/>" };
 EventPersistencySvc.CnvServices += { "AthenaPoolCnvSvc" };
diff --git a/Database/IOVDbSvc/src/IOVDbFolder.cxx b/Database/IOVDbSvc/src/IOVDbFolder.cxx
index ab57c5329fb..0687f4f2d9b 100644
--- a/Database/IOVDbSvc/src/IOVDbFolder.cxx
+++ b/Database/IOVDbSvc/src/IOVDbFolder.cxx
@@ -380,6 +380,7 @@ bool IOVDbFolder::loadCache(const cool::ValidityKey vkey,
             m_cacheattr[m_cacheattr.size()-1].fastCopyData(*pitr);
             m_nbytesread+=IOVDbNamespace::attributeListSize(*pitr);
           }
+          
           // save pointers to start and end
           m_cacheccstart.push_back(istart);
           m_cacheccend.push_back(m_cacheattr.size());
@@ -1246,7 +1247,6 @@ IOVDbFolder::setSharedSpec(const coral::AttributeList& atrlist) {
       " in folder " << m_foldername <<  " will not be counted for bytes-read statistics" );
     }
   }
-  m_nbytesread+=IOVDbNamespace::attributeListSize(atrlist);
   ATH_MSG_DEBUG( "Setup shared AttributeListSpecification with " <<  m_cachespec->size() << " elements" );
 }
 
diff --git a/Database/IOVDbSvc/test/IOVDbCoolFunctions_test.cxx b/Database/IOVDbSvc/test/IOVDbCoolFunctions_test.cxx
index 9e38fa3ddd1..e077c901d52 100644
--- a/Database/IOVDbSvc/test/IOVDbCoolFunctions_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbCoolFunctions_test.cxx
@@ -79,11 +79,13 @@ BOOST_AUTO_TEST_SUITE(CoolFunctionsTest)
     //needs coral::AttributeList argument
     auto pSpec=new coral::AttributeListSpecification;
     pSpec->extend<int>("myInt");
+    pSpec->extend<int>("anotherInt");
     pSpec->extend<std::string>("PoolRef");
     coral::AttributeList attrList(*pSpec, true);
     attrList[0].setValue(1);
-    attrList[1].setValue(std::string("hello"));
-    BOOST_TEST(IOVDbNamespace::attributeListSize(attrList) ==9);
+    attrList[1].setValue(2);
+    attrList[2].setValue(std::string("hello"));
+    BOOST_TEST(IOVDbNamespace::attributeListSize(attrList) ==13);
     
   }
   //
diff --git a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
index 7a1dabf4d44..df5d18c7409 100644
--- a/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbFolder_test.cxx
@@ -83,7 +83,7 @@ BOOST_FIXTURE_TEST_SUITE(IOVDbFolderTest , GaudiKernelFixture)
   BOOST_FIXTURE_TEST_SUITE(IOVDbFolderMethods, TestFolderFixture)
     BOOST_AUTO_TEST_CASE(PublicMethods){
       //preload tests
-      IOVDbConn connection("sqlite://;schema=cooldummy.db;dbname=OFLP200", true, parserFixture.log);
+      IOVDbConn connection("sqlite://;schema=IOVDbFolderTest.db;dbname=OFLP200", true, parserFixture.log);
       IOVDbFolder iovDbFolder(&connection, parserFixture.parser, parserFixture.log, clidSvc.get(),false);
       BOOST_TEST_CHECKPOINT("After instantiation, but before any loading method call");
       BOOST_TEST(iovDbFolder.folderName() == "/key1");
@@ -91,7 +91,7 @@ BOOST_FIXTURE_TEST_SUITE(IOVDbFolderTest , GaudiKernelFixture)
       BOOST_TEST(iovDbFolder.conn() != nullptr);
       BOOST_TEST(iovDbFolder.multiVersion() == false);
       const bool isEpochTimestamp(true);
-      BOOST_TEST(iovDbFolder.timeStamp() != isEpochTimestamp);
+      BOOST_TEST(iovDbFolder.timeStamp() != isEpochTimestamp);//before looking
       BOOST_TEST(iovDbFolder.tagOverride() == false);
       BOOST_TEST(iovDbFolder.retrieved() == false);
       BOOST_TEST(iovDbFolder.noOverride() == false);
@@ -111,14 +111,15 @@ BOOST_FIXTURE_TEST_SUITE(IOVDbFolderTest , GaudiKernelFixture)
       BOOST_TEST_CHECKPOINT("After preLoadFolder method call");
       const std::string tag("");
       auto addr=iovDbFolder.preLoadFolder(detStore.get(),0,600);
-      BOOST_TEST(iovDbFolder.loadCache(cool::ValidityKey((10ull<<32) + 20),600, tag, true) == true);
+      BOOST_TEST(iovDbFolder.loadCache(cool::ValidityKey(50),600, tag, true) == true);
       BOOST_TEST_CHECKPOINT("After loadCache method call");
+      BOOST_TEST(iovDbFolder.timeStamp() == isEpochTimestamp);//after looking
       BOOST_TEST(iovDbFolder.retrieved() == false);//only changed by getAddress method
-      BOOST_TEST(iovDbFolder.bytesRead() == 12);//why not 8? we got two int32 
+      BOOST_TEST(iovDbFolder.bytesRead() == 8);
       BOOST_TEST(iovDbFolder.readTime() > 0.0);
       BOOST_TEST(iovDbFolder.clid() == 1238547719);
       auto theValidityKey=iovDbFolder.iovTime(cool::ValidityKey(600));
-      BOOST_TEST(theValidityKey == cool::ValidityKey(18446744073709551615ull));//why? is this -1?
+      BOOST_TEST(theValidityKey == cool::ValidityKey(600));
       IOVRange zeroRange{0,0};
       BOOST_TEST(iovDbFolder.currentRange() ==  zeroRange);//why?
       BOOST_TEST(iovDbFolder.cacheValid(cool::ValidityKey(600)) );
diff --git a/Database/IOVDbSvc/test/IOVDbSvc_Boost_test.cxx b/Database/IOVDbSvc/test/IOVDbSvc_Boost_test.cxx
index 4f2be426753..85a2ed31195 100644
--- a/Database/IOVDbSvc/test/IOVDbSvc_Boost_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbSvc_Boost_test.cxx
@@ -24,6 +24,7 @@
 //
 #include "GaudiKernelFixtureBase.h"
 #include "TestFolderFixture.h"
+namespace utf = boost::unit_test;
 
 struct GaudiKernelFixture:public GaudiKernelFixtureBase{
   GaudiKernelFixture():GaudiKernelFixtureBase(__FILE__){
@@ -32,106 +33,107 @@ struct GaudiKernelFixture:public GaudiKernelFixtureBase{
 };
 
 struct TestFolderFixture:public TestFolderFixtureBase{
-  TestFolderFixture():TestFolderFixtureBase("IOVDbSvc_Boost_test.db"){
+  //using IOVDbSvc default connection to sqlite file cooldummy.db
+  TestFolderFixture():TestFolderFixtureBase("cooldummy.db"){
     //nop, everything in base.
   }
 };
 
 //Basic tests that the service can be retrieved
-BOOST_FIXTURE_TEST_SUITE(IOVDbSvcTest , GaudiKernelFixture)
+BOOST_AUTO_TEST_SUITE(IOVDbSvcTest )
+  GaudiKernelFixture g;
+  const auto & svcLoc=g.svcLoc;
+  ServiceHandle<IIOVDbSvc> iovdbsvc ("IOVDbSvc", "test");
+
   BOOST_AUTO_TEST_CASE( SanityCheck ){
-    BOOST_TEST(gaudiIsInitialised);
-    BOOST_TEST(svcLoc!=nullptr);
+    const bool svcLocatorIsOk=(svcLoc != nullptr);
+    BOOST_TEST(svcLocatorIsOk);
   }
 
   BOOST_AUTO_TEST_CASE(IOVDbSvcRetrieved){
-    ServiceHandle<IIOVDbSvc> iovdbsvc ("IOVDbSvc", "test");
     BOOST_TEST (iovdbsvc.retrieve().isSuccess());
   }
   
   BOOST_AUTO_TEST_CASE(interfaceID){
-    ServiceHandle<IIOVDbSvc> iovdbsvc ("IOVDbSvc", "test");
-    BOOST_TEST (iovdbsvc.retrieve().isSuccess());
     InterfaceID testId("IOVDbSvc",1,0);
     BOOST_TEST(iovdbsvc->interfaceID()==testId);
   }
 
   BOOST_AUTO_TEST_CASE(preloadAddresses){
-    ServiceHandle<IIOVDbSvc> iovdbsvc ("IOVDbSvc", "test");
-    BOOST_TEST (iovdbsvc.retrieve().isSuccess());
     IAddressProvider* iovdbsvc_ap =  dynamic_cast<IAddressProvider*> (iovdbsvc.get());
     IAddressProvider::tadList tlist;
     BOOST_TEST( iovdbsvc_ap->preLoadAddresses (StoreID::DETECTOR_STORE, tlist).isSuccess() );
-    
   }
   
   //tests requiring a database
-  BOOST_FIXTURE_TEST_SUITE(FolderTest, TestFolderFixture)
-    BOOST_AUTO_TEST_CASE(getRange){
-      IOVRange range;
-      std::string tag{};
-      IOpaqueAddress* addr = nullptr;
-      //normal folder
-      BOOST_TEST_MESSAGE("Testing getRange for folder");
-      BOOST_TEST( iovdbsvc->getRange (1238547719, fixtureFoldername, IOVTime (10, 15),range, tag, addr).isSuccess() );
-      BOOST_TEST (std::string(range) == "{[10,10] - [10,20]}");
-      BOOST_TEST(tag=="/key1");//setting this value is commented with 'FIXME' in the IOVDbSvc getRange method
-      //
-      BOOST_TEST( iovdbsvc->getRange (1238547719, fixtureFoldername, IOVTime (10, 35),range, tag, addr).isSuccess() );
-      BOOST_TEST (std::string(range) == "{[10,30] - [2147483647,4294967295]}");
-      //
-      //Things which should fail
-      //wrong clid
-      BOOST_TEST( iovdbsvc->getRange (999, fixtureFoldername, IOVTime (10, 15),range, tag, addr).isFailure() );
-      //wrong key
-      BOOST_TEST( iovdbsvc->getRange (1238547719, invalidFoldername, IOVTime (10, 15),range, tag, addr).isFailure() );
-      //wrong global tag (todo)
-    }
-    /** no need to test the setRange method; it does nothing
-    BOOST_AUTO_TEST_CASE(setRange){
-      BOOST_TEST( iovdbsvc->setRange (1238547719, "/key1",range,tag).isSuccess() );      
-    }
-    **/
-    BOOST_AUTO_TEST_CASE(signalBeginRun){
-      EventContext ctx;
-      ctx.setExtension<Atlas::ExtendedEventContext>( Atlas::ExtendedEventContext(nullptr,10));
-      BOOST_TEST( iovdbsvc->signalBeginRun(IOVTime(10,10), ctx).isSuccess());
-    }
-    
-    BOOST_AUTO_TEST_CASE(signalEndProxyPreload){
-      BOOST_CHECK_NO_THROW( iovdbsvc->signalEndProxyPreload());
-    }
-    
-    BOOST_AUTO_TEST_CASE(getKeyList){
-      auto keyList=iovdbsvc->getKeyList();
-      BOOST_TEST(keyList.size() ==1);
-      auto firstEntry=keyList.front();
-      BOOST_TEST(firstEntry == fixtureFoldername);
-    }
-    
-    BOOST_AUTO_TEST_CASE(getKeyInfo){
-      std::string foldername{};
-      std::string tag{"dummy"};
-      IOVRange range;
-      bool retrieved{};
-      unsigned long long bytesRead(0);
-      float readTime(0.);
-      BOOST_TEST( iovdbsvc->getKeyInfo(fixtureFoldername, foldername, tag, range, retrieved,bytesRead, readTime));
-      std::string rangeString(range);
+  //Create the test database for subsequent tests
+  TestFolderFixture db;
+
+  BOOST_AUTO_TEST_CASE(getRange){
+    IOVRange range;
+    std::string tag{};
+    IOpaqueAddress* addr = nullptr;
+    //normal folder
+    BOOST_TEST_MESSAGE("Testing getRange for folder");
+    BOOST_TEST( iovdbsvc->getRange (1238547719, db.fixtureFoldername, IOVTime (10),range, tag, addr).isSuccess() );
+    BOOST_TEST (std::string(range) == "{[0] - [100]}");
+    BOOST_TEST(tag=="/key1");//setting this value is commented with 'FIXME' in the IOVDbSvc getRange method
+    //
+    BOOST_TEST( iovdbsvc->getRange (1238547719, db.fixtureFoldername, IOVTime (103),range, tag, addr).isSuccess() );
+    BOOST_TEST (std::string(range) == "{[100] - [9223372036854775807]}");
+    //
+    //Things which should fail
+    //wrong clid
+    BOOST_TEST( iovdbsvc->getRange (999, db.fixtureFoldername, IOVTime (10, 15),range, tag, addr).isFailure() );
+    //wrong key
+    BOOST_TEST( iovdbsvc->getRange (1238547719, db.invalidFoldername, IOVTime (10, 15),range, tag, addr).isFailure() );
+    //wrong global tag (todo)
+  }
+  /** no need to test the setRange method; it does nothing
+  BOOST_AUTO_TEST_CASE(setRange){
+    BOOST_TEST( iovdbsvc->setRange (1238547719, "/key1",range,tag).isSuccess() );      
+  }
+  **/
+  BOOST_AUTO_TEST_CASE(signalBeginRun){
+    EventContext ctx;
+    ctx.setExtension<Atlas::ExtendedEventContext>( Atlas::ExtendedEventContext(nullptr,10));
+    BOOST_TEST( iovdbsvc->signalBeginRun(IOVTime(10,10), ctx).isSuccess());
+  }
+  
+  BOOST_AUTO_TEST_CASE(signalEndProxyPreload){
+    BOOST_CHECK_NO_THROW( iovdbsvc->signalEndProxyPreload());
+  }
+  
+  BOOST_AUTO_TEST_CASE(getKeyList){
+    auto keyList=iovdbsvc->getKeyList();
+    BOOST_TEST(keyList.size() ==1);
+    auto firstEntry=keyList.front();
+    BOOST_TEST(firstEntry == db.fixtureFoldername);
+  }
+  
+  BOOST_AUTO_TEST_CASE(getKeyInfo){
+    std::string foldername{};
+    std::string tag{"dummy"};
+    IOVRange range;
+    bool retrieved{};
+    unsigned long long bytesRead(0);
+    float readTime(0.);
+    BOOST_TEST( iovdbsvc->getKeyInfo(db.fixtureFoldername, foldername, tag, range, retrieved,bytesRead, readTime));
+    std::string rangeString(range);
 
-      BOOST_TEST(fixtureFoldername == foldername);
-      BOOST_TEST(tag.empty());
-      BOOST_TEST("{[10,30] - [2147483647,4294967295]}"==rangeString);
-      BOOST_TEST(retrieved);
-      BOOST_TEST(bytesRead == 12);//why is this 12 and not 8? two ints were written.
-      BOOST_TEST(readTime<0.5);
-    }
+    BOOST_TEST(db.fixtureFoldername == foldername);
+    BOOST_TEST(tag.empty());
+    BOOST_TEST("{[100] - [9223372036854775807]}"==rangeString);
+    BOOST_TEST(retrieved);
+    BOOST_TEST(bytesRead == 8);//why?
+    BOOST_TEST(readTime<0.5);
+  }
   BOOST_AUTO_TEST_CASE(dropObject){ 
     //not sure I can meaningfully test that the object was really dropped
     //BOOST_TEST(iovdbsvc->dropObject(fixtureFoldername, true)); //will fail, the proxy is nullptr
-    BOOST_TEST(!iovdbsvc->dropObject(fixtureFoldername,false));
+    BOOST_TEST(!iovdbsvc->dropObject(db.fixtureFoldername,false));
     //test invalid folderName
-    BOOST_TEST(!iovdbsvc->dropObject(invalidFoldername,true));
+    BOOST_TEST(!iovdbsvc->dropObject(db.invalidFoldername,true));
   }
-  BOOST_AUTO_TEST_SUITE_END()
+
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/Database/IOVDbSvc/test/IOVDbSvc_test.cxx b/Database/IOVDbSvc/test/IOVDbSvc_test.cxx
index dd12052eea3..992f4d6e66d 100644
--- a/Database/IOVDbSvc/test/IOVDbSvc_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbSvc_test.cxx
@@ -62,14 +62,19 @@ int main()
 
   CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); } );
   ISvcLocator* svcLoc;
-  if (!Athena_test::initGaudi("IOVDbSvc_test.txt", svcLoc))
+  //The following is to ensure I can run the test executable outside ctest
+  const std::string here=__FILE__;
+  const size_t lastSlash=here.find_last_of("/");
+  const std::string dir=here.substr(0,lastSlash+1);
+  const std::string searchPath=dir+"../share/";
+  if (!Athena_test::initGaudi(searchPath+"IOVDbSvc_test.txt", svcLoc))
     return 1;
 
-  unlink ("cooldummy.db");
+  unlink ("mytest.db");
 
   cool::IDatabaseSvc& dbSvc=cool::DatabaseSvcFactory::databaseService();
   cool::IDatabasePtr coolDb =
-    dbSvc.createDatabase("sqlite://;schema=cooldummy.db;dbname=OFLP200");
+    dbSvc.createDatabase("sqlite://;schema=mytest.db;dbname=OFLP200");
   cool::RecordSpecification spec;
   spec.extend ("int", cool::StorageType::Int32);
   cool::FolderSpecification fSpec (cool::FolderVersioning::SINGLE_VERSION,
diff --git a/Database/IOVDbSvc/test/TestFolderFixture.h b/Database/IOVDbSvc/test/TestFolderFixture.h
index c6f553ca1f4..a7bbb20d284 100644
--- a/Database/IOVDbSvc/test/TestFolderFixture.h
+++ b/Database/IOVDbSvc/test/TestFolderFixture.h
@@ -46,14 +46,14 @@ struct TestFolderFixtureBase{
     cool::RecordSpecification spec;
     spec.extend ("int", cool::StorageType::Int32);
     cool::FolderSpecification fSpec (cool::FolderVersioning::SINGLE_VERSION,spec,cool::PayloadMode::INLINEPAYLOAD);
-    std::string desc = "<timeStamp>run-event</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>";
+    std::string desc = "<timeStamp>time</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>";
     {
       cool::IFolderPtr f = coolDb->createFolder (fixtureFoldername, fSpec, desc);
       cool::Record payload (f->payloadSpecification());
       payload[0].setValue (1);
-      f->storeObject ((10ull<<32) + 10, (10ull<<32) + 20, payload, 0);
+      f->storeObject (0, 100, payload, 0);
       payload[0].setValue (2);
-      f->storeObject ((10ull<<32) + 30, cool::ValidityKeyMax, payload, 0);
+      f->storeObject (100, cool::ValidityKeyMax, payload, 0);
     }
     coolDb->closeDatabase();
   }
-- 
GitLab


From 45acafd74329d6591e650c2d3d11386e5846ebab Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 6 Mar 2019 12:03:51 +0100
Subject: [PATCH 264/404] TrigConfBase: Thread-safety fixes

- const-fix for outputLevel method in AthenaKernel/getMessageSvc
- Enable static thread checker for TrigConfBase
- Apply the same thread-safety fixes in TrigConfMessaging that were done
  already in AthMessaging (use a thread-local MsgStream instance)
- Add unit test for the standalone and athena use-case
---
 .../AthenaKernel/AthenaKernel/getMessageSvc.h | 13 +++---
 Control/AthenaKernel/src/getMessageSvc.cxx    |  4 +-
 .../TrigConfBase/CMakeLists.txt               | 21 ++++++---
 .../TrigConfBase/Root/MsgStream.cxx           | 42 ++++++++----------
 .../TrigConfBase/ATLAS_CHECK_THREAD_SAFETY    |  1 +
 .../TrigConfBase/TrigConfBase/MsgStream.h     | 15 +++----
 .../TrigConfBase/TrigConfMessaging.h          | 44 ++++++++++---------
 .../TrigConfBase/share/test_TrigConfMsgAlg.py |  9 ++++
 .../share/trigconf_msg_athena_test.ref        | 29 ++++++++++++
 .../share/trigconf_msg_standalone_test.ref    |  4 ++
 .../TrigConfBase/test/TrigConfMsgAlg.cxx      | 43 ++++++++++++++++++
 11 files changed, 155 insertions(+), 70 deletions(-)
 create mode 100644 Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigConfiguration/TrigConfBase/share/test_TrigConfMsgAlg.py
 create mode 100644 Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_athena_test.ref
 create mode 100644 Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_standalone_test.ref
 create mode 100644 Trigger/TrigConfiguration/TrigConfBase/test/TrigConfMsgAlg.cxx

diff --git a/Control/AthenaKernel/AthenaKernel/getMessageSvc.h b/Control/AthenaKernel/AthenaKernel/getMessageSvc.h
index 26ac444c955..d94ad9f01e8 100644
--- a/Control/AthenaKernel/AthenaKernel/getMessageSvc.h
+++ b/Control/AthenaKernel/AthenaKernel/getMessageSvc.h
@@ -1,7 +1,7 @@
 // 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
 */
 
 #ifndef ATHENAKERNEL_GETMESSAGESVC_H
@@ -9,7 +9,6 @@
 /** @file getMessageSvc.h
  *  @brief singleton-like access to IMessageSvc via open function and helper
  *
- *  $Id: getMessageSvc.h,v 1.6 2008-07-14 22:10:14 calaf Exp $
  *  @author Paolo Calafiura - Atlas collaboration
    */
 #include <cassert>
@@ -31,8 +30,8 @@ namespace Athena {
    *             The default is to be lazy and don't create anything.
    *  @param quiet : do not print warning if MessagesSvc cannot be found (default false)
    *
-   *  Also used via weak-linking from DetCommon code (see e.g. TrigConf::MsgStream in DetCommon)
-   *  DO NOT MODIFY THE SIGNATURE OF THESE METHODS WITHOUT UPDATING THE DETCOMMON SIDE !!!
+   *  Also used via weak-linking from TrigConf code (see e.g. TrigConfBase/Root/MsgStream.cxx)
+   *  DO NOT MODIFY THE SIGNATURE OF THESE METHODS WITHOUT UPDATING THE TRIGCONF SIDE !!!
    */
   IMessageSvc* getMessageSvc( bool quiet=false );
   IMessageSvc* getMessageSvc( const Options::CreateOptions o, bool quiet=false );
@@ -44,12 +43,12 @@ namespace Athena {
   //@{
   /** Wrappers for some of the IMessageSvc methods
    *  These can be used from libraries without explicit Gaudi dependency via weak linking.
-   *  (see e.g. TrigConf::MsgStream in DetCommon)
+   *  (see e.g. TrigConf::MsgStream in TrigConfBase)
    *
-   *  DO NOT MODIFY THE SIGNATURE OF THESE METHODS WITHOUT UPDATING THE DETCOMMON SIDE !!!
+   *  DO NOT MODIFY THE SIGNATURE OF THESE METHODS WITHOUT UPDATING THE TRIGCONF SIDE !!!
    */
   void reportMessage(IMessageSvc* ims, const std::string &source, int type, const std::string &message);
-  int outputLevel(IMessageSvc* ims, const std::string &source);
+  int outputLevel(const IMessageSvc* ims, const std::string &source);
   void setOutputLevel(IMessageSvc* ims, const std::string &source, int level);
   //@}
 
diff --git a/Control/AthenaKernel/src/getMessageSvc.cxx b/Control/AthenaKernel/src/getMessageSvc.cxx
index fd45a8b835c..fa34ba958b8 100644
--- a/Control/AthenaKernel/src/getMessageSvc.cxx
+++ b/Control/AthenaKernel/src/getMessageSvc.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 <iostream>
@@ -33,7 +33,7 @@ void Athena::reportMessage (IMessageSvc* ims, const std::string &source, int typ
   if (ims) ims->reportMessage(source, type, message);
 }
 
-int Athena::outputLevel(IMessageSvc* ims, const std::string &source) {
+int Athena::outputLevel(const IMessageSvc* ims, const std::string &source) {
   if (ims) return ims->outputLevel(source);
   else return MSG::INFO;
 }
diff --git a/Trigger/TrigConfiguration/TrigConfBase/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfBase/CMakeLists.txt
index 53fda6af915..c52c4ed3c68 100644
--- a/Trigger/TrigConfiguration/TrigConfBase/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfBase/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 777942 2016-10-12 01:14:44Z krasznaa $
 ################################################################################
 # Package: TrigConfBase
 ################################################################################
@@ -7,15 +6,25 @@
 atlas_subdir( TrigConfBase )
 
 # External dependencies:
-find_package( Boost COMPONENTS regex )
+find_package( Boost COMPONENTS regex thread )
 
 # Component(s) in the package:
 atlas_add_library( TrigConfBase
    TrigConfBase/*.h src/*.cxx Root/*.cxx
    PUBLIC_HEADERS TrigConfBase
-   PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
-   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} )
+   INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
+   LINK_LIBRARIES ${Boost_LIBRARIES} )
 
-atlas_add_executable( trigconf_msgsvc_test
-   test/trigconf_msgsvc_test.cxx
+atlas_install_joboptions( share/*.py )
+
+# Tests:
+atlas_add_component( TrigConfBaseTest
+   test/TrigConfMsgAlg.cxx
+   LINK_LIBRARIES TrigConfBase AthenaBaseComps )
+
+atlas_add_test( trigconf_msg_standalone_test
+   SOURCES test/trigconf_msgsvc_test.cxx
    LINK_LIBRARIES TrigConfBase )
+
+atlas_add_test( trigconf_msg_athena_test
+   SCRIPT athena.py TrigConfBase/test_TrigConfMsgAlg.py )
diff --git a/Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx b/Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx
index 8d508fb7abd..98b503b93ec 100644
--- a/Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx
+++ b/Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.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 <iostream>
@@ -15,28 +15,28 @@ using namespace TrigConf;
 class IMessageSvc;
 
 /** Some weak symbol referencing magic...
- *  These are declared in AthenaKernel/getMessageSvc.h and will be non-NULL in case
+ *  These are declared in AthenaKernel/getMessageSvc.h and will be non-nullptr in case
  *  the GaudiSvc/AthenaKernel shared libraries have been loaded.
  */
 namespace Athena {
   IMessageSvc* getMessageSvc(bool) __attribute__((weak));
   void reportMessage(IMessageSvc*, const std::string&, int, const std::string&) __attribute__((weak));
-  int outputLevel(IMessageSvc*, const std::string&) __attribute__((weak));
+  int outputLevel(const IMessageSvc*, const std::string&) __attribute__((weak));
   void setOutputLevel(IMessageSvc*, const std::string&, int) __attribute__((weak));
 }
 
-/** Global pointer to MessageSvc and helper to fill it
- */
+
 namespace {
-  IMessageSvc* p_msgsvc;
-  inline void getMessageSvc() {
-    // If we haven't found a MessageSvc try to find one
-    if (p_msgsvc==0 && Athena::getMessageSvc!=NULL) {
-      p_msgsvc = Athena::getMessageSvc(/*quiet=*/true);
-    }
+
+  /// Helper to get MessageSvc if running in athena environment
+  static IMessageSvc* getMessageSvc() {
+    static IMessageSvc* const msgsvc =
+      Athena::getMessageSvc!=nullptr ? Athena::getMessageSvc(/*quiet=*/true) : nullptr;
+    return msgsvc;
   }
-  const char* levelNames[MSGTC::NUM_LEVELS] = {"NIL","VERBOSE","DEBUG","INFO",
-                                               "WARNING","ERROR","FATAL","ALWAYS"};
+
+  static const char* const levelNames[MSGTC::NUM_LEVELS] =
+    {"NIL","VERBOSE","DEBUG","INFO","WARNING","ERROR","FATAL","ALWAYS"};
 }
 
 MsgStreamTC::MsgStreamTC(const std::string& name) :
@@ -44,31 +44,25 @@ MsgStreamTC::MsgStreamTC(const std::string& name) :
       m_msgLevel(MSGTC::INFO),
       m_name(name)
 {
-  getMessageSvc();
   // Initialize our own OutputLevel to the global one from the MessageSvc
-  m_level = (Athena::outputLevel!=NULL) ? MSGTC::Level(Athena::outputLevel(p_msgsvc, m_name)) : MSGTC::INFO;
+  m_level = (Athena::outputLevel!=nullptr) ? MSGTC::Level(Athena::outputLevel(getMessageSvc(), m_name)) : MSGTC::INFO;
 }
 
 // Set message level of stream
 void MsgStreamTC::setLevel(MSGTC::Level lvl) {
    lvl = (lvl >= MSGTC::NUM_LEVELS) ? MSGTC::ALWAYS : (lvl<MSGTC::NIL) ? MSGTC::NIL : lvl;
    m_level = lvl;
-   getMessageSvc();
-   if (p_msgsvc) {
-      Athena::setOutputLevel(p_msgsvc, m_name, m_level);
+   if (getMessageSvc()) {
+     Athena::setOutputLevel(getMessageSvc(), m_name, m_level);
    }
 }
 
-
-
 void MsgStreamTC::doOutput()
 {
-  getMessageSvc();
-  if (p_msgsvc) {
-    Athena::reportMessage(p_msgsvc, m_name, m_msgLevel, str());
+  if (getMessageSvc()) {
+    Athena::reportMessage(getMessageSvc(), m_name, m_msgLevel, str());
   }
   else {
-    // later use ERS here (ERS needs to be a third case, we also need simple cout)
     std::ios::fmtflags f( std::cout.flags() );
     std::cout << std::setw(m_width) << std::left << m_name << " " << levelNames[m_msgLevel] << " " << str() << std::endl;
     std::cout.flags(f);
diff --git a/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..8f85a4555c6
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigConfiguration/TrigConfBase
diff --git a/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h
index 0d8f0590d34..32f9b715003 100644
--- a/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h
+++ b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h
@@ -1,17 +1,13 @@
-// -*- 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 TRIGCONFBASE_MSGSTREAM_H
 #define TRIGCONFBASE_MSGSTREAM_H 1
 /**
  * @file   TrigConfBase/MsgStream.h
- * @brief  MsgStream for DetCommon
+ * @brief  MsgStream for TrigConf classes
  * @author Frank Winklmeier
- *
- * $Id$
  */
 
 #include <sstream>
@@ -36,19 +32,18 @@ namespace TrigConf {
   }
 
   /**
-   * MsgStreamTC class to be used in DetCommon equivalant to Gaudi's MsgStream
+   * MsgStreamTC class to be used in TrigConf equivalent to Gaudi's MsgStream
    *
    * The usage and behavior is identical to the default Gaudi message stream.
    * If the code is run within a Gaudi/Athena environment, the MsgStreamTC will
    * try to print its messages via the Gaudi MessageSvc. This is achieved via
-   * weak linking. In a non-Gaudi/Athena environemt ERS will be used.
+   * weak linking. In a non-Gaudi/Athena environment std::cout will be used.
    * The class can be used directly or better via inheriting from
    * TrigConf::TrigConfMessaging, which is the equivalent of AthMessaging.
    *
    * Main difference to Gaudi MsgStream:
    *   - OutputLevel cannot be configued via job options, instead the
-   *     gloabal OutputLevel of the MessageSvc is being used
-   *   - Only supports endmsg and not the the deprecated endmsg
+   *     global OutputLevel of the MessageSvc is being used
    */
   class MsgStreamTC : public std::ostringstream {
   public:
diff --git a/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/TrigConfMessaging.h b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/TrigConfMessaging.h
index 13ea7dc791b..1c4142933e2 100644
--- a/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/TrigConfMessaging.h
+++ b/Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/TrigConfMessaging.h
@@ -1,7 +1,5 @@
-// -*- 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 TRIGCONFBASE_TRIGCONFMESSAGING_H
@@ -9,22 +7,23 @@
 
 /**
  * @file   TrigConfMessaging.h
- * @brief  Messaging base class for DetCommon (copy of AthMessaging)
- * @author Frank Winklmeier (original author Sebastien Binet)
+ * @brief  Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
+ * @author Frank Winklmeier
  *
- * $Id$
  */
 
 #include <string>
+#include <boost/thread/tss.hpp>
 #include "TrigConfBase/MsgStream.h"
 #include "TrigConfBase/MsgStreamMacros.h"
 
-namespace TrigConf { 
+namespace TrigConf {
 
   /**
-   * Class to provide easy access to TrigConf::MsgStream within DetCommon
+   * Class to provide easy access to TrigConf::MsgStream for TrigConf classes
    *
-   * This is a copy&paste of AthMessaging and used in exactly the same way.
+   * This is a copy&paste of AthMessaging and used in exactly the same way but
+   * without introducing Gaudi/Athena dependencies.
    */
   class TrigConfMessaging { 
   public: 
@@ -33,7 +32,6 @@ namespace TrigConf {
      *  @param name Component name used in the messages
      */
     TrigConfMessaging (const std::string& name) :
-      m_msg(name),
       m_name(name)
     {}
 
@@ -48,7 +46,7 @@ namespace TrigConf {
     bool msgLvl (const MSGTC::Level lvl) const;
     
     /** The standard message stream.
-     *  Returns a reference to the default message stream
+     *  Returns a reference to the message stream
      *  May not be invoked before sysInitialize() has been invoked.
      */
     MsgStreamTC& msg() const;
@@ -59,21 +57,20 @@ namespace TrigConf {
      */
     MsgStreamTC& msg (const MSGTC::Level lvl) const;
 
-  private: 
-    TrigConfMessaging( const TrigConfMessaging& rhs ); //> not implemented
-    TrigConfMessaging& operator=( const TrigConfMessaging& rhs ); //> not implemented
+  private:
+    TrigConfMessaging() = delete;
+    TrigConfMessaging( const TrigConfMessaging& rhs ) = delete;
+    TrigConfMessaging& operator=( const TrigConfMessaging& rhs ) = delete;
 
-  private: 
-    
     /// MsgStreamTC instance (a std::cout like with print-out levels)
-    mutable MsgStreamTC m_msg;
+    mutable boost::thread_specific_ptr<MsgStreamTC> m_msg_tls;
     std::string m_name;
   }; 
 
   inline bool TrigConfMessaging::msgLvl (const MSGTC::Level lvl) const
   {
-    if (m_msg.level() <= lvl) {
-      m_msg << lvl;
+    if (msg().level() <= lvl) {
+      msg() << lvl;
       return true;
     }
     else {
@@ -83,12 +80,17 @@ namespace TrigConf {
 
   inline MsgStreamTC& TrigConfMessaging::msg() const 
   {
-    return m_msg;
+    MsgStreamTC* ms = m_msg_tls.get();
+    if (!ms) {
+      ms = new MsgStreamTC(m_name);
+      m_msg_tls.reset(ms);
+    }
+    return *ms;
   }
   
   inline MsgStreamTC& TrigConfMessaging::msg (const MSGTC::Level lvl) const 
   {
-    return m_msg << lvl;
+    return msg() << lvl;
   }
   
 } // namespace TrigConf
diff --git a/Trigger/TrigConfiguration/TrigConfBase/share/test_TrigConfMsgAlg.py b/Trigger/TrigConfiguration/TrigConfBase/share/test_TrigConfMsgAlg.py
new file mode 100644
index 00000000000..006a849bb05
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfBase/share/test_TrigConfMsgAlg.py
@@ -0,0 +1,9 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.AlgSequence import AlgSequence
+job = AlgSequence()
+
+from TrigConfBase.TrigConfBaseTestConf import TrigConfMsgAlg
+job += TrigConfMsgAlg()
+
+theApp.EvtMax = 2
diff --git a/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_athena_test.ref b/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_athena_test.ref
new file mode 100644
index 00000000000..3fee3247a19
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_athena_test.ref
@@ -0,0 +1,29 @@
+Py:Athena            INFO executing ROOT6Setup
+ApplicationMgr       INFO Application Manager Configured successfully
+AthDictLoaderSvc     INFO in initialize...
+AthDictLoaderSvc     INFO acquired Dso-registry
+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) 
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr       INFO Application Manager Started successfully
+AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events processed so far  <<<===
+TrigConfMsgAlg       INFO Next message is printed via TrigConfMessaging:
+TrigConfMsgAlg       INFO An INFO message
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
+AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 1 events processed so far  <<<===
+TrigConfMsgAlg       INFO Next message is printed via TrigConfMessaging:
+TrigConfMsgAlg       INFO An INFO message
+AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 2 events processed so far  <<<===
+ApplicationMgr       INFO Application Manager Stopped successfully
+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 ****************************************************************************************************
+*****Chrono*****     INFO ****************************************************************************************************
+ChronoStatSvc.f...   INFO  Service finalized successfully 
+ApplicationMgr       INFO Application Manager Finalized successfully
+ApplicationMgr       INFO Application Manager Terminated successfully
+Py:Athena            INFO leaving with code 0: "successful run"
diff --git a/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_standalone_test.ref b/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_standalone_test.ref
new file mode 100644
index 00000000000..5fddab96d70
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfBase/share/trigconf_msg_standalone_test.ref
@@ -0,0 +1,4 @@
+MyClass                        INFO This is a INFO message
+MyClass                        ERROR ERROR message via message stream macros
+MyClass                        WARNING WARNING message
+MyData                         INFO INFO message via MsgStream
diff --git a/Trigger/TrigConfiguration/TrigConfBase/test/TrigConfMsgAlg.cxx b/Trigger/TrigConfiguration/TrigConfBase/test/TrigConfMsgAlg.cxx
new file mode 100644
index 00000000000..24ea6bfae54
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfBase/test/TrigConfMsgAlg.cxx
@@ -0,0 +1,43 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "TrigConfBase/TrigConfMessaging.h"
+
+/**
+ * TrigConfMessaging athena-based testing
+ *
+ * Simple testing algorithm to make sure that messages printed via
+ * TrigConfMessaging are indeed output via the Gaudi MessageSvc.
+ */
+
+class MyClass : public TrigConf::TrigConfMessaging {
+public:
+  MyClass(const std::string& name) : TrigConf::TrigConfMessaging(name) {}
+
+  void print() const {
+    TRG_MSG_INFO("An INFO message");
+    TRG_MSG_DEBUG("A DEBUG message (should not be visible by default)");
+  }
+};
+
+class TrigConfMsgAlg : public AthAlgorithm {
+public:
+  TrigConfMsgAlg(const std::string& name, ISvcLocator* svcLoc) :
+      AthAlgorithm(name, svcLoc),
+      m_class(name)
+  {}
+
+  virtual StatusCode execute() override
+  {
+    ATH_MSG_INFO("Next message is printed via TrigConfMessaging:");
+    m_class.print();
+    return StatusCode::SUCCESS;
+  }
+
+private:
+  MyClass m_class;
+};
+
+DECLARE_COMPONENT(TrigConfMsgAlg)
-- 
GitLab


From abf9cadb1e6f5d1d14504c27d29e83d9f96a562c Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 6 Mar 2019 11:13:43 +0000
Subject: [PATCH 265/404] Add ATLAS_CHECK_THREAD_SAFETY to some SiSpacePoint
 related packages

---
 .../SiSpacePoint/SiSpacePoint/ATLAS_CHECK_THREAD_SAFETY    | 1 +
 .../SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h             | 1 -
 .../InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx      | 7 -------
 .../SiSpacePointsSeed/ATLAS_CHECK_THREAD_SAFETY            | 1 +
 .../SiSpacePointsSeedTool_xk/ATLAS_CHECK_THREAD_SAFETY     | 1 +
 5 files changed, 3 insertions(+), 8 deletions(-)
 create mode 100644 InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetRecEvent/SiSpacePointsSeed/SiSpacePointsSeed/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..29eee3ea62f
--- /dev/null
+++ b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecEvent/SiSpacePoint
diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h
index 4af8f9683e5..54766f3a796 100755
--- a/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h
+++ b/InnerDetector/InDetRecEvent/SiSpacePoint/SiSpacePoint/SCT_SpacePoint.h
@@ -89,7 +89,6 @@ namespace InDet
       void setup(const std::pair<IdentifierHash, IdentifierHash>& elementIdList,  		    
 		 const Amg::Vector3D& position,
 		 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>* clusList);
-      
     };
   
   ///////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx b/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx
index 16714c730c9..7adb6e674f2 100755
--- a/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx
+++ b/InnerDetector/InDetRecEvent/SiSpacePoint/src/SCT_SpacePoint.cxx
@@ -103,18 +103,11 @@ namespace InDet
 
   //-------------------------------------------------------------
 
-  /* Return the local covariance matrix. */
-  static const Amg::MatrixX* sctSpacePointSharedLocalCovariance = 0;
-
   //---------------------------------------------------------------
 
   void SCT_SpacePoint::setupLocalCovarianceSCT()
   {
 
-    if( sctSpacePointSharedLocalCovariance ){
-      Trk::MeasurementBase::m_localCovariance = *sctSpacePointSharedLocalCovariance;
-      return;
-    }
     /* For performance reason only, the error is assumed constant.
 	numbers are taken from 
 	Trigger/TrigTools/TrigOfflineSpacePointTool/OfflineSpacePointProviderTool */
diff --git a/InnerDetector/InDetRecEvent/SiSpacePointsSeed/SiSpacePointsSeed/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/SiSpacePointsSeed/SiSpacePointsSeed/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..60920e36ee1
--- /dev/null
+++ b/InnerDetector/InDetRecEvent/SiSpacePointsSeed/SiSpacePointsSeed/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecEvent/SiSpacePointsSeed
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e820b9d352f
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk
-- 
GitLab


From 24d0c09aa67567c2746ebe3e0dd9385f6a04397a Mon Sep 17 00:00:00 2001
From: Steven Schramm <steven.schramm@cern.ch>
Date: Thu, 6 Apr 2017 01:22:04 +0200
Subject: [PATCH 266/404] Added SoftKiller functionality for trigger jets
 (ATR-16023)

--> Changed TriggerMenu, TrigHLTJetRec, and JetRecTools
New functionality to apply SoftKiller to trigger jets as an
alternative form of pileup suppression.  Test chains were
also added to the MC_pp_v7 menu in order to compare the
performance against the standard jet-area pileup suppression.

Former-commit-id: a112412e8f831357a8525327a16e1b44bc43102b
---
 .../JetRecTools/JetConstituentModSequence.h   | 27 +++++++++
 .../Root/JetConstituentModSequence.cxx        | 21 +++++--
 .../TrigHLTJetRec/CMakeLists.txt              |  1 +
 .../TrigHLTJetRec/TrigHLTSoftKiller.h         |  7 ++-
 .../python/TrigHLTJetRecConfig.py             | 42 ++++++++++++--
 .../src/TrigHLTJetRecGroomer.cxx              |  2 +-
 .../TrigHLTJetRec/src/TrigHLTSoftKiller.cxx   | 58 +++++++++++++++----
 .../TriggerMenu/python/jet/AlgFactory.py      | 29 ++++++++++
 .../TriggerMenu/python/jet/JetDef.py          |  2 +-
 .../python/jet/JetSequencesBuilder.py         | 22 ++++++-
 .../python/jet/jetDefInstantiator.py          |  1 +
 .../TriggerMenu/python/menu/MC_pp_v7.py       |  8 +++
 .../TriggerMenu/python/menu/SignatureDicts.py |  2 +-
 13 files changed, 192 insertions(+), 30 deletions(-)

diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
index 50ded5fd426..f4befe98540 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,26 @@ 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
+  }
+  
+  // 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 4a8b4b1b0fd..e2e17de28ff 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/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
index 8e60a3038f7..ec07e72ecc6 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/TrigHLTSoftKiller.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTSoftKiller.h
index 31528c32113..473e371a60b 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/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index d8c75a00ba6..bb83cf9bd49 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -1201,7 +1201,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,
         )
         
@@ -1472,6 +1472,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 +1489,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                                                     
@@ -1528,9 +1561,6 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
                        vcSGkey=primVtxSGkey,
                        )
         addTrkMomsTool(trkmomstoolname, **trkmomsoptions)
-=======
-                                                     
->>>>>>> 72e6b7d9ee... Fixed memory leak in trimmed jet triggers (TrigHLTJetRec-00-00-56)
 
 # Data scouting algorithm
 class TrigHLTJetDSSelector(TrigHLTJetRecConf.TrigHLTJetDSSelector):
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTJetRecGroomer.cxx
index 99c57591b6b..6b8018cbe53 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 76bfb4d56c4..345c412a634 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,17 +75,43 @@ 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);
+    ATH_MSG_INFO("Input cluster container: " << inputclusters);
+    int process_status = skclustModSeqTool->execute();
+    const xAOD::CaloClusterContainer* outputclusters = dynamic_cast<const xAOD::CaloClusterContainer*>(skclustModSeqTool->getOutputClusterCollection()); 
+    ATH_MSG_INFO("Output cluster container after: " << outputclusters);
+    
+    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
     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");
     else
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
index f7a604febe6..403092985db 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):
@@ -253,6 +257,7 @@ class AlgFactory(object):
             'output_collection_label': "'%s'" % (self.fex_params.fex_label),
             'rclus': self.fex_params.rclus,
             'ptfrac': self.fex_params.ptfrac,
+            'OutputLevel':1
         }
 
         return [Alg(factory, (), kwds)]
@@ -638,6 +643,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 3dd7f4fa658..f50e03545c4 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 e4e24ec5ef4..4b454ab1707 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'\
@@ -311,6 +317,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 c795faae881..d0f17e660d2 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 0426c0ba1d8..9d546c5bab9 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/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py
index ecafb3edeb6..05193311046 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'],
-- 
GitLab


From 5be6e43ea78954e0314f35aabf3ae48cd8d5777d Mon Sep 17 00:00:00 2001
From: Steven Schramm <steven.schramm@cern.ch>
Date: Mon, 1 May 2017 21:57:12 +0200
Subject: [PATCH 267/404] Fix memory leak in trigger SoftKiller (ATR-16023)

There is currently a memory leak in the trigger implementation of
SoftKiller.  This patch fixes that, saving approximately 700kb
per event of memory.


Former-commit-id: 9d2e3b5c960faebb4e006c8c7b70d8d05b22e952
---
 .../TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
index 345c412a634..64e16c3da73 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
@@ -110,10 +110,14 @@ HLT::ErrorCode TrigHLTSoftKiller::hltExecute(const HLT::TriggerElement* inputTE,
 
 
     // Write the resulting container
+    auto auxStore = outputclusters->getStore();
     std::string key = "";
     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;
-- 
GitLab


From e04ac093610fe57cfbc13dc843dbca9d64047c94 Mon Sep 17 00:00:00 2001
From: Steven Schramm <steven.schramm@cern.ch>
Date: Mon, 1 May 2017 18:41:19 +0200
Subject: [PATCH 268/404] Add jet trig containers to output AOD (ATR-16214)

Addition of SoftKiller and reclustered subjesIS output containers
to the xAOD.  These are needed for 2017 trigger emulation/matching
and similar.

Former-commit-id: 049a68a3a0e6bfc1a93058cc7a3cf15b30129cb8
---
 Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py
index 1860061ee18..cc3b00049c2 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'),    
-- 
GitLab


From 411c69cdbc686baf465fde92bc80840d4a8c8eea Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Wed, 6 Mar 2019 12:33:09 +0100
Subject: [PATCH 269/404] Temp disable test_egamma_run_data.sh ESD test to
 debug error in CI

---
 .../TrigUpgradeTest/test/test_egamma_run_data.sh             | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
index e39bd0db0c5..37a04c78482 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
@@ -5,6 +5,7 @@
 #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 &&
-athena TrigUpgradeTest/checkESD.py 
+checkxAOD.py myESD.pool.root
 
+# Tim M 06-05-19. Temporarily disable post-checks while they're fixed
+# athena TrigUpgradeTest/checkESD.py 
-- 
GitLab


From 93d2eb5061b3d9eb2618d6b1b46011762f6e96d8 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 12:53:57 +0100
Subject: [PATCH 270/404] Update Simulation configuration unit tests.

After !21180 was merged all simulation jobs running outside of ISF now
include the `EventInfoTagBuilder/EventInfoTagBuilder` algorithm.
---
 .../test/test_AtlasG4_cosmics_configuration.py           | 3 ++-
 .../G4AtlasApps/test/test_AtlasG4_tf_configuration.py    | 3 ++-
 .../G4AtlasApps/test/test_TestBeam_tf_configuration.py   | 9 ++++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
index 9f299d6467c..4379e8f7155 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
@@ -112,7 +112,8 @@ class TestAtlasG4Cosmics(unittest.TestCase):
     def test___CosmicGenerator_is_at_start_of_AthAlgSeq(self):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now.
         expected_last_ath_alg_sequence_entry = "CosmicGenerator/CosmicGenerator"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
index 940f7f1cdc1..3442d3f9050 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
@@ -108,7 +108,8 @@ class TestAtlasG4(unittest.TestCase):
     def test___BeamEffectsAlg_is_before_G4AtlasAlg_in_AthAlgSeq(self):
         ath_alg_seqence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_seqence_list = eval(ath_alg_seqence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_seqence_list[1] #Position 0 should be the timer alg
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
index c1c7f9b86d2..147a61e9814 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
@@ -106,7 +106,8 @@ class TestTestBeam(unittest.TestCase):
     def test___ParticleGun_is_before_CopyEventWeight_in_AthAlgSeq(self):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "PyAthena::Alg/ParticleGun"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
@@ -116,7 +117,8 @@ class TestTestBeam(unittest.TestCase):
     def test___CopyEventWeight_is_before_BeamEffectsAlg_in_AthAlgSeq(self):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[2] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "CopyEventWeight/CopyEventWeight"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
@@ -126,7 +128,8 @@ class TestTestBeam(unittest.TestCase):
     def test___BeamEffectsAlg_is_before_G4AtlasAlg_in_AthAlgSeq(self):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[3] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
-- 
GitLab


From 2bd6ccd86f150b66237030a98cc211ca89c07eed Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Wed, 6 Mar 2019 13:07:42 +0100
Subject: [PATCH 271/404] Make tools private (except for the extrapolator)

---
 .../MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx
index 804ea1324d3..64c4acc58c8 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedStacoTagTool.cxx
@@ -26,10 +26,10 @@ namespace MuonCombined {
 
   MuonCombinedStacoTagTool::MuonCombinedStacoTagTool (const std::string& type, const std::string& name, const IInterface* parent)
     :	AthAlgTool(type, name, parent),
-	m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
-	m_tagTool("MuonCombined::MuonTrackTagTestTool/MuonTrackTagTestTool"),
+	m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",this),
+	m_tagTool("MuonCombined::MuonTrackTagTestTool/MuonTrackTagTestTool",this),
         m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
-	m_caloExtTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool")
+	m_caloExtTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool",this)
   {
     declareInterface<IMuonCombinedTagTool>(this);
     declareProperty("Printer",m_printer );
-- 
GitLab


From 6991491e35b9032ecf0c38836cad7553c049f794 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 15:34:55 +0100
Subject: [PATCH 272/404] Add ATLAS_CHECK_THREAD_SAFETY to G4AtlasServices
 package

* Add ATLAS_CHECK_THREAD_SAFETY to G4AtlasServices package
  * https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins
---
 Simulation/G4Atlas/G4AtlasServices/ATLAS_CHECK_THREAD_SAFETY | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Simulation/G4Atlas/G4AtlasServices/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/G4Atlas/G4AtlasServices/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Atlas/G4AtlasServices/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..18a2d31b00f
--- /dev/null
+++ b/Simulation/G4Atlas/G4AtlasServices/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Atlas/G4AtlasServices
-- 
GitLab


From 68aecf09dc2fa2be05c6ba178f0d0d409daf596b Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 16:07:37 +0100
Subject: [PATCH 273/404] Add ATLAS_CHECK_THREAD_SAFETY to BarcodeServices
 package * Add ATLAS_CHECK_THREAD_SAFETY to BarcodeServices package    *
 https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins *
 Make all methods of BarcodeServices/BitCalculator const * Adapt
 `IBarcodeSvc`, `GlobalBarcodeSvc` and `LegacyBarcodeSvc` to return a const
 BitCalculator.

---
 .../BarcodeInterfaces/IBarcodeSvc.h           |  4 +-
 .../BarcodeServices/ATLAS_CHECK_THREAD_SAFETY |  1 +
 .../BarcodeServices/BitCalculator.h           | 49 +++++++-------
 .../BarcodeServices/GlobalBarcodeSvc.h        |  4 +-
 .../BarcodeServices/LegacyBarcodeSvc.h        |  4 +-
 .../BarcodeServices/Root/BitCalculator.cxx    | 65 +++++++++----------
 6 files changed, 60 insertions(+), 67 deletions(-)
 create mode 100644 Simulation/Barcode/BarcodeServices/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h b/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h
index f90638831cd..542b9e7b4c5 100644
--- a/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h
+++ b/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -75,7 +75,7 @@ namespace Barcode {
     virtual Barcode::ParticleBarcode particleGenerationIncrement() const = 0;
 
     /** return bit calculator for encoding extra barcode info */
-    virtual BitCalculator* getBitCalculator() const { return 0; }
+    virtual const BitCalculator* getBitCalculator() const { return nullptr; }
     virtual bool hasBitCalculator() const { return false; }
   };
 
diff --git a/Simulation/Barcode/BarcodeServices/ATLAS_CHECK_THREAD_SAFETY b/Simulation/Barcode/BarcodeServices/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..46d370fe483
--- /dev/null
+++ b/Simulation/Barcode/BarcodeServices/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/Barcode/BarcodeServices
diff --git a/Simulation/Barcode/BarcodeServices/BarcodeServices/BitCalculator.h b/Simulation/Barcode/BarcodeServices/BarcodeServices/BitCalculator.h
index 5e16773da11..9f44f30059c 100644
--- a/Simulation/Barcode/BarcodeServices/BarcodeServices/BitCalculator.h
+++ b/Simulation/Barcode/BarcodeServices/BarcodeServices/BitCalculator.h
@@ -1,9 +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
 */
 
-#ifndef __BARCODE_BITCALCULATOR_H__
-#define __BARCODE_BITCALCULATOR_H__
+#ifndef __BARCODESERVICES_BITCALCULATOR_H__
+#define __BARCODESERVICES_BITCALCULATOR_H__
 
 #include "TObject.h"
 #include <vector>
@@ -15,24 +15,24 @@ namespace Barcode {
 
    public:
     BitCalculator();
-    virtual ~BitCalculator();
-    
-    int GetParentID(const int& barcode);
-    int GetPIDofParent(const int& barcode);
-    int GetBCID(const int& barcode);
-    int GetHS(const int& barcode);
-    int GetSimulator(const int& barcode); 
-    
-    void SetParentID(int& barcode, const int& parentID);
-    void SetPIDofParent(int& barcode, const int& parentPID);
-    void SetBCID(int& barcode, const int& bcid);
-    void SetHS(int& barcode, const int& hs);
-    void SetSimulator(int& barcode, const int& simulator);
-    
-    inline void SetHS(int& barcode, const bool& hs) { return SetHS(barcode,(int)hs); }
-
-    void PrintBits(const int& barcode);
-    void Summary(const int& barcode);
+    virtual ~BitCalculator() = default;
+
+    int GetParentID(const int& barcode) const;
+    int GetPIDofParent(const int& barcode) const;
+    int GetBCID(const int& barcode) const;
+    int GetHS(const int& barcode) const;
+    int GetSimulator(const int& barcode) const;
+
+    void SetParentID(int& barcode, const int& parentID) const;
+    void SetPIDofParent(int& barcode, const int& parentPID) const;
+    void SetBCID(int& barcode, const int& bcid) const;
+    void SetHS(int& barcode, const int& hs) const;
+    void SetSimulator(int& barcode, const int& simulator) const;
+
+    inline void SetHS(int& barcode, const bool& hs) const { return SetHS(barcode,(int)hs); }
+
+    void PrintBits(const int& barcode) const;
+    void Summary(const int& barcode) const;
 
    private:
 
@@ -41,16 +41,15 @@ namespace Barcode {
     const int m_nbitshs;
     const int m_nbitssimulator;
     const int m_nbitsbcid;
-    
+
     int m_parentOne;
     int m_pidOne;
     int m_hsOne;
     int m_simulatorOne;
     int m_bcidOne;
-    
+
     ClassDef(BitCalculator,1)
   };
 }
 
-#endif //> __BARCODE_BITCALCULATOR_H__
-
+#endif //> __BARCODESERVICES_BITCALCULATOR_H__
diff --git a/Simulation/Barcode/BarcodeServices/BarcodeServices/GlobalBarcodeSvc.h b/Simulation/Barcode/BarcodeServices/BarcodeServices/GlobalBarcodeSvc.h
index 0e7b401eda9..a3442402188 100644
--- a/Simulation/Barcode/BarcodeServices/BarcodeServices/GlobalBarcodeSvc.h
+++ b/Simulation/Barcode/BarcodeServices/BarcodeServices/GlobalBarcodeSvc.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -88,7 +88,7 @@ namespace Barcode {
     /** Return the barcode increment for each generation of updated particles */
     virtual Barcode::ParticleBarcode particleGenerationIncrement() const;
 
-    virtual inline Barcode::BitCalculator* getBitCalculator() const { return m_bitcalculator; }
+    virtual inline const Barcode::BitCalculator* getBitCalculator() const { return m_bitcalculator; }
     virtual inline bool hasBitCalculator() const { return (m_bitcalculator!=0); }
 
   private:
diff --git a/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h b/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h
index ff638d292b0..9f530953733 100644
--- a/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h
+++ b/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -89,7 +89,7 @@ namespace Barcode {
     virtual Barcode::ParticleBarcode particleGenerationIncrement() const override;
 
     /** handles to get barcode bitcalculator */
-    virtual inline Barcode::BitCalculator* getBitCalculator() const override { return m_bitcalculator; }
+    virtual inline const Barcode::BitCalculator* getBitCalculator() const override { return m_bitcalculator; }
     virtual inline bool hasBitCalculator() const override { return (m_bitcalculator!=0); }
 
   private:
diff --git a/Simulation/Barcode/BarcodeServices/Root/BitCalculator.cxx b/Simulation/Barcode/BarcodeServices/Root/BitCalculator.cxx
index de9ea92c7db..fe749eba2fd 100644
--- a/Simulation/Barcode/BarcodeServices/Root/BitCalculator.cxx
+++ b/Simulation/Barcode/BarcodeServices/Root/BitCalculator.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 "BarcodeServices/BitCalculator.h"
@@ -54,54 +54,48 @@ Barcode::BitCalculator::BitCalculator()
 }
 
 
-Barcode::BitCalculator::~BitCalculator()
-{
-  // delete collisions grl
-}
-
-
-int 
-Barcode::BitCalculator::GetParentID(const int& barcode)
+int
+Barcode::BitCalculator::GetParentID(const int& barcode) const
 {
   return (barcode&m_parentOne)>>(0);
 }
 
 
-int 
-Barcode::BitCalculator::GetPIDofParent(const int& barcode)
+int
+Barcode::BitCalculator::GetPIDofParent(const int& barcode) const
 {
   return (barcode&m_pidOne)>>(m_nbitsparent);
 }
 
 
-int 
-Barcode::BitCalculator::GetHS(const int& barcode)
+int
+Barcode::BitCalculator::GetHS(const int& barcode) const
 {
   return (barcode&m_hsOne)>>(m_nbitsparent+m_nbitspid);
 }
 
 
 int
-Barcode::BitCalculator::GetSimulator(const int& barcode)
+Barcode::BitCalculator::GetSimulator(const int& barcode) const
 {
   return (barcode&m_simulatorOne)>>(m_nbitsparent+m_nbitspid+m_nbitshs);
 }
 
 
-int 
-Barcode::BitCalculator::GetBCID(const int& barcode)
+int
+Barcode::BitCalculator::GetBCID(const int& barcode) const
 {
   // MB this works for both int and unsigned int
   int negTest = 1<<(8*sizeof(int)-1);
   bool isNeg(false);
-  if ((barcode&negTest)!=0) { isNeg = true; } 
+  if ((barcode&negTest)!=0) { isNeg = true; }
 
   int bc(barcode);
   if (isNeg) { bc &= ~negTest; } // turn off last bit, for bit shifting
 
   bc = (bc&m_bcidOne)>>(m_nbitsparent+m_nbitspid+m_nbitshs+m_nbitssimulator);
 
-  if (isNeg) { // turn on 'last, shifted hs bit' again 
+  if (isNeg) { // turn on 'last, shifted hs bit' again
     //int lastBit = 1<<(m_nbitsbcid-1);
     //bc |= lastBit;
     bc = -bc;
@@ -115,7 +109,7 @@ Barcode::BitCalculator::GetBCID(const int& barcode)
 
 
 void
-Barcode::BitCalculator::SetParentID(int& barcode, const int& parentID)
+Barcode::BitCalculator::SetParentID(int& barcode, const int& parentID) const
 {
   if (parentID<0) {
     std::cerr <<  "ERROR: parent-ID is negative: " << parentID << " Only accepting positive number." << std::endl;
@@ -134,15 +128,15 @@ Barcode::BitCalculator::SetParentID(int& barcode, const int& parentID)
 }
 
 
-void 
-Barcode::BitCalculator::SetPIDofParent(int& barcode, const int& parentPID)
+void
+Barcode::BitCalculator::SetPIDofParent(int& barcode, const int& parentPID) const
 {
   if (parentPID<0) {
     std::cerr <<  "ERROR: PID is negative: " << parentPID << " Only accepting positive number." << std::endl;
     return;
   }
 
-  int shifted = parentPID << (m_nbitsparent);  
+  int shifted = parentPID << (m_nbitsparent);
 
   if (parentPID>=(1<<m_nbitspid)) {
     std::cerr <<  "ERROR: parentPID too big for barcode: " << parentPID << " (limit = " << (1<<m_nbitspid)-1 << "). Reset to zero." << std::endl;
@@ -154,8 +148,8 @@ Barcode::BitCalculator::SetPIDofParent(int& barcode, const int& parentPID)
 }
 
 
-void 
-Barcode::BitCalculator::SetHS(int& barcode, const int& hs)
+void
+Barcode::BitCalculator::SetHS(int& barcode, const int& hs) const
 {
   if (hs<0) {
     std::cerr <<  "ERROR: hard scatter: " << hs << " Only accepting positive number." << std::endl;
@@ -175,7 +169,7 @@ Barcode::BitCalculator::SetHS(int& barcode, const int& hs)
 
 
 void
-Barcode::BitCalculator::SetSimulator(int& barcode, const int& simulator)
+Barcode::BitCalculator::SetSimulator(int& barcode, const int& simulator) const
 {
   int shifted = simulator << (m_nbitsparent+m_nbitspid+m_nbitshs);
 
@@ -189,8 +183,8 @@ Barcode::BitCalculator::SetSimulator(int& barcode, const int& simulator)
 }
 
 
-void 
-Barcode::BitCalculator::SetBCID(int& barcode, const int& bcid) // also to set negative bcid
+void
+Barcode::BitCalculator::SetBCID(int& barcode, const int& bcid) const // also to set negative bcid
 {
   bool isNeg = (bcid<0) ;
   int bcidpositive = (isNeg ? -bcid : bcid);
@@ -209,8 +203,8 @@ Barcode::BitCalculator::SetBCID(int& barcode, const int& bcid) // also to set ne
 }
 
 
-void 
-Barcode::BitCalculator::PrintBits(const int& barcode)
+void
+Barcode::BitCalculator::PrintBits(const int& barcode) const
 {
   for (int i = sizeof(int)*8 -1 ; i>=0; --i) {
     int j = 1<<i;
@@ -222,14 +216,13 @@ Barcode::BitCalculator::PrintBits(const int& barcode)
 
 
 void
-Barcode::BitCalculator::Summary(const int& barcode)
+Barcode::BitCalculator::Summary(const int& barcode) const
 {
   std::cout << "Barcode:      " << barcode << "\n"
-	    << "Bits:         ";   PrintBits(barcode);
+            << "Bits:         ";   PrintBits(barcode);
   std::cout << "Parent ID:    " << GetParentID(barcode) << "\n"
-	    << "Parent PID:   " << GetPIDofParent(barcode) << "\n"
-	    << "Hard scatter: " << GetHS(barcode) << "\n"
-	    << "Simulator:    " << GetSimulator(barcode) << "\n"
-	    << "BCID:         " << GetBCID(barcode) << std::endl;
+            << "Parent PID:   " << GetPIDofParent(barcode) << "\n"
+            << "Hard scatter: " << GetHS(barcode) << "\n"
+            << "Simulator:    " << GetSimulator(barcode) << "\n"
+            << "BCID:         " << GetBCID(barcode) << std::endl;
 }
-
-- 
GitLab


From 6f26e5911cfc5f39103fba99711cf24924493b3e Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 6 Mar 2019 16:18:45 +0100
Subject: [PATCH 274/404] TrigOutputHandling: enable static thread checker

Enable static thread checker for package and relevant trivial fixes
to test program.
---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../test/serial_deserial_test.cxx             | 45 ++++++-------------
 2 files changed, 15 insertions(+), 31 deletions(-)
 create mode 100644 Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..5f55356b178
--- /dev/null
+++ b/Trigger/TrigSteer/TrigOutputHandling/TrigOutputHandling/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigSteer/TrigOutputHandling
diff --git a/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx b/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx
index 27fbc810794..f05797523dc 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/test/serial_deserial_test.cxx
@@ -1,13 +1,9 @@
 
 /*
-  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 <iostream>
 
-
-
-
-
 #include "TestTools/expect.h"
 #include "TestTools/initGaudi.h"
 #include "GaudiKernel/IToolSvc.h"
@@ -20,7 +16,6 @@
 #include "xAODTrigCalo/TrigEMClusterAuxContainer.h"
 #include "xAODTrigger/TrigCompositeContainer.h"
 #include "xAODTrigger/TrigCompositeAuxContainer.h"
-//#include "AthContainers/AuxTypeRegistry.h"
 
 #include "../src/TriggerEDMSerialiserTool.h"
 #include "../src/TriggerEDMDeserialiserAlg.h"
@@ -29,16 +24,13 @@
 void testTrigEMContiner(  const EventContext &ctx );
 void testTrigCompositeContiner(  const EventContext &ctx );
 
-void testTrigEMContinerInsert();
-void testTrigCompositeContinerInsert();
+void testTrigEMContinerInsert(StoreGateSvc*);
+void testTrigCompositeContinerInsert(StoreGateSvc*);
 
+void testTrigEMContinerReadAndCheck(StoreGateSvc*);
+void testTrigCompositeContinerReadAndCheck(StoreGateSvc*);
 
-void testTrigEMContinerReadAndCheck();
-void testTrigCompositeContinerReadAndCheck();
 
-
-
-StoreGateSvc* pStore = nullptr;
 int main() {
   using namespace std;
   ISvcLocator* pSvcLoc;
@@ -49,7 +41,7 @@ int main() {
   assert(pSvcLoc);
   MsgStream log(Athena::getMessageSvc(), "serial_deserial_test");
   
-
+  StoreGateSvc* pStore = nullptr;
   VALUE( pSvcLoc->service("StoreGateSvc", pStore, true).isSuccess() ) EXPECTED ( true );
 
   IToolSvc * toolSvc = nullptr;
@@ -84,8 +76,8 @@ int main() {
   
 
   for ( int rep = 0; rep < 50 ; ++ rep ) {
-    testTrigEMContinerInsert();
-    testTrigCompositeContinerInsert();
+    testTrigEMContinerInsert(pStore);
+    testTrigCompositeContinerInsert(pStore);
 
     auto hltres = new HLT::HLTResultMT();
     VALUE( ser->fill( *hltres ) ) EXPECTED ( StatusCode::SUCCESS );  
@@ -97,8 +89,8 @@ int main() {
     VALUE( runAlg( deser ) ) EXPECTED ( StatusCode::SUCCESS );
     VALUE( runAlg( deser2 ) ) EXPECTED ( StatusCode::SUCCESS );
     
-    testTrigEMContinerReadAndCheck();
-    testTrigCompositeContinerReadAndCheck();
+    testTrigEMContinerReadAndCheck(pStore);
+    testTrigCompositeContinerReadAndCheck(pStore);
     
     // see if we do nto have owneship issues
     pStore->clearStore();  
@@ -110,7 +102,7 @@ int main() {
 }
 
 
-void testTrigEMContinerInsert() {
+void testTrigEMContinerInsert(StoreGateSvc* pStore) {
   
   // place test data
   auto em = new xAOD::TrigEMClusterContainer();
@@ -160,10 +152,9 @@ void testTrigEMContinerInsert() {
   
   VALUE( pStore->record( em, "EMClusters" ) ) EXPECTED ( StatusCode::SUCCESS );
   VALUE( pStore->record( emAux, "EMClustersAux." ) ) EXPECTED ( StatusCode::SUCCESS );
-  
 }
 
-void testTrigEMContinerReadAndCheck() {
+void testTrigEMContinerReadAndCheck(StoreGateSvc* pStore) {
 
   const xAOD::TrigEMClusterContainer *emback = nullptr;
   VALUE( pStore->retrieve( emback, "DESERIALISED_EMClusters") ) EXPECTED ( StatusCode::SUCCESS );
@@ -195,7 +186,7 @@ void testTrigEMContinerReadAndCheck() {
   std::cout << std::endl;
 }
 
-void testTrigCompositeContinerInsert() {
+void testTrigCompositeContinerInsert(StoreGateSvc* pStore) {
 
   auto m = new xAOD::TrigCompositeContainer();
   auto mAux = new xAOD::TrigCompositeAuxContainer();
@@ -211,12 +202,9 @@ void testTrigCompositeContinerInsert() {
   
   VALUE( pStore->record( m, "EMClustersDecisions" ) ) EXPECTED ( StatusCode::SUCCESS );
   VALUE( pStore->record( mAux, "EMClustersDecisionsAux." ) ) EXPECTED ( StatusCode::SUCCESS );
-
-  
-  
 }
 
-void testTrigCompositeContinerReadAndCheck() {
+void testTrigCompositeContinerReadAndCheck(StoreGateSvc* pStore) {
 
   const xAOD::TrigCompositeContainer *decisions = nullptr;
   VALUE( pStore->retrieve( decisions, "DESERIALISED_EMClustersDecisions") ) EXPECTED ( StatusCode::SUCCESS );
@@ -228,9 +216,4 @@ void testTrigCompositeContinerReadAndCheck() {
   VALUE( decisions->at(1)->getDetail<float>("detail1") ) EXPECTED( 1.7 );
   VALUE( decisions->at(0)->getDetail<int>("detail2") ) EXPECTED( 5 );
   VALUE( decisions->at(1)->getDetail<int>("detail2") ) EXPECTED( 7 );
-
-
-
-  
-  
 }
-- 
GitLab


From 031a63445d19f0b31cea621589e3bb456749aff6 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 16:46:42 +0100
Subject: [PATCH 275/404] Add ATLAS_CHECK_THREAD_SAFETY to G4CosmicFilter
 package * Add ATLAS_CHECK_THREAD_SAFETY to G4CosmicFilter package    *
 https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins *
 Drop thread-unsafe mutable StoreGateSvc members from `G4CosmicAndFilter`,  
 `G4CosmicFilter` and `G4CosmicOrFilter` * Replace usage of
 `CxxUtils::make_unique` with `std::make_unique`.

---
 .../G4CosmicFilter/ATLAS_CHECK_THREAD_SAFETY  |  1 +
 .../G4CosmicFilter/CMakeLists.txt             |  3 +-
 .../G4CosmicFilter/G4CosmicAndFilter.h        | 11 +---
 .../G4CosmicFilter/G4CosmicFilter.h           | 60 ++++++++-----------
 .../G4CosmicFilter/G4CosmicOrFilter.h         | 11 +---
 .../G4CosmicFilter/src/G4CosmicAndFilter.cxx  | 30 +++++-----
 .../src/G4CosmicAndFilterTool.cxx             |  5 +-
 .../G4CosmicFilter/src/G4CosmicFilter.cxx     | 34 +++++------
 .../G4CosmicFilter/src/G4CosmicFilterTool.cxx |  5 +-
 .../G4CosmicFilter/src/G4CosmicOrFilter.cxx   |  6 +-
 .../src/G4CosmicOrFilterTool.cxx              |  5 +-
 11 files changed, 67 insertions(+), 104 deletions(-)
 create mode 100644 Simulation/G4Extensions/G4CosmicFilter/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/G4Extensions/G4CosmicFilter/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Extensions/G4CosmicFilter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..2196b482db3
--- /dev/null
+++ b/Simulation/G4Extensions/G4CosmicFilter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Extensions/G4CosmicFilter
diff --git a/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt b/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt
index f0a7998d54b..c339ad433be 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt
+++ b/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt
@@ -13,7 +13,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Simulation/G4Atlas/G4AtlasInterfaces
                           Simulation/G4Atlas/G4AtlasTools
                           PRIVATE
-                          Control/CxxUtils
                           Simulation/G4Sim/MCTruth
                           Simulation/G4Sim/TrackRecord )
 
@@ -27,7 +26,7 @@ atlas_add_component( G4CosmicFilter
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib CxxUtils MCTruth )
+                     LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib MCTruth )
 
 # Install files from the package:
 atlas_install_headers( G4CosmicFilter )
diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h
index 82eda2b4f97..81232767e99 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.h
+++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicAndFilter.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 G4COSMICFILTER_G4CosmicAndFilter_H
@@ -8,9 +8,6 @@
 #include "G4UserEventAction.hh"
 #include "AthenaBaseComps/AthMessaging.h"
 
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-
 namespace G4UA
 {
 
@@ -52,12 +49,6 @@ namespace G4UA
       Config m_config;
       Report m_report;
 
-      typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-      /// Pointer to StoreGate (event store by default)
-      mutable StoreGateSvc_t m_evtStore;
-      /// Pointer to StoreGate (detector store by default)
-      mutable StoreGateSvc_t m_detStore;
-
   }; // class G4CosmicFilter
 
 } // namespace G4UA
diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h
index 2080889d766..a72e73248e8 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.h
+++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicFilter.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 G4COSMICFILTER_G4CosmicFilter_H
@@ -8,10 +8,6 @@
 #include "G4UserEventAction.hh"
 #include "AthenaBaseComps/AthMessaging.h"
 
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-
-
 namespace G4UA
 {
 
@@ -22,43 +18,37 @@ namespace G4UA
   class G4CosmicFilter: public AthMessaging, public G4UserEventAction
   {
 
-    public:
-
-      struct Config
-      {
-        std::string collectionName = "CaloEntryLayer";
-        int PDGId = 0;
-        double ptMin = -1;
-        double ptMax = -1;
-      };
+  public:
 
-      struct Report
-      {
-        int ntot = 0;
-        int npass = 0;
-        void merge(const Report& rep){
-          ntot += rep.ntot;
-          npass += rep.npass;
-        }
-      };
+    struct Config
+    {
+      std::string collectionName = "CaloEntryLayer";
+      int PDGId = 0;
+      double ptMin = -1;
+      double ptMax = -1;
+    };
 
-      G4CosmicFilter(const Config& config);
+    struct Report
+    {
+      int ntot = 0;
+      int npass = 0;
+      void merge(const Report& rep){
+        ntot += rep.ntot;
+        npass += rep.npass;
+      }
+    };
 
-      const Report& getReport() const
-      { return m_report; }
+    G4CosmicFilter(const Config& config);
 
-      virtual void EndOfEventAction(const G4Event*) override;
+    const Report& getReport() const
+    { return m_report; }
 
-    private:
+    virtual void EndOfEventAction(const G4Event*) override;
 
-      Config m_config;
-      Report m_report;
+  private:
 
-      typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-      /// Pointer to StoreGate (event store by default)
-      mutable StoreGateSvc_t m_evtStore;
-      /// Pointer to StoreGate (detector store by default)
-      mutable StoreGateSvc_t m_detStore;
+    Config m_config;
+    Report m_report;
 
   }; // class G4CosmicFilter
 
diff --git a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h
index 1d148bc043e..432bbf80d74 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.h
+++ b/Simulation/G4Extensions/G4CosmicFilter/G4CosmicFilter/G4CosmicOrFilter.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 G4COSMICFILTER_G4CosmicOrFilter_H
@@ -8,9 +8,6 @@
 #include "G4UserEventAction.hh"
 #include "AthenaBaseComps/AthMessaging.h"
 
-#include "StoreGate/StoreGateSvc.h"
-#include "GaudiKernel/ServiceHandle.h"
-
 namespace G4UA
 {
 
@@ -52,12 +49,6 @@ namespace G4UA
       Config m_config;
       Report m_report;
 
-      typedef ServiceHandle<StoreGateSvc> StoreGateSvc_t;
-      /// Pointer to StoreGate (event store by default)
-      mutable StoreGateSvc_t m_evtStore;
-      /// Pointer to StoreGate (detector store by default)
-      mutable StoreGateSvc_t m_detStore;
-
   }; // class G4CosmicOrFilter
 
 } // namespace G4UA
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx
index 16d57f88b3d..c5e6771cb96 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilter.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 "G4CosmicFilter/G4CosmicAndFilter.h"
@@ -19,9 +19,7 @@ namespace G4UA
 
   G4CosmicAndFilter::G4CosmicAndFilter(const Config& config)
     : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ), "G4CosmicAndFilter"),
-      m_config(config), m_report(),
-      m_evtStore("StoreGateSvc/StoreGateSvc", "G4CosmicAndFilter"),
-      m_detStore("StoreGateSvc/DetectorStore", "G4CosmicAndFilter")
+      m_config(config), m_report()
   {
   }
 
@@ -33,35 +31,35 @@ namespace G4UA
     SG::ReadHandle <TrackRecordCollection> coll(m_config.collectionName);
     if (! coll.isValid())
       {
-	ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " << m_config.collectionName);
+        ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " << m_config.collectionName);
       }
     else
       {
-	counter = coll->size();
+        counter = coll->size();
       }
 
     if (counter==0)
       {
-	ATH_MSG_INFO("aborting event due to failing AND filter");
-	G4RunManager::GetRunManager()->AbortEvent();
-	return;
+        ATH_MSG_INFO("aborting event due to failing AND filter");
+        G4RunManager::GetRunManager()->AbortEvent();
+        return;
       }
 
     SG::ReadHandle <TrackRecordCollection> coll2(m_config.collectionName2);
     if (! coll2.isValid())
-    {
-      ATH_MSG_INFO( "Cannot retrieve TrackRecordCollection " << m_config.collectionName2 );
-    }
+      {
+        ATH_MSG_INFO( "Cannot retrieve TrackRecordCollection " << m_config.collectionName2 );
+      }
     else
       {
-	counter = coll2->size();
+        counter = coll2->size();
       }
 
     if (counter==0)
       {
-	ATH_MSG_INFO("aborting event due to failing AND filter");
-	G4RunManager::GetRunManager()->AbortEvent();
-	return;
+        ATH_MSG_INFO("aborting event due to failing AND filter");
+        G4RunManager::GetRunManager()->AbortEvent();
+        return;
       }
 
     m_report.npass++;
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx
index 09f041d9707..ae790053e18 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicAndFilterTool.cxx
@@ -1,8 +1,7 @@
 /*
-  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 "CxxUtils/make_unique.h"
 #include "G4CosmicFilter/G4CosmicAndFilterTool.h"
 
 namespace G4UA
@@ -21,7 +20,7 @@ namespace G4UA
   G4CosmicAndFilterTool::makeAndFillAction(G4AtlasUserActions& actionList)
   {
     ATH_MSG_DEBUG("Constructing a G4CosmicAndFilter");
-    auto action = CxxUtils::make_unique<G4CosmicAndFilter>(m_config);
+    auto action = std::make_unique<G4CosmicAndFilter>(m_config);
     actionList.eventActions.push_back( action.get() );
     return action;
   }
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx
index 2d419bfefc9..9115d633791 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilter.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 "G4CosmicFilter/G4CosmicFilter.h"
@@ -20,9 +20,7 @@ namespace G4UA
 
   G4CosmicFilter::G4CosmicFilter(const Config& config)
     : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >( "MessageSvc" ), "G4CosmicFilter"),
-      m_config(config), m_report(),
-      m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicFilter"),
-      m_detStore("StoreGateSvc/DetectorStore","G4CosmicFilter")
+      m_config(config), m_report()
   {
   }
 
@@ -35,31 +33,31 @@ namespace G4UA
     SG::ReadHandle <TrackRecordCollection> coll(m_config.collectionName);
     if (! coll.isValid() )
       {
-	ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " << m_config.collectionName );
-	G4RunManager::GetRunManager()->AbortEvent();
-	return;
+        ATH_MSG_WARNING( "Cannot retrieve TrackRecordCollection " << m_config.collectionName );
+        G4RunManager::GetRunManager()->AbortEvent();
+        return;
       }
 
     counter = coll->size();
 
     if (m_config.PDGId!=0 || m_config.ptMin>0 || m_config.ptMax>0)
       {
-	counter=0;
-	for (const auto& a_tr : *coll)
-	  {
-	    if (m_config.PDGId!=0 && m_config.PDGId != fabs(a_tr.GetPDGCode())) continue;
-	    if (m_config.ptMin>0 && m_config.ptMin > a_tr.GetMomentum().perp() ) continue;
-	    if (m_config.ptMax>0 && m_config.ptMax < a_tr.GetMomentum().perp() ) continue;
-	    counter++;
-	  }
+        counter=0;
+        for (const auto& a_tr : *coll)
+          {
+            if (m_config.PDGId!=0 && m_config.PDGId != fabs(a_tr.GetPDGCode())) continue;
+            if (m_config.ptMin>0 && m_config.ptMin > a_tr.GetMomentum().perp() ) continue;
+            if (m_config.ptMax>0 && m_config.ptMax < a_tr.GetMomentum().perp() ) continue;
+            counter++;
+          }
       }
 
     //std::cout << "EndOfEventAction counter is "<<counter<<std::endl;
     if (counter==0)
       {
-	ATH_MSG_INFO("aborting event due to failing filter");
-	G4RunManager::GetRunManager()->AbortEvent();
-	return;
+        ATH_MSG_INFO("aborting event due to failing filter");
+        G4RunManager::GetRunManager()->AbortEvent();
+        return;
       }
 
     m_report.npass++;
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx
index dc9d6e2cc27..a9b9f35ed14 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicFilterTool.cxx
@@ -1,8 +1,7 @@
 /*
-  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 "CxxUtils/make_unique.h"
 #include "G4CosmicFilter/G4CosmicFilterTool.h"
 
 namespace G4UA
@@ -23,7 +22,7 @@ namespace G4UA
   G4CosmicFilterTool::makeAndFillAction(G4AtlasUserActions& actionList)
   {
     ATH_MSG_DEBUG("Constructing a G4CosmicFilter");
-    auto action = CxxUtils::make_unique<G4CosmicFilter>(m_config);
+    auto action = std::make_unique<G4CosmicFilter>(m_config);
     actionList.eventActions.push_back( action.get() );
     return action;
   }
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx
index 3553e940a59..355352aa787 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilter.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 "G4CosmicFilter/G4CosmicOrFilter.h"
@@ -18,9 +18,7 @@ namespace G4UA
 
   G4CosmicOrFilter::G4CosmicOrFilter(const Config& config)
     : AthMessaging(Gaudi::svcLocator()->service< IMessageSvc >("MessageSvc"), "G4CosmicOrFilter"),
-      m_config(config), m_report(),
-      m_evtStore("StoreGateSvc/StoreGateSvc","G4CosmicOrFilter"),
-      m_detStore("StoreGateSvc/DetectorStore","G4CosmicOrFilter")
+      m_config(config), m_report()
   {
   }
 
diff --git a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx
index 0e5bae175fd..83cb65643ca 100644
--- a/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx
+++ b/Simulation/G4Extensions/G4CosmicFilter/src/G4CosmicOrFilterTool.cxx
@@ -1,8 +1,7 @@
 /*
-  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 "CxxUtils/make_unique.h"
 #include "G4CosmicFilter/G4CosmicOrFilterTool.h"
 
 namespace G4UA
@@ -22,7 +21,7 @@ namespace G4UA
   G4CosmicOrFilterTool::makeAndFillAction(G4AtlasUserActions& actionList)
   {
     ATH_MSG_DEBUG("Constructing a G4CosmicFilter");
-    auto action = CxxUtils::make_unique<G4CosmicOrFilter>(m_config);
+    auto action = std::make_unique<G4CosmicOrFilter>(m_config);
     actionList.eventActions.push_back( action.get() );
     return action;
   }
-- 
GitLab


From 9ff75fb12814ad93d364b4e5384a4305c2278045 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 16:52:48 +0100
Subject: [PATCH 276/404] Add ATLAS_CHECK_THREAD_SAFETY to G4HitFilter package
 * Add ATLAS_CHECK_THREAD_SAFETY to G4HitFilter package    *
 https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins

---
 Simulation/G4Extensions/G4HitFilter/ATLAS_CHECK_THREAD_SAFETY | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Simulation/G4Extensions/G4HitFilter/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/G4Extensions/G4HitFilter/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Extensions/G4HitFilter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..a842c9e8394
--- /dev/null
+++ b/Simulation/G4Extensions/G4HitFilter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Extensions/G4HitFilter
-- 
GitLab


From 15ba5e2eebf46250b6f18ff2e96b290e85fdaf9d Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Wed, 6 Mar 2019 16:53:38 +0100
Subject: [PATCH 277/404] Add ATLAS_CHECK_THREAD_SAFETY to G4ScoringProcess
 package * Add ATLAS_CHECK_THREAD_SAFETY to G4ScoringProcess package    *
 https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CheckerGccPlugins

---
 .../G4Extensions/G4ScoringProcess/ATLAS_CHECK_THREAD_SAFETY      | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Simulation/G4Extensions/G4ScoringProcess/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Simulation/G4Extensions/G4ScoringProcess/ATLAS_CHECK_THREAD_SAFETY b/Simulation/G4Extensions/G4ScoringProcess/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e006b33ce28
--- /dev/null
+++ b/Simulation/G4Extensions/G4ScoringProcess/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Simulation/G4Extensions/G4ScoringProcess
-- 
GitLab


From b53eb969d81f90f74be09406d3089d665dca70eb Mon Sep 17 00:00:00 2001
From: MatousVozak <matous.vozak@cern.ch>
Date: Wed, 6 Mar 2019 17:52:05 +0100
Subject: [PATCH 278/404] Adding signature suffix to algs

---
 .../TrigUpgradeTest/python/InDetSetup.py      | 63 +++++++++++--------
 1 file changed, 38 insertions(+), 25 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
index 30c1091e46c..47001a6f5bd 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,11 +197,13 @@ 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(),
                                                       ClustersName            = "SCT_TrigClusters",
+                                                      #Adding the suffix to flagged conditions
+                                                      #SCT_FlaggedCondData     = "SCT_FlaggedCondData_TRIG",
                                                       conditionsTool          = InDetSCT_ConditionsSummaryToolWithoutFlagged)
   InDetSCT_Clusterization.isRoI_Seeded = True
   InDetSCT_Clusterization.RoIs = "EMViewRoIs"
@@ -210,12 +215,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 +244,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",
@@ -254,5 +259,13 @@ def makeInDetAlgs():
   viewAlgs.append(theTrackParticleCreatorAlg)
 
   
+ # #Run over all alg and suffix to CondData
+ # for alg in viewAlgs: 
+ #     if  alg.properties().has_key("SCT_FlaggedCondData"):
+ #       #Changing the suffix of FlaggedConditionData
+ #        alg.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"
+ # #Need to call it on inside tools
+
+
   return (viewAlgs, eventAlgs)
 
-- 
GitLab


From 6e6399b28a6b72b76d56fd667ba6723f44d3eeb4 Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Wed, 6 Mar 2019 18:01:51 +0100
Subject: [PATCH 279/404] Run egamma trigger post ESD test in MT mode

---
 .../TrigUpgradeTest/test/test_egamma_run_data.sh            | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
index 37a04c78482..f7156c46c3c 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh
@@ -5,7 +5,5 @@
 #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
-
-# Tim M 06-05-19. Temporarily disable post-checks while they're fixed
-# athena TrigUpgradeTest/checkESD.py 
+checkxAOD.py myESD.pool.root &&
+athena --threads=1 TrigUpgradeTest/checkESD.py 
-- 
GitLab


From 36071e55d6871300cb4fb9dc2f44eb0db534ee15 Mon Sep 17 00:00:00 2001
From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>
Date: Wed, 6 Mar 2019 21:09:22 +0100
Subject: [PATCH 280/404] Move generateDecisionTree function to separate file

---
 .../Menu/GenerateMenuMT_newJO.py              |   3 +-
 .../python/HLTMenuConfig/Menu/HLTCFConfig.py  | 103 ---------------
 .../HLTMenuConfig/Menu/HLTCFConfig_newJO.py   | 117 ++++++++++++++++++
 3 files changed, 119 insertions(+), 104 deletions(-)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index b4e212246bc..9556fcf2533 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
+    generateDecisionTreeOld
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree
 
 from AthenaCommon.Logging import logging
 from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index b822a7f1312..dbcefaf3c35 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -437,109 +437,6 @@ def generateDecisionTreeOld(HLTNode, chains, allChainDicts):
     return acc
 
 
-def connectStepToFilter(chainStep, filter):
-    filter_output = filter.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, filter.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
-
-
 def findFilter(filter_name, cfseqList):
       """
       searches for a filter, with given name, in the CF sequence list of this step
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 00000000000..45c9c25acd2
--- /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, filter):
+    filter_output = filter.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, filter.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
-- 
GitLab


From 30c90e7834adff4a6e6ce9dfb1f87ce66c016aa2 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:18:43 +0100
Subject: [PATCH 281/404] CxxUtils: Add CachedUniquePtr.

Add CachedUniquePtr, to help with cases where we lazily-cache
an allocated object.
---
 Control/CxxUtils/CMakeLists.txt               |   3 +-
 Control/CxxUtils/CxxUtils/CachedUniquePtr.h   | 122 +++++++++++
 Control/CxxUtils/CxxUtils/CachedUniquePtr.icc | 172 +++++++++++++++
 .../CxxUtils/share/CachedUniquePtr_test.ref   |   3 +
 .../CxxUtils/test/CachedUniquePtr_test.cxx    | 195 ++++++++++++++++++
 5 files changed, 494 insertions(+), 1 deletion(-)
 create mode 100644 Control/CxxUtils/CxxUtils/CachedUniquePtr.h
 create mode 100644 Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
 create mode 100644 Control/CxxUtils/share/CachedUniquePtr_test.ref
 create mode 100644 Control/CxxUtils/test/CachedUniquePtr_test.cxx

diff --git a/Control/CxxUtils/CMakeLists.txt b/Control/CxxUtils/CMakeLists.txt
index e27276167d7..a6607bec173 100644
--- a/Control/CxxUtils/CMakeLists.txt
+++ b/Control/CxxUtils/CMakeLists.txt
@@ -107,7 +107,8 @@ foreach( test sincos_test copyif_test ArrayScanner_test Arrayrep_test
       fpcompare_test StrFormat_test
       prefetch_test ClassName_test make_unique_test ones_test
       exctrace1_test bitscan_test ConcurrentRangeMap_test
-      CachedValue_test CachedPointer_test atomic_fetch_minmax_test
+      CachedValue_test CachedPointer_test CachedUniquePtr_test
+      atomic_fetch_minmax_test
       MurmurHash2_test bitmask_test crc64_test Ring_test )
    atlas_add_test( ${test}
       SOURCES test/${test}.cxx
diff --git a/Control/CxxUtils/CxxUtils/CachedUniquePtr.h b/Control/CxxUtils/CxxUtils/CachedUniquePtr.h
new file mode 100644
index 00000000000..0c83de06ac5
--- /dev/null
+++ b/Control/CxxUtils/CxxUtils/CachedUniquePtr.h
@@ -0,0 +1,122 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file CxxUtils/CachedUniquePtr.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Mar, 2019
+ * @brief Cached unique_ptr with atomic update.
+ */
+
+
+#ifndef CXXUTILS_CACHEDUNIQUEPTR_H
+#define CXXUTILS_CACHEDUNIQUEPTR_H
+
+
+#include <atomic>
+#include <memory>
+
+
+namespace CxxUtils {
+
+
+/**
+ * @brief Cached pointer with atomic update.
+ *
+ * This acts as a @c unique_ptr that may be set atomically through
+ * a const method.  If the pointer is already set, then the new value
+ * is deleted.  The intended use case is where one maintains some
+ * cached object that is computed lazily.  So one can do, for example,
+ *@code
+ *  CxxUtils::CachedUniquePtr<Payload> m_payload;
+ *  ...
+ *  const Payload* ...::get() const
+ *  {
+ *    if (!m_payload) {
+ *      m_payload.set (std::make_unique<Payload> (...));
+ *    }
+ *    return m_payload.get());
+ *  }
+ @endcode
+ *
+ * This only makes sense if the objects passed to set() are equivalent
+ * in all threads.  This is generally the case for a lazily-computed value,
+ * but this class has no way of enforcing this.
+ *
+ * It is recommended to generally use the template @c CachedUniquePtr, which
+ * is specialized for const types.
+ * The more general template @c CachedUniquePtrT can be used with a non-const
+ * type (but you don't want to do that for the lazy-cache use case).
+ */
+template <class T>
+class CachedUniquePtrT
+{
+public:
+  /// Default constructor.  Sets the element to null.
+  CachedUniquePtrT();
+
+   
+  /// Constructor from an element.
+  CachedUniquePtrT (std::unique_ptr<T> elt);
+
+
+  /// Move constructor.
+  CachedUniquePtrT (CachedUniquePtrT&& other);
+
+
+  /// Move.
+  CachedUniquePtrT& operator= (CachedUniquePtrT&& other);
+
+
+  // Destructor.
+  ~CachedUniquePtrT();
+
+
+  /// Atomically set the element.  If already set, then @c elt is discarded.
+  void set (std::unique_ptr<T> elt) const;
+
+
+  /// Store a new value to the element.
+  /// Not compatible with other concurrent access.
+  void store (std::unique_ptr<T> elt);
+
+
+  /// Return the current value of the element.
+  T* get() const;
+
+
+  /// Dereference the element.
+  T& operator*() const;
+
+
+  /// Dereference the element.
+  T* operator->() const;
+
+
+  /// Test if the element is null.
+  explicit operator bool() const;
+
+
+  /// Transfer ownership from the element: return the current value as a
+  /// unique_ptr, leaving the element null.
+  std::unique_ptr<T> release();
+
+
+private:
+  /// The cached element.
+  mutable std::atomic<T*> m_ptr;
+};
+
+
+template <class T>
+using CachedUniquePtr = CachedUniquePtrT<const T>;
+
+
+} // namespace CxxUtils
+
+
+#include "CxxUtils/CachedUniquePtr.icc"
+
+
+#endif // not CXXUTILS_CACHEDUNIQUEPTR_H
diff --git a/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc b/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
new file mode 100644
index 00000000000..f86b4c6293c
--- /dev/null
+++ b/Control/CxxUtils/CxxUtils/CachedUniquePtr.icc
@@ -0,0 +1,172 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+// $Id$
+/**
+ * @file CxxUtils/CachedUniquePtr.icc
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Mar, 2019
+ * @brief Cached unique_ptr with atomic update.
+ */
+
+
+namespace CxxUtils {
+
+
+/**
+ * @brief Default constructor.  Sets the element to null.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>::CachedUniquePtrT()
+  : m_ptr (nullptr)
+{
+}
+
+
+/**
+ * @brief Constructor from an element.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>::CachedUniquePtrT (std::unique_ptr<T> elt)
+  : m_ptr (elt.release())
+{
+}
+
+
+/**
+ * @brief Move constructor.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>::CachedUniquePtrT (CachedUniquePtrT&& other)
+  : m_ptr (other.release().release())
+{
+}
+
+
+/**
+ * @brief Move.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>&
+CachedUniquePtrT<T>::operator= (CachedUniquePtrT&& other)
+{
+  if (this != &other) {
+    store (other.release());
+  }
+  return *this;
+}
+
+
+/** 
+ * @brief Destructor.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>::~CachedUniquePtrT()
+{
+  delete m_ptr;
+}
+
+
+/**
+ * @brief Atomically set the element.  If already set, then @c elt is discarded.
+ * @param elt The new value for the element.
+ *
+ * If the current value of the element is null, then set it to @c elt.
+ * Otherwise, delete @c elt.
+ * This is done atomically.
+ */
+template <class T>
+inline
+void CachedUniquePtrT<T>::set (std::unique_ptr<T> elt) const
+{
+  // Set the element to ELT if it is currently null.
+  T* ptr = elt.release();
+  T* null = nullptr;
+  if (!m_ptr.compare_exchange_strong (null, ptr)) {
+    // Was already set.  Delete the new value.
+    delete ptr;
+  }
+}
+
+
+/**
+ * @brief Store a new value to the element.
+ *        Not compatible with other concurrent access.
+ */
+template <class T>
+inline
+void CachedUniquePtrT<T>::store (std::unique_ptr<T> elt)
+{
+  T* old = m_ptr.exchange (elt.release());
+  delete old;
+}
+
+
+/**
+ * @brief Return the current value of the element.
+ */
+template <class T>
+inline
+T*
+CachedUniquePtrT<T>::get() const
+{
+  return m_ptr.load();
+}
+
+
+/**
+ * @brief Dereference the element.
+ */
+template <class T>
+inline
+T&
+CachedUniquePtrT<T>::operator*() const
+{
+  return *get();
+}
+
+
+/**
+ * @brief Dereference the element.
+ */
+template <class T>
+inline
+T*
+CachedUniquePtrT<T>::operator->() const
+{
+  return get();
+}
+
+
+/**
+ * @brief Test if the element is null.
+ */
+template <class T>
+inline
+CachedUniquePtrT<T>::operator bool() const
+{
+  return get() != nullptr;
+}
+
+
+/**
+ * @brief Transfer ownership from the element: return the current value as a
+ *        unique_ptr, leaving the element null.
+ */
+template <class T>
+inline
+std::unique_ptr<T>
+CachedUniquePtrT<T>::release()
+{
+  T* old = m_ptr.exchange (nullptr);
+  return std::unique_ptr<T> (old);
+}
+
+
+} // namespace CxxUtils
diff --git a/Control/CxxUtils/share/CachedUniquePtr_test.ref b/Control/CxxUtils/share/CachedUniquePtr_test.ref
new file mode 100644
index 00000000000..f0c0fd55135
--- /dev/null
+++ b/Control/CxxUtils/share/CachedUniquePtr_test.ref
@@ -0,0 +1,3 @@
+CachedUniquePtr_test
+test1
+test2
diff --git a/Control/CxxUtils/test/CachedUniquePtr_test.cxx b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
new file mode 100644
index 00000000000..d4789458023
--- /dev/null
+++ b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
+ */
+
+// $Id$
+/**
+ * @file CxxUtils/test/CachedUniquePtr_test.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date mar, 2019
+ * @brief Unit tests for CachedUniquePtr
+ */
+
+
+#undef NDEBUG
+#include "CxxUtils/CachedUniquePtr.h"
+#include <atomic>
+#include <iostream>
+#include <cassert>
+#include <thread>
+#include <shared_mutex>
+
+
+struct P
+{
+  P(int x) : m_x(x) { ++s_count; }
+  ~P() { --s_count; }
+
+  int m_x;
+  static std::atomic<int> s_count;
+};
+
+std::atomic<int> P::s_count = 0;
+
+
+// Basic tests.
+void test1()
+{
+  std::cout << "test1\n";
+  //int x1 = 0;
+  //int x2 = 0;
+  //int x4 = 0;
+
+  CxxUtils::CachedUniquePtr<P> cp1;
+  assert (!cp1.get());
+  assert (!cp1);
+  assert (P::s_count == 0);
+  cp1.store (std::make_unique<P>(1));
+  assert (P::s_count == 1);
+  assert (cp1.get()->m_x == 1);
+  assert (cp1);
+  assert (cp1->m_x == 1);
+  assert ((*cp1).m_x == 1);
+  cp1.store (nullptr);
+  assert (!cp1.get());
+  assert (P::s_count == 0);
+
+  CxxUtils::CachedUniquePtr<P> cp2 (std::make_unique<P>(2));
+  assert (cp2->m_x == 2);
+  assert (P::s_count == 1);
+
+  cp1 = std::move(cp2);
+  assert (cp1->m_x == 2);
+  assert (!cp2);
+  assert (P::s_count == 1);
+
+  {
+    const CxxUtils::CachedUniquePtr<P> cp3 (std::move (cp1));
+    assert (cp3->m_x == 2);
+    assert (!cp1);
+    assert (P::s_count == 1);
+  }
+  assert (P::s_count == 0);
+
+  cp1.set (std::make_unique<P>(3));
+  assert (cp1->m_x == 3);
+  assert (P::s_count == 1);
+
+  cp1.set (std::make_unique<P>(4));
+  assert (cp1->m_x == 3);
+  assert (P::s_count == 1);
+
+  std::unique_ptr<const P> up = cp1.release();
+  assert (!cp1);
+  assert (up->m_x == 3);
+  assert (P::s_count == 1);
+}
+
+
+class ThreadingTest
+{
+public:
+  static const int NVAL = 10;
+  CxxUtils::CachedUniquePtr<P> m_vals[10];
+  std::shared_timed_mutex m_sm;
+  int m_x[NVAL] = {0};
+
+  void threadedTest();
+
+  struct writerThread
+  {
+    writerThread (ThreadingTest& test, int iworker)
+      : m_test (test), m_iworker (iworker) {}
+    void operator()();
+    ThreadingTest& m_test;
+    int m_iworker;
+  };
+
+  
+  struct readerThread
+  {
+    readerThread (ThreadingTest& test, int iworker)
+      : m_test (test), m_iworker (iworker) {}
+    void operator()();
+    ThreadingTest& m_test;
+    int m_iworker;
+  };
+};
+
+
+void ThreadingTest::writerThread::operator()()
+{
+  int i = m_iworker;
+  do {
+    m_test.m_vals[i].set (std::make_unique<const P>(i));
+    i++;
+    if (i >= NVAL) i = 0;
+  } while (i != m_iworker);
+}
+
+
+void ThreadingTest::readerThread::operator()()
+{
+  bool checked[NVAL] = {false};
+  int nchecked = 0;
+  while (nchecked < NVAL) {
+    int i = m_iworker;
+    do {
+      if (!checked[i] && m_test.m_vals[i]) {
+        assert (m_test.m_vals[i]->m_x == i);
+        checked[i] = true;
+        ++nchecked;
+      }
+      i++;
+      if (i >= NVAL) i = 0;
+    } while (i != m_iworker);
+  }
+}
+
+
+void ThreadingTest::threadedTest()
+{
+  for (int i=0; i < NVAL; i++) {
+    m_vals[i].store (nullptr);
+  }
+
+  const int nthread = 10;
+  std::thread threads[nthread];
+  m_sm.lock();
+
+  for (int i=0; i < nthread; i++) {
+    if (i < 3) {
+      threads[i] = std::thread (writerThread (*this, i));
+    }
+    else {
+      threads[i] = std::thread (readerThread (*this, i));
+    }
+  }
+
+  // Try to get the threads starting as much at the same time as possible.
+  m_sm.unlock();
+  for (int i=0; i < nthread; i++)
+    threads[i].join();
+}
+
+
+// Threading test.
+void test2()
+{
+  std::cout << "test2\n";
+
+  ThreadingTest test;
+#if 0
+  for (int i=0; i < 20; i++)
+    test.threadedTest();
+#endif
+}
+
+
+int main()
+{
+  std::cout << "CachedUniquePtr_test\n";
+  test1();
+  test2();
+  return 0;
+}
-- 
GitLab


From dba63f5b24790d7d56313bb86a61f7f2681796a1 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 03:59:36 +0100
Subject: [PATCH 282/404] CxxUtils: Fix compilation/ubsan warnings.

Suppress pedwarn from a tbb header.
Suppress ubsan warnings from boost::any.
---
 Control/CxxUtils/share/ubsan.supp               |  3 +++
 Control/CxxUtils/test/ConcurrentBitset_test.cxx | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Control/CxxUtils/share/ubsan.supp b/Control/CxxUtils/share/ubsan.supp
index 77dc9ed56a8..e0ba8742c05 100644
--- a/Control/CxxUtils/share/ubsan.supp
+++ b/Control/CxxUtils/share/ubsan.supp
@@ -9,3 +9,6 @@ vptr_check:PrepRawDataCollection
 # Suppress false positives caused by ToolHandle calls from code
 # generated by cling.
 vptr_check:ToolHandle
+
+# Suppress downcast warnings from boost::any.
+vptr_check:holder
diff --git a/Control/CxxUtils/test/ConcurrentBitset_test.cxx b/Control/CxxUtils/test/ConcurrentBitset_test.cxx
index 3b5e985a608..8590fc000c5 100644
--- a/Control/CxxUtils/test/ConcurrentBitset_test.cxx
+++ b/Control/CxxUtils/test/ConcurrentBitset_test.cxx
@@ -17,14 +17,14 @@
 #include "CxxUtils/ConcurrentBitset.h"
 #include "CxxUtils/checker_macros.h"
 #include "TestTools/random.h"
-// Work around a warning in tbb, found by gcc8.
-// Fixed in TBB 2018 U5.
-#if defined(__GNUC__) && __GNUC__ >= 8
+// tbb/machine/gcc_generic.h has spurious trailing semicolons after
+// the clz() functiosn (as of TBB 2019 U1).
+#if defined(__GNUC__)
 # pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wclass-memaccess"
+# pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include "tbb/concurrent_unordered_set.h"
-#if defined(__GNUC__) && __GNUC__ >= 8
+#if defined(__GNUC__)
 # pragma GCC diagnostic pop
 #endif
 #include "boost/timer/timer.hpp"
-- 
GitLab


From 3798546744b2a277fbbeb88a49d7a5cd0266346d Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 6 Mar 2019 15:46:12 +0100
Subject: [PATCH 283/404] AthenaKernel: Fix deletion ordering problem with
 RecyclableDataObject.

During finalization, it is possible that a component with a
RecyclableDataQueue gets deleted while there are still associated
data objects in the event store.  This can then lead to a use-after-free
error when the store is finalized.  Be robust against this by allocating
the underlying queue separately from RecyclableDataQueue and managing
it using shared_ptr.

Should fix ATLASSIM-4044.
---
 .../AthenaKernel/RecyclableDataObject.h       | 62 +++++++++++++------
 .../AthenaKernel/RecyclableDataObject.icc     | 22 +++++--
 2 files changed, 59 insertions(+), 25 deletions(-)

diff --git a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
index 0bdb0b2aa3a..b3b7f63ffca 100644
--- a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
+++ b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
@@ -1,6 +1,6 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 /*
  */
@@ -26,6 +26,7 @@
 #if defined(__GNUC__) && __GNUC__ >= 8
 # pragma GCC diagnostic pop
 #endif
+#include <memory>
 
 
 namespace Athena {
@@ -34,21 +35,23 @@ namespace Athena {
 /**
  * @brief Helper for recycling objects from event to event.
  *
- * In some cases, one wants to reuse already-allocated objects from event to event,
- * rather than deleting and recreating them each time.  This has typically been done
- * for complicated objects, such as classes deriving from IdentfiableContainer.
+ * In some cases, one wants to reuse already-allocated objects
+ * from event to event, rather than deleting and recreating them each time.
+ * This has typically been done for complicated objects,
+ * such as classes deriving from IdentfiableContainer.
  *
- * Some care is obviously needed for this to work in a MT job.  Rather than holding
- * a pointer to a specific object from a class member, we instead maintain
- * a concurrent_queue of pointers to objects.  When we want an object, we get
- * one from the queue; if the queue is empty, then we allocate a new one.
+ * Some care is obviously needed for this to work in a MT job.
+ * Rather than holding a pointer to a specific object from a class member,
+ * we instead maintain a concurrent_queue of pointers to objects.
+ * When we want an object, we get one from the queue; if the queue is empty,
+ * then we allocate a new one.
  *
- * The object used should derive from @c DataObject.  We bump the reference count
- * by 1 when the object is allocated so that it won't get deleted by StoreGate.
- * We also override @c release() so that when the reference count goes back
- * to 1 it is `recycled'.  When this happens, we call the @c recycle() method
- * on the object (which should probably be protected) and put the object
- * back on the queue to be allocated again.
+ * The object used should derive from @c DataObject.  We bump the reference
+ * count by 1 when the object is allocated so that it won't get deleted
+ * by StoreGate.  We also override @c release() so that when the reference
+ * count goes back to 1 it is `recycled'.  When this happens,
+ * we call the @c recycle() method on the object (which should probably
+ * be protected) and put the object back on the queue to be allocated again.
  *
  * Example use:
  *@code
@@ -68,7 +71,17 @@ namespace Athena {
  *    MyDataObj* obj = m_queue.get (true);
  @endcode
  * 
- * @c DOBJ should derive from @c DataObject and should provide a member @c recycle().
+ * @c DOBJ should derive from @c DataObject and should provide
+ * a member @c recycle().
+ *
+ * Implementation note: one needs to be careful about the order in which
+ * objects are deleted during finalization.  In particular, it is possible
+ * for a Gaudi component that holds a @c RecyclableDataQueue as a member
+ * to be deleted while there are still associated data objects registered
+ * in the event store.  To be robust against this, we allocate the
+ * actual queue object separately from @c RecyclableDataQueue and
+ * manage it with @c shared_ptr; @c RecyclableDataObject then references
+ * the queue with a @c shared_ptr.
  */
 template <class DOBJ>
 class RecyclableDataObject : public DOBJ
@@ -84,7 +97,7 @@ public:
    * @param args... Additional arguments to pass to the @c DOBJ constructor.
    */
   template <typename... ARGS>
-  RecyclableDataObject (queue_t& queue, ARGS&&... args);
+  RecyclableDataObject (std::shared_ptr<queue_t> queue, ARGS&&... args);
 
 
   /**
@@ -99,7 +112,7 @@ public:
 
 private:
   /// The queue on which this object will be placed when it is recycled.
-  queue_t& m_queue;
+  std::shared_ptr<queue_t> m_queue;
 };
 
 
@@ -110,11 +123,16 @@ private:
  */
 template <class DOBJ>
 class RecyclableDataQueue
-  : public RecyclableDataObject<DOBJ>::queue_t
 {
 public:
   /// Underlying queue type holding these objects.
-  using RecyclableDataObject<DOBJ>::queue_t::queue_t;
+  typedef typename RecyclableDataObject<DOBJ>::queue_t queue_t;
+
+
+  /** 
+   * @brief Constructor.
+   */
+  RecyclableDataQueue();
 
 
   /**
@@ -131,6 +149,12 @@ public:
    * Free all objects in the queue.
    */
   ~RecyclableDataQueue();
+
+
+private:
+  /// Shared reference to the actual queue.
+  /// Each data object also has a reference to the queue.
+  std::shared_ptr<queue_t> m_queue;
 };
 
 
diff --git a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.icc b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.icc
index e59c827a560..8802209bc7e 100644
--- a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.icc
+++ b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.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$
 /*
@@ -22,7 +22,7 @@ namespace Athena {
  */
 template <class DOBJ>
 template <typename... ARGS>
-RecyclableDataObject<DOBJ>::RecyclableDataObject (queue_t& queue, ARGS&&... args)
+RecyclableDataObject<DOBJ>::RecyclableDataObject (std::shared_ptr<queue_t> queue, ARGS&&... args)
   : DOBJ (std::forward<ARGS>(args)...),
     m_queue (queue)
 {
@@ -44,12 +44,22 @@ unsigned long RecyclableDataObject<DOBJ>::release()
   unsigned long cnt = DOBJ::release();
   if (cnt == 1) {
     this->recycle();
-    m_queue.push (this);
+    m_queue->push (this);
   }
   return cnt;
 }
 
 
+/** 
+ * @brief Constructor.
+ */
+template <class DOBJ>
+RecyclableDataQueue<DOBJ>::RecyclableDataQueue()
+  : m_queue (std::make_shared<queue_t>())
+{
+}
+
+
 /**
  * @brief Get an object, either a new one or one recycled from a previous event.
  * @param args... Arguments to pass to the @c DOBJ constructor if we make a new one.
@@ -59,10 +69,10 @@ template <typename... ARGS>
 DOBJ* RecyclableDataQueue<DOBJ>::get (ARGS&&... args)
 {
   DOBJ* obj = nullptr;
-  if (this->try_pop (obj)) {
+  if (m_queue->try_pop (obj)) {
     return obj;
   }
-  return new RecyclableDataObject<DOBJ> (*this, std::forward<ARGS>(args)...);
+  return new RecyclableDataObject<DOBJ> (m_queue, std::forward<ARGS>(args)...);
 }
 
 
@@ -75,7 +85,7 @@ template <class DOBJ>
 RecyclableDataQueue<DOBJ>::~RecyclableDataQueue()
 {
   DOBJ* obj = nullptr;
-  while (this->try_pop (obj)) {
+  while (m_queue->try_pop (obj)) {
     delete obj;
   }
 }
-- 
GitLab


From a05cb2b647a390ca24600087429b8ac3793b24e2 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 03:53:23 +0100
Subject: [PATCH 284/404] AthenaKernel: Fix compilation warning.

Suppress warning from tbb header.
---
 .../AthenaKernel/AthenaKernel/RecyclableDataObject.h   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
index b3b7f63ffca..31e36244307 100644
--- a/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
+++ b/Control/AthenaKernel/AthenaKernel/RecyclableDataObject.h
@@ -16,14 +16,14 @@
 #define ATHENAKERNEL_RECYCLABLEDATAOBJECT_H
 
 
-// Work around a warning in tbb, found by gcc8.
-// Fixed in TBB 2018 U5.
-#if defined(__GNUC__) && __GNUC__ >= 8
+// tbb/machine/gcc_generic.h has spurious trailing semicolons after
+// the clz() functiosn (as of TBB 2019 U1).
+#if defined(__GNUC__)
 # pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wclass-memaccess"
+# pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include "tbb/concurrent_queue.h"
-#if defined(__GNUC__) && __GNUC__ >= 8
+#if defined(__GNUC__)
 # pragma GCC diagnostic pop
 #endif
 #include <memory>
-- 
GitLab


From cd2168b408ff9fb119479737d7be14bbae2eeaf4 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 03:50:18 +0100
Subject: [PATCH 285/404] TestTools: Fix compilation warning.

Suppress warning from tbb header.
---
 AtlasTest/TestTools/src/ParallelCallTest.cxx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/AtlasTest/TestTools/src/ParallelCallTest.cxx b/AtlasTest/TestTools/src/ParallelCallTest.cxx
index b1d27fd9c5b..0c4af6aba07 100644
--- a/AtlasTest/TestTools/src/ParallelCallTest.cxx
+++ b/AtlasTest/TestTools/src/ParallelCallTest.cxx
@@ -1,9 +1,18 @@
 /*
-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 <vector>
+// tbb/machine/gcc_generic.h has spurious trailing semicolons after
+// the clz() functiosn (as of TBB 2019 U1).
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wpedantic"
+#endif
 #include "tbb/parallel_reduce.h"
 #include "tbb/blocked_range.h"
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
 #include "TestTools/ParallelCallTest.h"
 #include <unistd.h>
 #include <fcntl.h>
-- 
GitLab


From 6f768ea85034f557eab2c01963d2512aaa215ee3 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:22:09 +0100
Subject: [PATCH 286/404] InDetGlobalMonitoring: Fix clang warnings.

clang warnings: Unused private data members; operator precendence.
(One unused private member left commented out that still had uses in comments.)
---
 .../src/InDetGlobalHitsMonTool.cxx                   |  4 +---
 .../src/InDetGlobalHitsMonTool.h                     |  5 +----
 .../InDetGlobalMonitoring/src/InDetGlobalManager.cxx |  5 ++---
 .../InDetGlobalMonitoring/src/InDetGlobalManager.h   |  4 +---
 .../src/InDetGlobalNoiseOccupancyMonTool.cxx         |  4 ++--
 .../src/InDetGlobalNoiseOccupancyMonTool.h           |  2 +-
 .../src/InDetGlobalPixelTool.cxx                     |  1 -
 .../InDetGlobalMonitoring/src/InDetGlobalPixelTool.h |  3 +--
 .../src/InDetGlobalTopBottomMonTool.cxx              |  6 +-----
 .../src/InDetGlobalTopBottomMonTool.h                |  6 +-----
 .../src/InDetGlobalTrackMonTool.cxx                  | 12 +++++-------
 .../src/InDetGlobalTrackMonTool.h                    |  5 +----
 12 files changed, 17 insertions(+), 40 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.cxx
index bbbda6faff9..2fbacb3f226 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.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
 */
 
 /** @file InDetGlobalHitsMonTool.cxx
@@ -56,8 +56,6 @@ InDetGlobalHitsMonTool::InDetGlobalHitsMonTool(const std::string & type,
 				               const std::string & name,
 				               const IInterface* parent)
     : InDetGlobalMotherMonTool(type, name, parent),
-      m_updator(nullptr),
-      m_nTracks(0),
       m_tracks(nullptr),
       m_ID_hitmap_x_y(nullptr),
       m_ID_hitmap_x_y_eca(nullptr),
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.h
index d57282e3095..5c8b617ca4e 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalHitsMonTool.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
 */
 
 /** @file InDetGlobalHitsMonTool.h
@@ -89,12 +89,9 @@ private:
     //---------- member variables ------------
    
     /// Updator
-    const Trk::IUpdator  *m_updator;  // updator for unbiased states
     PublicToolHandle<Trk::IUpdator>             m_iUpdator
        {this,"KalmanUpdator","Trk::KalmanUpdator",""};
 
-    int m_nTracks;
-
     ///The track collection
     const TrackCollection* m_tracks;
 
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.cxx
index 905bd62980b..02869a1007c 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.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
 */
 
 /** @file InDetGlobalManager.cxx
@@ -39,8 +39,7 @@
 InDetGlobalManager::InDetGlobalManager(
     const std::string &name, 
     ISvcLocator *pSvcLocator)
-    : AthenaMonManager(name, pSvcLocator),
-      m_CombinedTracks(0)
+    : AthenaMonManager(name, pSvcLocator)
 {
  
 }
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.h
index ea379507a9b..10cae4e89e8 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalManager.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
 */
 
 /** @file InDetGlobalManager.h
@@ -57,8 +57,6 @@ private:
     /// Name of combined inner detector tracks container
     SG::ReadHandleKey<TrackCollection> m_CombinedTracksName{this,"CombinedTrackName", "ExtendedTracks", "Combined Track Collection For Monitoring"};
  
-    const TrackCollection *m_CombinedTracks;
-
     /// Name of trt drift circle container
     SG::ReadHandleKey<InDet::TRT_DriftCircleContainer> m_TRT_DriftCircleName{this,"TRT_DriftCircleName", "TRT_DriftCircles", "TRT Drift Circle Collection For Monitoring"};
 
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx
index 59b7146d541..b611beb8ecb 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.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
 */
 
 /** @file InDetGlobalNoiseOccupancyMonTool.cxx
@@ -110,7 +110,7 @@ InDetGlobalNoiseOccupancyMonTool::InDetGlobalNoiseOccupancyMonTool(
    m_SCT_TRT_NO(0),
    m_SCT_PIX_NO(0),
    m_PIX_TRT_NO(0),
-   m_PIX_SCT_TRT_NO(0),
+   //m_PIX_SCT_TRT_NO(0),
    m_TRT_SCTvTRT_PIX_10evt(0),
    m_TRT_SCTvSCT_PIX_10evt(0),
    m_TRT_PIXvSCT_PIX_10evt(0),
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
index 93e015f017e..2a196404639 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalNoiseOccupancyMonTool.h
@@ -144,7 +144,7 @@ class InDetGlobalNoiseOccupancyMonTool : public InDetGlobalMotherMonTool{
   TH2F_LW * m_PIX_TRT_NO;
   
   ///PIX noise occupancy vs event number   
-  TH2F_LW * m_PIX_SCT_TRT_NO;
+  //TH2F_LW * m_PIX_SCT_TRT_NO;
   
   
   
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
index 314782895f0..007c8993414 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.cxx
@@ -58,7 +58,6 @@ InDetGlobalPixelTool::InDetGlobalPixelTool(
     m_Pixel_track_bar_lay0_cluster_occupancy(0),
     m_Pixel_track_bar_lay1_cluster_occupancy(0),
     m_Pixel_track_bar_lay2_cluster_occupancy(0),
-    m_Pixel_track_Lvl1ID(0),
     m_Pixel_track_Lvl1A(0),
     m_Pixel_track_chi2(0),
     m_Pixel_track_qOverP(0),
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.h
index 142ba85ca5b..e15dc8b0cd0 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPixelTool.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
 */
 
 /** @file InDetGlobalPixelTool.h
@@ -66,7 +66,6 @@ class InDetGlobalPixelTool : public InDetGlobalMotherMonTool
       TH2F*   m_Pixel_track_bar_lay0_cluster_occupancy;
       TH2F*   m_Pixel_track_bar_lay1_cluster_occupancy;
       TH2F*   m_Pixel_track_bar_lay2_cluster_occupancy;
-      TH1F*   m_Pixel_track_Lvl1ID;
       TH1F*   m_Pixel_track_Lvl1A;
       TH1F*   m_Pixel_track_chi2;  
       TH1F*   m_Pixel_track_qOverP;
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.cxx
index 7bda7a1a66b..51f73b0aa34 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.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
 */
 
 /** @file InDetGlobalTopBottomMonTool.cxx
@@ -45,25 +45,21 @@ InDetGlobalTopBottomMonTool::InDetGlobalTopBottomMonTool(
      m_top_d0(0), 
      m_top_z0(0),
      m_top_phi(0), 
-     m_top_dphi(0), 
      m_top_eta(0),
      m_top_chi2(0),
      m_bottom_d0(0), 
      m_bottom_z0(0),
      m_bottom_phi(0),
-     m_bottom_dphi(0),
      m_bottom_eta(0),
      m_bottom_chi2(0),
      m_top_d0_1trk(0), 
      m_top_z0_1trk(0),
      m_top_phi_1trk(0), 
-     m_top_dphi_1trk(0), 
      m_top_eta_1trk(0),
      m_top_chi2_1trk(0),
      m_bottom_d0_1trk(0), 
      m_bottom_z0_1trk(0),
      m_bottom_phi_1trk(0),
-     m_bottom_dphi_1trk(0),
      m_bottom_eta_1trk(0),
      m_bottom_chi2_1trk(0),
      m_top_bottom_dd0(0), 
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.h
index 8947378455b..a032ba3e233 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTopBottomMonTool.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
 */
 
 /** @file InDetGlobalTopBottomMonTool.h 
@@ -78,14 +78,12 @@ private:
     TH1F*  m_top_d0; 
     TH1F*  m_top_z0;
     TH1F*  m_top_phi; 
-    TH1F*  m_top_dphi; 
     TH1F*  m_top_eta;
     TH1F*  m_top_chi2;
   
     TH1F*  m_bottom_d0; 
     TH1F*  m_bottom_z0;
     TH1F*  m_bottom_phi;
-    TH1F*  m_bottom_dphi;
     TH1F*  m_bottom_eta;
     TH1F*  m_bottom_chi2;
 
@@ -93,14 +91,12 @@ private:
     TH1F*  m_top_d0_1trk; 
     TH1F*  m_top_z0_1trk;
     TH1F*  m_top_phi_1trk; 
-    TH1F*  m_top_dphi_1trk; 
     TH1F*  m_top_eta_1trk;
     TH1F*  m_top_chi2_1trk;
   
     TH1F*  m_bottom_d0_1trk; 
     TH1F*  m_bottom_z0_1trk;
     TH1F*  m_bottom_phi_1trk;
-    TH1F*  m_bottom_dphi_1trk;
     TH1F*  m_bottom_eta_1trk;
     TH1F*  m_bottom_chi2_1trk;
  
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx
index 82f89687b79..fdc18f4f459 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.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
 */
 
 /** @file InDetGlobalTrackMonTool.cxx
@@ -62,7 +62,6 @@ InDetGlobalTrackMonTool::InDetGlobalTrackMonTool( const std::string & type,
     : ManagedMonitorToolBase(type, name, parent),
       m_baseline_selTool( "InDet::InDetTrackSelectionTool/TrackSelectionTool", this ),
       m_tight_selTool( "InDet::InDetTrackSelectionTool/TrackSelectionTool", this ),
-      m_doLumiblock(true),
       m_doHolePlots(false),
       m_DoHoles_Search(false),
       m_doHitMaps(false),
@@ -112,7 +111,6 @@ InDetGlobalTrackMonTool::InDetGlobalTrackMonTool( const std::string & type,
       m_holes_eta_pt(nullptr),
       m_holes_phi_pt(nullptr), 
       m_holes_eta_phi_n(nullptr),
-      m_holesComb2(nullptr),
       m_holes_hits(nullptr),
       m_holesvshits(nullptr),
       m_holesvshits_ECA(nullptr),
@@ -778,10 +776,10 @@ StatusCode InDetGlobalTrackMonTool::procHistograms()
 
 void InDetGlobalTrackMonTool::FillHits( const Trk::Track *track, const std::unique_ptr<const Trk::TrackSummary> & summary )
 {
-    int pixHits = ( summary->get(Trk::numberOfPixelHits) >= 0 ) ? summary->get(Trk::numberOfPixelHits) : 0 
-	+ ( summary->get(Trk::numberOfPixelDeadSensors) >= 0 ) ? summary->get(Trk::numberOfPixelDeadSensors ) : 0;
-    int sctHits = ( ( summary->get(Trk::numberOfSCTHits) >= 0 ) ? summary->get(Trk::numberOfSCTHits) : 0 )
-	+ ( ( summary->get(Trk::numberOfSCTDeadSensors) >= 0 ) ? summary->get(Trk::numberOfSCTDeadSensors) : 0 );
+  int pixHits = ( summary->get(Trk::numberOfPixelHits) >= 0 ? summary->get(Trk::numberOfPixelHits) : 0 )
+    + ( summary->get(Trk::numberOfPixelDeadSensors) >= 0 ? summary->get(Trk::numberOfPixelDeadSensors ) : 0 );
+  int sctHits = (summary->get(Trk::numberOfSCTHits) >= 0 ? summary->get(Trk::numberOfSCTHits) : 0)
+    + (summary->get(Trk::numberOfSCTDeadSensors) >= 0 ? summary->get(Trk::numberOfSCTDeadSensors) : 0 );
     int trtHits = summary->get(Trk::numberOfTRTHits) + summary->get(Trk::numberOfTRTDeadStraws);
     
     const Trk::Perigee *perigee = track->perigeeParameters();
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.h
index 9cfe9573419..998c7bdddda 100755
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.h
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.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
 */
 
 
@@ -111,8 +111,6 @@ private:
     ToolHandle< InDet::IInDetTrackSelectionTool > m_baseline_selTool;
     ToolHandle< InDet::IInDetTrackSelectionTool > m_tight_selTool;
 
-    ///Switch if LB accounting should be done
-    bool m_doLumiblock;
     /// Switch for hole searching
     bool m_doHolePlots;
     bool m_DoHoles_Search;
@@ -212,7 +210,6 @@ private:
     TProfile2D  *m_holes_eta_pt;
     TProfile2D  *m_holes_phi_pt;
     TProfile2D  *m_holes_eta_phi_n;
-    TH1F     *m_holesComb2;
     TProfile *m_holes_hits;
     TH2F     *m_holesvshits;
     TH2F     *m_holesvshits_ECA;
-- 
GitLab


From b6d4a5e77057575064129493af2406e61beaf01c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:21:12 +0100
Subject: [PATCH 287/404] LArSimEventTPCnv: Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../LArSimEventTPCnv/LArHitContainerCnv_p2.h  | 14 +++++----
 .../LArHitFloatContainerCnv_p2.h              | 17 +++++++----
 .../src/LArHitContainerCnv_p2.cxx             | 29 ++++++++++++-------
 .../src/LArHitFloatContainerCnv_p2.cxx        | 29 ++++++++++++-------
 .../test/LArHitContainerCnv_p2_test.cxx       |  8 ++---
 .../test/LArHitFloatContainerCnv_p2_test.cxx  |  8 ++---
 6 files changed, 60 insertions(+), 45 deletions(-)

diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitContainerCnv_p2.h b/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitContainerCnv_p2.h
index 114c8c53763..5804926db6d 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitContainerCnv_p2.h
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitContainerCnv_p2.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 LARTPCNV_LARHITCONTAINERCNV_P2_H
@@ -9,15 +9,19 @@
 #include "LArSimEvent/LArHitContainer.h"
 #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
 
+class CaloCell_ID;
+
 
 class LArHitContainerCnv_p2 : public T_AthenaPoolTPCnvBase<LArHitContainer, LArHitContainer_p2>
 {
  public:
-  LArHitContainerCnv_p2() {};
+  LArHitContainerCnv_p2();
   
-  virtual void  persToTrans(const LArHitContainer_p2* persColl, LArHitContainer* transColl,  MsgStream &log) ;
-  virtual void  transToPers(const LArHitContainer* transColl, LArHitContainer_p2* persColl,  MsgStream &log) ;
- private:
+  virtual void  persToTrans(const LArHitContainer_p2* persColl, LArHitContainer* transColl,  MsgStream &log) override;
+  virtual void  transToPers(const LArHitContainer* transColl, LArHitContainer_p2* persColl,  MsgStream &log) override;
+
+private:
+  const CaloCell_ID* m_cellIdHelper;
 };
 
 #endif // not LARTPCNV_LARHITCONTAINERCNV_P2_H
diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitFloatContainerCnv_p2.h b/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitFloatContainerCnv_p2.h
index 1a4c90b4b5c..c2b081ae5e4 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitFloatContainerCnv_p2.h
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/LArSimEventTPCnv/LArHitFloatContainerCnv_p2.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 LARTPCNV_LARHITFLOATCONTAINERCNV_p2_H
@@ -10,14 +10,19 @@
 #include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h"
 
 
+class CaloCell_ID;
+
+
 class LArHitFloatContainerCnv_p2 : public T_AthenaPoolTPCnvBase<LArHitFloatContainer, LArHitContainer_p2>
 {
- public:
-  LArHitFloatContainerCnv_p2() {};
+public:
+  LArHitFloatContainerCnv_p2();
   
-  virtual void  persToTrans(const LArHitContainer_p2* persColl, LArHitFloatContainer* transColl,  MsgStream &log) ;
-  virtual void  transToPers(const LArHitFloatContainer* transColl, LArHitContainer_p2* persColl,  MsgStream &log) ;
- private:
+  virtual void  persToTrans(const LArHitContainer_p2* persColl, LArHitFloatContainer* transColl,  MsgStream &log) override;
+  virtual void  transToPers(const LArHitFloatContainer* transColl, LArHitContainer_p2* persColl,  MsgStream &log) override;
+
+private:
+  const CaloCell_ID* m_cellIdHelper;
 };
 
 
diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitContainerCnv_p2.cxx b/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitContainerCnv_p2.cxx
index a891c916b69..e782d98f8c0 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitContainerCnv_p2.cxx
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitContainerCnv_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
 */
 
 #include "LArSimEvent/LArHit.h"
@@ -8,7 +8,6 @@
 
 #include "Identifier/IdentifierHash.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 #include "AthenaPoolCnvSvc/Compressor.h"
 
@@ -16,7 +15,21 @@
 // author Ilija Vukotic
 
 #include "LArSimEventTPCnv/LArHitContainerCnv_p2.h"
-#include "map"
+#include "StoreGate/StoreGateSvc.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include <map>
+#include <stdexcept>
+
+
+LArHitContainerCnv_p2::LArHitContainerCnv_p2()
+  : m_cellIdHelper(nullptr)
+{
+  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "LArHitContainerCnv_p2");
+  if (detStore->retrieve (m_cellIdHelper, "CaloCell_ID").isFailure()) {
+    throw std::runtime_error ("LArHitContainerCnv_p2: Can't get CaloCell_ID");
+  }
+}
+
 
 void LArHitContainerCnv_p2::transToPers(const LArHitContainer* transCont, LArHitContainer_p2* persCont, MsgStream &log) 
 {   //static int ev=0;
@@ -28,15 +41,12 @@ void LArHitContainerCnv_p2::transToPers(const LArHitContainer* transCont, LArHit
 	std::vector<float> tempE;	tempE.reserve(size);
 	std::vector<float> tempT;	tempT.reserve(size);
 	
-	const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();// getDM_ID 
-	
-
 	LArHitContainer::const_iterator it  = transCont->begin();
 	
 	std::multimap <unsigned int, unsigned int> map_hashPositions;// first hash ; second its position in container
 
 	for (unsigned int w=0;w<size;++w){
-                IdentifierHash hashId = cellIdHelper->calo_cell_hash((*it)->cellID());
+                IdentifierHash hashId = m_cellIdHelper->calo_cell_hash((*it)->cellID());
 		map_hashPositions.insert(std::pair<unsigned int, int>((unsigned int)hashId, w));
 //		if (!ev) std::cout<<hashId<<"\t"<<((*it)->cellID())<<std::endl;
 		++it;
@@ -79,9 +89,6 @@ void LArHitContainerCnv_p2::persToTrans(const LArHitContainer_p2* persCont, LArH
 	transCont->setName(persCont->name() );
 	
 	
-	const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();// getDM_ID 
-	
-	
 	Compressor A;
 	std::vector<float> tempE;	tempE.reserve(cells);
 	std::vector<float> tempT;	tempT.reserve(cells);
@@ -92,7 +99,7 @@ void LArHitContainerCnv_p2::persToTrans(const LArHitContainer_p2* persCont, LArH
 	for (unsigned int i=0;i<cells;++i){
 		sum+= persCont->m_channelHash[i];
 		LArHit* trans=new LArHit
-                  (cellIdHelper->cell_id(sum),
+                  (m_cellIdHelper->cell_id(sum),
                    tempE[i],
                    tempE[i] != 0 ? (double)(tempT[i])/tempE[i] : 0);
 //		if(!dog) std::cout<<"Reading hash: "<< sum <<"\t E: "<< (double)tempE[i]<<"\t T: "<<(tempT[i]) <<std::endl;
diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitFloatContainerCnv_p2.cxx b/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitFloatContainerCnv_p2.cxx
index 0ac8161e261..57bc15e19d2 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitFloatContainerCnv_p2.cxx
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/src/LArHitFloatContainerCnv_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
 */
 
 #include "LArSimEvent/LArHitFloat.h"
@@ -8,7 +8,6 @@
 
 #include "Identifier/IdentifierHash.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 #include "AthenaPoolCnvSvc/Compressor.h"
 
@@ -16,7 +15,21 @@
 // author Ilija Vukotic
 
 #include "LArSimEventTPCnv/LArHitFloatContainerCnv_p2.h"
-#include "map"
+#include "StoreGate/StoreGateSvc.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include <map>
+#include <stdexcept>
+
+
+LArHitFloatContainerCnv_p2::LArHitFloatContainerCnv_p2()
+  : m_cellIdHelper(nullptr)
+{
+  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "LArHitFloatContainerCnv_p2");
+  if (detStore->retrieve (m_cellIdHelper, "CaloCell_ID").isFailure()) {
+    throw std::runtime_error ("LArHitFloatContainerCnv_p2: Can't get CaloCell_ID");
+  }
+}
+
 
 void LArHitFloatContainerCnv_p2::transToPers(const LArHitFloatContainer* transCont, LArHitContainer_p2* persCont, MsgStream &log) 
 {   //static int ev=0;
@@ -28,15 +41,12 @@ void LArHitFloatContainerCnv_p2::transToPers(const LArHitFloatContainer* transCo
 	std::vector<float> tempE;	tempE.reserve(size);
 	std::vector<float> tempT;	tempT.reserve(size);
 	
-	const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();// getDM_ID 
-	
-
 	LArHitFloatContainer::const_iterator it  = transCont->begin();
 	
 	std::multimap <unsigned int, unsigned int> map_hashPositions;// first hash ; second its position in container
 
 	for (unsigned int w=0;w<size;++w){
-                IdentifierHash hashId = cellIdHelper->calo_cell_hash((*it).cellID());
+                IdentifierHash hashId = m_cellIdHelper->calo_cell_hash((*it).cellID());
 		map_hashPositions.insert(std::pair<unsigned int, int>((unsigned int)hashId, w));
 //		if (!ev) std::cout<<hashId<<"\t"<<((*it)->cellID())<<std::endl;
 		++it;
@@ -77,9 +87,6 @@ void LArHitFloatContainerCnv_p2::persToTrans(const LArHitContainer_p2* persCont,
 	transCont->clear();
 	transCont->reserve(cells);
 	
-	const CaloCell_ID* cellIdHelper = (CaloIdManager::instance())->getCaloCell_ID();// getDM_ID 
-	
-	
 	Compressor A;
 	std::vector<float> tempE;	tempE.reserve(cells);
 	std::vector<float> tempT;	tempT.reserve(cells);
@@ -89,7 +96,7 @@ void LArHitFloatContainerCnv_p2::persToTrans(const LArHitContainer_p2* persCont,
 	unsigned int sum=0;
 	for (unsigned int i=0;i<cells;++i){
 		sum+= persCont->m_channelHash[i];
-                LArHitFloat hit(cellIdHelper->cell_id(sum),tempE[i],tempT[i]);
+                LArHitFloat hit(m_cellIdHelper->cell_id(sum),tempE[i],tempT[i]);
 //		if(!dog) std::cout<<"Reading hash: "<< sum <<"\t E: "<< (double)tempE[i]<<"\t T: "<<(tempT[i]) <<std::endl;
 		transCont->push_back(hit);
 		}
diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitContainerCnv_p2_test.cxx b/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitContainerCnv_p2_test.cxx
index 4da55211f3c..eb2eb850745 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitContainerCnv_p2_test.cxx
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitContainerCnv_p2_test.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
 */
 
 // $Id$
@@ -15,7 +15,6 @@
 #include "LArSimEventTPCnv/LArHitContainerCnv_p2.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "IdDictParser/IdDictParser.h"
 #include "TestTools/initGaudi.h"
 #include "TestTools/FLOATassert.h"
@@ -107,12 +106,9 @@ const CaloCell_ID& make_dd (ISvcLocator* svcLoc)
                                           tile_id);
   assert (calo_id->initialize_from_dictionary (idd) == 0);
 
-  CaloIdManager* mgr = new CaloIdManager;
-  mgr->set_helper (calo_id);
-
   StoreGateSvc* detStore = nullptr;
   assert (svcLoc->service( "DetectorStore", detStore ).isSuccess());
-  assert (detStore->record (mgr, "CaloIdManager").isSuccess());
+  assert (detStore->record (calo_id, "CaloCell_ID").isSuccess());
   return *calo_id;
 }
 
diff --git a/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitFloatContainerCnv_p2_test.cxx b/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitFloatContainerCnv_p2_test.cxx
index 7d666ff5453..fc4e3288b35 100644
--- a/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitFloatContainerCnv_p2_test.cxx
+++ b/LArCalorimeter/LArCnv/LArSimEventTPCnv/test/LArHitFloatContainerCnv_p2_test.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
 */
 
 // $Id$
@@ -15,7 +15,6 @@
 #include "LArSimEventTPCnv/LArHitFloatContainerCnv_p2.h"
 #include "StoreGate/StoreGateSvc.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "IdDictParser/IdDictParser.h"
 #include "TestTools/initGaudi.h"
 #include "TestTools/FLOATassert.h"
@@ -106,12 +105,9 @@ const CaloCell_ID& make_dd (ISvcLocator* svcLoc)
                                           tile_id);
   assert (calo_id->initialize_from_dictionary (idd) == 0);
 
-  CaloIdManager* mgr = new CaloIdManager;
-  mgr->set_helper (calo_id);
-
   StoreGateSvc* detStore = nullptr;
   assert (svcLoc->service( "DetectorStore", detStore ).isSuccess());
-  assert (detStore->record (mgr, "CaloIdManager").isSuccess());
+  assert (detStore->record (calo_id, "CaloCell_ID").isSuccess());
   return *calo_id;
 }
 
-- 
GitLab


From 6bf5236561ae0e98f3b0adef61b2f9556cb7cbef Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:21:30 +0100
Subject: [PATCH 288/404] LArDetDescr: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
Get rid of some unused classes.
---
 .../LArDetDescr/LArDetDescr/FCAL_ChannelMap.h |   17 -
 .../LArDetDescr/LArDetDescr/LArCellVolumeDB.h |   34 -
 .../LArDetDescr/LArDetDescr/LArCellVolumes.h  |   44 -
 .../LArDetDescr/LArDetDescr/LArNumberHelper.h |  256 ----
 .../LArDetDescr/src/LArCellVolumes.cxx        |  124 --
 .../LArDetDescr/src/LArNumberHelper.cxx       | 1355 -----------------
 .../LArDetDescr/src/LArRecoMaterialTool.cxx   |    9 +-
 .../LArDetDescr/src/LArRecoSimpleGeomTool.cxx |    8 +-
 8 files changed, 5 insertions(+), 1842 deletions(-)
 delete mode 100755 LArCalorimeter/LArDetDescr/LArDetDescr/FCAL_ChannelMap.h
 delete mode 100755 LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h
 delete mode 100755 LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumes.h
 delete mode 100755 LArCalorimeter/LArDetDescr/LArDetDescr/LArNumberHelper.h
 delete mode 100755 LArCalorimeter/LArDetDescr/src/LArCellVolumes.cxx
 delete mode 100755 LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx

diff --git a/LArCalorimeter/LArDetDescr/LArDetDescr/FCAL_ChannelMap.h b/LArCalorimeter/LArDetDescr/LArDetDescr/FCAL_ChannelMap.h
deleted file mode 100755
index 1bb5bc4b2d7..00000000000
--- a/LArCalorimeter/LArDetDescr/LArDetDescr/FCAL_ChannelMap.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LARDETDESCR_FCAL_CHANNELMAP_OBS_H
-#define LARDETDESCR_FCAL_CHANNELMAP_OBS_H
-#warning from FCAL_ChannelMap: you are using an obsolete header file. please migrate you code to the new one asap
- 
-#include "LArReadoutGeometry/FCAL_ChannelMap.h"
- 
-#endif // LARDETDESCR_FCAL_CHANNELMAP_H
-
-
-
-
-
-
diff --git a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h b/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h
deleted file mode 100755
index f4c13272a35..00000000000
--- a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumeDB.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LARDETDESCR_LARCELLVOLUMEDB_H 
-#define LARDETDESCR_LARCELLVOLUMEDB_H 
-
-#include <vector>
-#include "Identifier/Identifier.h"
-
-/** c-struct containing the LArCell volume information : 
-
-    thanks to the phi symmetry, in em and hec there is 1
-    volume per eta bin ( see class LArCellVolumes.h , where this
-    class is used )
-
- * @author Hong Ma
- * @version  0-0-1 , Feb 25, 2004 
-
-*/
-
-
-// persistent c-struct
-struct LArCellVolumeDB_t{
-  Identifier    db_channelID; // offline comp_id 
-  float         db_volume   ; // in mm*3 
-};
-
-typedef std::vector<LArCellVolumeDB_t> LArCellVolumeDB;
-
-#include "AthenaKernel/CLASS_DEF.h"
-CLASS_DEF(LArCellVolumeDB, 34482670 ,1)
-
-#endif
diff --git a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumes.h b/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumes.h
deleted file mode 100755
index 7471ddb0754..00000000000
--- a/LArCalorimeter/LArDetDescr/LArDetDescr/LArCellVolumes.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LARCELL_VOLUMES_H
-#define LARCELL_VOLUMES_H
-
-#include "RDBAccessSvc/IRDBAccessSvc.h"
-
-class Identifier;
-class CaloCell_ID;
-
-/** This class builds a vector of LArCellVolumeDB objects, read from 
-    the Oracle database ( see constructor), and uses it to provide 
-    the volume of each LAr cell ( public method CellVolume )
-
-    Author : V. Tsulaia  &  C. Adam
-    may 2005
-
-*/
-
-#include "LArDetDescr/LArCellVolumeDB.h" 
-
-class LArCellVolumes
-{
-public:
-
-  // Constructors:
-  LArCellVolumes(IRDBRecordset_ptr cellVolRec);
-
-  virtual ~LArCellVolumes();
-
-  double CellVolume (Identifier cell_id);
-
-  virtual void print();
-
-private:
-  const CaloCell_ID* m_calocell_id ;
-
-  LArCellVolumeDB m_cellVolume;  
-};
-
- 
-#endif
diff --git a/LArCalorimeter/LArDetDescr/LArDetDescr/LArNumberHelper.h b/LArCalorimeter/LArDetDescr/LArDetDescr/LArNumberHelper.h
deleted file mode 100755
index 7a5abf79e6c..00000000000
--- a/LArCalorimeter/LArDetDescr/LArDetDescr/LArNumberHelper.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LArNumberHelper_H
-#define LArNumberHelper_H
-
-#include "Identifier/Identifier.h"
-#include "RDBAccessSvc/IRDBAccessSvc.h"
-class StoreGateSvc;
-class LArEM_ID;
-class LArHEC_ID;
-class LArFCAL_ID;
-
-class IRDBRecord;
-class LArCellVolumes;
-class IGeoModelSvc;
-
-/**
-
-    This class reads all numbers traditionnaly needed and used 
-    to build the read-out geometry part of the LArDetDescrManager :
-
-     - grannularity and region size in eta/phi are taken from the
-       Identifier dictionnary. These are in "ideal" geometry.
-
-     - the cell depth (in R or Z) comes from the official geometry DB
-
-    The LArMgrInitializer uses these numbers and takes care of the translation 
-    between cylindric/cartesian coordinates if needed.
-
-    Now that the position of each region is taken from the GeoModel, the HepTransforms
-    are provided by another specific class : LArSubdetPosHelper
-
-    The name Helper was choosen to differentiate such simple classes, which are 
-    exclusively used within the LArDetDescr package, from Tools possibly used by
-    reconstrcution clients.
-
-*/
-
-class LArNumberHelper
-{
-public :
-  
-  LArNumberHelper(const std::string geometry);
-  ~LArNumberHelper();
- 
-  // fill in first, will take care of the user interface after...
-  
-  // Warning: 
-  //          phi_min is the LAr conventional origin and stays at 0
-  //          phi_max is the region size in phi and stays equal to 2 pi .
-  //          It is for individual channels that the -pi,pi convention
-  //          is applied.
-
-  int nb_of_em_regions();
-  int nb_of_hec_regions();
-  int nb_of_fcal_regions();
-  
-  void print_em();
-  void print_hec();
-  void print_fcal();
-
-  // em :
-  Identifier region_id_em(int i);
-  int     n_eta_em(int i);
-  int     n_phi_em(int i);
-  double  deta_em(int i);
-  double  dphi_em(int i);
-  int     sign_em(int i);
-  double  eta_min_em(int i);
-  double  eta_max_em(int i);
-  double  phi_min_em(int i);
-  double  phi_max_em(int i);
-  int     n_depth_em(int i);
-  double  depth_em_in(int i, int j);
-  double  depth_em_out(int i, int j);
-
-  // hec :
-  Identifier region_id_hec(int i);
-  int       n_eta_hec(int i);
-  int       n_phi_hec(int i);
-  double    deta_hec(int i);
-  double    dphi_hec(int i);
-  int       sign_hec(int i);
-  double    eta_min_hec(int i);
-  double    eta_max_hec(int i);
-  double    phi_min_hec(int i);
-  double    phi_max_hec(int i);
-  int       n_depth_hec(int i);
-  double    depth_hec_in(int i, int j);
-  double    depth_hec_out(int i, int j);
-
-  // fcal : geometry in in x/y, but FCAL_ID works in eta/phi !
-  Identifier  region_id_fcal(int i);
-  int      n_eta_fcal(int i);
-  int      n_phi_fcal(int i);
-  double   deta_fcal(int i);
-  double   dphi_fcal(int i);
-  int      sign_fcal(int i);
-
-  double   x_min_fcal(int i);
-  double   x_max_fcal(int i);
-  double   dx_fcal(int i);
-  double   y_min_fcal(int i);
-  double   y_max_fcal(int i);
-  double   dy_fcal(int i);
-  double   z_min_fcal(int i);
-  double   z_max_fcal(int i);
-
-  double    eta_min_fcal(int i);
-  double    eta_max_fcal(int i);
-  double    phi_min_fcal(int i);
-  double    phi_max_fcal(int i);
-
-  int     n_depth_fcal(int i);
-  double  depth_fcal_in(int i, int j);
-  double  depth_fcal_out(int i, int j);
-
-  LArCellVolumes* VolumeHelper();
-
-  // Parameters needed for sagging
-  void sagging_param( std::vector<double>& Rhocen, std::vector<double>& Sag );
-  
- private:
-
-  const LArEM_ID* m_em_id;
-  const LArHEC_ID* m_hec_id;
-  const LArFCAL_ID* m_fcal_id;
-  std::string m_geometry;
-
-  StoreGateSvc* m_pDetStore;   
-
-  IRDBAccessSvc* m_iAccessSvc;
-  IRDBRecordset_ptr m_lar;
-  const IRDBRecord* m_rec;
-  const IGeoModelSvc* m_geoModelSvc;
-
-  std::string m_tag;
-  std::string m_node;
-
-  LArCellVolumes* m_cellVolumes;
-
-  void prepare_arrays();
-
-  void hard_em();
-  void db_nb_em();
-
-  void hard_hec();
-  void db_nb_hec();
-
-  void hard_fcal();
-  void db_nb_fcal();
-
-  void cart_to_cyl (  double x,    double y,    double z,
-		      double& eta, double& phi, double& r );
-
-  double eta ( double r, double z );
-
-  // std::vector <double> z_array;  // max dim will be 44
-
-  // em : info coming from Identifiers
-  std::vector <Identifier>    m_region_id_em;
-  std::vector <int>           m_n_eta_em;
-  std::vector <int>           m_n_phi_em;
-  std::vector <double>        m_deta_em;
-  std::vector <double>        m_dphi_em;
-  std::vector <int>           m_sign_em;
-
-  // em : info coming from the geometry DB
-  std::vector <double>        m_eta_min_em;
-  std::vector <double>        m_eta_max_em;
-  std::vector <double>        m_phi_min_em;
-  std::vector <double>        m_phi_max_em;
-  std::vector <int>           m_n_depth_em;
-  std::vector < std::vector <double> > m_depth_em_in;
-  std::vector < std::vector <double> > m_depth_em_out;
-
-  // hec : info coming from Identifiers
-  std::vector <Identifier>    m_region_id_hec;
-  std::vector <int>           m_n_eta_hec;
-  std::vector <int>           m_n_phi_hec;
-  std::vector <double>        m_deta_hec;
-  std::vector <double>        m_dphi_hec;
-  std::vector <int>           m_sign_hec;
-
-  // hec : info coming from the geometry DB
-  std::vector <double>        m_eta_min_hec;
-  std::vector <double>        m_eta_max_hec;
-  std::vector <double>        m_phi_min_hec;
-  std::vector <double>        m_phi_max_hec;
-  std::vector <int>           m_n_depth_hec;
-  std::vector < std::vector <double> > m_depth_hec_in;
-  std::vector < std::vector <double> > m_depth_hec_out;
- 
-  // fcal : info coming from Identifiers
-  std::vector <Identifier>    m_region_id_fcal;
-  std::vector <int>           m_n_eta_fcal;
-  std::vector <int>           m_n_phi_fcal;
-  std::vector <double>        m_deta_fcal;
-  std::vector <double>        m_dphi_fcal;
-  std::vector <int>           m_sign_fcal;
-
-  // fcal : info coming from FCAL ChannelMap
-  std::vector <double>        m_x_min_fcal;
-  std::vector <double>        m_x_max_fcal;
-  std::vector <double>        m_dx_fcal;
-  std::vector <double>        m_y_min_fcal;
-  std::vector <double>        m_y_max_fcal;
-  std::vector <double>        m_dy_fcal;
-  std::vector <double>        m_z_min_fcal;
-  std::vector <double>        m_z_max_fcal;
-  std::vector <double>        m_eta_min_fcal;
-  std::vector <double>        m_eta_max_fcal;
-  std::vector <double>        m_phi_min_fcal;
-  std::vector <double>        m_phi_max_fcal;
-  std::vector <int>           m_n_depth_fcal;
-  std::vector < std::vector <double> > m_depth_fcal_in;
-  std::vector < std::vector <double> > m_depth_fcal_out;
-
-  // these arrays are read in the geometry DB and used internally
-
-  // EMB
-  double m_emb_psin;
-  double m_accg_rin_ac;
-  double m_accg_rout_ac;
-  std::vector <double> m_acco_rmx12;
-  std::vector <double> m_acco_ee12;
-  std::vector <double> m_acco_rmx23;
-
-  // EMEC
-  double m_endg_zorig;
-  std::vector <double> m_esep_iw23;
-  double m_emb_iwout;
-  double m_emec_psin;
-  double m_esep_zsep12;
-  std::vector <double> m_esep_zsep23;
-  double m_emec_out;
-
-  // HEC
-  double m_hec_in0;
-  double m_hec_in1;
-  double m_hec_in2;
-  double m_hec_in3;
-  double m_hec_out;
-  double m_hec_gap;
-
-  // FCAL: none, its all in the FCALChannelMaps
-
-  // Avoid coverity warnings.
-  LArNumberHelper (const LArNumberHelper&);
-  LArNumberHelper& operator= (const LArNumberHelper&);
-
-};
-
-#endif
diff --git a/LArCalorimeter/LArDetDescr/src/LArCellVolumes.cxx b/LArCalorimeter/LArDetDescr/src/LArCellVolumes.cxx
deleted file mode 100755
index 7637ab32f38..00000000000
--- a/LArCalorimeter/LArDetDescr/src/LArCellVolumes.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LArDetDescr/LArCellVolumes.h"
-
-#include "CaloIdentifier/CaloIdManager.h"
-#include "CaloIdentifier/CaloCell_ID.h"
-
-#include "RDBAccessSvc/IRDBRecordset.h"
-#include "RDBAccessSvc/IRDBRecord.h"
-
-#include <iostream>
-#include <iomanip>
-#include <algorithm>
-
-
-namespace {
-
-struct LArCellVolumeDB_Compare
-{
-  bool operator() (const LArCellVolumeDB_t& a, const LArCellVolumeDB_t& b)
-  { return a.db_channelID < b.db_channelID; }
-  bool operator() (const LArCellVolumeDB_t& a, Identifier b)
-  { return a.db_channelID < b; }
-};
-
-} // anonymous namespace
-
-
-
-LArCellVolumes::LArCellVolumes(IRDBRecordset_ptr cellVolRec)
-{
-  // Get Id Helper
-  m_calocell_id = CaloIdManager::instance()->getCaloCell_ID();
-
-  // Initialize m_cellVolume vector
-  for(unsigned int ind = 0; ind < cellVolRec->size(); ind++)
-  {
-    const IRDBRecord* currentRec = (*cellVolRec)[ind];
-
-    int subcalo = currentRec->getInt("SUBCALO");
-    int posneg = currentRec->getInt("POSNEG");
-    int sampling = currentRec->getInt("SAMPLING");
-    int region = currentRec->getInt("REGION");
-    int eta = currentRec->getInt("ETA");
-    int phi = currentRec->getInt("PHI");
-
-    Identifier channelID = m_calocell_id->cell_id
-      (subcalo, posneg, sampling, region, eta, phi);
-
-    LArCellVolumeDB_t cellVol;
-    cellVol.db_channelID = channelID;
-    cellVol.db_volume = currentRec->getDouble("VOLUME");
-    m_cellVolume.push_back(cellVol);
-  }
-
-  std::sort (m_cellVolume.begin(), m_cellVolume.end(),
-             LArCellVolumeDB_Compare());
-}
-
-LArCellVolumes::~LArCellVolumes()
-{
-  m_cellVolume.clear();
-}
-
-double 
-LArCellVolumes::CellVolume ( Identifier cell_id )
-{
-  if (m_cellVolume.size()==0)
-    std::cerr << "LArCellVolumes::CellVolume(). Problem in LArCellVolumes: no cell volumes...\n"; 
-  else
-  {
-  //log << MSG::INFO << "Looking for volume for cell :" << endmsg;
-  //m_calocell_id->print(cell_id);
-
-  // compute Identifier of Cell with same eta, but phi=0 and pos side
-  // (except for fcal)
-    Identifier volId;
-
-    if (!m_calocell_id->is_fcal(cell_id)) {
-      int subCalo = m_calocell_id->sub_calo(cell_id);
-      int posneg = std::abs (m_calocell_id->pos_neg(cell_id));
-      int sampling = m_calocell_id->sampling(cell_id);
-      int region = m_calocell_id->region(cell_id);
-      int eta = m_calocell_id->eta(cell_id);
-    
-      volId = m_calocell_id->cell_id
-	(subCalo, posneg, sampling, region, eta, 0);
-    }
-    else
-      volId = cell_id;
-
-  //m_calocell_id->print( (Identifier) volId );
-
-    LArCellVolumeDB::const_iterator it = 
-      std::lower_bound (m_cellVolume.begin(), m_cellVolume.end(), volId,
-                        LArCellVolumeDB_Compare());
-    if (it != m_cellVolume.end() && it->db_channelID == volId)
-      return it->db_volume;
-  }
-
-  return 0.;
-}
-
-void
-LArCellVolumes::print ()
-{
-  if (m_cellVolume.size()==0)
-    std::cerr << "LArCellVolumes::print(). No cell volumes...\n";
-  else 
-    {
-      std::cout << "LArCellVolumes::print(). Number of volumes found: " 
-		<< m_cellVolume.size();
-      
-      for ( unsigned int i = 0; i< m_cellVolume.size(); i++)
-	{
-	  const LArCellVolumeDB_t  vol = m_cellVolume[i];
-	  m_calocell_id->print( (Identifier) vol.db_channelID );
-	  std::cout << "   ==> vol= " 
-		    << vol.db_volume << "  mm3\n";
-	}
-    }
-}
diff --git a/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx b/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx
deleted file mode 100755
index c983e296b92..00000000000
--- a/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx
+++ /dev/null
@@ -1,1355 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LArDetDescr/LArNumberHelper.h"
-
-#include "GaudiKernel/Bootstrap.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/IMessageSvc.h"
-
-#include "StoreGate/StoreGate.h"
-#include "StoreGate/DataHandle.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "RDBAccessSvc/IRDBAccessSvc.h"
-#include "RDBAccessSvc/IRDBRecordset.h"
-#include "RDBAccessSvc/IRDBRecord.h"
-
-#include "CLHEP/Geometry/Point3D.h"
-
-#include "CaloIdentifier/CaloID.h"
-#include "CaloIdentifier/CaloIdManager.h"
-
-#include "LArDetDescr/LArCellVolumes.h"
-#include "GeoModelInterfaces/IGeoModelSvc.h"
-#include "GeoModelUtilities/DecodeVersionKey.h"
-#include "GaudiKernel/SystemOfUnits.h"
-
-LArNumberHelper::LArNumberHelper(const std::string geometry) :
-  m_geometry(geometry),
-  m_pDetStore(0),
-  m_iAccessSvc(0),
-  m_rec(0),
-  m_geoModelSvc(0),
-  m_cellVolumes(0),
-  m_emb_psin(0),
-  m_accg_rin_ac(0),
-  m_accg_rout_ac(0),
-  m_endg_zorig(0),
-  m_emb_iwout(0),
-  m_emec_psin(0),
-  m_esep_zsep12(0),
-  m_emec_out(0),
-  m_hec_in0(0),
-  m_hec_in1(0),
-  m_hec_in2(0),
-  m_hec_in3(0),
-  m_hec_out(0),
-  m_hec_gap(0)
-{
-
-  IMessageSvc*  msgSvc;
-
-  //retrieves helpers 
-  const CaloIdManager*  calo_id_man = CaloIdManager::instance();
-  m_em_id = calo_id_man->getEM_ID();
-  m_hec_id = calo_id_man->getHEC_ID();
-  m_fcal_id = calo_id_man->getFCAL_ID();
-
-  ISvcLocator* svcLoc = Gaudi::svcLocator( );
-  StatusCode sc = svcLoc->service( "MessageSvc", msgSvc );
-
-  if ( sc.isSuccess( ) ) {
-
-    MsgStream log(msgSvc, "LArNumberHelper" );
-
-    sc = svcLoc->service( "DetectorStore", m_pDetStore );
-
-    if (!sc.isSuccess() || 0 == m_pDetStore)  {
-      log <<MSG::FATAL <<"Could not find DetectorStore" <<endmsg;
-      // do not try to go further: nothing will work anyway
-      return;
-    }
-    
-    // Decode tag ( via GeoModel ) and fix it for TestBeam :
-    m_tag = "ATLAS-00";
-    m_node = "ATLAS";
-    m_geoModelSvc  = 0;
-
-    sc = svcLoc->service("GeoModelSvc",m_geoModelSvc);
-    if (sc.isFailure()) 
-      log << MSG::ERROR << "Unable to get pointer to GeoModel service" << endmsg;
-    else
-    {
-      DecodeVersionKey detectorKey = DecodeVersionKey(m_geoModelSvc, "LAr");
-      log <<MSG::INFO << "DecodeVersionKey found : " << detectorKey.tag() 
-	  << " " << detectorKey.tag()<<endmsg;
-
-      if ( detectorKey.tag() != "LAr-H8-00" &&  detectorKey.tag() != "LAr-H6-00"
-	   && detectorKey.tag() != "LAr-G3-00")
-	{
-	  m_tag =  detectorKey.tag();
-	  m_node =  detectorKey.node();
-	}
-    }
-
-    log <<MSG::INFO <<"Readout geometry will use : " << m_tag << " " << m_node <<endmsg;
-
-    // Acess the DB service :
-
-    sc = svcLoc->service("RDBAccessSvc",m_iAccessSvc);
-    if (sc.isFailure()) 
-      {
-	log << MSG::ERROR << "Unable to get RDBAccessSvc." << endmsg;
-      }
-    else
-      {
-	log <<MSG::INFO <<" did access RDBAccessSvc " <<endmsg;
-
-	prepare_arrays();
-	
-	db_nb_em();
-	db_nb_hec();
-	db_nb_fcal();
-	
-	IRDBRecordset_ptr recCellVolumes = m_iAccessSvc->getRecordsetPtr("LArCellVolumes",m_tag,m_node);
-	
-	if(recCellVolumes->size()==0)
-	  {
-	    // Error occured in detting the recordset with detectorKey
-	    // That probably means the LArCellVolumes node does not exist for this
-	    // particular version of atlas geometry. Make another try
-	    
-	    recCellVolumes = m_iAccessSvc->getRecordsetPtr("LArCellVolumes","LArCellVolumes-00");
-	  }
-	
-	if(recCellVolumes->size())
-	  m_cellVolumes = new LArCellVolumes(recCellVolumes);
-	else 
-	  log << MSG::ERROR << "Unable to get LArCellVolumes" << endmsg;
-
-      }
-
-    // now use all the info to finish up :
-    hard_em();
-    hard_hec();
-    hard_fcal();
-    
-    //print_em();
-    //print_hec();
-    //print_fcal();
-  }
-}
-
-
-LArNumberHelper::~LArNumberHelper() 
-{
-  if(m_cellVolumes)
-    delete m_cellVolumes;
-}
-
-int  
-LArNumberHelper::nb_of_em_regions()
-{  return m_region_id_em.size();
-}
-
-int  
-LArNumberHelper::nb_of_hec_regions()
-{  return m_region_id_hec.size();
-}
-
-int  
-LArNumberHelper::nb_of_fcal_regions()
-{  return m_region_id_fcal.size();
-}
-  
-void  
-LArNumberHelper::print_em()
-{
-
-    std::cout << "LArNumberHelper::print_em" << std::endl;
-
-  for ( unsigned int i=0; i < m_em_id->region_hash_max(); i++ ) {
-    
-    int barrel_ec = abs( m_em_id->barrel_ec (m_region_id_em[i]) );
-    int samp = m_em_id->sampling (m_region_id_em[i]);
-    int region = m_em_id->region (m_region_id_em[i]);
-    std::cout << "Region #" << i << " is : " << barrel_ec 
-	      << " " << samp << " " << region << std::endl;
-
-    std::cout << "number of chan in eta, phi "
-	      <<  m_n_eta_em[i] << " " << m_n_phi_em[i] << std::endl;
-
-    std::cout << "eta_min eta_max deta phi_min phi_max dphi"
-	      << std::endl;
-
-    std::cout << m_eta_min_em[i] << " " << m_eta_max_em[i]
-	      << " " << m_deta_em[i] << " "
-              << m_phi_min_em[i] << " " << m_phi_max_em[i] 
-	      << " " << m_dphi_em[i] << std::endl;
-
-    if ( m_n_depth_em[i] != 0 ) {
-      std::cout << "EMEC Z locations : in" ;
-      for ( int j = 0 ; j < m_n_depth_em[i]; j++ ) 
-	std::cout << m_depth_em_in[i][j] << " " ;
-      std::cout <<  std::endl;
-      
-      std::cout << "EMEC Z locations : out" ;
-      for ( int j = 0 ; j < m_n_depth_em[i]; j++ ) 
-	std::cout << m_depth_em_out[i][j] << " " ;
-      std::cout <<  std::endl;
-    }
-  }
-}
-
-void  
-LArNumberHelper::print_hec()
-{
-
-    std::cout << "LArNumberHelper::print_hec" << std::endl;
-
-  for ( unsigned int i=0; i < m_hec_id->region_hash_max(); i++ ) {
-    
-    int pos_neg = abs( m_hec_id->pos_neg (m_region_id_hec[i]) );
-    int samp = m_hec_id->sampling (m_region_id_hec[i]);
-    int region = m_hec_id->region (m_region_id_hec[i]);
-    std::cout << "Region #" << i << " is : " << pos_neg 
-	      << " " << samp << " " << region << std::endl;
-
-    std::cout << "number of chan in eta, phi "
-	      <<  m_n_eta_hec[i] << " " << m_n_phi_hec[i] << std::endl;
-
-    std::cout << "eta_min eta_max deta phi_min phi_max dphi"
-	      << std::endl;
-
-    std::cout << m_eta_min_hec[i] << " " << m_eta_max_hec[i]
-	      << " " << m_deta_hec[i] << " "
-              << m_phi_min_hec[i] << " " << m_phi_max_hec[i] 
-	      << " " << m_dphi_hec[i] << std::endl;
-
-    if ( m_n_depth_hec[i] != 0 ) {
-      std::cout << "HEC Z locations: in" ;
-      for ( int j = 0 ; j < m_n_depth_hec[i]; j++ ) 
-	std::cout << m_depth_hec_in[i][j] << " " ;
-      std::cout <<  std::endl;
-      std::cout << "HEC Z locations: out" ;
-      for ( int j = 0 ; j < m_n_depth_hec[i]; j++ ) 
-	std::cout << m_depth_hec_out[i][j] << " " ;
-      std::cout <<  std::endl;
-    }
-  }
-}
-
-void  
-LArNumberHelper::print_fcal()
-{
-
-    std::cout << "LArNumberHelper::print_fcal" << std::endl;
-
-  for ( unsigned int i=0; i < m_fcal_id->module_hash_max(); i++ ) {
-    
-    int pos_neg = abs( m_fcal_id->pos_neg (m_region_id_fcal[i]) );
-    int module = m_fcal_id->module (m_region_id_fcal[i]);
-    std::cout << "Module #" << i << " is : " <<  pos_neg
-	      << " " << module << std::endl;
-
-    std::cout << "channels : n_eta, n_phi, deta, dphi "
-	      <<  m_n_eta_fcal[i] << " " << m_n_phi_fcal[i] << " "  
-	      <<  m_deta_fcal[i] << " " << m_dphi_fcal[i] 
-	      << std::endl;
-
-    std::cout << "x_min x_max dx y_min y_max dy "
-	      << std::endl;
-
-    std::cout << m_x_min_fcal[i] << " " << m_x_max_fcal[i]
-	      << " " << m_dx_fcal[i] << " "
-              << m_y_min_fcal[i] << " " << m_y_max_fcal[i] 
-	      << " " << m_dy_fcal[i] << std::endl;
-
-    if ( m_n_depth_fcal[i] != 0 ) {
-      std::cout << "FCAL Z locations : in" ;
-      for ( int j = 0 ; j < m_n_depth_fcal[i]; j++ ) 
-	std::cout << m_depth_fcal_in[i][j] << " " ;
-      std::cout <<  std::endl;
-      
-      std::cout << "FCAL Z locations : out" ;
-      for ( int j = 0 ; j < m_n_depth_fcal[i]; j++ ) 
-	std::cout << m_depth_fcal_out[i][j] << " " ;
-      std::cout <<  std::endl;
-    }
-  }
-}
-
-LArCellVolumes* 
-LArNumberHelper::VolumeHelper()
-{
-  return  m_cellVolumes;
-}
-
-void 
-LArNumberHelper::prepare_arrays()
-{
-  // Arrays are ordered by the region hash index.
-
-  // em :  2*18 regions
-  //            EM PS  1 per +- side
-  //            EMB    5 per +- side
-  //            EC PS  1 per +- side
-  //            EMEC  11 per +- side
-
-  int Ntot =  (int) m_em_id->region_hash_max();
-  //std::cout << "LArNumberHelper::prepare_arrays for em.  Ntot = " 
-  //	    << Ntot << std::endl;
-
-  // these come from the identier package
-  m_region_id_em.resize(Ntot);
-  m_n_eta_em.resize(Ntot,0);
-  m_n_phi_em.resize(Ntot,0);
-  m_deta_em.resize(Ntot,(double) 0.);
-  m_dphi_em.resize(Ntot, (double) 0.);
-  m_eta_min_em.resize(Ntot,(double) 0.);
-  m_eta_max_em.resize(Ntot,(double) 0.);
-  m_phi_min_em.resize(Ntot,(double) 0.);
-  m_phi_max_em.resize(Ntot,(double) 0.);
-  m_sign_em.resize(Ntot,0);
-
-  // 2 "facts of life" : 
-  //   in H8, the EMB module is centered around phi=0
-  //        = rotated by 1/2 module compared to Atlas
-  //        compute the shift here, using the middle layer,
-  //        and ignore the standard  DDDb value. 
-
-  double phiEMBShift = 0.;
-
-  if ( m_geometry == "H8" ) {
-    Identifier id = m_em_id->region_id(1,2,0);
-    IdentifierHash i = m_em_id->region_hash(id);
-    double cellnb =  m_em_id->phi_max(id) + 1 -  m_em_id->phi_min(id);
-    double cellsize = (double)  m_em_id->phiGranularity(i);
-    phiEMBShift = cellnb * cellsize / 2. ;
-  }  
-  else {
-    m_lar = m_iAccessSvc->getRecordsetPtr("BarrelGeometry",m_tag,m_node);
-    if (m_lar->size()) {
-      m_rec = (*m_lar)[0];
-      phiEMBShift = -1.*m_rec->getDouble("PHIFIRST");
-    }
-  }
-
-  //   in G3, the EMEC phi origin was the 1rst absorber, 
-  //   in G4, it is defined as the 1rst electrode
-  double phiEMECShift = 0.;
-  if ( m_geometry == "Atlas" ) {
-    Identifier id = m_em_id->region_id(2,2,0);
-    IdentifierHash i = m_em_id->region_hash(id);
-    double cellsize = (double)  m_em_id->phiGranularity(i);
-    phiEMECShift = cellsize * (1./ 6.) ;
-  }
-
-  for ( unsigned int i=0; i < m_em_id->region_hash_max(); i++ ) {
-    Identifier id = m_em_id->region_id ( i );
-    m_region_id_em[i] = id;
-    m_n_eta_em [i] =  m_em_id->eta_max(id) + 1;
-    m_n_phi_em [i] =  m_em_id->phi_max(id) + 1;
-    m_deta_em [i] = (double)  m_em_id->etaGranularity(i);
-    m_dphi_em [i] = (double)  m_em_id->phiGranularity(i);
-    int barrel_ec = abs( m_em_id->barrel_ec (id) );
-    if (barrel_ec == 0) barrel_ec = 1;
-    m_sign_em[i] = m_em_id->barrel_ec (id) /  barrel_ec;
-    m_eta_min_em [i] = (double) (m_em_id->eta0(i) - 
-	      m_em_id->eta_min(id)*m_em_id->etaGranularity(i));  // ideal !
-    m_eta_max_em [i] = m_eta_min_em[i] + m_n_eta_em[i]*m_deta_em[i];
-    m_phi_min_em [i] = m_em_id->phi0(i) - 
-              m_em_id->phi_min(id)*m_em_id->phiGranularity(i);  // ideal !;
-    m_phi_max_em [i] = m_phi_min_em[i] + m_n_phi_em[i]*m_dphi_em[i] -
-              0.01*m_dphi_em[i];  // when = 2pi get rounding pb.
-
-    // apply phi shifts mentioned above :
-
-    if ( m_em_id->barrel_ec (id) == 1 ) {
-      m_phi_min_em [i] = m_phi_min_em [i] - phiEMBShift ;
-      m_phi_max_em [i] = m_phi_max_em [i] - phiEMBShift;
-    }
-    else if ( m_em_id->barrel_ec (id) == -1) {
-      m_phi_min_em [i] = m_phi_min_em [i] + phiEMBShift ;
-      m_phi_max_em [i] = m_phi_max_em [i] + phiEMBShift;
-    }
-    else if (m_em_id->barrel_ec (id) < 0) {
-      m_phi_min_em [i] = m_phi_min_em [i] + phiEMECShift ;
-      m_phi_max_em [i] = m_phi_max_em [i] + phiEMECShift;
-    }
-    else {
-      m_phi_min_em [i] = m_phi_min_em [i] - phiEMECShift ;
-      m_phi_max_em [i] = m_phi_max_em [i] - phiEMECShift;
-    }
-  }
-
-  // these will come from the geometry numbers
-  m_n_depth_em.resize(Ntot,0);
-  m_depth_em_in.resize(Ntot);
-  m_depth_em_out.resize(Ntot);
-
-  // hec :  2*8 regions
-  // ------------------
-
-  Ntot =  (int) m_hec_id->region_hash_max();
-  //std::cout << "LArNumberHelper::prepare_arrays for hec.  Ntot = " 
-  //	    << Ntot << std::endl;
-
-  // these come from the identier package
-  m_region_id_hec.resize(Ntot);
-  m_n_eta_hec.resize(Ntot,0);
-  m_n_phi_hec.resize(Ntot,0);
-  m_deta_hec.resize(Ntot,(double) 0.);
-  m_dphi_hec.resize(Ntot, (double) 0.);
-  m_eta_min_hec.resize(Ntot,(double) 0.);
-  m_eta_max_hec.resize(Ntot,(double) 0.);
-  m_phi_min_hec.resize(Ntot,(double) 0.);
-  m_phi_max_hec.resize(Ntot,(double) 0.);
-  m_sign_hec.resize(Ntot,0);
-
-  for ( unsigned int i=0; i < m_hec_id->region_hash_max(); i++ ) {
-    Identifier id = m_hec_id->region_id ( i );
-    m_region_id_hec[i] = id;
-    m_n_eta_hec [i] =  m_hec_id->eta_max(id) + 1;
-    m_n_phi_hec [i] = m_hec_id->phi_max(id) + 1;
-    m_deta_hec [i] = (double) m_hec_id->etaGranularity(i);
-    m_dphi_hec [i] = (double) m_hec_id->phiGranularity(i);
-    int pos_neg = abs( m_hec_id->pos_neg (id) );
-    if (pos_neg == 0) pos_neg = 1;
-    m_eta_min_hec [i] = (double)(m_hec_id->eta0(i) - 
-        m_hec_id->eta_min(id)*m_hec_id->etaGranularity(i));  // ideal !
-    m_eta_max_hec [i] = m_eta_min_hec[i] + m_n_eta_hec[i]*m_deta_hec[i];
-    m_phi_min_hec [i] =  m_hec_id->phi0(i) - 
-	      m_hec_id->phi_min(id)*m_hec_id->phiGranularity(i);  // ideal !;
-    m_phi_max_hec[i] = m_phi_min_hec[i] + m_n_phi_hec[i]*m_dphi_hec[i] -
-              0.01*m_dphi_hec[i];  // when = 2pi get rounding pb.;
-    m_sign_hec[i] = m_hec_id->pos_neg (id) /  pos_neg;
-  }
-
-  // these will come from the geometry numbers
-  m_n_depth_hec.resize(Ntot,0);
-  m_depth_hec_in.resize(Ntot);
-  m_depth_hec_out.resize(Ntot);
-  
-  // fcal :  2*3 regions
-  // ---------------------
-  // N.B. : FCAL is a mess, because information always came
-  // from a specific class and FCAL_ID only knows about eta/phi
-
-  Ntot =  (int) m_fcal_id->module_hash_max();
-  //std::cout << "LArNumberHelper::prepare_arrays for fcal.  Ntot = " 
-  //	    << Ntot << std::endl;
-
-  // these come from the identier package
-  m_region_id_fcal.resize(Ntot);
-  m_n_eta_fcal.resize(Ntot,0);
-  m_n_phi_fcal.resize(Ntot,0);
-  m_deta_fcal.resize(Ntot,(double) 0.);
-  m_dphi_fcal.resize(Ntot, (double) 0.);
-  m_sign_fcal.resize(Ntot,0);
-  m_n_depth_fcal.resize(Ntot,0);
-  m_depth_fcal_in.resize(Ntot);
-  m_depth_fcal_out.resize(Ntot);
-
-  for ( unsigned int i=0; i < m_fcal_id->module_hash_max(); i++ ) {
-
-    Identifier id = m_fcal_id->module_id ( i );
-    m_region_id_fcal[i] = id;
-
-    // these are in fact number of channels in eta/phi...
-    m_n_eta_fcal [i] = m_fcal_id->eta_max(id) + 1;
-    m_n_phi_fcal [i] = m_fcal_id->phi_max(id) + 1;
-    m_deta_fcal [i] = (double)  m_fcal_id->etaGranularity(i);
-    m_dphi_fcal [i] = (double)  m_fcal_id->phiGranularity(i);
-
-    int pos_neg = abs( m_fcal_id->pos_neg (id) );
-    m_sign_fcal[i] = pos_neg ? m_fcal_id->pos_neg (id) /  pos_neg : 0;
-  }
-
-  // these will come from  geometry numbers
-  m_x_min_fcal.resize(Ntot,(double) 0.);
-  m_x_max_fcal.resize(Ntot,(double) 0.);
-  m_dx_fcal.resize(Ntot,(double) 0.);
-  m_y_min_fcal.resize(Ntot,(double) 0.);
-  m_y_max_fcal.resize(Ntot,(double) 0.);
-  m_dy_fcal.resize(Ntot, (double) 0.);
-  m_z_min_fcal.resize(Ntot,(double) 0.);
-  m_z_max_fcal.resize(Ntot,(double) 0.);
-  m_eta_min_fcal.resize(Ntot,(double) 0.);
-  m_eta_max_fcal.resize(Ntot,(double) 0.);
-  m_phi_min_fcal.resize(Ntot,(double) 0.);
-  m_phi_max_fcal.resize(Ntot,(double) 0.);
-  
-  //std::cout << "LArNumberHelper::prepare_arrays finished " 
-  //          << std::endl;
-}
-
-void 
-LArNumberHelper::db_nb_em()
-{
-  // ---- Defaults are the values taken from Nova a long time
-  //      ago -> this is where their name comes from
-  // ---- Now all overwritten by DB value
-
-  //std::cout << " ----- in db_nb_em tags are : " << m_tag << " " << m_node << std::endl;
-
-  // PS
-  // m_emb_psin = 141.23*Gaudi::Units::cm;    // this is the TDR number 1385 mm + 27.3 mm   
-  //  ----> overwritten
-
-  m_lar = m_iAccessSvc->getRecordsetPtr("PresamplerGeometry","ATLAS-00","ATLAS");
-
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-    m_emb_psin = m_rec->getDouble("RACTIVE")*Gaudi::Units::cm;
-  }
-
-  // ACCG :
-  // m_accg_rin_ac = 144.73*Gaudi::Units::cm; // 1385mm + 27.3mm + 35mm
-  // m_accg_rout_ac = 200.35*Gaudi::Units::cm; // end of active material
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelGeometry",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_accg_rin_ac = m_rec->getDouble("RMIN") *Gaudi::Units::cm;
-    m_accg_rout_ac = m_rec->getDouble("RMAX") *Gaudi::Units::cm;
-  }
-
-  // ACCO :
-  m_acco_rmx12.resize (8,(double) 0.); 
-  // m_acco_rmx12[0] = 158.6*Gaudi::Units::cm;
-  // m_acco_rmx12[1] = 158.6*Gaudi::Units::cm;
-  // m_acco_rmx12[2] = 157.07*Gaudi::Units::cm;
-  // m_acco_rmx12[3] = 157.07*Gaudi::Units::cm;
-  // m_acco_rmx12[4] = 154.83*Gaudi::Units::cm;
-  // m_acco_rmx12[5] = 154.83*Gaudi::Units::cm;
-  // m_acco_rmx12[6] = 153.23*Gaudi::Units::cm;
-  // m_acco_rmx12[7] = 153.23*Gaudi::Units::cm;
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelLongDiv",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_acco_rmx12[0] = m_rec->getDouble("RMX12_0")*Gaudi::Units::cm;
-    m_acco_rmx12[1] = m_rec->getDouble("RMX12_1")*Gaudi::Units::cm;
-    m_acco_rmx12[2] = m_rec->getDouble("RMX12_2")*Gaudi::Units::cm;
-    m_acco_rmx12[3] = m_rec->getDouble("RMX12_3")*Gaudi::Units::cm;
-    m_acco_rmx12[4] = m_rec->getDouble("RMX12_4")*Gaudi::Units::cm;
-    m_acco_rmx12[5] = m_rec->getDouble("RMX12_5")*Gaudi::Units::cm;
-    m_acco_rmx12[6] = m_rec->getDouble("RMX12_6")*Gaudi::Units::cm;
-    m_acco_rmx12[7] = m_rec->getDouble("RMX12_7")*Gaudi::Units::cm;
-  }
-
-  m_acco_ee12.resize (8,(double) 0.); 
-  // m_acco_ee12[0] = 0.;
-  // m_acco_ee12[1] = 0.275;
-  // m_acco_ee12[2] = 0.6;
-  // m_acco_ee12[3] = 0.799;
-  // m_acco_ee12[4] = 0.8;
-  // m_acco_ee12[5] = 1.1312;
-  // m_acco_ee12[6] = 1.3531;
-  // m_acco_ee12[7] = 1.6;
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelLongDiv",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_acco_ee12[0] = m_rec->getDouble("EE_0");
-    m_acco_ee12[1] = m_rec->getDouble("EE_1");
-    m_acco_ee12[2] = m_rec->getDouble("EE_2");
-    m_acco_ee12[3] = m_rec->getDouble("EE_3");
-    m_acco_ee12[4] = m_rec->getDouble("EE_4");
-    m_acco_ee12[5] = m_rec->getDouble("EE_5");
-    m_acco_ee12[6] = m_rec->getDouble("EE_6");
-    m_acco_ee12[7] = m_rec->getDouble("EE_7");
-  }
-
-  m_acco_rmx23.resize (53,(double) 0.); 
-  /*
-    m_acco_rmx23[0] = 192.83*Gaudi::Units::cm;  ... up to :
-    m_acco_rmx23[52] = 178.89*Gaudi::Units::cm;
-  */
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelLongDiv",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_acco_rmx23[0] = m_rec->getDouble("RMX23_0")*Gaudi::Units::cm;
-    m_acco_rmx23[1] = m_rec->getDouble("RMX23_1")*Gaudi::Units::cm;
-    m_acco_rmx23[2] = m_rec->getDouble("RMX23_2")*Gaudi::Units::cm;
-    m_acco_rmx23[3] = m_rec->getDouble("RMX23_3")*Gaudi::Units::cm;
-    m_acco_rmx23[4] = m_rec->getDouble("RMX23_4")*Gaudi::Units::cm;
-    m_acco_rmx23[5] = m_rec->getDouble("RMX23_5")*Gaudi::Units::cm;
-    m_acco_rmx23[6] = m_rec->getDouble("RMX23_6")*Gaudi::Units::cm;
-    m_acco_rmx23[7] = m_rec->getDouble("RMX23_7")*Gaudi::Units::cm;
-    m_acco_rmx23[8] = m_rec->getDouble("RMX23_8")*Gaudi::Units::cm;
-    m_acco_rmx23[9] = m_rec->getDouble("RMX23_9")*Gaudi::Units::cm;
-    m_acco_rmx23[10] = m_rec->getDouble("RMX23_10")*Gaudi::Units::cm;
-    m_acco_rmx23[11] = m_rec->getDouble("RMX23_11")*Gaudi::Units::cm;
-    m_acco_rmx23[12] = m_rec->getDouble("RMX23_12")*Gaudi::Units::cm;
-    m_acco_rmx23[13] = m_rec->getDouble("RMX23_13")*Gaudi::Units::cm;
-    m_acco_rmx23[14] = m_rec->getDouble("RMX23_14")*Gaudi::Units::cm;
-    m_acco_rmx23[15] = m_rec->getDouble("RMX23_15")*Gaudi::Units::cm;
-    m_acco_rmx23[16] = m_rec->getDouble("RMX23_16")*Gaudi::Units::cm;
-    m_acco_rmx23[17] = m_rec->getDouble("RMX23_17")*Gaudi::Units::cm;
-    m_acco_rmx23[18] = m_rec->getDouble("RMX23_18")*Gaudi::Units::cm;
-    m_acco_rmx23[19] = m_rec->getDouble("RMX23_19")*Gaudi::Units::cm;
-    m_acco_rmx23[20] = m_rec->getDouble("RMX23_20")*Gaudi::Units::cm;
-    m_acco_rmx23[21] = m_rec->getDouble("RMX23_21")*Gaudi::Units::cm;
-    m_acco_rmx23[22] = m_rec->getDouble("RMX23_22")*Gaudi::Units::cm;
-    m_acco_rmx23[23] = m_rec->getDouble("RMX23_23")*Gaudi::Units::cm;
-    m_acco_rmx23[24] = m_rec->getDouble("RMX23_24")*Gaudi::Units::cm;
-    m_acco_rmx23[25] = m_rec->getDouble("RMX23_25")*Gaudi::Units::cm;
-    m_acco_rmx23[26] = m_rec->getDouble("RMX23_26")*Gaudi::Units::cm;
-    m_acco_rmx23[27] = m_rec->getDouble("RMX23_27")*Gaudi::Units::cm;
-    m_acco_rmx23[28] = m_rec->getDouble("RMX23_28")*Gaudi::Units::cm;
-    m_acco_rmx23[29] = m_rec->getDouble("RMX23_29")*Gaudi::Units::cm;
-    m_acco_rmx23[30] = m_rec->getDouble("RMX23_30")*Gaudi::Units::cm;
-    m_acco_rmx23[31] = m_rec->getDouble("RMX23_31")*Gaudi::Units::cm;
-    m_acco_rmx23[32] = m_rec->getDouble("RMX23_32")*Gaudi::Units::cm;
-    m_acco_rmx23[33] = m_rec->getDouble("RMX23_33")*Gaudi::Units::cm;
-    m_acco_rmx23[34] = m_rec->getDouble("RMX23_34")*Gaudi::Units::cm;
-    m_acco_rmx23[35] = m_rec->getDouble("RMX23_35")*Gaudi::Units::cm;
-    m_acco_rmx23[36] = m_rec->getDouble("RMX23_36")*Gaudi::Units::cm;
-    m_acco_rmx23[37] = m_rec->getDouble("RMX23_37")*Gaudi::Units::cm;
-    m_acco_rmx23[38] = m_rec->getDouble("RMX23_38")*Gaudi::Units::cm;
-    m_acco_rmx23[39] = m_rec->getDouble("RMX23_39")*Gaudi::Units::cm;
-    m_acco_rmx23[40] = m_rec->getDouble("RMX23_40")*Gaudi::Units::cm;
-    m_acco_rmx23[41] = m_rec->getDouble("RMX23_41")*Gaudi::Units::cm;
-    m_acco_rmx23[42] = m_rec->getDouble("RMX23_42")*Gaudi::Units::cm;
-    m_acco_rmx23[43] = m_rec->getDouble("RMX23_43")*Gaudi::Units::cm;
-    m_acco_rmx23[44] = m_rec->getDouble("RMX23_44")*Gaudi::Units::cm;
-    m_acco_rmx23[45] = m_rec->getDouble("RMX23_45")*Gaudi::Units::cm;
-    m_acco_rmx23[46] = m_rec->getDouble("RMX23_46")*Gaudi::Units::cm;
-    m_acco_rmx23[47] = m_rec->getDouble("RMX23_47")*Gaudi::Units::cm;
-    m_acco_rmx23[48] = m_rec->getDouble("RMX23_48")*Gaudi::Units::cm;
-    m_acco_rmx23[49] = m_rec->getDouble("RMX23_49")*Gaudi::Units::cm;
-    m_acco_rmx23[50] = m_rec->getDouble("RMX23_50")*Gaudi::Units::cm;
-    m_acco_rmx23[51] = m_rec->getDouble("RMX23_51")*Gaudi::Units::cm;
-    m_acco_rmx23[52] = m_rec->getDouble("RMX23_52")*Gaudi::Units::cm;
-  }
-
-  // ENDG
-  // m_endg_zorig = 369.1*Gaudi::Units::cm; // this is the NOVA/Oracle number
-  // m_emb_iwout = 422.7*Gaudi::Units::cm;  // 369.1*Gaudi::Units::cm + 53.6*Gaudi::Units::cm is the end of the active part
-  // m_emec_out = 422.7*Gaudi::Units::cm;  // 369.1*Gaudi::Units::cm + 53.6*Gaudi::Units::cm is the end of the active part
-  m_lar = m_iAccessSvc->getRecordsetPtr("EmecGeometry",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-    m_endg_zorig = m_rec->getDouble("Z1")*Gaudi::Units::cm;
-    double epaisseurTotale =  m_rec->getDouble("ETOT")*Gaudi::Units::cm;
-    m_emb_iwout = m_endg_zorig + epaisseurTotale;
-    m_emec_out  = m_endg_zorig + epaisseurTotale;
-
-  } 
-
-  // Cryostat
-  // m_emec_psin = 362.5*Gaudi::Units::cm; // notch in cold wall of cryostat
-  if ( m_geometry == "Atlas" ) {
-    DecodeVersionKey detectorKeyAtl = DecodeVersionKey(m_geoModelSvc, "ATLAS");
-    m_lar = m_iAccessSvc->getRecordsetPtr("PresamplerPosition",detectorKeyAtl.tag(),detectorKeyAtl.node());
-  }
-  else {
-    m_lar = m_iAccessSvc->getRecordsetPtr("PresamplerPosition",m_tag,m_node);
-  }
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-    m_emec_psin = m_rec->getDouble("ZPOS")*Gaudi::Units::cm;
-  } 
-
-  // ESEP
-  m_esep_iw23.resize(7, (double) 0.); 
-  // m_esep_iw23[0] = 413.934*Gaudi::Units::cm;
-  // m_esep_iw23[1] = 412.518*Gaudi::Units::cm;
-  // m_esep_iw23[2] = 411.792*Gaudi::Units::cm;
-  // m_esep_iw23[3] = 409.545*Gaudi::Units::cm;
-  // m_esep_iw23[4] = 407.987*Gaudi::Units::cm;
-  // m_esep_iw23[5] = 407.510*Gaudi::Units::cm;
-  // m_esep_iw23[6] = 404.730*Gaudi::Units::cm;
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("EmecSamplingSep",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_esep_iw23[0] = m_rec->getDouble("ZIW_0")*Gaudi::Units::cm;
-    m_esep_iw23[1] = m_rec->getDouble("ZIW_1")*Gaudi::Units::cm;
-    m_esep_iw23[2] = m_rec->getDouble("ZIW_2")*Gaudi::Units::cm;
-    m_esep_iw23[3] = m_rec->getDouble("ZIW_3")*Gaudi::Units::cm;
-    m_esep_iw23[4] = m_rec->getDouble("ZIW_4")*Gaudi::Units::cm;
-    m_esep_iw23[5] = m_rec->getDouble("ZIW_5")*Gaudi::Units::cm;
-    m_esep_iw23[6] = m_rec->getDouble("ZIW_6")*Gaudi::Units::cm;
-}
-
-  // m_esep_zsep12 = 378.398*Gaudi::Units::cm;   
-  // Note that in the gometryDB this is an array, but
-  // of very similar numbers -> Zebra was using 1rst value only
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("EmecSamplingSep",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_esep_zsep12 = m_rec->getDouble("ZSEP12_0")*Gaudi::Units::cm;
-  }
-
-  m_esep_zsep23.resize(22, (double) 0.); 
-  /*
-  m_esep_zsep23 [0] = 999.999*Gaudi::Units::cm;       // inheritance from Zebra.
-  m_esep_zsep23 [1] = 999.999*Gaudi::Units::cm;       // will be skipped in hard_em
-  m_esep_zsep23 [2] = 413.205*Gaudi::Units::cm;   ... up to :
-  m_esep_zsep23 [21] = 401.153*Gaudi::Units::cm;
-  */
-  //  ----> overwritten
-  m_lar = m_iAccessSvc->getRecordsetPtr("EmecSamplingSep",m_tag,m_node);
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];  
-    m_esep_zsep23 [0] = m_rec->getDouble("ZSEP23_0")*Gaudi::Units::cm;
-    m_esep_zsep23 [1] = m_rec->getDouble("ZSEP23_1")*Gaudi::Units::cm;
-    m_esep_zsep23 [2] = m_rec->getDouble("ZSEP23_2")*Gaudi::Units::cm;
-    m_esep_zsep23 [3] = m_rec->getDouble("ZSEP23_3")*Gaudi::Units::cm;
-    m_esep_zsep23 [4] = m_rec->getDouble("ZSEP23_4")*Gaudi::Units::cm;
-    m_esep_zsep23 [5] = m_rec->getDouble("ZSEP23_5")*Gaudi::Units::cm;
-    m_esep_zsep23 [6] = m_rec->getDouble("ZSEP23_6")*Gaudi::Units::cm;
-    m_esep_zsep23 [7] = m_rec->getDouble("ZSEP23_7")*Gaudi::Units::cm;
-    m_esep_zsep23 [8] = m_rec->getDouble("ZSEP23_8")*Gaudi::Units::cm;
-    m_esep_zsep23 [9] = m_rec->getDouble("ZSEP23_9")*Gaudi::Units::cm;
-    m_esep_zsep23 [10] = m_rec->getDouble("ZSEP23_10")*Gaudi::Units::cm;
-    m_esep_zsep23 [11] = m_rec->getDouble("ZSEP23_11")*Gaudi::Units::cm;
-    m_esep_zsep23 [12] = m_rec->getDouble("ZSEP23_12")*Gaudi::Units::cm;
-    m_esep_zsep23 [13] = m_rec->getDouble("ZSEP23_13")*Gaudi::Units::cm;
-    m_esep_zsep23 [14] = m_rec->getDouble("ZSEP23_14")*Gaudi::Units::cm;
-    m_esep_zsep23 [15] = m_rec->getDouble("ZSEP23_15")*Gaudi::Units::cm;
-    m_esep_zsep23 [16] = m_rec->getDouble("ZSEP23_16")*Gaudi::Units::cm;
-    m_esep_zsep23 [17] = m_rec->getDouble("ZSEP23_17")*Gaudi::Units::cm;
-    m_esep_zsep23 [18] = m_rec->getDouble("ZSEP23_18")*Gaudi::Units::cm;
-    m_esep_zsep23 [19] = m_rec->getDouble("ZSEP23_19")*Gaudi::Units::cm;
-    m_esep_zsep23 [20] = m_rec->getDouble("ZSEP23_20")*Gaudi::Units::cm;
-    m_esep_zsep23 [21] = m_rec->getDouble("ZSEP23_21")*Gaudi::Units::cm;
-  }
-
-}
-
-void 
-LArNumberHelper::db_nb_hec()  
-{
-  
-  // ---- Set default :
-  /*  
-  m_hec_in0 = 427.70*Gaudi::Units::cm;  // z_start
-  m_hec_in1 = 455.75*Gaudi::Units::cm;  // z_start+ 28.05*Gaudi::Units::cm
-  m_hec_in2 = 513.40*Gaudi::Units::cm;  // z_start + 28.05*Gaudi::Units::cm + 26.8*Gaudi::Units::cm + 26.8*Gaudi::Units::cm + 4.05*Gaudi::Units::cm
-  m_hec_in3 = 562.70*Gaudi::Units::cm;  // z_start + 28.05*Gaudi::Units::cm + 26.8*Gaudi::Units::cm + 26.8*Gaudi::Units::cm + 4.05*Gaudi::Units::cm 
-                          //        + 25.9*Gaudi::Units::cm + 23.4*Gaudi::Units::cm
-  m_hec_gap = 4.05*Gaudi::Units::cm;    // gap between the two HEC wheels  
-  
-  // Comment from Sven Menke :
-  // I don't know why the the Nova Z_end is 2.5cm more, but the active
-  // volume must be the sum of all blocks plus the gap - thus it's 609.5*cm
-  m_hec_out = 609.5*Gaudi::Units::cm;  // z_end - 2.5*Gaudi::Units::cm (or z_orig + all blocks)
-  */
-
-  //std::cout << " ----- in db_nb_hec tags are : " << m_tag << " " << m_node << std::endl;
-
- 
-  // ---- Overwrite with real NOVA/Oracle numbers :
-  
-  m_lar = m_iAccessSvc->getRecordsetPtr("HadronicEndcap",m_tag,m_node);
-  
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-    
-    // HEC0 is Block0     
-    // Block0 = 1.25 cm Front Plate + 
-    //          8 times (0.85 cm LAr gap + 2.50 cm Plate) = 28.05 cm 
-    double Block0 = ( m_rec->getDouble("PLATE_0")/2. 
-		      + 8*(m_rec->getDouble("LARG") + m_rec->getDouble("PLATE_0")))*Gaudi::Units::cm;
-    
-    // HEC1 is Block1 + Block2
-    // Block1 = 8 times (0.85 cm LAr gap + 2.50 cm Plate) 
-    //         = 26.80 cm
-    double Block1 = 8*(m_rec->getDouble("LARG") + m_rec->getDouble("PLATE_0"))*Gaudi::Units::cm;
-    double Block2 = Block1 ;
-
-    // Gap     = 4.05 cm
-    m_hec_gap = m_rec->getDouble("GAPWHL") *Gaudi::Units::cm;
-    
-    // HEC2 is  Block 3 + Block 4
-    // Block3 = 2.5 cm Front Plate + 
-    //      4 times (0.85 cm LAr gap + 5.00 cm Plate) = 25.90 cm 
-    double Block3 =  ( m_rec->getDouble("PLATE_1")/2. 
-		       + 4*(m_rec->getDouble("LARG") + m_rec->getDouble("PLATE_1")))*Gaudi::Units::cm;
-    
-    // Block4 = 4 times (0.85 cm LAr gap + 5.00 cm Plate) = 23.40 cm 
-    double Block4 = 4*(m_rec->getDouble("LARG") + m_rec->getDouble("PLATE_1"))*Gaudi::Units::cm;
-    
-    // HEC3 is  Block 5 + Block 6
-    double Block5 = Block4 ;
-    double Block6 = Block4;
-    
-    double zstart =  m_rec->getDouble("ZSTART") *Gaudi::Units::cm;
-    
-    m_hec_in0 = zstart;
-    m_hec_in1 = m_hec_in0 + Block0  ;
-    m_hec_in2 = m_hec_in1 + Block1 + Block2 + m_hec_gap ;
-    m_hec_in3 = m_hec_in2 + Block3 + Block4;
-    m_hec_out = m_hec_in3 + Block5 + Block6;
-  }
-}
-
-void 
-LArNumberHelper::db_nb_fcal()
-{
-  //    decode_fcal();    //  FCAL   3 per +- side
-  //std::cout << " ----- in db_nb_fcal tags are : " << m_tag << " " << m_node << std::endl;
-
-}
-
-void
-LArNumberHelper::cart_to_cyl (  double x,    double y,    double z,
-                                double& eta, double& phi, double& r )
-{
-  HepGeom::Point3D<double> pt(x,y,z);
-  eta = pt.eta();
-  phi = pt.phi();
-  r = pt.perp();
-}
-
-double
-LArNumberHelper::eta ( double r, double z )
-{
-  return -log(tan(atan2(r,z)/2));
-}
-
-  
-void  
-LArNumberHelper::hard_em()
-{
-
-  // Numbers are taken from DB, but still have to define which ones are used
-  // for what !
-
-  std::vector <double> z_loc_in;
-  std::vector <double> z_loc_out;
-
-  for ( unsigned int i=0; i < m_em_id->region_hash_max(); i++ ) {
-
-    int barrel_ec = abs( m_em_id->barrel_ec (m_region_id_em[i]) );
-    int samp = m_em_id->sampling (m_region_id_em[i]);
-    int region = m_em_id->region (m_region_id_em[i]);
-    //int pos_neg = m_em_id->barrel_ec (m_region_id_em[i]);
-
-    // Default
-    m_n_depth_em [i] = 0;
-    z_loc_in.resize( 0 );
-    z_loc_out.resize( 0 );
-
-    // Barrel 
-    if ( barrel_ec == 1 )  {
-
-      if ( samp == 0) {
-	m_n_depth_em [i] = 1;
-	z_loc_in.resize( m_n_depth_em [i], (double) 0. );
-	z_loc_out.resize( m_n_depth_em [i], (double) 0. );
-
-	z_loc_in [0] = m_emb_psin;
-	z_loc_out [0] = m_accg_rin_ac;
-
-      } 
-
-      else if ( samp == 1) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0. );
-	z_loc_out.resize( m_n_depth_em [i], (double) 0. );
-
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  z_loc_in[n] = m_accg_rin_ac;
-	  double where = m_eta_min_em[i]+n*m_deta_em[i];
-	  if ( where < m_acco_ee12[1] ) z_loc_out [n] = m_acco_rmx12[0];
-	  else if ( where < m_acco_ee12[2] ) z_loc_out [n] = m_acco_rmx12[1];
-	  else if ( where < m_acco_ee12[4] ) z_loc_out [n] = m_acco_rmx12[2];
-	  else if ( where < m_acco_ee12[5] ) z_loc_out [n] = m_acco_rmx12[4];
-	  else if ( where < m_acco_ee12[6] ) z_loc_out [n] = m_acco_rmx12[5];
-	  else z_loc_out[n] = m_acco_rmx12[6];
-	}
-
-      }
-
-      else if ( samp == 2) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0. );
-	z_loc_out.resize( m_n_depth_em [i], (double) 0. );
-
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  double where = m_eta_min_em[i]+(n+0.5)*m_deta_em[i];
-	  if ( where <  m_acco_ee12[1] ) z_loc_in [n] = m_acco_rmx12[0];
-	  else if ( where < m_acco_ee12[2] ) z_loc_in [n] = m_acco_rmx12[1];
-	  else if ( where < m_acco_ee12[4] ) z_loc_in [n] = m_acco_rmx12[2];
-	  else if ( where < m_acco_ee12[5] ) z_loc_in [n] = m_acco_rmx12[4];
-	  else if ( where < m_acco_ee12[6] ) z_loc_in [n] = m_acco_rmx12[5];
-	  else z_loc_in[n] = m_acco_rmx12[6];
-	}
-
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  if (n<53) z_loc_out[n] = m_acco_rmx23[n];
-	  else z_loc_out[n] = m_acco_rmx23[52];
-	  // this is wrong for the last 3 channels (z edge) !
-	}
-      }
-
-      else if ( samp == 3) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0. );
-	z_loc_out.resize( m_n_depth_em [i], (double) 0. );
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  z_loc_out[n] =  m_accg_rout_ac;
-	      // this is wrong for the last 2 channels (z edge) !
-	  if (2*n<52) z_loc_in[n] = 
-			(m_acco_rmx23[2*n]+m_acco_rmx23[2*n+1])/2.;
-	  else z_loc_in[n] = m_acco_rmx23[52];          
-	}
-      }
-    }
-
-    // EMEC-OW  : numbers are from RD
-
-    if ( barrel_ec == 2 )  {
-
-      if ( samp == 0 ) {
-	m_n_depth_em [i] = 1;
-	z_loc_in.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_out.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_in [0] = m_emec_psin;
-	z_loc_out [0] = m_endg_zorig;
-      }
-
-      if ( samp == 1 ) {
-	m_n_depth_em [i] = 1;
-      z_loc_in.resize( m_n_depth_em [i] , (double) 0.);
-      z_loc_out.resize( m_n_depth_em [i] , (double) 0.);
-      z_loc_in [0] = m_endg_zorig;
-      z_loc_out [0] = m_esep_zsep12;
-      }
-
-      if ( samp == 2 && region == 0 ) {
-	m_n_depth_em [i] = 1;
-	z_loc_in.resize( m_n_depth_em [i] );
-	z_loc_out.resize( m_n_depth_em [i] );
-	z_loc_in [0] = m_esep_zsep12;
-	z_loc_out [0] = m_emec_out;
-      }
-
-      if ( samp == 2 && region != 0 ) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_out.resize( m_n_depth_em [i], (double) 0.);
-	for (int n=0; n<3; n++) {
-	  z_loc_in [n] = m_esep_zsep12;
-	  z_loc_out [n] = m_emec_out;
-	}
-	for (int n=3; n<m_n_depth_em [i]; n++) {
-	  z_loc_in [n] = m_esep_zsep12;
-	  int num = (n-3)/2;
-	  if (num<20) z_loc_out [n] = m_esep_zsep23[num+2];
-	  else z_loc_out [n] = m_esep_zsep23[22];
-	}
-      }
-
-      if ( samp == 3 ) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_out.resize( m_n_depth_em [i], (double) 0.);
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  z_loc_out [n] = m_emec_out;
-	  if (n<20) z_loc_in [n] = m_esep_zsep23[n+2];
-	  else z_loc_in [n] = m_esep_zsep23[22];
-	}
-      }
-    }
-
-    // EMEC-IW
-
-    if ( barrel_ec == 3 )  {
-
-      if ( samp == 1 ) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_out.resize( m_n_depth_em [i], (double) 0.);
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  z_loc_in [n] = m_endg_zorig;
-	  if (n<7) z_loc_out [n] = m_esep_iw23[n];
-	  else z_loc_out [n] = m_esep_iw23[6];
-	}
-      }
-      else if ( samp == 2 ) {
-	m_n_depth_em [i] =  m_n_eta_em [i];
-	z_loc_in.resize( m_n_depth_em [i], (double) 0.);
-	z_loc_out.resize( m_n_depth_em [i], (double) 0.);
-	for (int n=0; n<m_n_depth_em [i]; n++) {
-	  if (n<7) z_loc_in [n] = m_esep_iw23[n];
-	  else z_loc_in [n] = m_esep_iw23[6];
-	  z_loc_out [n] = m_emb_iwout;
-	}
-      }
-    }
-
-    // That's it : store result in official arrays 
-    m_depth_em_in [i] = z_loc_in ;
-    m_depth_em_out [i] = z_loc_out;
-
-  }
-  //std::cout << "LArNumberHelper::hard_em finished " << std::endl;
-
-}
-
-void  
-LArNumberHelper::hard_hec()
-{
-
-  // Numbers are taken from DB, but still have to define which ones are used
-  // for what !
-
-  std::vector <double> z_loc_in;
-  std::vector <double> z_loc_out;
-
-  for ( unsigned int i=0; i < m_hec_id->region_hash_max(); i++ ) {
-
-    int samp = m_hec_id->sampling (m_region_id_hec[i]);
-    //int region = m_hec_id->region (m_region_id_hec[i]);
-    //int pos_neg = m_hec_id->pos_neg (m_region_id_hec[i]);
-
-    m_n_depth_hec [i] = 1;
-    z_loc_in.resize( 1, (double) 0.);
-    z_loc_out.resize( 1, (double) 0.);
-
-    if      ( samp == 0 ) {
-      z_loc_in [0] = m_hec_in0;
-      z_loc_out [0] = m_hec_in1;
-
-    }
-    else if ( samp == 1 ) {
-      z_loc_in [0] = m_hec_in1;
-      z_loc_out [0] = m_hec_in2-m_hec_gap;
-
-    }
-    else if ( samp == 2 ) {
-      z_loc_in [0] = m_hec_in2;
-      z_loc_out [0] = m_hec_in3;
-
-    }
-    else if ( samp == 3 ) {
-      z_loc_in [0] = m_hec_in3;
-      z_loc_out [0] = m_hec_out;
-    }
-
-    // that's it :
-    m_depth_hec_in [i] = z_loc_in ;
-    m_depth_hec_out [i] = z_loc_out;
-  }
-}
-
-void  
-LArNumberHelper::hard_fcal()
-{
-
-  // Numbers are taken from DB, but still have to define which ones are used
-  // for what !
-
-  std::vector <double> z_loc_in;
-  z_loc_in.resize( 1, (double) 0.);
-  std::vector <double> z_loc_out;
-  z_loc_out.resize( 1, (double) 0.);
-
-  // x and y are taken from drawings in the TDR
-  for ( unsigned int i=0; i < m_fcal_id->module_hash_max(); i++ ) {
-    m_x_min_fcal [i] = 8.6*Gaudi::Units::cm;
-    m_x_max_fcal [i] = 47.5*Gaudi::Units::cm;
-    m_y_min_fcal [i] = 8.6;
-    m_y_max_fcal [i] = 47.5*Gaudi::Units::cm;
-    m_phi_min_fcal[i] = 0.;
-    m_phi_max_fcal[i] = 6.28;   // when too close to 2pi pb
-
-    m_n_depth_fcal [i] = 1;
-    
-    int mod = m_fcal_id->module (m_region_id_fcal[i]);
-    //int pos_neg = m_fcal_id->pos_neg (m_region_id_fcal[i]);
-    
-    if ( mod == 1 ) {
-      m_dx_fcal [i] = 3.*Gaudi::Units::cm;
-      m_dy_fcal [i] = 2.598*Gaudi::Units::cm;
-      z_loc_in [0] = 466.85*Gaudi::Units::cm;
-      z_loc_out [0] = z_loc_in [0]+45.*Gaudi::Units::cm;
-
-    }
-    else if ( mod == 2 ) {
-      m_dx_fcal [i] = 3.272*Gaudi::Units::cm;
-      m_dy_fcal [i] = 4.25*Gaudi::Units::cm;
-      z_loc_in [0] = 512.3*Gaudi::Units::cm;
-      z_loc_out [0] = z_loc_in [0]+45.*Gaudi::Units::cm;
-
-    }
-    else if ( mod == 3 ) {
-      m_dx_fcal [i] = 5.4*Gaudi::Units::cm;
-      m_dy_fcal [i] = 4.677*Gaudi::Units::cm;
-      z_loc_in [0] = 559.75*Gaudi::Units::cm;
-      z_loc_out [0] = z_loc_in [0]+45.*Gaudi::Units::cm;
-
-    }
-    else  {
-      m_dx_fcal [i] = 0.;
-      m_dy_fcal [i] = 0.;
-      z_loc_in [0] = 0.;
-      z_loc_out [0] = z_loc_in [0]+45.*Gaudi::Units::cm;
-    }
-
-    m_z_min_fcal [i] = z_loc_in [0];
-    m_z_max_fcal [i] = m_z_min_fcal [i] + 45.*Gaudi::Units::cm ;
-
-    double z = m_z_min_fcal [i];
-    double r = m_x_max_fcal [i];
-    m_eta_min_fcal[i] = -log(tan(atan2(r,z)/2));
-    z = m_z_max_fcal [i];
-    r = m_x_min_fcal [i];
-    m_eta_max_fcal[i] = -log(tan(atan2(r,z)/2));
-
-    m_depth_fcal_in [i] =  z_loc_in ;
-    m_depth_fcal_out [i] = z_loc_out;
-    
-  }
-}
-
-// Parameters needed for sagging
-void   
-LArNumberHelper::sagging_param( std::vector<double>& Rhocen, std::vector<double>& Sag )
-{
-  Rhocen.clear();
-  Sag.clear();
-
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelGeometry",m_tag,m_node);
-  
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_0")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_1")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_2")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_3")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_4")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_5")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_6")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_7")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_8")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_9")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_10")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_11")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_12")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_13")*Gaudi::Units::cm);
-    Rhocen.push_back(m_rec->getDouble("RHOCEN_14")*Gaudi::Units::cm);
-  }
- 
-  m_lar = m_iAccessSvc->getRecordsetPtr("BarrelSagging",m_tag,m_node);
-  
-  if (m_lar->size()) {
-    m_rec = (*m_lar)[0];
-
-    Sag.push_back(m_rec->getDouble("SAG_0")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_1")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_2")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_3")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_4")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_5")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_6")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_7")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_8")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_9")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_10")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_11")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_12")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_13")*Gaudi::Units::cm);
-    Sag.push_back(m_rec->getDouble("SAG_14")*Gaudi::Units::cm);
-
-  }
-
-}
-
-Identifier  
-LArNumberHelper::region_id_em(int i)
-{ return m_region_id_em[i]; }
-
-int  
-LArNumberHelper::n_eta_em(int i)
-{ return m_n_eta_em[i]; }
-
-int  
-LArNumberHelper::n_phi_em(int i)
-{ return m_n_phi_em[i]; }
-
-double  
-LArNumberHelper::deta_em(int i)
-{ return m_deta_em[i]; }
-
-double  
-LArNumberHelper::dphi_em(int i)
-{ return m_dphi_em[i]; }
-
-int     
-LArNumberHelper::sign_em(int i)
-{ return m_sign_em[i]; }
-
-double  
-LArNumberHelper::eta_min_em(int i)
-{ return m_eta_min_em[i]; }
-
-double  
-LArNumberHelper::eta_max_em(int i)
-{ return m_eta_max_em[i]; }
-
-double  
-LArNumberHelper::phi_min_em(int i)
-{ return m_phi_min_em[i]; }
-
-double  
-LArNumberHelper::phi_max_em(int i)
-{ return m_phi_max_em[i]; }
-
-int   
-LArNumberHelper::n_depth_em(int i)
-{ return m_n_depth_em[i]; }
-
-double   
-LArNumberHelper::depth_em_in(int i, int j)
-{ return m_depth_em_in[i][j]; }
-
-double   
-LArNumberHelper::depth_em_out(int i, int j)
-{ return m_depth_em_out[i][j]; }
-
-Identifier      
-LArNumberHelper::region_id_hec(int i)
-{ return m_region_id_hec[i]; }
-
-int   
-LArNumberHelper::n_eta_hec(int i)
-{ return m_n_eta_hec[i]; }
-
-int   
-LArNumberHelper::n_phi_hec(int i)
-{ return m_n_phi_hec[i]; }
-
-double  
-LArNumberHelper::deta_hec(int i)
-{ return m_deta_hec[i]; }
-
-double   
-LArNumberHelper::dphi_hec(int i)
-{ return m_dphi_hec[i]; }
-
-int    
-LArNumberHelper::sign_hec(int i)
-{ return m_sign_hec[i]; }
-
-double  
-LArNumberHelper::eta_min_hec(int i)
-{ return m_eta_min_hec[i]; }
-
-double   
-LArNumberHelper::eta_max_hec(int i)
-{ return m_eta_max_hec[i]; }
-
-double   
-LArNumberHelper::phi_min_hec(int i)
-{ return m_phi_min_hec[i]; }
-
-double  
-LArNumberHelper::phi_max_hec(int i)
-{ return m_phi_max_hec[i]; }
-
-int      
-LArNumberHelper::n_depth_hec(int i)
-{ return m_n_depth_hec[i]; }
-
-double   
-LArNumberHelper::depth_hec_in(int i, int j)
-{ return m_depth_hec_in[i][j]; }
-
-double   
-LArNumberHelper::depth_hec_out(int i, int j)
-{ return m_depth_hec_out[i][j]; }
-
-Identifier    
-LArNumberHelper::region_id_fcal(int i)
-{ return m_region_id_fcal[i]; }
-
-int  
-LArNumberHelper::n_eta_fcal(int i)
-{ return m_n_eta_fcal[i]; }
-
-int   
-LArNumberHelper::n_phi_fcal(int i)
-{ return m_n_phi_fcal[i]; }
-
-double   
-LArNumberHelper::deta_fcal(int i)
-{ return m_deta_fcal[i]; }
-
-double   
-LArNumberHelper::dphi_fcal(int i)
-{ return m_dphi_fcal[i]; }
-
-int      
-LArNumberHelper::sign_fcal(int i)
-{ return m_sign_fcal[i]; }
-
-double     
-LArNumberHelper::x_min_fcal(int i)
-{ return m_x_min_fcal[i]; }
-
-double     
-LArNumberHelper::x_max_fcal(int i)
-{ return m_x_max_fcal[i]; }
-
-double   
-LArNumberHelper::dx_fcal(int i)
-{ return m_dx_fcal[i]; }
-
-double     
-LArNumberHelper::y_min_fcal(int i)
-{ return m_y_min_fcal[i]; }
-
-double     
-LArNumberHelper::y_max_fcal(int i)
-{ return m_y_max_fcal[i]; }
-
-double   
-LArNumberHelper::dy_fcal(int i)
-{ return m_dy_fcal[i]; }
-
-double     
-LArNumberHelper::z_min_fcal(int i)
-{ return m_z_min_fcal[i]; }
-
-double     
-LArNumberHelper::z_max_fcal(int i)
-{ return m_z_max_fcal[i]; }
-
-double  
-LArNumberHelper::eta_min_fcal(int i)
-{ return m_eta_min_fcal[i]; }
-
-double  
-LArNumberHelper::eta_max_fcal(int i)
-{ return m_eta_max_fcal[i]; }
-
-double  
-LArNumberHelper::phi_min_fcal(int i)
-{ return m_phi_min_fcal[i]; }
-
-double  
-LArNumberHelper::phi_max_fcal(int i)
-{ return m_phi_max_fcal[i]; }
-
-int   
-LArNumberHelper::n_depth_fcal(int i)
-{ return m_n_depth_fcal[i]; }
-
-double   
-LArNumberHelper::depth_fcal_in(int i, int j)
-{ return m_depth_fcal_in[i][j]; }
-
-double   
-LArNumberHelper::depth_fcal_out(int i, int j)
-{ return m_depth_fcal_out[i][j]; }
diff --git a/LArCalorimeter/LArDetDescr/src/LArRecoMaterialTool.cxx b/LArCalorimeter/LArDetDescr/src/LArRecoMaterialTool.cxx
index 94b6277869a..dee1c566cd9 100755
--- a/LArCalorimeter/LArDetDescr/src/LArRecoMaterialTool.cxx
+++ b/LArCalorimeter/LArDetDescr/src/LArRecoMaterialTool.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
 */
 
 // ***************************************************************************
@@ -22,7 +22,6 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/CaloDM_ID.h"
 
@@ -46,10 +45,8 @@ LArRecoMaterialTool::LArRecoMaterialTool(const std::string& type,
 StatusCode
 LArRecoMaterialTool::initialize()
 {
-  // Retrieve the Id helpers needed    
-  const CaloIdManager* mgr = CaloIdManager::instance();
-  m_calo_id = mgr->getCaloCell_ID();
-  m_dm_id = mgr->getDM_ID();
+  ATH_CHECK( detStore()->retrieve (m_calo_id, "CaloCell_ID") );
+  ATH_CHECK( detStore()->retrieve (m_dm_id,   "CaloDM_ID") );
   
   // These vectors will contain the results :
   m_alignvol_number.resize(0);
diff --git a/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx b/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx
index 7fd73c48e24..7d6d4765597 100755
--- a/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx
+++ b/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.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
 */
 
 // ***************************************************************************
@@ -12,11 +12,9 @@
 #include "GaudiKernel/Property.h"
 #include "GaudiKernel/IService.h"
 #include "GaudiKernel/IToolSvc.h"
-#include "StoreGate/StoreGate.h"
 #include "StoreGate/StoreGateSvc.h"
 #include <vector>
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloDetDescr/CaloDetDescriptor.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
 
@@ -52,9 +50,7 @@ StatusCode
 LArRecoSimpleGeomTool::initialize()
 {
   // Retrieve the Id helpers needed    
-  const CaloIdManager* mgr = CaloIdManager::instance();
-  m_calo_id = mgr->getCaloCell_ID();
-
+  ATH_CHECK( detStore()->retrieve (m_calo_id, "CaloCell_ID") );
   
   // Decode tag ( via GeoModel ) and fix it for TestBeam :
   m_tag = "ATLAS-00";
-- 
GitLab


From 2b2aebc04e72a79af0ec53352728a52cf3664e77 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:21:47 +0100
Subject: [PATCH 289/404] LArROD: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.

Also migrate several components to using handles; clean up error handling
and logging.
---
 .../LArROD/LArROD/LArRawChannelBuilder.h      |  22 +-
 .../LArROD/LArRawChannelSimpleBuilder.h       |  24 +-
 LArCalorimeter/LArROD/LArROD/ReadLArDigits.h  |   6 +-
 .../LArROD/src/LArCellBuilderDriver.cxx       |   1 -
 .../LArROD/src/LArRawChannelBuilder.cxx       | 319 +++++++-----------
 .../LArRawChannelBuilderADC2EConstants.cxx    |  13 +-
 .../src/LArRawChannelBuilderADC2EDataBase.cxx |   3 +-
 .../src/LArRawChannelBuilderToolAverage.cxx   |  19 +-
 .../src/LArRawChannelBuilderToolCubic.cxx     |   9 +-
 .../src/LArRawChannelBuilderToolParabola.cxx  |  16 +-
 .../LArROD/src/LArRawChannelSimpleBuilder.cxx | 213 +++++-------
 .../LArROD/src/LArSuperCellBuilderDriver.cxx  |   1 -
 LArCalorimeter/LArROD/src/ReadLArDigits.cxx   | 175 +++-------
 LArCalorimeter/LArROD/src/ReadLArRaw.cxx      |  68 ++--
 14 files changed, 342 insertions(+), 547 deletions(-)

diff --git a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilder.h b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilder.h
index 696acfe4a17..e963dd647fb 100644
--- a/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilder.h
+++ b/LArCalorimeter/LArROD/LArROD/LArRawChannelBuilder.h
@@ -18,27 +18,30 @@
 #define LARRAWCHANNELBUILDER
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "LArElecCalib/ILArOFCTool.h"
 #include "LArElecCalib/ILArADC2MeVTool.h"
 #include "LArElecCalib/ILArHVCorrTool.h"
 #include "LArCabling/LArOnOffIdMapping.h"
-
+#include "LArRawEvent/LArDigitContainer.h"
+#include "TBEvent/TBPhase.h"
 #include "LArRawEvent/LArRawChannelContainer.h"
 
 #include "LArIdentifier/LArOnlineID.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 class LArRawChannelBuilder : public AthAlgorithm
 {
 
 public:
   LArRawChannelBuilder (const std::string& name, ISvcLocator* pSvcLocator);
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
 
 private:
   //Services & Tools 
@@ -50,8 +53,13 @@ private:
   //LArRawOrdering m_larRawOrdering; 
 
 
-  //Algo-properties 
-  std::string m_DataLocation, m_ChannelContainerName;
+  //Algo-properties
+  SG::ReadHandleKey<LArDigitContainer> m_dataLocation
+    { this, "DataLocation", "FREE", "" };
+  SG::ReadHandleKey<TBPhase> m_tbPhaseLocation
+    { this, "TBPhaseLocation", "TBPhase", "" };
+  SG::WriteHandleKey<LArRawChannelContainer> m_ChannelContainerName
+    { this, "LArRawChannelContainerName", "LArRawChannels", "" };
   bool m_useTDC, m_useOFCTool;
   float m_Ecut;
   int m_initialTimeSampleShift;
diff --git a/LArCalorimeter/LArROD/LArROD/LArRawChannelSimpleBuilder.h b/LArCalorimeter/LArROD/LArROD/LArRawChannelSimpleBuilder.h
index a33bc46ec72..021c8ca6d8d 100644
--- a/LArCalorimeter/LArROD/LArROD/LArRawChannelSimpleBuilder.h
+++ b/LArCalorimeter/LArROD/LArROD/LArRawChannelSimpleBuilder.h
@@ -14,9 +14,10 @@
 #ifndef LARRAWCHANNELSIMPLEBUILDER
 #define LARRAWCHANNELSIMPLEBUILDER
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "LArRawEvent/LArRawChannelContainer.h"
+#include "LArRawEvent/LArDigitContainer.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "CaloIdentifier/LArFCAL_ID.h"
 #include "CaloIdentifier/LArHEC_ID.h"
@@ -24,19 +25,22 @@
 #include "LArRecUtils/LArParabolaPeakRecoTool.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
 
 class LArRawChannelContainer;
 
 
-class LArRawChannelSimpleBuilder : public AthAlgorithm
+class LArRawChannelSimpleBuilder : public AthReentrantAlgorithm
 {
 
 public:
 
   LArRawChannelSimpleBuilder (const std::string& name, ISvcLocator* pSvcLocator);
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode finalize() override;
+
 
 private:
   //Services & Tools 
@@ -50,7 +54,10 @@ private:
   ToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool;
   
   //Algo-properties
-  std::string m_DataLocation, m_ChannelContainerName;
+  SG::ReadHandleKey<LArDigitContainer> m_DataLocation
+    { this, "DataLocation", "FREE", "" };
+  SG::WriteHandleKey<LArRawChannelContainer> m_ChannelContainerName
+    { this, "LArRawChannelContainerName", "LArRawChannels", "" };
   int m_imaxSamp;
   std::string m_mode;
   std::string m_FCALmodeTime;
@@ -65,12 +72,7 @@ private:
   float m_ADCtoMeVEMECOuter[4];
   float m_ADCtoMeVEMB[4];
   
-  //Private Member functions:
-  void sortChannels(LArRawChannelContainer* container) ;
- 
   unsigned int m_iPedestal;
-  LArRawChannelContainer* m_larRawChannelContainer;
-
 };
 
 #endif
diff --git a/LArCalorimeter/LArROD/LArROD/ReadLArDigits.h b/LArCalorimeter/LArROD/LArROD/ReadLArDigits.h
index e96d1af282e..085c2494be5 100644
--- a/LArCalorimeter/LArROD/LArROD/ReadLArDigits.h
+++ b/LArCalorimeter/LArROD/LArROD/ReadLArDigits.h
@@ -17,7 +17,8 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/MsgStream.h"
-#include  "StoreGate/StoreGateSvc.h"
+#include "StoreGate/StoreGateSvc.h"
+#include "StoreGate/ReadHandleKey.h"
 #include "LArRawEvent/LArDigitContainer.h"
 #include "CaloIdentifier/LArEM_ID.h"
 #include "GaudiKernel/INTupleSvc.h"
@@ -47,7 +48,8 @@ class ReadLArDigits : public AthAlgorithm
   const LArEM_ID* m_emId;
   const LArOnlineID* m_onlineHelper;
   std::ofstream m_outfile;
-  std::string m_containerKey;
+  SG::ReadHandleKey<LArDigitContainer> m_containerKey
+    { this, "ContainerKey", "FREE", "" };
   std::string m_dumpFile;
   bool m_printCellLoc;
   bool m_printFebChan;
diff --git a/LArCalorimeter/LArROD/src/LArCellBuilderDriver.cxx b/LArCalorimeter/LArROD/src/LArCellBuilderDriver.cxx
index cdb7c4d3057..9dc48ae19e3 100644
--- a/LArCalorimeter/LArROD/src/LArCellBuilderDriver.cxx
+++ b/LArCalorimeter/LArROD/src/LArCellBuilderDriver.cxx
@@ -12,7 +12,6 @@
 
 #include "LArRawEvent/LArDigitContainer.h"
 #include "LArRawEvent/LArRawChannelContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "Identifier/Identifier.h"
 
 #include "CLHEP/Units/SystemOfUnits.h"
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilder.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilder.cxx
index 44a18b97854..7e51d2cf138 100644
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilder.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilder.cxx
@@ -17,6 +17,8 @@
 #include "LArElecCalib/ILArFEBTimeOffset.h"
 #include "CLHEP/Units/SystemOfUnits.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
 
 #include <math.h>
 
@@ -32,8 +34,6 @@ LArRawChannelBuilder::LArRawChannelBuilder (const std::string& name, ISvcLocator
   m_hvCorrTool("LArHVCorrTool"),
   m_onlineHelper(NULL),
   //m_roiMap("LArRoI_Map"),
-  m_DataLocation("FREE"),
-  m_ChannelContainerName("LArRawChannels"),
   m_useTDC(false),
   m_useOFCTool(false),
   m_Ecut(256*MeV),
@@ -63,8 +63,6 @@ LArRawChannelBuilder::LArRawChannelBuilder (const std::string& name, ISvcLocator
   , m_shapesKey("LArShape")
  {
    //m_useIntercept={false,false,false,false};
- declareProperty("LArRawChannelContainerName",m_ChannelContainerName);
- declareProperty("DataLocation",              m_DataLocation );
  declareProperty("UseTDC",                    m_useTDC);
  declareProperty("UseOFCTool",                m_useOFCTool);
  declareProperty("Ecut",                      m_Ecut);
@@ -95,45 +93,29 @@ LArRawChannelBuilder::LArRawChannelBuilder (const std::string& name, ISvcLocator
 }
 
 
-StatusCode LArRawChannelBuilder::initialize(){
-
-  MsgStream log(msgSvc(), name());
-
-  StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
-    return StatusCode::FAILURE;
-  }
+StatusCode LArRawChannelBuilder::initialize()
+{
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
 
   if (m_useOFCTool) {
-    sc = m_OFCTool.retrieve();
-    if (sc.isFailure()) {
-      log << MSG::ERROR << "Unable to find tool for LArOFCTool" << endmsg;
-      return StatusCode::FAILURE;
-    }
-  }
-
-  sc = m_adc2mevTool.retrieve();
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Unable to find tool for LArADC2MeV" << endmsg;
-    return StatusCode::FAILURE;
+    ATH_CHECK( m_OFCTool.retrieve() );
   }
+  ATH_CHECK( m_adc2mevTool.retrieve() );
+  
+  // ***
   
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
   if (!m_emId) {
-    log << MSG::ERROR << "Could not get lar EM ID helper" << endmsg;
+    ATH_MSG_ERROR( "Could not get lar EM ID helper"  );
     return StatusCode::FAILURE;
   }
   
   ATH_CHECK( m_cablingKey.initialize() );
 
   if (m_hvcorr) {
-    sc = m_hvCorrTool.retrieve();
-    if (sc.isFailure()) {
-      log << MSG::ERROR << "Unable to find tool for LArHVCorrTool" << endmsg;
-      return StatusCode::FAILURE;
-    }
+    ATH_CHECK( m_hvCorrTool.retrieve() );
   }
 
 
@@ -177,21 +159,23 @@ StatusCode LArRawChannelBuilder::initialize(){
     m_SamplingPeriodeLowerLimit = 0;
   }
 
-  log << MSG::DEBUG << "Number of OFC time bins per sampling periode=" << m_NOFCTimeBins << endmsg;
-  log << MSG::DEBUG << "Sampling Periode=" << m_SamplingPeriode << "ns" << endmsg;
-  log << MSG::DEBUG << "Sampling Periode Limits: (" << m_SamplingPeriodeLowerLimit
-      << "," << m_SamplingPeriodeUpperLimit << ") ns" << endmsg;
+  ATH_MSG_DEBUG( "Number of OFC time bins per sampling periode=" << m_NOFCTimeBins  );
+  ATH_MSG_DEBUG( "Sampling Periode=" << m_SamplingPeriode << "ns"  );
+  ATH_MSG_DEBUG( "Sampling Periode Limits: (" << m_SamplingPeriodeLowerLimit
+                 << "," << m_SamplingPeriodeUpperLimit << ") ns"  );
+
+  ATH_CHECK( m_dataLocation.initialize() );
+  ATH_CHECK( m_tbPhaseLocation.initialize(m_useTDC) );
+  ATH_CHECK( m_ChannelContainerName.initialize() );
 
   return StatusCode::SUCCESS;
 }
 
 
 
-StatusCode LArRawChannelBuilder::execute() 
+StatusCode LArRawChannelBuilder::execute()
 {
-  MsgStream log(msgSvc(), name());
-  StatusCode sc;
-  
+  const EventContext& ctx = Gaudi::Hive::currentContext();
   //Counters for errors & warnings per event
   int noEnergy   = 0; // Number of completly failed channels in a given event
   int BadTiming  = 0; // Number of channels with bad timing in a given event
@@ -201,8 +185,6 @@ StatusCode LArRawChannelBuilder::execute()
   int highE      = 0; // Number of channels with 'high' (above threshold) energy in a given event 
   int saturation = 0; // Number of saturating channels in a given event   
   
-  //Pointer to input data container
-  const LArDigitContainer* digitContainer=NULL;//Pointer to LArDigitContainer
   //const TBPhase* theTBPhase; //Pointer to Testbeam TDC-Phase object (if needed)
   float PhaseTime=0;                //Testbeam TDC phase (if needed)
   float globalTimeOffset=0;
@@ -220,53 +202,31 @@ StatusCode LArRawChannelBuilder::execute()
     return StatusCode::FAILURE;
   }
 
-  sc=evtStore()->retrieve(digitContainer,m_DataLocation);
-  if(sc.isFailure()) {
-    log << MSG::ERROR << "Can't retrieve LArDigitContainer with key " <<m_DataLocation << "from StoreGate." << endmsg;
-    return StatusCode::FAILURE;
-  }
+  //Pointer to input data container
+  SG::ReadHandle<LArDigitContainer> digitContainer (m_dataLocation, ctx);
   
   //Retrieve calibration data
-  sc=detStore()->retrieve(larPedestal,m_pedestalKey);
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Can't retrieve LArPedestal from Conditions Store " << m_pedestalKey << endmsg;
-    return StatusCode::FAILURE;
-  }
-  
-  sc=detStore()->retrieve(larShape,m_shapesKey);
-  if (sc.isFailure()) {
-    log << MSG::WARNING << "Can't retrieve LArShape from Conditions Store" << std::endl
-	<< "Quality factor will not be caluclated." << endmsg;
-    larShape=NULL;
-  }
-  log << MSG::DEBUG << "Retrieving LArOFC object" << endmsg;
-  if (!m_useOFCTool) {  //OFC-Conditons object only needed if OFC's not computed on-the-fly
-    sc=detStore()->retrieve(larOFC);
-    if (sc.isFailure()) {
-      log << MSG::ERROR << "Can't retrieve LArOFC from Conditions Store" << endmsg;
-      return StatusCode::FAILURE;
-    }
+  ATH_CHECK( detStore()->retrieve(larPedestal,m_pedestalKey) );
+  ATH_CHECK( detStore()->retrieve(larShape,m_shapesKey) );
+  ATH_MSG_DEBUG( "Retrieving LArOFC object"  );
+  if (!m_useOFCTool) {  //OFC-Conditions object only needed if OFC's not computed on-the-fly
+    ATH_CHECK( detStore()->retrieve(larOFC) );
   }
 
   //retrieve TDC
   if (m_useTDC) { //All this timing business is only necessary if the readout and the beam are not in phase (Testbeam)
-    const TBPhase* theTBPhase;
     const ILArGlobalTimeOffset* larGlobalTimeOffset;
-    sc = evtStore()->retrieve(theTBPhase,"TBPhase");
-    if (sc.isFailure()) {
-      log << MSG::ERROR << "cannot allocate TBPhase with key <TBPhase>"<< endmsg;
-      //return StatusCode::FAILURE;
-      return StatusCode::SUCCESS;
-    }
+    SG::ReadHandle<TBPhase> theTBPhase (m_tbPhaseLocation, ctx);
+
     //Get Phase in nanoseconds
     PhaseTime = theTBPhase->getPhase();
     // ###
     if (m_phaseInv) PhaseTime = m_SamplingPeriode - PhaseTime ;
-    log << MSG::DEBUG << " *** Phase = " << PhaseTime << endmsg;
+    ATH_MSG_DEBUG( " *** Phase = " << PhaseTime  );
     // ###
     
     //Get Global Time Offset
-    sc=detStore()->retrieve(larGlobalTimeOffset);
+    StatusCode sc=detStore()->retrieve(larGlobalTimeOffset);
     if (sc.isSuccess()) globalTimeOffset = larGlobalTimeOffset->TimeOffset();
 
     //Get FEB time offset
@@ -275,28 +235,17 @@ StatusCode LArRawChannelBuilder::execute()
   }
 
 
-  LArRawChannelContainer* larRawChannelContainer=new LArRawChannelContainer();
+  auto larRawChannelContainer = std::make_unique<LArRawChannelContainer>();
   larRawChannelContainer->reserve(digitContainer->size());
-  sc = evtStore()->record(larRawChannelContainer,m_ChannelContainerName);
-  if(sc.isFailure()) {
-    log << MSG::ERROR << "Can't record LArRawChannelContainer in StoreGate" << endmsg;
-  }
 
   // Average number of LArDigits per event
   m_nEvents++;
   m_aveChannels += digitContainer->size();
 
-  bool verbosePrint=false;
-  if (log.level() <= MSG::VERBOSE) verbosePrint=true;
-  bool debugPrint=false;
-  if (log.level() <= MSG::DEBUG) debugPrint=true;
-
   // Now all data is available, start loop over Digit Container
-  LArDigitContainer::const_iterator cont_it=digitContainer->begin();
-  LArDigitContainer::const_iterator cont_it_e=digitContainer->end();
   int ntot_raw=0;
 
-  for (;cont_it!=cont_it_e;cont_it++) {
+  for (const LArDigit* digit : *digitContainer) {
 
     //Data that goes into RawChannel:
     float energy=0;
@@ -307,23 +256,23 @@ StatusCode LArRawChannelBuilder::execute()
     int timeSampleShift=m_initialTimeSampleShift;
 
     //Get data from LArDigit
-    const std::vector<short>& samples=(*cont_it)->samples();
+    const std::vector<short>& samples=digit->samples();
     const unsigned nSamples=samples.size(); 
-    const HWIdentifier chid=(*cont_it)->channelID();
-    const CaloGain::CaloGain gain=(*cont_it)->gain();
+    const HWIdentifier chid=digit->channelID();
+    const CaloGain::CaloGain gain=digit->gain();
     
     // to be used in case of DEBUG output
     int layer  = -99999 ;
     int eta    = -99999 ; 
     int phi    = -99999 ; 
     int region = -99999 ;    
-    if (debugPrint) {
+    if (msgLvl (MSG::DEBUG)) {
       Identifier id ;
       try {
         id = cabling->cnvToIdentifier(chid);
       } catch ( LArID_Exception & except ) {
-        log << MSG::DEBUG << "A Cabling exception was caught for channel 0x!" 
-  	    << MSG::hex << chid.get_compact() << MSG::dec << endmsg;
+        ATH_MSG_DEBUG( "A Cabling exception was caught for channel 0x!" 
+                       << MSG::hex << chid.get_compact() << MSG::dec  );
         continue ;
       }
       layer  = m_emId->sampling(id);
@@ -344,14 +293,14 @@ StatusCode LArRawChannelBuilder::execute()
       }
     }
     if ( nSatur>-1 ) {
-      if (debugPrint)log << MSG::DEBUG << "Saturation on channel 0x" << MSG::hex << chid.get_compact() << MSG::dec ;         
+      if (msgLvl (MSG::DEBUG))msg() << MSG::DEBUG << "Saturation on channel 0x" << MSG::hex << chid.get_compact() << MSG::dec ;         
       saturation++;
     }
     if ( m_skipSaturCells && nSatur>-1 ) {
-      log << ". Skipping channel." << endmsg; 
+      msg() << ". Skipping channel." << endmsg; 
       continue; // Ignore this cell, saturation on at least one sample
     } else if ( nSatur>-1 ) {
-      log << "." << endmsg;
+      msg() << "." << endmsg;
     }   
     
     //Get conditions data for this channel:
@@ -361,18 +310,13 @@ StatusCode LArRawChannelBuilder::execute()
     float pedestalAverage;
     if (pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
       if( m_pedestalFallbackMode >= 1 ) {
-        if (debugPrint) {
-         log << MSG::DEBUG << "No pedestal found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-              << " Gain " << gain <<".  Using time sample " << m_iPedestal << endmsg;
-        }
+        ATH_MSG_DEBUG( "No pedestal found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                       << " Gain " << gain <<".  Using time sample " << m_iPedestal  );
         pedestalAverage=samples[m_iPedestal];
       } else {              
-        if (debugPrint) {
-	  log << MSG::DEBUG << noEnergy << ". No pedestal found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-              //<< " Gain " << gain << ". Skipping channel." << endmsg;
-              << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
-	      << " Gain = " << gain << ". Skipping channel." << endmsg;
-        }
+        ATH_MSG_DEBUG( noEnergy << ". No pedestal found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                       << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
+                       << " Gain = " << gain << ". Skipping channel."  );
 	noEnergy++;
         continue;
       }
@@ -380,10 +324,8 @@ StatusCode LArRawChannelBuilder::execute()
       if( ( m_pedestalFallbackMode>=2 && gain==CaloGain::LARLOWGAIN )   ||
           ( m_pedestalFallbackMode>=3 && gain==CaloGain::LARMEDIUMGAIN ) ||
           ( m_pedestalFallbackMode>=4 && gain==CaloGain::LARHIGHGAIN )       ) {
-        if (debugPrint) {
-          log << MSG::DEBUG << "Forcing pedestal fallback for  channel 0x" << MSG::hex << chid.get_compact()
-              << MSG::dec   << " Gain=" << gain << ". Using time sample " << m_iPedestal << endmsg;
-        }
+        ATH_MSG_DEBUG( "Forcing pedestal fallback for  channel 0x" << MSG::hex << chid.get_compact()
+                       << MSG::dec   << " Gain=" << gain << ". Using time sample " << m_iPedestal  );
         pedestalAverage=samples[m_iPedestal];
       } else {
         //Assume there is only one pedestal value, even the ILArPedestal object returns a vector<float>
@@ -404,27 +346,27 @@ StatusCode LArRawChannelBuilder::execute()
       if (larFebTimeOffset)
 	febTimeOffset=larFebTimeOffset->TimeOffset(febid);
       double timeShift=PhaseTime+globalTimeOffset+febTimeOffset;
-      if (verbosePrint)
-       log << MSG::VERBOSE << "Channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+      if (msgLvl (MSG::VERBOSE))
+        msg() << MSG::VERBOSE << "Channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
  	   << " phase=" << PhaseTime  << " Feb=" << febTimeOffset 
 	   << " Global=" << globalTimeOffset;
 
       if (m_useOFCPhase) {
 	const double ofcTimeOffset=larOFC->timeOffset(chid,gain);
 	timeShift+=ofcTimeOffset;
-	if (verbosePrint) log << MSG::VERBOSE << " OFC=" << ofcTimeOffset;
+	if (msgLvl (MSG::VERBOSE)) msg() << MSG::VERBOSE << " OFC=" << ofcTimeOffset;
       }
 
-      if (verbosePrint) log << MSG::VERBOSE << " Total=" << timeShift << endmsg;
+      if (msgLvl (MSG::VERBOSE)) msg() << MSG::VERBOSE << " Total=" << timeShift << endmsg;
       
       if (m_allowTimeJump && timeShift >= m_NOFCPhases*m_OFCTimeBin ) {
-	if (verbosePrint) log << MSG::VERBOSE << "Time Sample jump: +1" << endmsg;
+	if (msgLvl (MSG::VERBOSE)) msg() << MSG::VERBOSE << "Time Sample jump: +1" << endmsg;
 	timeSampleShift += 1;
 	//timeShift       -= m_NOFCTimeBins*m_OFCTimeBin ;
 	timeShift       -= m_SamplingPeriode ;
       }
       else if (m_allowTimeJump && timeShift < 0 ) {
-	if (verbosePrint) log << MSG::VERBOSE << "Time Sample jump: -1" << endmsg;
+	ATH_MSG_VERBOSE( "Time Sample jump: -1"  );
 	timeSampleShift -= 1;
 	//timeShift       += m_NOFCTimeBins*m_OFCTimeBin ;
         timeShift       += m_SamplingPeriode ;
@@ -433,16 +375,16 @@ StatusCode LArRawChannelBuilder::execute()
       if (m_allowTimeJump && ( timeShift > m_NOFCPhases*m_OFCTimeBin || timeShift < 0 ) ) {
 	BadTiming++;
 	noEnergy++;
-	log << MSG::ERROR << noEnergy << ". Time offset out of range for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-	    << " Found " << timeShift << ",  expected ( 0 - " << m_NOFCPhases*m_OFCTimeBin << ") ns. Skipping channel." << endmsg;
+	ATH_MSG_ERROR( noEnergy << ". Time offset out of range for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                       << " Found " << timeShift << ",  expected ( 0 - " << m_NOFCPhases*m_OFCTimeBin << ") ns. Skipping channel."  );
 	continue;
       }
       
       if (m_allowTimeJump && timeSampleShift < 0) {
 	BadTiming++;
 	noEnergy++;
-	log << MSG::ERROR << noEnergy << ". Negative time sample (" << timeSampleShift << ") shift for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-	    << " Found. Skipping channel." << endmsg;
+	ATH_MSG_ERROR( noEnergy << ". Negative time sample (" << timeSampleShift << ") shift for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                       << " Found. Skipping channel."  );
 	continue;
       }
 
@@ -454,13 +396,13 @@ StatusCode LArRawChannelBuilder::execute()
       //else 
       //   OFCTimeBin -= 1 ; 
       
-      if (verbosePrint) log << MSG::VERBOSE << "OFC bin width = " << m_OFCTimeBin << " - OFCBin = " << OFCTimeBin << " - timeShift = " << timeShift << endmsg;
+      ATH_MSG_VERBOSE( "OFC bin width = " << m_OFCTimeBin << " - OFCBin = " << OFCTimeBin << " - timeShift = " << timeShift  );
       
       if ( OFCTimeBin < 0 ) {
-        log << MSG::ERROR << "Channel " << MSG::hex << chid.get_compact() << MSG::dec << " asks for OFC bin = " << OFCTimeBin << ". Set to 0." << endmsg;
+        ATH_MSG_ERROR( "Channel " << MSG::hex << chid.get_compact() << MSG::dec << " asks for OFC bin = " << OFCTimeBin << ". Set to 0."  );
         OFCTimeBin=0;
       } else if ( OFCTimeBin >= m_NOFCPhases ) {
-        log << MSG::ERROR << "Channel " << MSG::hex << chid.get_compact() << MSG::dec << " asks for OFC bin = " << OFCTimeBin << ". Set to (NOFCPhases-1) =" << m_NOFCTimeBins-1 << endmsg;
+        ATH_MSG_ERROR( "Channel " << MSG::hex << chid.get_compact() << MSG::dec << " asks for OFC bin = " << OFCTimeBin << ". Set to (NOFCPhases-1) =" << m_NOFCTimeBins-1  );
         OFCTimeBin = m_NOFCPhases-1;
       }
 
@@ -471,21 +413,21 @@ StatusCode LArRawChannelBuilder::execute()
     //Check if we have OFC for this channel and time bin
     if (ofc_a.size()==0) {
       noEnergy++;
-      if (debugPrint) log << MSG::DEBUG << noEnergy << ". No OFC's found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-          << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
-	  << " Time bin = " << OFCTimeBin << ", Gain = " << gain << ". Skipping channel." << endmsg;
+      ATH_MSG_DEBUG( noEnergy << ". No OFC's found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                     << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
+                     << " Time bin = " << OFCTimeBin << ", Gain = " << gain << ". Skipping channel."  );
       continue;
     } 
     if (ofc_a.size()+timeSampleShift>nSamples) {
       BadTiming++;
       noEnergy++;
-      if (debugPrint) {
+      if (msgLvl (MSG::DEBUG)) {
         if (timeSampleShift==0)
-	  log << MSG::DEBUG << "Found LArDigit with " << nSamples << " samples, but OFCs for " 
-	      << ofc_a.size() << " samples. Skipping Channel "<< endmsg;
+	  ATH_MSG_DEBUG( "Found LArDigit with " << nSamples << " samples, but OFCs for " 
+                         << ofc_a.size() << " samples. Skipping Channel " );
         else //have time sample shift
-	  log << MSG::DEBUG << "After time sample shift of " << timeSampleShift << ", " << nSamples-timeSampleShift
-	      << " samples left, but have OFCs for " << ofc_a.size() << " samples. Skipping Channel "<< endmsg;
+	  ATH_MSG_DEBUG( "After time sample shift of " << timeSampleShift << ", " << nSamples-timeSampleShift
+                         << " samples left, but have OFCs for " << ofc_a.size() << " samples. Skipping Channel " );
       }
       continue;
     } 
@@ -495,26 +437,25 @@ StatusCode LArRawChannelBuilder::execute()
     for (unsigned i=0;i<(ofc_a.size());i++) 
       ADCPeak+=(samples[i+timeSampleShift]-pedestalAverage)*ofc_a.at(i);
     
-    if (verbosePrint) log << MSG::VERBOSE << "ADC Height calculated " << ADCPeak << " TimeBin=" << OFCTimeBin  << endmsg;
+    ATH_MSG_VERBOSE( "ADC Height calculated " << ADCPeak << " TimeBin=" << OFCTimeBin   );
      
     //ADC2MeV (a.k.a. Ramp)   
     const std::vector<float>& ramp=m_adc2mevTool->ADC2MEV(chid,gain);
     //Check ramp coefficents
     if (ramp.size()==0) {
       noEnergy++;
-      if (debugPrint) log << MSG::DEBUG << noEnergy << ". No ADC2MeV data found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec
-	  //<< " Gain "<< gain << " Skipping channel." << endmsg;
-          << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
-	  << " Gain = " << gain << ". Skipping channel." << endmsg;
+      ATH_MSG_DEBUG( noEnergy << ". No ADC2MeV data found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec
+                     << " [ Layer = " << layer << " - Eta = " << eta << " - Phi = " << phi << " - Region = " << region << " ]"
+                     << " Gain = " << gain << ". Skipping channel."  );
       continue;
     } 
 
-    // temporalery fix for bad ramps... should be done in the DB
+    // temporary fix for bad ramps... should be done in the DB
     // if(ramp[1]>500 || ramp[1]<0) {
 
     if(ramp[1]>m_ramp_max[gain] || ramp[1]<0) {
       noEnergy++;
-      if (debugPrint) log << MSG::DEBUG << "Bad ramp for channel " << chid << " (ramp[1] = " << ramp[1] << "): skip this channel" << endmsg;
+      ATH_MSG_DEBUG( "Bad ramp for channel " << chid << " (ramp[1] = " << ramp[1] << "): skip this channel"  );
       continue;
     } 
 
@@ -545,14 +486,14 @@ StatusCode LArRawChannelBuilder::execute()
       else 
 	ofc_b=larOFC->OFC_b(chid,gain,OFCTimeBin);
       if (ofc_b.size() != ofc_a.size()) {//don't have proper number of coefficients
-        if (debugPrint) {
+        if (msgLvl (MSG::DEBUG)) {
 	  if (ofc_b.size()==0)
-	    log << MSG::DEBUG << "No time-OFC's found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-	        << " Gain "<< gain << " found. Time not calculated." << endmsg;
+	    ATH_MSG_DEBUG( "No time-OFC's found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                           << " Gain "<< gain << " found. Time not calculated."  );
 	  else
-	    log << MSG::DEBUG << "OFC for time size " << ofc_b.size() 
-                << " not equal to OFC for energy size " << ofc_a.size() 
-                << "   Time not calculated " << endmsg;
+	    ATH_MSG_DEBUG( "OFC for time size " << ofc_b.size() 
+                           << " not equal to OFC for energy size " << ofc_a.size() 
+                           << "   Time not calculated "  );
         }
 	noTime++;
       }else{
@@ -562,7 +503,7 @@ StatusCode LArRawChannelBuilder::execute()
 	// !! Time is now in ns with respect to calibration pulse shape
 	// Used to calculate quality factor
       }
-      if (verbosePrint) log << MSG::VERBOSE << "Time calculated " << time << " TimeBin=" << OFCTimeBin  << endmsg;
+      ATH_MSG_VERBOSE( "Time calculated " << time << " TimeBin=" << OFCTimeBin   );
 
       //Calculate Quality factor
       if (larShape) { //Have shape object
@@ -582,25 +523,25 @@ StatusCode LArRawChannelBuilder::execute()
                id = cabling->cnvToIdentifier(chid); 
                if(m_emId->is_lar_hec(id)) {
                   ihecshift=1;
-                  log << MSG::DEBUG << "Setting firstSample to 1 for HEC channel "<< chid.get_compact() << endmsg;
+                  ATH_MSG_DEBUG( "Setting firstSample to 1 for HEC channel "<< chid.get_compact()  );
                }
           } catch ( LArID_Exception & except ) {
-               log << MSG::DEBUG << "A Cabling exception was caught for channel 0x!"
-                   << MSG::hex << chid.get_compact() << MSG::dec << endmsg;
+                  ATH_MSG_DEBUG( "A Cabling exception was caught for channel 0x!"
+                                 << MSG::hex << chid.get_compact() << MSG::dec );
           }
         }
 	
 	//Check Shape
         if ((shape.size()+m_firstSample+ihecshift) < ofc_a.size()) {
-          if (debugPrint) {
+          if (msgLvl (MSG::DEBUG)) {
 	    if (shape.size()==0) 
-	       log << MSG::DEBUG << "No Shape found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-	   	   << " Gain "<< gain << ". Quality factor not calculated." << endmsg;
+              ATH_MSG_DEBUG( "No Shape found for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                             << " Gain "<< gain << ". Quality factor not calculated."  );
             else
-               log << MSG::DEBUG << "Shape size " << shape.size() 
-                   << "smaller than OFC size " << ofc_a.size() 
-                   << "for channel 0x" << MSG::hex << chid.get_compact() 
-                   << MSG::dec << ". Quality factor not calculated." << endmsg;
+              ATH_MSG_DEBUG( "Shape size " << shape.size() 
+                             << "smaller than OFC size " << ofc_a.size() 
+                             << "for channel 0x" << MSG::hex << chid.get_compact() 
+                             << MSG::dec << ". Quality factor not calculated."  );
           }
 	  quality=0;  //Can't calculate chi^2, assume good hit.
 	  noShape++;
@@ -608,8 +549,8 @@ StatusCode LArRawChannelBuilder::execute()
 	else {//Shape ok
 	  if (time!=0 && shapeDer.size()!=shape.size()) { 
 	    //Send warning
-	    if (debugPrint) log << MSG::DEBUG << "Shape-Derivative has different size than Shape for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-	        << ". Derivative not taken into accout for quality factor." << endmsg;
+	    ATH_MSG_DEBUG( "Shape-Derivative has different size than Shape for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
+                           << ". Derivative not taken into accout for quality factor."  );
 	    noShapeDer++;
 	  }//end-if 
 	  if (time==0 || shapeDer.size()!=shape.size() ) { //Calculate Q without time info
@@ -648,25 +589,24 @@ StatusCode LArRawChannelBuilder::execute()
     LArRawChannel larRawChannel(chid,(int)energy,(int)time,iqual,iprov, gain);   
     larRawChannelContainer->push_back(larRawChannel); //Add to container 
     ntot_raw++;
-    if (verbosePrint)
-      log << MSG::VERBOSE << "Got LArRawChannel #" << ntot_raw << ", chid=0x" << MSG::hex << chid.get_compact() << MSG::dec  
-  	  << " e=" << energy << " t=" << time << " Q=" << quality << endmsg;
+    ATH_MSG_VERBOSE( "Got LArRawChannel #" << ntot_raw << ", chid=0x" << MSG::hex << chid.get_compact() << MSG::dec  
+                     << " e=" << energy << " t=" << time << " Q=" << quality  );
   } // End loop over LArDigits
 
-  if (debugPrint) log << MSG::DEBUG <<  ntot_raw << " channels successfully processed, (" << highE << " with high energy)" << endmsg;
+  ATH_MSG_DEBUG(  ntot_raw << " channels successfully processed, (" << highE << " with high energy)"  );
 
   // deal with bad timing
   if(BadTiming>=128){
-    log<< MSG::ERROR << "Too many channels (" <<BadTiming<<  " !) have a bad timing !!" << endmsg;
-    log<< MSG::ERROR << "OFC time constants should be revisited !!!" << endmsg;
-    log<< MSG::ERROR << "Event is skipped" << endmsg;
+    ATH_MSG_ERROR( "Too many channels (" <<BadTiming<<  " !) have a bad timing !!"  );
+    ATH_MSG_ERROR( "OFC time constants should be revisited !!!"  );
+    ATH_MSG_ERROR( "Event is skipped"  );
     larRawChannelContainer->clear();
     //return StatusCode::SUCCESS;
   }
   
   // in case of at least one saturating cell, skip all event (if selected) 
   if ( saturation && m_skipSaturCells == 2 ) {
-    log<< MSG::ERROR << saturation << " saturating channels were found. Event is skipped." << endmsg;
+    ATH_MSG_ERROR( saturation << " saturating channels were found. Event is skipped."  );
     larRawChannelContainer->clear();
   }
   
@@ -726,48 +666,43 @@ StatusCode LArRawChannelBuilder::execute()
     else
       msglvl=MSG::INFO;
 
-    log << msglvl << " *** Error & Warning summary for this event *** " << std::endl;
+    msg() << msglvl << " *** Error & Warning summary for this event *** " << std::endl;
     
     if ( noEnergy ) {
-      log << msglvl << "   " << noEnergy << " out of " 
+      msg() << msglvl << "   " << noEnergy << " out of " 
 	  << digitContainer->size() << " channel(s) skipped due to a lack of basic calibration constants." 
 	  << std::endl;  	  
     }
     if ( noTime ) {
-      log << msglvl << "   " << noTime << " out of " 
+      msg() << msglvl << "   " << noTime << " out of " 
 	  << highE << " high-enegy channel(s) have no time-info due to a lack of Optimal Filtering Coefficients." 
 	  << std::endl;
     }
     if ( noShape ) {
-      log << msglvl << "   " << noShape << " out of " 
+      msg() << msglvl << "   " << noShape << " out of " 
 	  << highE << " high-enegy channel(s) have no quality factor due to a lack of shape." 
 	  << std::endl;
     }
     if ( noShapeDer ) { 
-      log << msglvl << "   " << noShapeDer << " out of " 
+      msg() << msglvl << "   " << noShapeDer << " out of " 
 	  << highE << " high-enegy channel(s) lack the derivative of the shape. Not taken into accout for Quality factor." 
 	  << std::endl;
     }
     if ( saturation ) {
       if ( m_skipSaturCells == 2 )
-          log << MSG::ERROR << "   " << saturation << " out of " 
+          msg() << MSG::ERROR << "   " << saturation << " out of " 
 	      << digitContainer->size() << " channel(s) showed saturations. The complete event was skipped." << std::endl;
       else if ( m_skipSaturCells == 1 )
-          log << MSG::ERROR << "   " << saturation << " out of " 
+        msg() << MSG::ERROR << "   " << saturation << " out of " 
 	      << digitContainer->size() << " channel(s) showed saturations and were skipped." << std::endl;
       else
-          log << MSG::WARNING << "   " << saturation << " out of " 
+        msg() << MSG::WARNING << "   " << saturation << " out of " 
 	      << digitContainer->size() << " channel(s) showed saturations." << std::endl;
     }
-    log << endmsg;
+    msg() << endmsg;
   }
     
-  // lock raw channel container
-  sc = evtStore()->setConst(larRawChannelContainer);
-  if (sc.isFailure()) {
-    log << MSG::ERROR << " Cannot lock RawChannel Container " << endmsg;
-    return(StatusCode::FAILURE);
-  }
+  ATH_CHECK( SG::makeHandle(m_ChannelContainerName, ctx).record (std::move (larRawChannelContainer)) );
 
   return StatusCode::SUCCESS;
 }
@@ -791,10 +726,8 @@ StatusCode LArRawChannelBuilder::finalize()
 
   // Error and Warning Summary for this job:
   
-  MsgStream log(msgSvc(), name());
-  
-  log << MSG::DEBUG << "  LArRawChannelBuilder::finalize " 
-      << m_noEnergy << " " << m_noTime << " " << m_noShape << " " << m_noShapeDer << " " << m_saturation << endmsg;
+  ATH_MSG_DEBUG( "  LArRawChannelBuilder::finalize " 
+                 << m_noEnergy << " " << m_noTime << " " << m_noShape << " " << m_noShapeDer << " " << m_saturation  );
   
   if ( m_noEnergy || m_noTime || m_noShape || m_noShapeDer || m_saturation ) {
     MSG::Level msglvl;
@@ -802,37 +735,37 @@ StatusCode LArRawChannelBuilder::finalize()
       msglvl=MSG::ERROR;
     else
       msglvl=MSG::WARNING;
-    log << msglvl << " *** Error & Warning Summary for all events *** " << std::endl ;
+    msg() << msglvl << " *** Error & Warning Summary for all events *** " << std::endl ;
     
     if (m_noEnergy)
-      log << msglvl << "   " << m_noEnergy << " events had on average " << (int)round(m_aveNoEnergy) 
+      msg() << msglvl << "   " << m_noEnergy << " events had on average " << (int)round(m_aveNoEnergy) 
           << " channels out of " << (int)round(m_aveChannels) << " without basic calibration constants." 
 	  << std::endl;
     
     if (m_noTime) 
-      log << msglvl << "   " << m_noTime  << " events had on average " << (int)round(m_aveNoTime) 
+      msg() << msglvl << "   " << m_noTime  << " events had on average " << (int)round(m_aveNoTime) 
           << " channels out of " << (int)round(m_aveChannels) << " without OFCs for timing." 
 	  << std::endl ;
    
     if (m_noShape)
-      log << msglvl << "   " << m_noShape << " events had on average " << (int)round(m_aveNoShape) 
+      msg() << msglvl << "   " << m_noShape << " events had on average " << (int)round(m_aveNoShape) 
           << " channels out of " << (int)round(m_aveChannels) << " without shape information." 
 	  << std::endl;
     
     if (m_noShapeDer)
-      log << msglvl << "   " << m_noShapeDer << " events had on average " << (int)round(m_aveNoShapeDer) 
+      msg() << msglvl << "   " << m_noShapeDer << " events had on average " << (int)round(m_aveNoShapeDer) 
           << " channels out of " << (int)round(m_aveChannels) << " without shape derivative." 
 	  << std::endl;
 	
     if ( m_saturation )
-      log << msglvl << "   " << m_saturation << " events had on average " << (int)round(m_aveSaturCells) 
+      msg() << msglvl << "   " << m_saturation << " events had on average " << (int)round(m_aveSaturCells) 
           << " out of " << (int)round(m_aveChannels) << " saturating channels."  
 	  << std::endl ;
     
-    log << endmsg;
+    msg() << endmsg;
   } 
   else
-    log << MSG::INFO << "LArRawChannelBuilder finished without errors or warnings." << endmsg;
+    ATH_MSG_INFO( "LArRawChannelBuilder finished without errors or warnings."  );
 
   //if (m_larRawChannelContainer) {
     //m_larRawChannelContainer->release();
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EConstants.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EConstants.cxx
index d3377641e70..165ba8d1f5f 100755
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EConstants.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EConstants.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
 */
 
 
 #include "LArROD/LArRawChannelBuilderADC2EConstants.h"
 #include "LArROD/LArRawChannelBuilderStatistics.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "Identifier/Identifier.h"
 
 using CLHEP::MeV;
@@ -27,10 +27,11 @@ LArRawChannelBuilderADC2EConstants::LArRawChannelBuilderADC2EConstants(const std
 
 StatusCode LArRawChannelBuilderADC2EConstants::initTool()
 {
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
   
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EDataBase.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EDataBase.cxx
index 7caf6470f79..10257ad0320 100755
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EDataBase.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderADC2EDataBase.cxx
@@ -1,12 +1,11 @@
 /*
-  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 "LArROD/LArRawChannelBuilderADC2EDataBase.h"
 #include "LArROD/LArRawChannelBuilderStatistics.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
 #include "Identifier/Identifier.h"
 #include "StoreGate/StoreGateSvc.h" 
 #include "LArIdentifier/LArOnlineID.h" 
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolAverage.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolAverage.cxx
index 58a70dcacb4..971cbb62ecf 100755
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolAverage.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolAverage.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,7 +9,7 @@
 #include "LArRawEvent/LArDigit.h"
 #include "CLHEP/Units/SystemOfUnits.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "Identifier/Identifier.h"
 #include <math.h>
@@ -48,17 +48,14 @@ LArRawChannelBuilderToolAverage::LArRawChannelBuilderToolAverage(const std::stri
 
 StatusCode LArRawChannelBuilderToolAverage::initTool()
 {
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
   
 
-  if (detStore()->retrieve(m_onlineHelper, "LArOnlineID").isFailure()){
-    msg(MSG::ERROR) << "Could not get LArOnlineID m_helper !" << endmsg;
-    return StatusCode::FAILURE;
-  }
-  
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
   return StatusCode::SUCCESS;
 }
 
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolCubic.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolCubic.cxx
index 0ec7ae721c5..5f44db36a13 100755
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolCubic.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolCubic.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
 */
 
 
 #include "LArROD/LArRawChannelBuilderToolCubic.h"
 #include "GaudiKernel/MsgStream.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "Identifier/Identifier.h"
 #include "LArRawEvent/LArDigit.h"
 
@@ -41,8 +41,9 @@ LArRawChannelBuilderToolCubic::LArRawChannelBuilderToolCubic(const std::string&
 
 StatusCode LArRawChannelBuilderToolCubic::initTool()
 {
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_fcalId=caloIdMgr->getFCAL_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_fcalId=idHelper->fcal_idHelper();
   
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolParabola.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolParabola.cxx
index 0b7ff1df452..59b5bdb1604 100755
--- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolParabola.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderToolParabola.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 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/StatusCode.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "Identifier/Identifier.h"
 
 #include "LArRawEvent/LArDigit.h"
@@ -34,15 +34,11 @@ LArRawChannelBuilderToolParabola::LArRawChannelBuilderToolParabola(const std::st
 
 StatusCode LArRawChannelBuilderToolParabola::initTool()
 {
-  if(m_parabolaRecoTool.retrieve().isFailure() )
-    {
-      MsgStream log(msgSvc(), name());
-      log << MSG::ERROR << "Unable to find tool LArParabolaPeakRecoTool" << endmsg;
-      return StatusCode::FAILURE;
-    }
+  ATH_CHECK( m_parabolaRecoTool.retrieve() );
   
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance();
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper(); 
   
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArROD/src/LArRawChannelSimpleBuilder.cxx b/LArCalorimeter/LArROD/src/LArRawChannelSimpleBuilder.cxx
index 217bdab9c5f..b8af2c7d7e1 100644
--- a/LArCalorimeter/LArROD/src/LArRawChannelSimpleBuilder.cxx
+++ b/LArCalorimeter/LArROD/src/LArRawChannelSimpleBuilder.cxx
@@ -5,9 +5,11 @@
 #include "LArROD/LArRawChannelSimpleBuilder.h"
 #include "LArRawEvent/LArDigitContainer.h"
 #include "CLHEP/Units/SystemOfUnits.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 #include "LArIdentifier/LArOnlID_Exception.h"
 #include "StoreGate/StoreGateSvc.h"
+#include "StoreGate/ReadHandle.h"
+#include "StoreGate/WriteHandle.h"
 
 #include "LArElecCalib/ILArPedestal.h"
 
@@ -18,7 +20,7 @@ using CLHEP::ns;
 using CLHEP::MeV;
 
 LArRawChannelSimpleBuilder::LArRawChannelSimpleBuilder (const std::string& name, ISvcLocator* pSvcLocator):
-  AthAlgorithm(name, pSvcLocator),
+  AthReentrantAlgorithm(name, pSvcLocator),
   //  m_roiMap("LArRoI_Map"),
   m_emId(0),
   m_fcalId(0),
@@ -26,14 +28,9 @@ LArRawChannelSimpleBuilder::LArRawChannelSimpleBuilder (const std::string& name,
   m_onlineHelper(0),
   m_adc2mevTool("LArADC2MeVTool"),
   m_peakParabolaTool("LArParabolaPeakTool"),
-  m_DataLocation("FREE"),
-  m_ChannelContainerName("LArRawChannels"),
-  m_iPedestal(0),// jobO ?
-  m_larRawChannelContainer(0)
+  m_iPedestal(0)// jobO ?
 {
    //m_useIntercept={false,false,false,false};
- declareProperty("LArRawChannelContainerName",m_ChannelContainerName);
- declareProperty("DataLocation", m_DataLocation );
  declareProperty("maxSamp",m_imaxSamp=8);
  declareProperty("RecoMode",m_mode="CUBIC");
  declareProperty("CubicRecoTimeModeFCAL",m_FCALmodeTime="LINEAR");
@@ -72,97 +69,64 @@ LArRawChannelSimpleBuilder::LArRawChannelSimpleBuilder (const std::string& name,
 
 }
 
-StatusCode LArRawChannelSimpleBuilder::initialize(){
-  MsgStream log(msgSvc(), name());
-  StatusCode sc;
-  
-  log << MSG::DEBUG << "In Initialize." << endmsg;
-
-  /*  
-  if (m_roiMap.retrieve().isFailure()) {
-    log << MSG::ERROR << "Unable to find tool LArRoI_Map" << endmsg;
-    return StatusCode::FAILURE; 
-  }
-  */
+StatusCode LArRawChannelSimpleBuilder::initialize()
+{
+  ATH_MSG_DEBUG( "In Initialize."  );
 
   if (m_useRampDB) {
-    if (m_adc2mevTool.retrieve().isFailure()) {
-      log << MSG::ERROR << "Unable to find tool for LArADC2MeV" << endmsg;
-      return StatusCode::FAILURE;
-    }
+    ATH_CHECK( m_adc2mevTool.retrieve() );
   }
   
   if ( m_mode == "PARABOLA"){
     if (m_peakParabolaTool.retrieve().isFailure())
-      {log << MSG::ERROR << "Can't get LArParabolaPeakRecoTool" << endmsg;
+    {
+      ATH_MSG_ERROR( "Can't get LArParabolaPeakRecoTool"  );
       return StatusCode::SUCCESS;
-      }
-    log << MSG::DEBUG << "LArParabolaPeakRecoTool retrieved with success!" << endmsg ;
+    }
+    ATH_MSG_DEBUG( "LArParabolaPeakRecoTool retrieved with success!"  );
   }
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
-  m_fcalId=caloIdMgr->getFCAL_ID();
-  m_hecId=caloIdMgr->getHEC_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
+  m_fcalId=idHelper->fcal_idHelper();
+  m_hecId=idHelper->hec_idHelper();
 
   ATH_CHECK(m_cablingKey.initialize());
 
-  sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
 
-  
+
+  ATH_CHECK( m_DataLocation.initialize() );
+  ATH_CHECK( m_ChannelContainerName.initialize() );
   return StatusCode::SUCCESS;
 }
 
 
 
-StatusCode LArRawChannelSimpleBuilder::execute() {
-  StatusCode sc;
-  MsgStream log(msgSvc(), name());
-
-  log << MSG::DEBUG << "In execute" << endmsg;
+StatusCode LArRawChannelSimpleBuilder::execute (const EventContext& ctx) const
+{
+  ATH_MSG_DEBUG( "In execute"  );
   
-  //Pointer to input data container
-  const LArDigitContainer* digitContainer;//Pointer to LArDigitContainer
-
   //Retrieve Digit Container
-  log << MSG::DEBUG << "About to retrieve LArDigitContainer with key " << m_DataLocation << endmsg;
-  sc=evtStore()->retrieve(digitContainer,m_DataLocation);
-  log << MSG::DEBUG << "1) LArDigitContainer container size = " <<  digitContainer->size() << endmsg;
-  if(sc.isFailure()) {
-    log << MSG::ERROR << "Can't retrieve LArDigitContainer with key " <<m_DataLocation << "from StoreGate." << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_MSG_DEBUG( "About to retrieve LArDigitContainer with key " << m_DataLocation  );
+  SG::ReadHandle<LArDigitContainer> digitContainer (m_DataLocation, ctx);
+  ATH_MSG_DEBUG( "1) LArDigitContainer container size = " <<  digitContainer->size()  );
 
-  log << MSG::DEBUG << "2) LArDigitContainer container size = " <<  digitContainer->size() << endmsg;
+  ATH_MSG_DEBUG( "2) LArDigitContainer container size = " <<  digitContainer->size()  );
   if( digitContainer->size() < 1 ) {
-    log << MSG::INFO << "Empty LArDigitContainer container." << endmsg;
+    ATH_MSG_INFO( "Empty LArDigitContainer container."  );
     return StatusCode::SUCCESS;
   }
   
-  if(!m_larRawChannelContainer) { 
-    //Prepare LArRawChannelContainer
-    m_larRawChannelContainer = new LArRawChannelContainer();
-   }
-
-  m_larRawChannelContainer ->clear(); 
+  auto larRawChannelContainer = std::make_unique<LArRawChannelContainer>();
 
-  // Put this LArRawChannel container in the transient store
-  sc = evtStore()->record(m_larRawChannelContainer, m_ChannelContainerName);
-  if(sc.isFailure()) {
-    log << MSG::INFO << "Can't record LArRawChannelContainer in StoreGate" << endmsg;
-  }
-  
   //Pointer to conditions data objects 
   const ILArPedestal* larPedestal=NULL;
   if (m_usePedestalDB) {
-    sc=detStore()->retrieve(larPedestal);
-    if (sc.isFailure()) {
+    if (detStore()->retrieve(larPedestal).isFailure()) {
       larPedestal=NULL;
-      log << MSG::DEBUG << "No pedestal found in database. Use default values." << endmsg;
+      ATH_MSG_DEBUG( "No pedestal found in database. Use default values."  );
     }
   }
 
@@ -190,17 +154,15 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
   for(int iloop=0;iloop<2;iloop++) {
    
     //Now all data is available, start loop over Digit Container
-    log << MSG::DEBUG << "Loop over Digit Container " << endmsg;
-    
-    LArDigitContainer::const_iterator cont_it=digitContainer->begin();
-    LArDigitContainer::const_iterator cont_it_e=digitContainer->end();
-    for (;cont_it!=cont_it_e;cont_it++) {
+    ATH_MSG_DEBUG( "Loop over Digit Container "  );
+
+    for (const LArDigit* digit : *digitContainer) {
     
       //Get data from LArDigit
-      const std::vector<short>& samples  = (*cont_it)->samples();
+      const std::vector<short>& samples  = digit->samples();
       unsigned int              nSamples = samples.size(); 
-      const HWIdentifier        chid     = (*cont_it)->channelID();
-      const CaloGain::CaloGain  gain     = (*cont_it)->gain();
+      const HWIdentifier        chid     = digit->channelID();
+      const CaloGain::CaloGain  gain     = digit->gain();
       
       
       float thePedestal=-1;    
@@ -211,7 +173,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
       }
       if (thePedestal<0) {
 	thePedestal = (float)samples[m_iPedestal];
-	log << MSG::DEBUG << "No pedestal found for this cell. Use default value " << thePedestal << endmsg;
+	ATH_MSG_DEBUG( "No pedestal found for this cell. Use default value " << thePedestal  );
       }
       //>>>> PL June 20, 2004: subtract pedestal first, assume first sample ->JO?
       std::vector<float> mySamples;
@@ -235,14 +197,13 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	GainFactor = 1.0;
       } else {
 	GainFactor = 1.0;
-	log << MSG::ERROR << "Channel " << chid << "unknown gain: " << gain << endmsg;
+	ATH_MSG_ERROR( "Channel " << chid << "unknown gain: " << gain  );
       }
       
       // Get hardware identifier for later use.
       HWIdentifier FebID = m_onlineHelper->feb_Id(chid);
       unsigned int channel  = m_onlineHelper->channel(chid);
-      MSG::hex(log) << MSG::DEBUG
-		    << " FebID / chid / channel = " << FebID << " / " << chid << " / " << channel << endmsg;
+      ATH_MSG_DEBUG( std::hex << " FebID / chid / channel = " << FebID << " / " << chid << " / " << channel );
       
       // And note if this is an FCAL channel with fast pulses (cubic fails)
       // EM and HEC are also tested to adjust the signal range for averaging
@@ -278,7 +239,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
       }
       //catch( LArOnlID_Exception & except) 
       catch (LArID_Exception & execpt) {
-	MSG::hex(log) << MSG::DEBUG << " is disconnected." << endmsg;
+	ATH_MSG_DEBUG (" is disconnected.");
         // The question now being:  do we want to skip this channel???
         // Probably yes, so do so.  RMcP 9 June 2006
         continue;
@@ -291,9 +252,9 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 
       // sanity checks
       if ( nAverage > nSamples ) {
-	log << MSG::WARNING << " Number of samples to average (" 
-	    << nAverage << ") is larger than total number of samples (" 
-	    << nSamples << ")! adjusting nAverage ... " << endmsg; 
+	ATH_MSG_WARNING( " Number of samples to average (" 
+                         << nAverage << ") is larger than total number of samples (" 
+                         << nSamples << ")! adjusting nAverage ... "  );
 	nAverage = nSamples;
       }
 
@@ -301,7 +262,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
       if ( iloop == 0 ) {
 
         if (pSum == 0) {
-          MSG::hex(log) << MSG::ERROR << " don't have pSum pointer." << endmsg;
+          ATH_MSG_ERROR( " don't have pSum pointer." );
           continue;
         }
   
@@ -350,7 +311,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	  if(isFCAL &&   m_mode == "CUBIC" &&
 	     ! ( CubicFailed = maxADCPeak <= m_cubicAdcCut ) ) {
 	  
-	    log << MSG::DEBUG << " Special reconstruction for FCAL." << endmsg;
+	    ATH_MSG_DEBUG( " Special reconstruction for FCAL."  );
           
 	    unsigned int it0;
 	  
@@ -412,14 +373,14 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 		int layer = 0;
 		try {
 		  const Identifier id = cabling->cnvToIdentifier(chid);
-		  MSG::hex(log) << MSG::DEBUG << "     id = " << id << endmsg;
+		  ATH_MSG_DEBUG( std::hex << "     id = " << id );
 		  if (m_emId->is_em_barrel(id)) {
 		    layer= m_emId->sampling(id);
 		  }
 		}
 		catch (LArID_Exception & execpt){
-		  MSG::hex(log) << MSG::DEBUG
-				<< " Cannot get offline identifier from online ID = " << chid << endmsg;
+                  ATH_MSG_DEBUG( std::hex
+                                 << " Cannot get offline identifier from online ID = " << chid );
 		}
 	      
 		std::vector<float> peak =m_peakParabolaTool->peak(samples,layer,thePedestal); 
@@ -428,12 +389,12 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 		  if (peak.size()==2)time = peak[1];
 		  else time = peak[2];
 		}else{
-		  log << MSG::DEBUG << "No pic is computed from Parabola. Use scaled average of selected samples" << endmsg;
+		  ATH_MSG_DEBUG( "No pic is computed from Parabola. Use scaled average of selected samples"  );
 		  ADCPeak = averagedADC;
 		  time    = -99.;
 		}
 	      }else{
-		log << MSG::FATAL << "No parabola tool available ! Choose another mode" << endmsg;
+		ATH_MSG_FATAL( "No parabola tool available ! Choose another mode"  );
 	      }
 	    }
 	  
@@ -488,20 +449,19 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	  time    = -99. ;
 	}
       
-	log << MSG::DEBUG
-	    << "Flag: "
-	    << CubicFailed
-	    << " Detector: "
-	    << (isEM?"EM":(isHEC?"HEC":(isFCAL?"FCAL":"none")))
-	    << " Mode: "
-	    << m_mode
-	    << " Signal: "
-	    <<  ADCPeak
-	    << " Peak: "
-	    << maxADCPeak
-	    << " PeakSample: "
-	    << iPeakSamp
-	    << endmsg;
+	ATH_MSG_DEBUG( "Flag: "
+                       << CubicFailed
+                       << " Detector: "
+                       << (isEM?"EM":(isHEC?"HEC":(isFCAL?"FCAL":"none")))
+                       << " Mode: "
+                       << m_mode
+                       << " Signal: "
+                       <<  ADCPeak
+                       << " Peak: "
+                       << maxADCPeak
+                       << " PeakSample: "
+                       << iPeakSamp
+                       );
       
 	float energy=-9999;
 	if (m_useRampDB) {
@@ -519,7 +479,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	  }
 	}
 	if (energy==-9999) {
-	  log << MSG::DEBUG << "No Ramp found for this cell. Use default values" << endmsg;
+	  ATH_MSG_DEBUG( "No Ramp found for this cell. Use default values"  );
 	  //Apply default values
 	  // Now must get subdetector ID and feed in here ...
 	  float ADCtoMeV      = 10.0;
@@ -532,7 +492,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	  try {
 	    const Identifier id = cabling->cnvToIdentifier(chid);
 	  
-	    MSG::hex(log) << MSG::DEBUG << "     id = " << id << endmsg;
+	    ATH_MSG_DEBUG( std::hex << "     id = " << id );
 	  
 	    if (m_emId->is_em_barrel(id)) {
 	      const int layer= m_emId->sampling(id);
@@ -540,31 +500,31 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	      ADCtoMeV = m_ADCtoMeVEMB[layer];
 	      if (layer==2 && eta<32)
 		ADCtoMeV=ADCtoMeV*(12./18.); //Correct for lead thickness
-	      log << MSG::DEBUG << " in EMB s="<< layer <<", using ADCtoMeV = " << ADCtoMeV << endmsg;
+	      ATH_MSG_DEBUG( " in EMB s="<< layer <<", using ADCtoMeV = " << ADCtoMeV  );
 	    } else if (m_emId->is_em_endcap_inner(id)) {
 	      // m_emId->sampling(id);
 	      ADCtoMeV = m_ADCtoMeVEMECInner[m_emId->sampling(id)-1];
-	      log << MSG::DEBUG << " in EMEC inner s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV << endmsg;
+	      ATH_MSG_DEBUG( " in EMEC inner s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV  );
 	    } else if (m_emId->is_em_endcap_outer(id)) {
 	      // m_emId->sampling(id);
 	      // ADCtoMeV = m_ADCtoMeVEMECOuter[m_emId->sampling(id)-1];
               ADCtoMeV = m_ADCtoMeVEMECOuter[m_emId->sampling(id)];
-	      log << MSG::DEBUG << " in EMEC outer s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV << endmsg;
+	      ATH_MSG_DEBUG( " in EMEC outer s="<<m_emId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV  );
 	    } else if (m_fcalId->is_lar_fcal(id)) {
 	      // m_fcalId->module(chid);
 	      ADCtoMeV = m_ADCtoMeVFCAL[m_fcalId->module(id)-1];
-	      log << MSG::DEBUG << " in FCAL m=" << m_fcalId->module(id)<<", using ADCtoMeV = " << ADCtoMeV << endmsg;
+	      ATH_MSG_DEBUG( " in FCAL m=" << m_fcalId->module(id)<<", using ADCtoMeV = " << ADCtoMeV  );
 	    } else if (m_hecId->is_lar_hec(id)) {
 	      // m_layer[m_cellIndex]=m_hecId->sampling(id);
 	      ADCtoMeV = m_ADCtoMeVHEC[0];
-	      log << MSG::DEBUG << " in HEC s="<<m_hecId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV << endmsg;
+	      ATH_MSG_DEBUG( " in HEC s="<<m_hecId->sampling(id)<<", using ADCtoMeV = " << ADCtoMeV  );
 	    }
 	  }
 	  //catch( LArOnlID_Exception & except) 
 	  catch (LArID_Exception & execpt)
-	    {MSG::hex(log) << MSG::DEBUG
-			   << " is disconnected. Set ADCtoMeV to 1" << endmsg;
-	    ADCtoMeV=1;
+	    {
+              ATH_MSG_DEBUG( " is disconnected. Set ADCtoMeV to 1" );
+              ADCtoMeV=1;
 	    }
 	  energy  = ADCPeak * ADCtoMeV * GainFactor;
 	}
@@ -574,7 +534,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	time*=1000; //Convert to picoseconds
 	//Make LArRawChannel Object with new data
 	LArRawChannel larRawChannel(chid,(int)energy,(int)time,iquality,iprovenance, gain);   
-	m_larRawChannelContainer->add(larRawChannel); //Add to container
+	larRawChannelContainer->add(larRawChannel); //Add to container
       }
     }// End loop over LArDigits
     if ( iloop == 0 ) {
@@ -589,7 +549,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	}
       }
       if ( fSumEM.size() > 0 ) {
-	log << MSG::DEBUG << "Found best EM window starting at sample <" << nMinEM << ">" << endmsg;
+	ATH_MSG_DEBUG( "Found best EM window starting at sample <" << nMinEM << ">"  );
       }
 
       for(i=0;i<fSumHEC.size();i++) {
@@ -599,7 +559,7 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	}
       }
       if ( fSumHEC.size() > 0 ) {
-	log << MSG::DEBUG << "Found best HEC window starting at sample <" << nMinHEC << ">" << endmsg;
+	ATH_MSG_DEBUG( "Found best HEC window starting at sample <" << nMinHEC << ">"  );
       }
 
       for(i=0;i<fSumFCAL.size();i++) {
@@ -609,29 +569,24 @@ StatusCode LArRawChannelSimpleBuilder::execute() {
 	}
       }
       if ( fSumFCAL.size() > 0 ) {
-	log << MSG::DEBUG << "Found best FCAL window starting at sample <" << nMinFCAL << ">" << endmsg;
+	ATH_MSG_DEBUG( "Found best FCAL window starting at sample <" << nMinFCAL << ">"  );
       }
 
     }
   }// End of double loop over Digit containers
 
-  log << MSG::DEBUG << "Finished loop over Digit Container " << endmsg;
+  ATH_MSG_DEBUG( "Finished loop over Digit Container "  );
 
-  // lock raw channel container
-  sc = evtStore()->setConst(m_larRawChannelContainer);
-  if (sc.isFailure()) {
-    log << MSG::ERROR << " Cannot lock RawChannel Container " << endmsg;
-    return(StatusCode::FAILURE);
-  }
+  // Put this LArRawChannel container in the transient store
+  ATH_CHECK( SG::makeHandle (m_ChannelContainerName, ctx).record (std::move (larRawChannelContainer)) );
 
   return StatusCode::SUCCESS;
 }
 
 StatusCode LArRawChannelSimpleBuilder::finalize()
 {//Error and Warning Summary for this job:
-  MsgStream log(msgSvc(), name());
   
-  log << MSG::INFO << "LArRawChannelSimpleBuilder finished." << endmsg;
+  ATH_MSG_INFO( "LArRawChannelSimpleBuilder finished."  );
 
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx b/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx
index fdfd494cdc1..10c0e2b8225 100644
--- a/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx
+++ b/LArCalorimeter/LArROD/src/LArSuperCellBuilderDriver.cxx
@@ -12,7 +12,6 @@
 
 #include "LArRawEvent/LArDigitContainer.h"
 #include "LArRawEvent/LArRawChannelContainer.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "Identifier/Identifier.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloEvent/CaloCellContainer.h"
diff --git a/LArCalorimeter/LArROD/src/ReadLArDigits.cxx b/LArCalorimeter/LArROD/src/ReadLArDigits.cxx
index 6fdeb225a0d..21144d24774 100644
--- a/LArCalorimeter/LArROD/src/ReadLArDigits.cxx
+++ b/LArCalorimeter/LArROD/src/ReadLArDigits.cxx
@@ -6,7 +6,8 @@
 #include "LArRawEvent/LArDigit.h"
 #include <vector>
 // #include "GaudiKernel/IToolSvc.h"
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
+#include "StoreGate/ReadHandle.h"
 
 
 ReadLArDigits::SortDigits::SortDigits(const LArOnlineID* onlineHelper)
@@ -19,7 +20,6 @@ ReadLArDigits::ReadLArDigits(const std::string& name, ISvcLocator* pSvcLocator)
   m_ntuplePtr(NULL)
        
 {m_count=0;
- declareProperty("ContainerKey",m_containerKey="");
  declareProperty("DumpFile",m_dumpFile="");
  declareProperty("PrintCellLocation",m_printCellLoc=false);
  declareProperty("PrintFebChan",m_printFebChan=true);
@@ -31,19 +31,15 @@ ReadLArDigits::~ReadLArDigits()
 }
 
 StatusCode ReadLArDigits::initialize()
-{ MsgStream log(msgSvc(), name());
-  log << MSG::INFO << "Initialize" << endmsg;
+{
+  ATH_MSG_INFO( "Initialize"  );
 
-  const CaloIdManager *caloIdMgr=CaloIdManager::instance() ;
-  m_emId=caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_emId=idHelper->em_idHelper();
 
   ATH_CHECK(m_cablingKey.initialize());
-
-  StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
-  if (sc.isFailure()) {
-    log << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
 
   if (m_dumpFile.size()>0)
     m_outfile.open(m_dumpFile.c_str(),std::ios::out);
@@ -51,138 +47,73 @@ StatusCode ReadLArDigits::initialize()
  
 
   NTupleFilePtr file1(ntupleSvc(),"/NTUPLES/FILE1");
-  if (!file1)
-    {log << MSG::ERROR << "Booking of NTuple failed" << endmsg;
+  if (!file1) {
+    ATH_MSG_ERROR( "Booking of NTuple failed"  );
     return StatusCode::FAILURE;
-   }
+  }
   NTuplePtr nt(ntupleSvc(),"/NTUPLES/FILE1/LARDIGITS");
   if (!nt) {
     nt=ntupleSvc()->book("/NTUPLES/FILE1/LARDIGITS",CLID_ColumnWiseTuple,"LArDigits");
   }
-  if (!nt)
-    {log << MSG::ERROR << "Booking of NTuple failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("icell",m_cellIndex,0,3600);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Cell Index' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  //sc=nt->addItem("layer",m_layer,0,4);
-  sc=nt->addItem("layer",m_cellIndex,m_layer);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Layer' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  //sc=nt->addItem("ieta",m_eta,0,510);
-  sc=nt->addItem("ieta",m_cellIndex,m_eta);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Eta' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("iphi",m_cellIndex,m_phi);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Phi' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'barrel_ec' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("pos_neg",m_cellIndex,m_pos_neg);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'pos_neg' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("FT",m_cellIndex,m_FT);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'FT' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("slot",m_cellIndex,m_slot);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'slot' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("channel",m_cellIndex,m_channel);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'channel' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }
-
-  sc=nt->addItem("gain",m_cellIndex,m_gain);
-  if (sc!=StatusCode::SUCCESS)
-    {log << MSG::ERROR << "addItem 'Gain' failed" << endmsg;
-     return StatusCode::FAILURE;
-    }  
-  
-  sc=nt->addItem("NSamples",m_Nsamples,0,32);
-  if (sc!=StatusCode::SUCCESS) {
-    log << MSG::ERROR << "addItem 'sampleIndex' failed" << endmsg;
-    return StatusCode::FAILURE;
-  }
-  
-  sc=nt->addItem("Samples",m_cellIndex,m_samples,32);
-  //sc=nt->addItem("Samples",m_cellIndex,m_samples,m_Nsamples);
-  if (sc!=StatusCode::SUCCESS) {
-    log << MSG::ERROR << "addItem failed" << endmsg;
+  if (!nt) {
+    ATH_MSG_ERROR( "Booking of NTuple failed"  );
     return StatusCode::FAILURE;
   }
+
+  ATH_CHECK( nt->addItem("icell",m_cellIndex,0,3600) );
+  ATH_CHECK( nt->addItem("layer",m_cellIndex,m_layer) );
+  ATH_CHECK( nt->addItem("ieta",m_cellIndex,m_eta) );
+  ATH_CHECK( nt->addItem("iphi",m_cellIndex,m_phi) );
+  ATH_CHECK( nt->addItem("barrel_ec",m_cellIndex,m_barrel_ec) );
+  ATH_CHECK( nt->addItem("pos_neg",m_cellIndex,m_pos_neg) );
+  ATH_CHECK( nt->addItem("FT",m_cellIndex,m_FT) );
+  ATH_CHECK( nt->addItem("slot",m_cellIndex,m_slot) );
+  ATH_CHECK( nt->addItem("channel",m_cellIndex,m_channel) );
+  ATH_CHECK( nt->addItem("gain",m_cellIndex,m_gain) );
+  ATH_CHECK( nt->addItem("NSamples",m_Nsamples,0,32) );
+  ATH_CHECK( nt->addItem("Samples",m_cellIndex,m_samples,32) );
+
+  ATH_CHECK( m_containerKey.initialize() );
   
   m_ntuplePtr=nt;
   m_count=0;
-  log << MSG::INFO << "======== ReadLArDigits initialize successfully ========" << endmsg;
+  ATH_MSG_INFO( "======== ReadLArDigits initialize successfully ========"  );
   return StatusCode::SUCCESS;
 }
 
 
 StatusCode ReadLArDigits::execute()
-{MsgStream log(msgSvc(), name());
+{
  m_count++; 
- StatusCode sc; 
- log << MSG::VERBOSE << "======== executing event "<< m_count << " ========" << endmsg;
- log << MSG::VERBOSE << "Retrieving LArDigitContainer. Key= " << m_containerKey << std::endl; 
- LArDigitContainer* larDigitCont;
- if (m_containerKey.size())
-   sc = evtStore()->retrieve(larDigitCont ,m_containerKey);
- else
-   sc = evtStore()->retrieve(larDigitCont);
- if (sc.isFailure()) 
-   {log << MSG::FATAL << " Cannot read LArDigitContainer from StoreGate! key=" << m_containerKey << endmsg;
-    return StatusCode::FAILURE;
-   }
- 
+ ATH_MSG_VERBOSE( "======== executing event "<< m_count << " ========"  );
+ ATH_MSG_VERBOSE( "Retrieving LArDigitContainer. Key= " << m_containerKey.key()  );
+ const EventContext& ctx = Gaudi::Hive::currentContext();
+ SG::ReadHandle<LArDigitContainer> larDigitContIn (m_containerKey, ctx);
+
+ // View container copy.
+ LArDigitContainer larDigitCont (*larDigitContIn);
+
  SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
  const LArOnOffIdMapping* cabling{*cablingHdl};
  if(!cabling) {
     ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key());
     return StatusCode::FAILURE;
  }
+
+
  if (m_outfile.is_open()) {
    SortDigits sortDigits(m_onlineHelper);
-   std::sort(larDigitCont->begin(),larDigitCont->end(),sortDigits);
+   std::sort(larDigitCont.begin(),larDigitCont.end(),sortDigits);
  }
  unsigned cellCounter=0;
  m_cellIndex=0;
- LArDigitContainer::const_iterator it=larDigitCont->begin();
- LArDigitContainer::const_iterator it_end=larDigitCont->end();
- if (larDigitCont->size()>0)
-   m_Nsamples=(*it)->samples().size();
+ if (larDigitCont.size()>0)
+   m_Nsamples=larDigitCont.front()->samples().size();
  else                       
    m_Nsamples=0;
- for (;it!=it_end;it++)
-   {HWIdentifier chid=(*it)->hardwareID();
-   const std::vector<short>& vSamples=(*it)->samples();
+ for (const LArDigit* digit : larDigitCont) {
+   HWIdentifier chid=digit->hardwareID();
+   const std::vector<short>& vSamples=digit->samples();
    m_cellIndex++;
     try {
       const Identifier id=cabling->cnvToIdentifier(chid);
@@ -207,7 +138,7 @@ StatusCode ReadLArDigits::execute()
     m_FT[cellCounter] = m_onlineHelper->feedthrough(chid);
     m_slot[cellCounter] = m_onlineHelper->slot(chid);
     m_channel[cellCounter]   = m_onlineHelper->channel(chid);
-    m_gain[cellCounter]=(*it)->gain();
+    m_gain[cellCounter]=digit->gain();
     
     int nSamples=vSamples.size();
     for (int i=0;i<nSamples && i<32;i++)
@@ -231,21 +162,17 @@ StatusCode ReadLArDigits::execute()
     }
     cellCounter++;
    }
- sc=ntupleSvc()->writeRecord(m_ntuplePtr);
- if (sc!=StatusCode::SUCCESS) {
-   log << MSG::ERROR << "writeRecord failed" << endmsg;
-   return StatusCode::FAILURE;
- }
+ ATH_CHECK( ntupleSvc()->writeRecord(m_ntuplePtr) );
  
  if (m_count%1000==0) 
-   log << MSG::INFO  << "Event " << m_count << " contains " << cellCounter << " channels\n";
+   ATH_MSG_INFO( "Event " << m_count << " contains " << cellCounter << " channels" );
  return StatusCode::SUCCESS;
 }
 
 StatusCode ReadLArDigits::finalize()
-{ MsgStream log(msgSvc(), name());
+{
   if (m_outfile.is_open()) 
     m_outfile.close();
-  log << MSG::INFO << "finalize ReadLarDigits" << endmsg;
+  ATH_MSG_INFO( "finalize ReadLarDigits"  );
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArROD/src/ReadLArRaw.cxx b/LArCalorimeter/LArROD/src/ReadLArRaw.cxx
index b3cab9bdff4..8e5d1ee69d4 100644
--- a/LArCalorimeter/LArROD/src/ReadLArRaw.cxx
+++ b/LArCalorimeter/LArROD/src/ReadLArRaw.cxx
@@ -39,7 +39,7 @@
 // #include "LArRawUtils/LArRawRoISelector.h"
 //#include "LArRawUtils/LArTT_Selector.h"
 
-#include "CaloIdentifier/CaloIdManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
 
 using namespace std ;
 
@@ -60,33 +60,18 @@ ReadLArRaw::ReadLArRaw(const std::string& name, ISvcLocator* pSvcLocator) :
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
-StatusCode ReadLArRaw::initialize(){
-
-  MsgStream log(msgSvc(), name());
-  log << MSG::INFO << "in initialize()" << endmsg;
+StatusCode ReadLArRaw::initialize()
+{
+  ATH_MSG_INFO( "in initialize()"  );
   
   ATH_CHECK(m_cablingKey.initialize());
 
-  StoreGateSvc* detStore;
-   if (service("DetectorStore", detStore).isFailure()) {
-     log << MSG::ERROR
-         << "Unable to access DetectoreStore" << endmsg; 
-     return StatusCode::FAILURE;
-   }
-
-// retrieve OnlineID helper from detStore
-   if (detStore->retrieve(m_onlineID, "LArOnlineID").isFailure()) {
-      log << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
-      return StatusCode::FAILURE;
-   }
+  ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") );
 
 // retrieve helpers for identifier
-  const DataHandle<CaloIdManager> caloIdMgr;
-  if (detStore->retrieve(caloIdMgr).isFailure()) {
-      log << MSG::FATAL << "Could not get CaloIdManager " << endmsg;
-      return StatusCode::FAILURE;
-  } 
-  m_larem_id   = caloIdMgr->getEM_ID();
+  const CaloCell_ID* idHelper = nullptr;
+  ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
+  m_larem_id   = idHelper->em_idHelper();
 
 
 
@@ -103,16 +88,9 @@ StatusCode ReadLArRaw::initialize(){
 
 StatusCode ReadLArRaw::execute() {
 
-  MsgStream log(msgSvc(), name());
-  log << MSG::DEBUG << "in execute()" << endmsg;
-  const DataHandle<LArRawChannelContainer> LArRaw ;
-  //  StatusCode sc_read = StoreGate::retrieve( LArRaw, string( "LArRawChannelContainer" ) ) ;
-  StatusCode sc_read = StoreGate::instance().retrieve( LArRaw, m_ChannelContainerName ) ;
-
-  if ( !sc_read.isSuccess() ) {
-    log << MSG::FATAL << "Could not find event" << endmsg;
-    return StatusCode::FAILURE;
-  }
+  ATH_MSG_DEBUG( "in execute()"  );
+  const LArRawChannelContainer* LArRaw ;
+  ATH_CHECK( evtStore()->retrieve (LArRaw, m_ChannelContainerName) );
 
 
  int emax= 0; 
@@ -139,19 +117,18 @@ StatusCode ReadLArRaw::execute() {
      emax=it1->energy() ; 
      maxId =ch_id;
      //  use LArOnlineID methods
-     log << MSG::VERBOSE
-	 << "--barrel_ec : " << m_onlineID->barrel_ec(ch_id) 
-	 << " Pos_neg : " << m_onlineID->pos_neg(ch_id)
-	 << " FeedThrough no. : " << m_onlineID->feedthrough(ch_id)
-	 << " slot no. : " << m_onlineID->slot(ch_id)
-	 << " channel no. : " << m_onlineID->channel(ch_id)
-	 << endmsg;
+     ATH_MSG_VERBOSE( "--barrel_ec : " << m_onlineID->barrel_ec(ch_id) 
+                      << " Pos_neg : " << m_onlineID->pos_neg(ch_id)
+                      << " FeedThrough no. : " << m_onlineID->feedthrough(ch_id)
+                      << " slot no. : " << m_onlineID->slot(ch_id)
+                      << " channel no. : " << m_onlineID->channel(ch_id)
+                      );
      
-     log << MSG::DEBUG << "Energy = " << it1->energy() << "; Time = " 
-	 << it1->time()
-	 << "; Chi-Square = " << it1->quality() << endmsg ;
+     ATH_MSG_DEBUG( "Energy = " << it1->energy() << "; Time = " 
+                    << it1->time()
+                    << "; Chi-Square = " << it1->quality()  );
    }     
-   log <<MSG::DEBUG<< " Channel with max energy , maxID =  "<< emax<<" "<<maxId.getString() <<endmsg; 
+   ATH_MSG_DEBUG( " Channel with max energy , maxID =  "<< emax<<" "<<maxId.getString()  );
  }
 
  return StatusCode::SUCCESS;
@@ -161,10 +138,9 @@ StatusCode ReadLArRaw::execute() {
 
 StatusCode ReadLArRaw::finalize() {
 
-  MsgStream log(msgSvc(), name());
   if (m_outFile.is_open()) 
     m_outFile.close();
-  log << MSG::INFO << "in finalize()" << endmsg;
+  ATH_MSG_INFO( "in finalize()"  );
 
   return StatusCode::SUCCESS;
 }
-- 
GitLab


From eac499a7dd0e6a887a779e56e05d9a1b0a7647de Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:23:10 +0100
Subject: [PATCH 290/404] TrkParametersBase: Fix ubsan warnings due to cling
 alignment.

This package contains the declaration:

   static const Amg::Vector2D INVALID_POSITION(INVALID,INVALID);

It appears, however, that when cling generates code for this
declaration, it does not respect the proper alignment --- we were
seeing this object 8-byte aligned, rather than 16-byte as eigen
requires.  This was causing ubsan warnings as well as assertion
failures from eigen.

This variable is, however, only referenced frmo two places in the same file,
and in those places we can just as well construct is as needed.
So get rid of this static.
---
 .../TrkParametersBase/TrkParametersBase/ParametersT.icc      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
index 1715d16a155..dd7bac520e7 100644
--- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
+++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc
@@ -19,7 +19,6 @@ namespace Trk
     static constexpr double INVALID=std::numeric_limits<double>::quiet_NaN();
     static constexpr double INVALID_P(10e9);
     static constexpr double INVALID_QOP(10e-9);
-    static const Amg::Vector2D INVALID_POSITION(INVALID,INVALID);
 
     template<typename T>
     int sgn(const T& val)
@@ -133,7 +132,7 @@ namespace Trk
     Amg::Vector2D lPosition;
     const bool ok = m_surface->globalToLocal(position(),momentum(),lPosition);
     if(not ok)
-      lPosition = INVALID_POSITION;
+      lPosition = Amg::Vector2D (INVALID,INVALID);
 
     // fill the vector now
     m_parameters << lPosition[Trk::loc1], lPosition[Trk::loc2], momentum().phi(),
@@ -174,7 +173,7 @@ namespace Trk
     Amg::Vector2D lPosition;
     const bool ok = m_surface->globalToLocal(position(),momentum(),lPosition);
     if (not ok)
-      lPosition = INVALID_POSITION;
+      lPosition = Amg::Vector2D (INVALID,INVALID);
     
     // fill the vector now
     m_parameters << lPosition[Trk::loc1], lPosition[Trk::loc2], phi, theta, qop;   
-- 
GitLab


From ccce2ab5a69a162591333acbbe14692046cfa9ac Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:36:11 +0100
Subject: [PATCH 291/404] TrkExSolenoidalIntersector: Fix ubsan warnings.

Suppress ubsan warnings coming from cling.
---
 .../TrkExSolenoidalIntersector/CMakeLists.txt                | 5 ++++-
 .../test/SolenoidalIntersector_test.cxx                      | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/CMakeLists.txt b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/CMakeLists.txt
index 950b28137dd..781ce057786 100644
--- a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/CMakeLists.txt
+++ b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/CMakeLists.txt
@@ -14,12 +14,14 @@ atlas_depends_on_subdirs( PUBLIC
                           Tracking/TrkExtrapolation/TrkExInterfaces
                           Tracking/TrkExtrapolation/TrkExUtils
                           PRIVATE
+                          Control/CxxUtils
                           Event/EventPrimitives
                           Tracking/TrkDetDescr/TrkSurfaces
                           Tracking/TrkEvent/TrkParameters )
 
 # External dependencies:
 find_package( Eigen )
+find_package( ROOT )
 
 # Component(s) in the package:
 atlas_add_component( TrkExSolenoidalIntersector
@@ -42,7 +44,8 @@ atlas_add_test( SolenoidParametrization_test
 
 atlas_add_test( SolenoidalIntersector_test
                 SOURCES test/SolenoidalIntersector_test.cxx
-                LINK_LIBRARIES TrkExUtils GaudiKernel TestTools
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES TrkExUtils GaudiKernel TestTools CxxUtils ${ROOT_LIBRARIES}
                 EXTRA_PATTERNS "^AtlasFieldSvc +INFO"
                 ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
 
diff --git a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx
index b505fe9d458..75b8181d811 100644
--- a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx
+++ b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx
@@ -14,9 +14,11 @@
 #include "TestTools/initGaudi.h"
 #include "TestTools/FLOATassert.h"
 #include "AthenaKernel/Units.h"
+#include "CxxUtils/ubsan_suppress.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/Incident.h"
 #include "GaudiKernel/IIncidentListener.h"
+#include "TInterpreter.h"
 #include <iostream>
 #include <cassert>
 #include <cmath>
@@ -283,6 +285,7 @@ void test_perigee (Trk::IIntersector& tool)
 int main()
 {
   std::cout << "SolenoidalIntersector_test\n";
+  CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
   ISvcLocator* svcloc = nullptr;
   Athena_test::initGaudi ("SolenoidalIntersector_test.txt", svcloc);
   ToolHandle<Trk::IIntersector> tool ("Trk::SolenoidalIntersector");
-- 
GitLab


From 94f6e55fef84d43102756e73318b0056f5ac13af Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:30:32 +0100
Subject: [PATCH 292/404] TrkExRungeKuttaIntersector: Suppress ubsan warnings
 from cling.

Suppress ubsan warnings we get from cling.
---
 .../TrkExRungeKuttaIntersector/CMakeLists.txt               | 6 +++++-
 .../test/RungeKuttaIntersector_test.cxx                     | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/CMakeLists.txt b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/CMakeLists.txt
index dd94301dd40..7c05f55b53a 100644
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/CMakeLists.txt
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/CMakeLists.txt
@@ -15,6 +15,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Tracking/TrkExtrapolation/TrkExInterfaces
                           Tracking/TrkExtrapolation/TrkExUtils
                           PRIVATE
+                          Control/CxxUtils
                           AtlasTest/TestTools
                           Tracking/TrkDetDescr/TrkDetDescrUtils
                           Tracking/TrkDetDescr/TrkGeometry
@@ -23,6 +24,8 @@ atlas_depends_on_subdirs( PUBLIC
 
 # External dependencies:
 find_package( Eigen )
+find_package( ROOT )
+
 
 # Component(s) in the package:
 atlas_add_component( TrkExRungeKuttaIntersector
@@ -38,7 +41,8 @@ atlas_install_headers( TrkExRungeKuttaIntersector )
 
 atlas_add_test( RungeKuttaIntersector_test
                 SOURCES test/RungeKuttaIntersector_test.cxx
-                LINK_LIBRARIES TrkExUtils GaudiKernel TestTools
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES TrkExUtils GaudiKernel TestTools CxxUtils ${ROOT_LIBRARIES}
                 EXTRA_PATTERNS "^AtlasFieldSvc +INFO"
                 ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
 
diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx
index 14b0fddb0e2..f0c0809b019 100644
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx
@@ -14,9 +14,11 @@
 #include "TestTools/initGaudi.h"
 #include "TestTools/FLOATassert.h"
 #include "AthenaKernel/Units.h"
+#include "CxxUtils/ubsan_suppress.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/Incident.h"
 #include "GaudiKernel/IIncidentListener.h"
+#include "TInterpreter.h"
 #include <iostream>
 #include <cassert>
 #include <cmath>
@@ -269,6 +271,7 @@ void test_perigee (Trk::IIntersector& tool)
 int main()
 {
   std::cout << "RungeKuttaIntersector_test\n";
+  CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
   ISvcLocator* svcloc = nullptr;
   Athena_test::initGaudi ("RungeKuttaIntersector_test.txt", svcloc);
   ToolHandle<Trk::IIntersector> tool ("Trk::RungeKuttaIntersector");
-- 
GitLab


From fa51bc581b0fc6aa33a0690f35b323142a17ee85 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 03:35:15 +0100
Subject: [PATCH 293/404] AthenaPoolMultiTest: Update reference files.

Fix test failures in master.
---
 .../share/AthenaPoolMultiTestEventNoSplit.ref               | 2 +-
 .../share/AthenaPoolMultiTestEventSplitDecision.ref         | 6 +++---
 .../share/AthenaPoolMultiTestStreamSelect.ref               | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
index 78bb5124f76..ebec9ab64db 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventNoSplit.ref
@@ -50,7 +50,7 @@ Splitter3            INFO L1 failed
 Triggered            INFO EventInfo event: 0 run: 0
 Triggered            INFO L1 passed
 Domain[ROOT_All]     INFO                           AthenaPoolMultiTest_StreamAll.root
-RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll.root File version:61408
+RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll.root File version:61600
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 1 run: 0
 Splitter1           DEBUG Trigmask = 2
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
index d447b55989a..69a5e6b5c11 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestEventSplitDecision.ref
@@ -2,13 +2,13 @@ Py:Athena            INFO including file "AthenaPoolMultiTest/ExampleStreamConfi
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 Splitter1           DEBUG Property update for OutputLevel : new value = 2
 Splitter1            INFO in initialize()
-Splitter1           DEBUG input handles: 1
+Splitter1           DEBUG input handles: 3
 Splitter1           DEBUG output handles: 0
 Splitter1           DEBUG Data Deps for Splitter1
 Splitter2            INFO in initialize()
 Splitter3           DEBUG Property update for OutputLevel : new value = 2
 Splitter3            INFO in initialize()
-Splitter3           DEBUG input handles: 1
+Splitter3           DEBUG input handles: 3
 Splitter3           DEBUG output handles: 0
 Splitter3           DEBUG Data Deps for Splitter3
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
@@ -32,7 +32,7 @@ Splitter3            INFO EventInfo event: 0 run: 0
 Splitter3           DEBUG Trigmask = 1
 Splitter3            INFO L1 failed
 Domain[ROOT_All]     INFO                           AthenaPoolMultiTest_StreamAll2.root
-RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll2.root File version:61408
+RootDatabase.open    INFO AthenaPoolMultiTest_StreamAll2.root File version:61600
 Splitter1           DEBUG in execute()
 Splitter1            INFO EventInfo event: 1 run: 0
 Splitter1           DEBUG Trigmask = 2
diff --git a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestStreamSelect.ref b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestStreamSelect.ref
index 57b8875aa69..a88cd75fffc 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestStreamSelect.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolMultiTest/share/AthenaPoolMultiTestStreamSelect.ref
@@ -397,5 +397,5 @@ EventSelector.S...   INFO <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>>
 EventSelector.S...  DEBUG Found attribute list
 EventSelector.S...  ERROR Stream decision for StreamX does not exist in input
 EventSelector        INFO skipping event 20
-EventSelector        INFO Disconnecting input sourceID: 1493FAFB-462F-434F-9DE6-5F15E2EDEC31
+EventSelector        INFO Disconnecting input sourceID: EC48B5A6-FBBA-994F-B8BD-88D3E055817A
 ReadData             INFO in finalize()
-- 
GitLab


From 77976b78fa4fd4116ebf0f2e602cb24c26943d8e Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:05:22 +0100
Subject: [PATCH 294/404] DQDefects: Make sure we're using the correct version
 of nosetests.

With LCG_95, we're picking up the version of nosetests from /usr/bin,
which is not compatible with the nose library we get with LCG.
Try to find the nosebin library relative to the nose python module.
---
 DataQuality/DQDefects/test/DQDefects_test.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/DataQuality/DQDefects/test/DQDefects_test.sh b/DataQuality/DQDefects/test/DQDefects_test.sh
index c536ff179b0..b5225956c25 100755
--- a/DataQuality/DQDefects/test/DQDefects_test.sh
+++ b/DataQuality/DQDefects/test/DQDefects_test.sh
@@ -1,3 +1,4 @@
 #!/bin/bash
 
-nosetests -v DQDefects
\ No newline at end of file
+NOSEPATH=`python -c 'import nose; f=nose.__file__; i=f.find("/lib/"); print f[0:i]'`
+$NOSEPATH/bin/nosetests -v DQDefects
\ No newline at end of file
-- 
GitLab


From c255df793196d8a3330265bf21f021df73c65b8e Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:41:59 +0100
Subject: [PATCH 295/404] TrigT2CaloCommon: Get test working.

In TestCaloDataAccess, need to set a valid EventContext in new threads.

In the job configuration, need to to configure tile conditions
and LArBadChanLegacyTool.
---
 .../TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py    | 7 ++++++-
 .../TrigT2CaloCommon/src/TestCaloDataAccess.cxx            | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
index 3a27c1960df..79f5d951a4b 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigCaloDataAccessConfig.py
@@ -49,8 +49,13 @@ def trigCaloDataAccessSvcCfg( flags ):
     
     acc.merge( createLArRoI_Map( flags ) )
 
+    # Needed by LArBadChanLegacyTool, refrerenced from LArCellCont.
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    acc.merge(addFolders(flags, ['/LAR/BadChannels/BadChannels'], 'LAR'))
+    acc.merge(addFolders(flags, ['/LAR/BadChannels/MissingFEBs'], 'LAR'))
 
-
+    from TileConditions.TileConditionsConfig import tileCondCfg
+    acc.merge( tileCondCfg (flags) )
 
     from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool
     import math
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
index 779db7f64d9..c9f6ea6b9e3 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TestCaloDataAccess.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 <iostream>
 #include "tbb/parallel_reduce.h"
@@ -96,6 +96,7 @@ public:
 
   // calculate reference quantities in the first call
   void firstCall() override { 
+    Gaudi::Hive::setCurrentContext (m_context);
     if ( m_roi.isFullscan() ) {
       struct timeval t1,t2;
       gettimeofday(&t1,NULL);
@@ -136,6 +137,7 @@ public:
   
   bool callAndCompare() const override {
 
+    Gaudi::Hive::setCurrentContext (m_context);
     LArTT_Selector<LArCellCont> sel;
     ConstDataVector<CaloCellContainer> col(SG::VIEW_ELEMENTS);
     double etSum  = 0;      
-- 
GitLab


From 95ff3bf5006dc151d68b61ec710d5cc2368fda7f Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Thu, 7 Mar 2019 08:46:39 +0100
Subject: [PATCH 296/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetEventCnvTools
 package.

---
 .../InDetEventCnvTools/ATLAS_CHECK_THREAD_SAFETY                 | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventCnvTools/InDetEventCnvTools/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetEventCnv/InDetEventCnvTools/InDetEventCnvTools/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/InDetEventCnvTools/InDetEventCnvTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6b4bfcdb640
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetEventCnvTools/InDetEventCnvTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/InDetEventCnvTools
-- 
GitLab


From 456b0d1dc9c64ce6cf4d146850676c1621b96995 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 7 Mar 2019 09:11:11 +0100
Subject: [PATCH 297/404] Fixes for test on slc6

The slc6 version of `pkill` does not supported long option names.
---
 HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh b/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
index 8ee0600f174..5ee5a5490e9 100755
--- a/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
+++ b/HLT/Trigger/TrigControl/TrigCommon/share/test_athenaHLT.sh
@@ -10,8 +10,8 @@ test_options=$@
 trap cleanup INT TERM EXIT
 function cleanup {
     sid=`ps -o sess= -p $$`  # our own session id
-    pkill -9 --parent 1 --session $sid ipc_server
-    pkill -9 --parent 1 --session $sid is_server
+    pkill -9 -P 1 -s $sid ipc_server
+    pkill -9 -P 1 -s $sid is_server
 }
 
 # We only test the configuration stage, so these dummy values are just fine.
-- 
GitLab


From 09c3f515487ad360bf7abc34c12e918271ade0e0 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Thu, 7 Mar 2019 09:43:01 +0100
Subject: [PATCH 298/404] Add ATLAS_CHECK_THREAD_SAFETY

---
 .../InDetSimEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY            | 1 +
 .../InDetSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY                 | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/InDetSimEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetEventCnv/InDetSimEventTPCnv/InDetSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/InDetSimEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/InDetSimEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3435c2b014f
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/InDetSimEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/InDetSimEventAthenaPool
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/InDetSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/InDetSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..fd6bc537d7c
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/InDetSimEventTPCnv/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/InDetSimEventTPCnv
-- 
GitLab


From 70deef348429a06a799edbcf3a13c931f56d85b4 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Thu, 7 Mar 2019 10:49:05 +0000
Subject: [PATCH 299/404] Add ATLAS_CHECK_THREAD_SAFETY to
 InDetPrepRawDataToxAOD package

---
 .../SCTRawHitValidationAuxContainer_v1.cxx    |  2 +-
 .../Root/SCTRawHitValidation_v1.cxx           |  7 +++-
 .../SCTRawHitValidationAuxContainer_v1.h      |  5 +++
 .../versions/SCTRawHitValidation_v1.h         | 33 ++++++++++++++++++-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../src/SCT_RawDataToxAOD.cxx                 | 18 +++-------
 6 files changed, 50 insertions(+), 16 deletions(-)
 create mode 100644 InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Event/xAOD/xAODTracking/Root/SCTRawHitValidationAuxContainer_v1.cxx b/Event/xAOD/xAODTracking/Root/SCTRawHitValidationAuxContainer_v1.cxx
index 0cd4a40a380..bbae7be5766 100644
--- a/Event/xAOD/xAODTracking/Root/SCTRawHitValidationAuxContainer_v1.cxx
+++ b/Event/xAOD/xAODTracking/Root/SCTRawHitValidationAuxContainer_v1.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 "xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h"
diff --git a/Event/xAOD/xAODTracking/Root/SCTRawHitValidation_v1.cxx b/Event/xAOD/xAODTracking/Root/SCTRawHitValidation_v1.cxx
index b77313167b2..bad5f35683e 100644
--- a/Event/xAOD/xAODTracking/Root/SCTRawHitValidation_v1.cxx
+++ b/Event/xAOD/xAODTracking/Root/SCTRawHitValidation_v1.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 "xAODTracking/versions/SCTRawHitValidation_v1.h"
@@ -11,6 +11,11 @@ namespace xAOD {
   SCTRawHitValidation_v1::SCTRawHitValidation_v1() { }
 
   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, uint64_t, identifier, setIdentifier)
+  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, int, bec, setBec)
+  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, int, layer, setLayer)
+  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, int, eta_module, setEta_module)
+  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, int, phi_module, setPhi_module)
+  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(SCTRawHitValidation_v1, int, side, setSide)
 
   static const SG::AuxElement::Accessor<uint32_t> word_acc("dataword");
   void SCTRawHitValidation_v1::setWord(uint32_t new_word) {
diff --git a/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h b/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h
index 67157be1e9c..0627f07f838 100644
--- a/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h
+++ b/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h
@@ -21,6 +21,11 @@ namespace xAOD {
   private:
     std::vector<uint64_t> identifier;
     std::vector<uint32_t> dataword;
+    std::vector<int> bec;
+    std::vector<int> layer;
+    std::vector<int> phi_module;
+    std::vector<int> eta_module;
+    std::vector<int> side;
   };
 }
 
diff --git a/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidation_v1.h b/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidation_v1.h
index 559f906c79a..640ca40a54c 100644
--- a/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidation_v1.h
+++ b/Event/xAOD/xAODTracking/xAODTracking/versions/SCTRawHitValidation_v1.h
@@ -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
 */
 
 #ifndef XAODTRACKING_VERSIONS_SCTRAWHITVALIDATION_V1_H
@@ -63,6 +63,37 @@ namespace xAOD {
     /// check if there is an error in the second hit's data
     bool SecondHitError() const;
     /// @}
+
+    /// set bec of this RDO
+    void setBec(int new_bec);
+
+    /// get bec of this RDO
+    int bec() const;
+
+    /// set layer of this RDO
+    void setLayer(int new_layer);
+
+    /// get layer of this RDO
+    int layer() const;
+    
+    /// set eta_module of this RDO
+    void setEta_module(int new_eta_module);
+    
+    /// get eta_module of this RDO
+    int eta_module() const;
+    
+    /// set phi_module of this RDO
+    void setPhi_module(int new_phi_module);
+    
+    /// get phi_module of this RDO
+    int phi_module() const;
+    
+    /// set side of this RDO
+    void setSide(int new_side);
+
+    /// get side of this RDO
+    int side() const;
+    
   }; // end of the SCTRawHitValidation_v1 class definition
 
 } // end of the xAOD namespace
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..1f133e2fc83
--- /dev/null
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_RawDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_RawDataToxAOD.cxx
index 25ab40b25de..345d2abbc20 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_RawDataToxAOD.cxx
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_RawDataToxAOD.cxx
@@ -29,14 +29,6 @@ StatusCode SCT_RawDataToxAOD::initialize() {
   return StatusCode::SUCCESS;
 }
 
-// define accessors used by execute method; defining them once means fewer
-// string comparisons.
-static SG::AuxElement::Accessor<int> bec_acc("bec");
-static SG::AuxElement::Accessor<int> layer_acc("layer");
-static SG::AuxElement::Accessor<int> phi_module_acc("phi_module");
-static SG::AuxElement::Accessor<int> eta_module_acc("eta_module");
-static SG::AuxElement::Accessor<int> side_acc("side");
-
 StatusCode SCT_RawDataToxAOD::execute(const EventContext& ctx) const {
   SG::ReadHandle<SCT_RDO_Container> rdoContainer(m_rdoContainerName, ctx);
 
@@ -56,11 +48,11 @@ StatusCode SCT_RawDataToxAOD::execute(const EventContext& ctx) const {
       xrdo->setIdentifier(id.get_compact());
       xrdo->setWord(rdo->getWord());
       // setting additional decorations based on identifier
-      bec_acc(*xrdo) = m_SCTHelper->barrel_ec(id);
-      layer_acc(*xrdo) = m_SCTHelper->layer_disk(id);
-      phi_module_acc(*xrdo) = m_SCTHelper->phi_module(id);
-      eta_module_acc(*xrdo) = m_SCTHelper->eta_module(id);
-      side_acc(*xrdo) = m_SCTHelper->side(id);
+      xrdo->setBec(m_SCTHelper->barrel_ec(id));
+      xrdo->setLayer(m_SCTHelper->layer_disk(id));
+      xrdo->setPhi_module(m_SCTHelper->phi_module(id));
+      xrdo->setEta_module(m_SCTHelper->eta_module(id));
+      xrdo->setSide(m_SCTHelper->side(id));
     }
   }
   ATH_MSG_DEBUG(" recorded SCT_RawData objects: size " << xaod->size());
-- 
GitLab


From 65c8cfd1822081c50819e8b3dcfe25c0931c19a4 Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Thu, 7 Mar 2019 11:30:40 +0000
Subject: [PATCH 300/404] Remove bad chan legacy tool

---
 .../LArBadChannelTool/LArBadChanLegacyTool.h  | 142 ----
 .../LArBadChannelDBToolsDict.h                |   1 -
 .../LArBadChannelTool/LArBadChannelState.h    |   2 -
 .../LArBadChannelTool/LArBadFebMasker.h       |  53 ++
 .../src/LArBadChanLegacyTool.cxx              | 634 ------------------
 .../LArBadChannelTool/src/LArBadFebMasker.cxx | 118 ++++
 .../components/LArBadChannelTool_entries.cxx  |   4 +-
 .../LArRecConditions/ILArBadChanTool.h        |  56 --
 .../LArRecConditions/ILArBadFebMasker.h       |  33 +
 .../TrigT2CaloCommon/CMakeLists.txt           |   3 +-
 .../TrigT2CaloCommon/LArCellCont.h            |   7 +-
 .../TrigT2CaloCommon/share/CaloCellMasking.py |  11 +-
 .../TrigT2CaloCommon/src/LArCellCont.cxx      |  21 +-
 .../L1CaloLArTowerEnergy.h                    |   4 +-
 .../src/L1CaloLArTowerEnergy.cxx              |  14 +-
 15 files changed, 236 insertions(+), 867 deletions(-)
 delete mode 100644 LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h
 create mode 100644 LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadFebMasker.h
 delete mode 100644 LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx
 create mode 100644 LArCalorimeter/LArBadChannelTool/src/LArBadFebMasker.cxx
 delete mode 100644 LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadChanTool.h
 create mode 100644 LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadFebMasker.h

diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h
deleted file mode 100644
index be223d2732e..00000000000
--- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef LArBadChanLegacyTool_H
-#define LArBadChanLegacyTool_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "LArRecConditions/ILArBadChanTool.h"
-
-#include "LArRecConditions/LArBadChannel.h"
-#include "LArRecConditions/BadChanContainer.h"
-#include "CaloConditions/ICaloBadChanTool.h"
-
-#include "Identifier/HWIdentifier.h"
-#include "LArIdentifier/LArOnlineID.h"
-#include "LArCabling/LArCablingLegacyService.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "AthenaKernel/IOVSvcDefs.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-
-#include "StoreGate/DataHandle.h"
-#include "LArBadChannelTool/LArBadChannelState.h"
-#include "LArBadChannelTool/LArBadChanContainerHashed.h"
-#include "LArBadChannelTool/LArBadChanFEBHasher.h"
-
-class StoreGateSvc;
-
-class LArBadChanLegacyTool : public AthAlgTool,
-		       public ILArBadChanTool,
-		       public ICaloBadChanTool 
-{
-public:
-
-  typedef LArBadChannelState                                   State;
-  typedef LArBadChanContainerHashed::BadFebEntry               BadFebEntry;
-  typedef std::vector<BadFebEntry>                             BadFebVec;
-
-  LArBadChanLegacyTool(const std::string& type, const std::string& name, 
-		    const IInterface* parent);
-					  
-// to allow access to the  interface
-   StatusCode queryInterface( const InterfaceID& riid, void** ppvIf );
-
-
-  StatusCode initialize();
-  // StatusCode finalize();
-
-  LArBadChannel status( HWIdentifier id) const;
-
-  LArBadChannel status( const HWIdentifier& FEBid, int chan) const;
-
-  LArBadChannel offlineStatus( Identifier id) const;
-
-  virtual bool febMissing(  HWIdentifier febId) const {
-    return m_HwBadChan.febBad( febId);
-  }
-  virtual bool febAllGood(  HWIdentifier febId) const {
-    return m_HwBadChan.febAllGood( febId);
-  }
-
-  virtual LArBadFeb febStatus( HWIdentifier febId) const {
-    return  m_HwBadChan.febStatus( febId);
-  }
-
-/// Converts a LArBadChannel status to CaloBadChannel, thus implementing the 
-/// ICaloBadChannelTool interface
-  virtual CaloBadChannel caloStatus( Identifier id) const;
-
-  static const InterfaceID& interfaceID();
-
-  const State& fullState() const {return m_State;}
-
-  std::vector<HWIdentifier> missingFEBs() const;
-
-  const BadFebVec& fullBadFebsState() const {return m_BadFebs;}
-
-  // Callback functions
-  virtual StatusCode updateFromDB(IOVSVC_CALLBACK_ARGS);
-  virtual StatusCode updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS);
-
-private:
-
-  typedef LArBadChanContainerHashed                      BadChanInfo;
-  typedef BadChanInfo::BadChanVec                        BadChanVec;
-  typedef BadChanContainer<Identifier, LArBadChannel>    OfflineInfo;
-  typedef OfflineInfo::BadChanVec                        OfflineVec;
-
-  const DataHandle<LArOnlineID> m_onlineID;
-  const DataHandle<CondAttrListCollection>  m_DBColl;
-  const DataHandle<CondAttrListCollection>  m_TmpDBColl;
-  const DataHandle<AthenaAttributeList>          m_DBBadFebColl;
-  ToolHandle<LArCablingLegacyService> m_cablingService;
-
-  mutable BadChanInfo      m_HwBadChan; //should be non-mutable if possible
-  mutable OfflineInfo      m_OfflineBadChan;
-  State                    m_State;
-  State                    m_Updates;
-  BadFebVec                m_BadFebs;
-  BadFebVec                m_BadFebUpdates;
-
-  bool                 m_updatedFromDB;
-  bool                 m_updatedFebsFromDB;
-  mutable bool         m_ready;
-
-  bool                 m_readFromASCII;
-  int                  m_ASCII_action;
-  bool                 m_writeEmptyFolders;
-  std::vector<std::string> m_fileNames;
-  std::string              m_febFileName;
-  std::string              m_DBFolder;
-  std::string              m_TmpDBFolder;
-  std::string              m_DBBadFebFolder;
-  bool                     m_dumpCache;
-  mutable bool             m_OfflineCacheInvalid;
-
-  bool prepareFebHash();
-  void check() const {if (!m_ready) complain();} // keep it inline for speed
-
-  void complain() const;
-  bool readASCII();
-
-  void fillOfflineInfo() const;
-  void updateCache();
-  void updateFebCache();
-
-  bool readFromDB();
-  bool readFromDB( const DataHandle<CondAttrListCollection> collection);
-  bool readBadFebsFromDB();
-  void dumpHWCache() const;
-  void applyUpdates();
-  void applyUpdate( State::CoolChannelData& coolChan, const State::BadChanEntry& entry);
-  void applyFebUpdates();
-
-  void dumpAscii( const std::string& fileName) const;
-  void dumpFEBsAscii( const std::string& fileName) const;
-  void warnInvalidFEB( const HWIdentifier& id) const;
-
-};
-
-#endif
diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h
index 9db4b7695d5..94827b6f9be 100644
--- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h
+++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h
@@ -14,7 +14,6 @@
 #include "LArRecConditions/LArBadChanBitPacking.h"
 
 #include "LArBadChannelTool/LArBadChannelMasker.h"
-#include "LArBadChannelTool/LArBadChanLegacyTool.h"
 
 std::pair<bool,LArBadChannelEnum::ProblemType> dummy1;
 std::pair<HWIdentifier,LArBadFeb> dummy2;
diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h
index ec81a825e8c..e169ffda64c 100644
--- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h
+++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h
@@ -163,8 +163,6 @@ class LArBadChannelState {
 
   std::vector< CoolChannelData> m_DataVec;
 
-  friend class LArBadChanLegacyTool;
-
   // Non-const access to channel data
   CoolChannelData& coolChannel( int i) {
     return m_DataVec.at( static_cast<CoolChannelEnum>(i));
diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadFebMasker.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadFebMasker.h
new file mode 100644
index 00000000000..2b8a636b6ce
--- /dev/null
+++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadFebMasker.h
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef LARBADFEBMASKER_H
+#define LARBADFEBMASKER_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "Identifier/HWIdentifier.h" 
+#include "LArRecConditions/LArBadChannelCont.h"
+#include "LArRecConditions/ILArBadFebMasker.h"
+
+//class StoreGateSvc;
+
+#include "StoreGate/ReadCondHandleKey.h"
+
+class LArBadFebMasker : virtual public ILArBadFebMasker, public AthAlgTool
+{
+public:
+
+   LArBadFebMasker(const std::string& type, const std::string& name, const IInterface* parent);
+   virtual ~LArBadFebMasker();
+
+   virtual StatusCode initialize() override;
+
+   virtual bool febMissing( const HWIdentifier& febId) const override final;
+   virtual bool shouldbeMasked(const  HWIdentifier& febId) const override final;
+   virtual LArBadFeb febStatus(const  HWIdentifier& febId) const override final;
+
+   virtual bool isMaskingOn() const override final//allow the client code to check in order to optimize
+      {return m_doMasking;}
+
+   StatusCode queryInterface(const InterfaceID& riid, void** ppvIf);
+   static const InterfaceID& interfaceID();
+
+private:
+
+   typedef LArBadFebEnum::BitWord BitWord;
+
+   LArBadFebMasker();   
+
+   void buildBitMask();
+   static const std::vector<std::string>& defaultProblems();
+
+   SG::ReadCondHandleKey<LArBadFebCont> m_bfContKey;
+   BitWord                      m_bitMask;           // The list of problems from m_problemWords, in bit form.
+   std::vector<std::string>     m_problemWords;      // The list of FEB problems to be masked.
+   bool                         m_doMasking;         // Determines whether to do masking.
+
+};
+
+#endif
diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx
deleted file mode 100644
index 72cc9e2203f..00000000000
--- a/LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "LArBadChannelTool/LArBadChanLegacyTool.h"
-
-#include "LArBadChannelTool/LArBadChannelDecoder.h"
-#include "StoreGate/StoreGate.h"
-#include "GaudiKernel/MsgStream.h"
-#include "LArIdentifier/LArOnlineID.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "LArRecConditions/LArBadChanBitPacking.h"
-#include "LArRecConditions/LArBadFebBitPacking.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "CoolKernel/types.h"
-#include "LArBadChannelTool/LArBadChannelDBTools.h"
-#include "LArBadChannelTool/LArBadChanBlobUtils.h"
-
-#include "combined_ordered_container.h"
-#include "mergeDuplicateEntries.h"
-
-#include <set>
-
-#include <fstream>
-
-struct BadFebEntryLess {
-  bool operator()(const LArBadChanLegacyTool::BadFebEntry& a,
-		  const LArBadChanLegacyTool::BadFebEntry& b) const {
-    return a.first < b.first;
-  }
-};
-
-struct BadFebEntryMerger {
-  LArBadChanLegacyTool::BadFebEntry operator()( const LArBadChanLegacyTool::BadFebEntry& a, 
-					  const LArBadChanLegacyTool::BadFebEntry& b) const {
-    return LArBadChanLegacyTool::BadFebEntry( a.first, 
-					LArBadFeb( a.second.packedData() | b.second.packedData()));
-  }
-};
-
-LArBadChanLegacyTool::LArBadChanLegacyTool(const std::string& type, const std::string& name, 
-			       const IInterface* parent) :
-	AthAlgTool( type, name, parent), 
-        m_cablingService("LArCablingLegacyService"),
-	m_updatedFromDB( false),
-	m_updatedFebsFromDB( false),
-	m_ready( false),
-	m_readFromASCII(false),
-	m_ASCII_action(0),
-	m_writeEmptyFolders(false),
-	m_fileNames(State::NCoolChannels),
-	m_DBFolder("/LAR/BadChannels/BadChannels"),
-	m_TmpDBFolder(),                           // empty by default
-	m_DBBadFebFolder("/LAR/BadChannels/MissingFEBs"),
-	m_dumpCache(false),
-	m_OfflineCacheInvalid(true)
-{
-  declareInterface<ILArBadChanTool>(this);
-  declareInterface<ICaloBadChanTool>(this);
-
-  declareProperty("ReadFromASCII", m_readFromASCII);
-  declareProperty("ASCIIFileAction", m_ASCII_action);
-  declareProperty("WriteEmptyFolders", m_writeEmptyFolders);
-  declareProperty("CoolFolder", m_DBFolder);
-  declareProperty("ComplementaryCoolFolder", m_TmpDBFolder);
-  declareProperty("CoolMissingFEBsFolder", m_DBBadFebFolder);
-  declareProperty("DumpCache", m_dumpCache);
-
-  declareProperty("EMBAfile", m_fileNames[State::EMBA]);
-  declareProperty("EMBCfile", m_fileNames[State::EMBC]);
-  declareProperty("EMECAfile", m_fileNames[State::EMECA]);
-  declareProperty("EMECCfile", m_fileNames[State::EMECC]);
-  declareProperty("HECAfile", m_fileNames[State::HECA]);
-  declareProperty("HECCfile", m_fileNames[State::HECC]);
-  declareProperty("FCALAfile", m_fileNames[State::FCALA]);
-  declareProperty("FCALCfile", m_fileNames[State::FCALC]);
-  declareProperty("FEBfile", m_febFileName);
-
-}
-
-const InterfaceID& LArBadChanLegacyTool::interfaceID() 
-{ 
-  //return ILArBadChanLegacyTool::interfaceID(); 
-  static const InterfaceID id("LArBadChanLegacyTool", 1 , 0);
-  return id; 
-}
-
-StatusCode LArBadChanLegacyTool::queryInterface( const InterfaceID& riid, void** ppvIf )
-{
-   if ( riid == ILArBadChanTool::interfaceID() )  {
-      *ppvIf = static_cast<ILArBadChanTool*>(this);
-      addRef();
-      return StatusCode::SUCCESS;
-   }
-   if ( riid == interfaceID() )  {
-      *ppvIf = this;
-      addRef();
-      return StatusCode::SUCCESS;
-   }
-   /*
-   if ( riid == ICaloBadChannelTool::interfaceID() )  {
-      *ppvIf = static_cast<ICaloBadChannelTool*>(this);
-      addRef();
-      return StatusCode::SUCCESS;
-   }
-   */
-   return AthAlgTool::queryInterface( riid, ppvIf );
-}
-
-StatusCode LArBadChanLegacyTool::initialize()
-{
-  ATH_MSG_DEBUG ("in initialize()" );
-	
-  ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") );
-  if (!prepareFebHash()) {
-    ATH_MSG_ERROR ( "Could not configure FEB hasher" );
-    return StatusCode::FAILURE;
-  }
-
-  // we need to read from ASCII before the callback registration, because
-  // if the tool is initialised e.g. during event processing the callback
-  // will be triggered immediately
-  if (m_readFromASCII) {
-    if (!readASCII()) {
-      ATH_MSG_ERROR ("Could not read ASCII file(s)" );
-      return StatusCode::FAILURE;
-    }
-    // prepare the tool for use in case no DB update occurs, but keep m_ready false
-    m_State = m_Updates;
-    if (!m_BadFebUpdates.empty()) applyFebUpdates(); // from ASCII file. Does sorting and duplicate removal
-    updateCache();
-    updateFebCache();
-  }
-
-  if (!m_DBFolder.empty()) {
-    ATH_CHECK( detStore()->regFcn( &ILArBadChanTool::updateFromDB, dynamic_cast<ILArBadChanTool*>(this),
-                                   m_DBColl, m_DBFolder, true) );
-  }
-
-  if (!m_TmpDBFolder.empty()) {
-    ATH_CHECK( detStore()->regFcn( &ILArBadChanTool::updateFromDB, dynamic_cast<ILArBadChanTool*>(this),
-                                   m_TmpDBColl, m_TmpDBFolder, true) );
-  }
-
-  if (!m_DBBadFebFolder.empty()) {
-    ATH_CHECK( detStore()->regFcn( &ILArBadChanTool::updateBadFebsFromDB, dynamic_cast<ILArBadChanTool*>(this),
-                                   m_DBBadFebColl, m_DBBadFebFolder, true) );
-  }
-
-  ATH_CHECK( m_cablingService.retrieve() );
-  ATH_MSG_DEBUG ( "CablingService retrieved" );
-  
-  return StatusCode::SUCCESS;
-}
-
-std::vector<HWIdentifier> LArBadChanLegacyTool::missingFEBs() const
-{
-  std::vector<HWIdentifier> result( m_BadFebs.size());
-  for (unsigned int i=0; i<m_BadFebs.size(); ++i)
-    result[i] = m_BadFebs[i].first;
-  return result;
-}
-
-void LArBadChanLegacyTool::complain() const
-{
-  if (!m_updatedFromDB) {
-    // if we are here then the bad channel DB update did not take place before first use
-    ATH_MSG_WARNING ( "the LArBadChanLegacyTool is used without bad channel information from DB" );
-
-    if (m_Updates.empty()) {
-      ATH_MSG_WARNING ( "and it contains no bad channel information from ASCII file." );
-      ATH_MSG_WARNING 
-        ( "All channels will be considered good, but this may not be what you wanted" );
-      BadChanVec empty;
-      m_HwBadChan.set(empty); //need to populate the hash table with good channels
-    }
-    else {
-      // No need to apply updates from ASCII file, that's done in initialize()
-      ATH_MSG_WARNING ( "Only ASCII file bad channel information is available." );
-    }
-  }
-  if (!m_updatedFebsFromDB) {
-    // if we are here then the bad Feb DB update did not take place before first use
-    ATH_MSG_WARNING ( "the LArBadChanLegacyTool is used without missing FEB information from DB" );
-
-    if (m_BadFebUpdates.empty()) {
-      ATH_MSG_WARNING ( "and it contains no missing FEB information from ASCII file." );
-      ATH_MSG_WARNING 
-        ( "All FEBs will be considered good, but this may not be what you wanted" );
-      // the febs are good by default so we don't need to set them explicitly
-    }
-    else {
-      // No need to apply updates from ASCII file, that's done in initialize()
-      ATH_MSG_WARNING ( "Only ASCII file missing FEB information is available." );
-    }
-  }
-  m_ready = true;
-}
-
-bool LArBadChanLegacyTool::readASCII() 
-{
-  LArBadChannelDecoder decoder(&(*m_onlineID), msg());
-
-  int goodLines = 0;
-  for (int i=0; i<State::NCoolChannels; i++) {
-    if ( !m_fileNames.at(i).empty()) {
-      State::CoolChannelEnum coolChan = static_cast<State::CoolChannelEnum>(i);
-      ATH_MSG_INFO ( "Attempting to read file " << m_fileNames[i] 
-                     << " for COOL channel " << State::coolChannelName( coolChan) );
-
-      std::vector<State::BadChanEntry> res = decoder.readASCII( m_fileNames[i], coolChan);
-      if ( !res.empty()) {
-	ATH_MSG_INFO ( "Read " << res.size() << " lines from file " << m_fileNames[i]
-                       << " into COOL channel " << State::coolChannelName( coolChan) );
-	m_Updates.addUpdate( res, coolChan);
-	goodLines += res.size();
-      }
-      else if (!m_writeEmptyFolders) {
-	ATH_MSG_ERROR ( "Failed to read any lines from file " << m_fileNames[i] 
-                        << " for COOL channel " << State::coolChannelName( coolChan) );
-	return false;
-      }
-    }
-  }
-  if ( !m_febFileName.empty()) {
-    std::vector<LArBadChannelDecoder::BadFebEntry> febs = decoder.readFebASCII( m_febFileName);
-    if (febs.empty() && (!m_writeEmptyFolders) ) {
-      ATH_MSG_ERROR ( "Failed to read any lines from FEB file " <<  m_febFileName );
-      return false;
-    }
-    else {
-      ATH_MSG_INFO ( "Decoded " << febs.size() << " lines from FEB file " <<  m_febFileName );
-      m_BadFebUpdates = febs;
-      goodLines += febs.size();
-    }
-  }
-
-  if (goodLines == 0 && (!m_writeEmptyFolders) ) {
-    ATH_MSG_ERROR ( "ASCII reading requested but no file names specified " );
-    return false;
-  }
-  else {
-    ATH_MSG_INFO ( "Read " << goodLines 
-                   << " lines in total (for all COOL channels and missing FEBs together) " );
-  }
-
-  // at this stage we have all the contents of the ASCII files in m_Updates.
-  // We need to
-  //  1) resolve duplicate entries for same channel
-  //  2) update the m_HwBadChan
-  //  3) invalidate or update m_OfflineBadChan
-  //  4) write the new status to the DB
-
-  for (int i=0; i<State::NCoolChannels; i++) {
-    if ( m_Updates.coolChannel(i).changed()) {
-      // resolveDuplicateEntries( m_Updates.coolChannel(i));
-      m_Updates.coolChannel(i).resolveDuplicateEntries();
-    }
-  }
-  return true;
-}
-
-LArBadChannel LArBadChanLegacyTool::status( HWIdentifier id) const {
-  check();
-  try {
-    return m_HwBadChan.status(id);
-  }
-  catch (const std::exception& ex) {
-    warnInvalidFEB(id);
-    return LArBadChannel();
-  }
-}
-
-LArBadChannel LArBadChanLegacyTool::status( const HWIdentifier& FEBid, int chan) const {
-  check();
-  try {
-    return m_HwBadChan.status( FEBid, chan);
-  }
-  catch (const std::exception& ex) {
-    warnInvalidFEB( FEBid);
-    return LArBadChannel();
-  }
-}
-
-void LArBadChanLegacyTool::warnInvalidFEB( const HWIdentifier& id) const
-{
-  ATH_MSG_WARNING ( "status requested for unknown HWIdentifier " 
-                    << id.get_identifier32().get_compact() );
-}
-
-LArBadChannel LArBadChanLegacyTool::offlineStatus( Identifier id) const
-{
-  check();
-
-  if (m_OfflineCacheInvalid) fillOfflineInfo();
-
-  return m_OfflineBadChan.status(id);
-}
-
-CaloBadChannel LArBadChanLegacyTool::caloStatus( Identifier id) const
-{
-  CaloBadChannel::BitWord res = 0;
-  LArBadChannel lbc = offlineStatus( id);
-
-  //Set 'noise' bit if appropriate
-  if ( lbc.reallyNoisy() || lbc.sporadicBurstNoise()) {
-    CaloBadChannel::setBit( CaloBadChannel::noisyBit, res);
-  }
-  //Set 'dead' bit (could be combined with noise bit)
-  if (lbc.deadReadout() || lbc.deadPhys()) {
-    CaloBadChannel::setBit( CaloBadChannel::deadBit, res);
-  }
-  //Set 'affected' bit (could be combined with noise bit, but not with dead bit
-  else if ( ! lbc.good()) {
-    CaloBadChannel::setBit( CaloBadChannel::affectedBit, res);
-  }
-  return CaloBadChannel(res);
-}
-
-void LArBadChanLegacyTool::fillOfflineInfo() const
-{
-  m_OfflineBadChan.clear(); 
-  OfflineVec vec;
-  std::vector<HWIdentifier> hwvec;
-  for (BadChanVec::const_iterator i=m_HwBadChan.begin(); i!=m_HwBadChan.end(); i++) {
-    Identifier id = m_cablingService->cnvToIdentifier( i->first);
-    vec.push_back(OfflineVec::value_type(id, status(i->first)));
-    hwvec.push_back(i->first);
-  }
-  std::sort( hwvec.begin(), hwvec.end());
-
-  // fill the missing FEB channels
-  for (std::vector<BadFebEntry>::const_iterator feb=m_BadFebs.begin(); feb!=m_BadFebs.end(); ++feb) {
-    for (int ch=0; ch<128; ++ch) {
-      HWIdentifier hwid = m_onlineID->channel_Id( feb->first, ch); 
-      // check if the channel is bad to avoid duplicates
-      if ( !std::binary_search( hwvec.begin(), hwvec.end(), hwid)) {
-	// check if the ids we generate are connected
-	if (m_cablingService->isOnlineConnected(hwid)) {
-	  Identifier id = m_cablingService->cnvToIdentifier( hwid);
-	  vec.push_back( OfflineVec::value_type( id, status(hwid,ch)));
-	}
-      }
-    }
-  }
-
-  m_OfflineBadChan = OfflineInfo(vec);
-  m_OfflineCacheInvalid = false;
-}
-
-void LArBadChanLegacyTool::updateCache()
-{
-  ATH_MSG_DEBUG ( " entering updateCache " );
-
-  BadChanVec bcv;
-
-  for (int cc=0; cc<State::NCoolChannels; cc++) {
-    const State::CoolChannelData& coolChan = m_State.coolChannel(cc);
-    bcv.insert( bcv.end(), coolChan.begin(), coolChan.end());
-  }
-  m_HwBadChan.set(bcv);
-
-  // invalidate offline cache (will be filled at first access, if needed
-  m_OfflineCacheInvalid = true;
-  
-  ATH_MSG_DEBUG ( " updateCache done " );
-}
-
-void LArBadChanLegacyTool::updateFebCache() 
-{
-  // just copy current FEB list to the cache
-  m_HwBadChan.setBadFEBs( m_BadFebs);
-
-  // invalidate offline cache (will be filled at first access, if needed
-  m_OfflineCacheInvalid = true;
-  
-}
-
-bool LArBadChanLegacyTool::readFromDB( const DataHandle<CondAttrListCollection> collection) 
-{
-  for ( CondAttrListCollection::const_iterator i=collection->begin(); 
-	i != collection->end(); ++i) {
-    State::CoolChannelEnum coolChan = static_cast<State::CoolChannelEnum>(i->first);
-    ATH_MSG_DEBUG ( "Reading Cool Channel " << i->first 
-                    << " corresponding to " << State::coolChannelName(coolChan) );
-    /*
-    const AthenaAttributeList& attrList( i->second);
-    const coral::Blob& blob = attrList["Blob"].data<coral::Blob>();
-    unsigned int chanSize = attrList["ChannelSize"].data<unsigned int>();
-    unsigned int stateSize = attrList["StatusWordSize"].data<unsigned int>();
-    unsigned int endian = attrList["Endianness"].data<unsigned int>();
-    unsigned int version = attrList["Version"].data<unsigned int>();
-    
-    std::vector<State::BadChanEntry> stateVec = 
-      LArBadChanBlobUtils::decodeBlob<LArBadChannel>( &blob, chanSize, stateSize, endian,
-						      version, log);
-    */
-    /* 
-    // Unfortunately we have to skip this test because we need empty channels to 
-    // bypass Athena problem.
-    if (stateVec.empty()) {
-    log <<MSG::ERROR <<"Got empty channel list after Blob decoding of col channel " 
-    << State::coolChannelName(coolChan) << endmsg;
-    return false;
-    }
-    */
-    
-    m_State.addFromDB( LArBadChannelDBTools::readBadChan( i->second, msg()), coolChan);
-  }
-  return true;
-}
-
-bool LArBadChanLegacyTool::readBadFebsFromDB() 
-{
-
-  ATH_CHECK( detStore()->retrieve( m_DBBadFebColl, m_DBBadFebFolder), false );
-  ATH_MSG_INFO ( "Retrieved folder " << m_DBBadFebFolder );
-
-  if (!m_DBBadFebColl.isValid()){
-    ATH_MSG_ERROR ( " DB handle for missing FEBs is invalid" );
-    return false;
-  }
-  /*
-  const AthenaAttributeList& attrList( *m_DBBadFebColl);
-  const coral::Blob& blob = attrList["Blob"].data<coral::Blob>();
-  unsigned int chanSize = attrList["ChannelSize"].data<unsigned int>();
-  unsigned int stateSize = attrList["StatusWordSize"].data<unsigned int>();
-  unsigned int endian = attrList["Endianness"].data<unsigned int>();
-  unsigned int version = attrList["Version"].data<unsigned int>();
-    
-  // overwrite list of bad febs
-  if (version == 1) {
-    std::vector<HWIdentifier> idvec = 
-      LArBadChanBlobUtils::decodeFebBlobV1( &blob, chanSize, endian, version, log);
-    m_BadFebs.resize(idvec.size());
-    LArBadFeb missingState;
-    LArBadFebBitPacking febPacking;
-    febPacking.setBit( LArBadFeb::deadAllBit, missingState);
-    for (unsigned int i=0; i<idvec.size(); ++i) {
-      m_BadFebs[i] = BadFebEntry( idvec[i], missingState);
-    }
-  }
-  else {
-    m_BadFebs = LArBadChanBlobUtils::decodeBlob<LArBadFeb>( &blob, chanSize, stateSize,
-							    endian, version, log);
-  }
-  */
-
-  m_BadFebs = LArBadChannelDBTools::readBadFeb( *m_DBBadFebColl, msg());
-  return true;
-}
-
-
-StatusCode LArBadChanLegacyTool::updateFromDB( int&, std::list<std::string>& keylist)
-{
-  m_State.reset();
-
-  ATH_MSG_INFO (  "DB callback called with " << keylist.size() << " keys " );
-  for (std::list<std::string>::const_iterator ikey = keylist.begin(); ikey != keylist.end(); ikey++) {
-    ATH_MSG_INFO (  "DB callback called with key " << *ikey );
-  }
-
-  // Always read both folders if they are valid, even if only one folder triggered the callback
-  if (m_DBColl.isValid()) {
-    if (!readFromDB( m_DBColl)) return StatusCode::FAILURE;
-  }
-  if (m_TmpDBColl.isValid()) {
-    if (!readFromDB( m_TmpDBColl)) return StatusCode::FAILURE;
-  }
-
-  m_updatedFromDB = true;
-
-  ATH_MSG_INFO ( "Callback updateFromDB finished reading from DB" );
-
-  if (!m_Updates.empty()) applyUpdates(); // from ASCII file
-
-  updateCache();
-  m_ready = m_updatedFebsFromDB; // m_ready is true if both channels and febs are OK from DB
-
-  if(m_dumpCache) dumpAscii("dump.txt");
-
-  ATH_MSG_INFO ( "Have " << m_HwBadChan.size() << " entries in total." );
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode LArBadChanLegacyTool::updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS)
-{
-  if (!readBadFebsFromDB()) return StatusCode::FAILURE;
-  m_updatedFebsFromDB = true;
-
-  ATH_MSG_INFO ( "Callback updateBadFebsFromDB finished reading from DB" );
-
-  if (!m_BadFebUpdates.empty()) applyFebUpdates(); // from ASCII file
-
-  updateFebCache();
-  m_ready = m_updatedFromDB; // m_ready is true if both channels and febs are OK from DB
-
-  if(m_dumpCache) dumpFEBsAscii("dumpFEBs.txt");
-
-  ATH_MSG_INFO ( "Have " << m_BadFebs.size() << " missing FEBs in total." );
-  return StatusCode::SUCCESS;
-}
-
-void LArBadChanLegacyTool::dumpHWCache() const 
-{
-  LArBadChanBitPacking packing;
-  ATH_MSG_INFO ( "Begin of dump of online Id cache" );
-  for (BadChanInfo::const_iterator i=m_HwBadChan.begin(); i!=m_HwBadChan.end(); ++i) {
-    ATH_MSG_INFO ( "HWId " << i->first.get_identifier32().get_compact() << " status " 
-                   << packing.stringStatus(i->second) );
-  }
-  ATH_MSG_INFO ( "End of dump of online Id cache" );
-}
-
-void LArBadChanLegacyTool::applyUpdates()
-{
-  typedef std::vector<State::BadChanEntry>::const_iterator   Iter;
-
-  for (int cc=0; cc<State::NCoolChannels; cc++) {
-    State::CoolChannelData& coolChan = m_State.coolChannel(cc);
-    State::CoolChannelData& updChan = m_Updates.coolChannel(cc);
-
-    if (coolChan.empty()) coolChan = updChan;
-    else {
-      for (Iter iupd = updChan.begin(); iupd != updChan.end(); iupd++) {
-	applyUpdate( coolChan, *iupd);
-      }
-    }
-  }
-}
-
-void LArBadChanLegacyTool::applyUpdate( State::CoolChannelData& coolChan,
-				  const State::BadChanEntry& entry)
-{
-  typedef std::vector<State::BadChanEntry>::iterator   Iter;
-
-  // we assume that coolChan does not contain duplicate entries
-  // because at some point it came from ASCII, so resolveDuplicateEntries was called then.
-  for (Iter i = coolChan.begin(); i != coolChan.end(); i++) {
-    if (i->first == entry.first) {  // Try to match the update with an existing bad channel
-      State::mergeFlags( *i, entry);       // If found, combine the problems
-      return;
-    }
-  }    // The cell from the ASCII update was not already present in the database
-  coolChan.add(entry); // So, add the new bad channel
-}
-
-// should not be called if m_BadFebUpdates.empty()
-void LArBadChanLegacyTool::applyFebUpdates()
-{
-  using namespace LArBadChanImpl;
-  typedef combined_ordered_container< BadFebVec, BadFebEntryLess >   CNT;
-
-  std::sort( m_BadFebUpdates.begin(), m_BadFebUpdates.end(), BadFebEntryLess());
-
-  if (m_BadFebs.empty()) {
-    m_BadFebs = mergeDuplicateEntries( m_BadFebUpdates, BadFebEntryLess(), BadFebEntryMerger());
-  }
-  else {
-    std::sort( m_BadFebs.begin(), m_BadFebs.end(), BadFebEntryLess()); // in case it's not sorted
-    CNT cnt( m_BadFebs, m_BadFebUpdates); // a combined sorted view of the two containers
-    m_BadFebs = mergeDuplicateEntries( cnt, BadFebEntryLess(), BadFebEntryMerger());
-  }
-}
-
-void LArBadChanLegacyTool::dumpAscii( const std::string& fileName) const
-{
-  std::ofstream out(fileName.c_str());
-  LArBadChanBitPacking packing;
-
-  for (BadChanInfo::const_iterator i=m_HwBadChan.begin(); i!=m_HwBadChan.end(); ++i) {
-    int be = m_onlineID->barrel_ec(i->first);
-    int pn = m_onlineID->pos_neg(i->first);
-    int ft = m_onlineID->feedthrough(i->first);
-    int slot = m_onlineID->slot(i->first);
-    int ch = m_onlineID->channel(i->first);
-    out << be << " " << pn << " " << ft << " " << slot << " " << ch << " " << 0 << " "
-	<< packing.stringStatus(i->second) << std::endl;
-  }
-}
-
-void LArBadChanLegacyTool::dumpFEBsAscii( const std::string& fileName) const
-{
-  std::ofstream out(fileName.c_str());
-  LArBadFebBitPacking packing;
-
-  for (BadFebVec::const_iterator i=m_BadFebs.begin(); i!=m_BadFebs.end(); ++i) {
-    int be = m_onlineID->barrel_ec(i->first);
-    int pn = m_onlineID->pos_neg(i->first);
-    int ft = m_onlineID->feedthrough(i->first);
-    int slot = m_onlineID->slot(i->first);
-    out << be << " " << pn << " " << ft << " " << slot << " " 
-	<< packing.stringStatus(i->second) << std::endl;
-  }
-}
-
-bool LArBadChanLegacyTool::prepareFebHash() 
-{
-  int firstFEB = m_onlineID->feb_begin()->get_identifier32().get_compact();
-  int prevFEB = firstFEB;
-  int minDelta = 999999999;
-  int nFEBs = 0;
-  for (std::vector<HWIdentifier>::const_iterator i = ++(m_onlineID->feb_begin());
-       i != m_onlineID->feb_end(); ++i) {
-    int iFEB = i->get_identifier32().get_compact();
-    minDelta = std::min( minDelta, iFEB - prevFEB);
-    nFEBs++;
-    prevFEB = iFEB;
-  }
-  int lastFEB = prevFEB; // == iFEB
-  if (minDelta < 1) {
-    // FEB ids not sorted
-    return false;
-  }
-  
-  unsigned int febShift = 0;
-  for (int i = 1; i < 31; i++) {
-    if ( 1 << i == minDelta) febShift = i; 
-    // check also that minDelta is a power of 2!!!
-  }
-  if ( febShift == 0) return false;
-
-  int FEBRange = (lastFEB - firstFEB) / minDelta;
-  if (FEBRange > 2500) {
-    // too much memory
-    return false;
-  }
-
-  m_HwBadChan.setHasher( LArBadChanFEBHasher( firstFEB, lastFEB, febShift, 
-					      &(*m_onlineID)));
-  return true;
-}
diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadFebMasker.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadFebMasker.cxx
new file mode 100644
index 00000000000..d34e8d40af0
--- /dev/null
+++ b/LArCalorimeter/LArBadChannelTool/src/LArBadFebMasker.cxx
@@ -0,0 +1,118 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "LArBadChannelTool/LArBadFebMasker.h"
+#include "StoreGate/ReadCondHandle.h"
+#include "LArRecConditions/LArBadFebBitPacking.h"
+
+
+LArBadFebMasker::LArBadFebMasker(const std::string& type, 
+      const std::string& name, const IInterface* parent) :
+  AthAlgTool(type, name, parent), 
+  m_bfContKey("LArBadFeb"),
+  m_bitMask(0), 
+  m_problemWords(defaultProblems()),
+  m_doMasking(false)
+{
+  declareInterface<ILArBadFebMasker>(this);
+  declareProperty("BFKey",m_bfContKey,"Key of the BadFebContainer in the conditions store");
+  declareProperty("ProblemsToMask", m_problemWords, "List of FEB problems to be masked.");
+  declareProperty("DoMasking", m_doMasking, "Flag to turn FEB masking on or off.");
+}
+
+LArBadFebMasker::~LArBadFebMasker()
+{}
+
+StatusCode LArBadFebMasker::initialize() 
+{
+   ATH_MSG_DEBUG ( "in initialize()" );
+
+   if(!m_doMasking) return StatusCode::SUCCESS; //Do nothing
+
+   ATH_CHECK(m_bfContKey.initialize());
+     
+   buildBitMask();
+
+   LArBadFeb tempBF(m_bitMask);    //consider overloading the function
+   LArBadFebBitPacking bf_bitpack;
+   ATH_MSG_INFO ( "Cell masking is ON. The following problems will be masked: " 
+                  << bf_bitpack.stringStatus(tempBF) );
+   
+   return StatusCode::SUCCESS;
+}
+
+bool LArBadFebMasker::febMissing(const HWIdentifier& febId) const{
+
+   if(!m_doMasking) return false;
+
+   SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
+   const LArBadFebCont* bfCont{*bfContHdl};
+   return  (0x1 << LArBadFebEnum::ProblemType::deadAllBit) & (bfCont->status(febId)).packedData();
+}
+
+bool LArBadFebMasker::shouldbeMasked(const HWIdentifier& febId) const{
+
+   if(!m_doMasking) return false;
+
+   SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
+   const LArBadFebCont* bfCont{*bfContHdl};
+   return  m_bitMask & (bfCont->status(febId)).packedData();
+}
+
+LArBadFeb LArBadFebMasker::febStatus(const HWIdentifier& febId) const{
+
+   SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
+   const LArBadFebCont* bfCont{*bfContHdl};
+   return  bfCont->status(febId);
+}
+
+void LArBadFebMasker::buildBitMask()
+{
+  m_bitMask = 0;
+
+  LArBadFebBitPacking bf_bitPacking;
+  for(std::vector<std::string>::const_iterator it = m_problemWords.begin(); 
+    it != m_problemWords.end(); ++it)
+  {
+    if(bf_bitPacking.setBit(*it,m_bitMask,true))
+      ATH_MSG_DEBUG("The problem flag '"<< (*it) << "' was set.");
+    else
+      ATH_MSG_WARNING ( "The problem flag '" << (*it) << "' was not recognized." );
+  }
+}
+
+const std::vector<std::string>& LArBadFebMasker::defaultProblems()
+{
+  static std::vector<std::string> defaults;
+  if(defaults.size() == 0)
+  {
+    defaults.reserve(1);
+    defaults.push_back("deadAllBit");
+  }
+  return defaults;
+}
+
+StatusCode LArBadFebMasker::queryInterface(const InterfaceID& riid, void** ppvIf )
+{
+   if(riid == ILArBadFebMasker::interfaceID())
+   {
+      *ppvIf = static_cast<ILArBadFebMasker*>(this);
+      addRef();
+      return StatusCode::SUCCESS;
+   }
+   else if(riid == interfaceID())
+   {
+      *ppvIf = this;
+      addRef();
+      return StatusCode::SUCCESS;
+   }
+   else return AthAlgTool::queryInterface( riid, ppvIf );
+}
+
+const InterfaceID& LArBadFebMasker::interfaceID() 
+{
+  static const InterfaceID id("LArBadFebMasker", 1 , 0);
+  return id; 
+}
+
diff --git a/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx b/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx
index 06163018eab..f4a6869ee1d 100644
--- a/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx
+++ b/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx
@@ -1,4 +1,3 @@
-#include "LArBadChannelTool/LArBadChanLegacyTool.h"
 #include "LArBadChannelTool/LArBadChannelMasker.h"
 #include "LArBadChannelTool/LArBadChannelDBAlg.h"
 #include "LArBadChannelTool/LArBadChannelTimingAlg.h"
@@ -6,8 +5,8 @@
 #include "LArBadChannelTool/LArBadFeb2Ascii.h"
 #include "LArBadChannelTool/LArBadChannelCondAlg.h"
 #include "LArBadChannelTool/LArBadFebCondAlg.h"
+#include "LArBadChannelTool/LArBadFebMasker.h"
 
-DECLARE_COMPONENT( LArBadChanLegacyTool )
 DECLARE_COMPONENT( LArBadChannelMasker )
 DECLARE_COMPONENT( LArBadChannelDBAlg )
 DECLARE_COMPONENT( LArBadChannelTimingAlg )
@@ -15,4 +14,5 @@ DECLARE_COMPONENT( LArBadChannel2Ascii )
 DECLARE_COMPONENT( LArBadFeb2Ascii )
 DECLARE_COMPONENT( LArBadChannelCondAlg )
 DECLARE_COMPONENT( LArBadFebCondAlg )
+DECLARE_COMPONENT( LArBadFebMasker )
 
diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadChanTool.h b/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadChanTool.h
deleted file mode 100644
index 9967c9a551e..00000000000
--- a/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadChanTool.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ILArBadChanTool_H
-#define ILArBadChanTool_H
-
-#include "Identifier/HWIdentifier.h"
-#include "LArRecConditions/LArBadChannel.h"
-#include "LArRecConditions/LArBadFeb.h"
-#include "GaudiKernel/IAlgTool.h"
-#include "AthenaKernel/IOVSvcDefs.h"
-
-
-class ILArBadChanTool : public virtual IAlgTool {
-public:
-  virtual ~ILArBadChanTool() {}
-
-  static const InterfaceID& interfaceID() { 
-    static const InterfaceID IID_ILArBadChanTool("ILArBadChanTool", 1 , 0);
-    return IID_ILArBadChanTool; 
-  }
-
-  /// status access via LAr hardware identifier
-  virtual LArBadChannel status( HWIdentifier id) const = 0;
-
-  /// status access via LAr FEB id, and channel number within that FEB (0 to 127)
-  virtual LArBadChannel status(const HWIdentifier& febId, int chanNumber) const = 0;
-
-  /// status access via offline identifier
-  virtual LArBadChannel offlineStatus( Identifier id) const = 0;
-
-  /// returns true if the FEB (identified by it's HWIdentifier) is missing 
-  virtual bool febMissing(  HWIdentifier febId) const = 0;
-
-  /// returns true if the FEB (identified by it's HWIdentifier) does not have 
-  /// any bad channels 
-  virtual bool febAllGood(  HWIdentifier febId) const = 0;
-
-  /// returns the complete FEB status for a FEB HWIdentifier
-  virtual LArBadFeb febStatus( HWIdentifier febId) const = 0;
-
-  /// returns the HWIdentifiers of all the problematic FEBs, no matter what the FEB problem is
-  virtual std::vector<HWIdentifier> missingFEBs() const = 0;
-
-  /// returns all the information about problematic FEBs in one container
-  virtual const std::vector< std::pair<HWIdentifier,LArBadFeb> >& fullBadFebsState() const = 0;
-
-  // Callback functions
-  virtual StatusCode updateFromDB(IOVSVC_CALLBACK_ARGS) = 0;
-  virtual StatusCode updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS) = 0;
-
-};
-
-
-#endif
diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadFebMasker.h b/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadFebMasker.h
new file mode 100644
index 00000000000..97e83851954
--- /dev/null
+++ b/LArCalorimeter/LArRecConditions/LArRecConditions/ILArBadFebMasker.h
@@ -0,0 +1,33 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ILArBadFebMasker_H
+#define ILArBadFebMasker_H
+
+#include "GaudiKernel/IAlgTool.h"
+#include "CaloIdentifier/CaloGain.h"
+
+class HWIdentifier;
+class LArBadFeb;
+
+class ILArBadFebMasker : public virtual IAlgTool
+{
+public:
+   static const InterfaceID& interfaceID()
+   { 
+      static const InterfaceID IID_ILArBadFebMasker("ILArBadFebMasker", 1, 0);
+      return IID_ILArBadFebMasker; 
+   }
+
+   virtual ~ILArBadFebMasker()
+   {}
+
+   virtual bool febMissing(const HWIdentifier& febId)  const = 0;
+   virtual bool shouldbeMasked(const HWIdentifier& febId) const = 0; 
+   virtual  LArBadFeb febStatus(const HWIdentifier& febId) const =0;
+
+   virtual bool isMaskingOn() const = 0;
+};
+
+#endif
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
index 3d2a182ba55..68614d53f60 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/CMakeLists.txt
@@ -38,6 +38,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Database/AthenaPOOL/AthenaPoolUtilities
                           Event/ByteStreamData
                           LArCalorimeter/LArElecCalib
+                          LArCalorimeter/LArBadChannelTool
                           LArCalorimeter/LArIdentifier
                           LArCalorimeter/LArRecConditions
                           LArCalorimeter/LArRecUtils
@@ -51,7 +52,7 @@ atlas_add_library( TrigT2CaloCommonLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigT2CaloCommon
                    INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloEvent CaloGeoHelpers CaloIdentifier AthenaBaseComps AthenaKernel IRegionSelector Identifier EventInfo xAODTrigCalo ZdcEvent GaudiKernel LArRecEvent TileEvent TrigSteeringEvent StoreGateLib SGtests ByteStreamCnvSvcBaseLib ZdcByteStreamLib ZdcRecLib LArByteStreamLib LArRawUtilsLib LArCablingLib TileByteStreamLib TrigInterfacesLib TrigTimeAlgsLib CaloDetDescrLib CaloUtilsLib ByteStreamData_test LArRecUtilsLib
+                   LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} CaloEvent CaloGeoHelpers CaloIdentifier AthenaBaseComps AthenaKernel IRegionSelector Identifier EventInfo xAODTrigCalo ZdcEvent GaudiKernel LArRecEvent TileEvent TrigSteeringEvent StoreGateLib SGtests ByteStreamCnvSvcBaseLib ZdcByteStreamLib ZdcRecLib LArByteStreamLib LArRawUtilsLib LArCablingLib TileByteStreamLib TrigInterfacesLib TrigTimeAlgsLib CaloDetDescrLib CaloUtilsLib ByteStreamData_test LArRecUtilsLib 
                    PRIVATE_LINK_LIBRARIES AthenaPoolUtilities ByteStreamData LArIdentifier LArRecConditions TrigT1Interfaces )
 
 atlas_add_component( TrigT2CaloCommon
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
index efc58be4a70..ab8f291d823 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/LArCellCont.h
@@ -23,12 +23,13 @@
 #include "LArByteStream/Hid2RESrcID.h"
 #include "Identifier/HWIdentifier.h"
 #include "CaloInterface/ICaloLumiBCIDTool.h"
+
 #include <vector>
 
 class EventInfo;
 //class StoreGateSvc;
 class ILArBadChannelMasker;
-class ILArBadChanTool;
+class ILArBadFebMasker;
 static std::vector<float> corrBCIDref_example;
 
 /** Class which contains statically allocated LArCellCollections */
@@ -104,9 +105,9 @@ private:
 	std::vector<DataVector<LArCell>*> m_vecs;
 
 	/** A tool to help mask cells */
-	ILArBadChannelMasker* m_masker;		
+	const ILArBadChannelMasker  *m_masker;
 	/** A tool to help mask febs */
-	ILArBadChanTool* m_badChanTool;		
+	const ILArBadFebMasker *m_badFebMasker;
 	/** List of Missing ROBs to be disabled at the RS */
 	std::vector<uint32_t> m_MissingROBs;
 	/** hash references to BCID */
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
index d39f9c882da..3fbcafd3194 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
@@ -1,13 +1,12 @@
 include.block("TrigT2CaloCommon/CaloCellMasking.py")
 
 from AthenaCommon.AppMgr import ToolSvc #if not already imported
-from LArBadChannelTool.LArBadChannelToolConf import LArBadChanLegacyTool, LArBadChannelMasker
+from LArBadChannelTool.LArBadChannelToolConf import LArBadFebMasker, LArBadChannelMasker
 
-ToolSvc+=LArBadChanLegacyTool("MyBadChanTool")
-ToolSvc.MyBadChanTool.ReadFromASCII=False #Not necessary if you have already produced a database file
-ToolSvc.MyBadChanTool.ComplementaryCoolFolder="/LAR/BadChannels/BadChannelsOnl"
-#ToolSvc.MyBadChanTool.OutputLevel=VERBOSE
-#ToolSvc.MyBadChanTool.OutputLevel=DEBUG
+#The masker tool name must be "LArBadFebMasker", the same as retrieved in LArCellCont.cxx
+ToolSvc+=LArBadFebMasker("LArBadFebMasker")
+ToolSvc.LArBadFebMasker.DoMasking = True #Masking can easily be turned on and off here.
+#ToolSvc.LArBadFebMasker.OutputLevel=DEBUG
 
 #The masker tool name must be "LArBadChannelMasker", the same as retrieved in LArCellCont.cxx
 ToolSvc+=LArBadChannelMasker("LArBadChannelMasker")
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx
index 746d4c9d578..3e6ce6c58cf 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx
@@ -11,7 +11,7 @@
 #include "LArRawUtils/LArRoI_Map.h"
 #include "LArRecUtils/MakeLArCellFromRaw.h"
 #include "LArRecConditions/ILArBadChannelMasker.h"
-#include "LArRecConditions/ILArBadChanTool.h"
+#include "LArBadChannelTool/LArBadFebMasker.h"
 #include "CaloUtils/CaloCellCorrection.h"
 #include "GaudiKernel/ListItem.h"
 #include "EventInfo/EventInfo.h"
@@ -21,7 +21,7 @@
 #include <iostream>
 //#include <time.h>
 
-LArCellCont::LArCellCont() : m_event(0), m_masker(NULL), m_badChanTool(NULL), m_corrBCIDref( corrBCIDref_example ), m_caloLumiBCIDTool(0), m_lumi_block(0), m_bcid(5000), m_larCablingSvc(0), m_BCIDcache(false)
+LArCellCont::LArCellCont() : m_event(0), m_corrBCIDref( corrBCIDref_example ), m_caloLumiBCIDTool(nullptr), m_lumi_block(0), m_bcid(5000), m_larCablingSvc(nullptr), m_BCIDcache(false)
 {}
 
 StatusCode
@@ -120,15 +120,16 @@ makeCell.initialize( roiMap, &LArCellCorrTools, 0 );
 sc = toolSvc->retrieveTool("LArBadChannelMasker", m_masker);
 bool doCellMasking = sc.isSuccess() && m_masker->isMaskingOn();
 
-if(!sc.isSuccess())	//not a critical error. LArCellCont can proceed as usual, without masking.
-	std::cout << "LArCellCont\t\t INFO \t Failed to retrieve LArBadChannelMasker - no masking will be done." << std::endl;
+if(!sc.isSuccess()) //not a critical error. LArCellCont can proceed as usual, without masking.
+    std::cout << "LArCellCont\t\t INFO \t Failed to retrieve LArBadChannelMasker - no masking will be done." << std::endl;
+std::cout << "doCellMasking "<<doCellMasking<<std::endl;
 
-
-sc = toolSvc->retrieveTool("LArBadChanLegacyTool/MyBadChanTool", m_badChanTool);
+sc = toolSvc->retrieveTool("LArBadFebMasker", m_badFebMasker);
 bool toolAvailable = sc.isSuccess(); 
 
-if(!sc.isSuccess())	//not a critical error. LArCellCont can proceed as usual, without masking.
-	std::cout << "LArCellCont\t\t INFO \t Failed to retrieve LArBadChanTool - no masking will be done." << std::endl;
+if(!sc.isSuccess()) //not a critical error. LArCellCont can proceed as usual, without masking.
+    std::cout << "LArCellCont\t\t INFO \t Failed to retrieve LArBadFebMasker - no masking will be done." << std::endl;
+std::cout <<"toolAvailable "<<toolAvailable<<std::endl;
 
 std::vector<uint32_t> RobsFromMissingFeb;
 
@@ -172,10 +173,10 @@ m_hashSym.resize(onlineId->febHashMax());
 //for(std::vector<HWIdentifier>::const_iterator i=larFEBs.begin();i!=larFEBs.end();i++){
  for (unsigned iFeb=0;iFeb<onlineId->febHashMax();++iFeb) {
    const HWIdentifier febid=onlineId->feb_Id(IdentifierHash(iFeb));
-    if( (toolAvailable && (m_badChanTool->febMissing(febid)) ) || !toolAvailable ){
+    if( (toolAvailable && (m_badFebMasker->febMissing(febid)) ) || !toolAvailable ){
 	RobsFromMissingFeb.push_back( m_conv.getRobID( m_conv.getRodID( febid ) ) );
     }
-    if( (toolAvailable && !(m_badChanTool->febMissing(febid)) ) || !toolAvailable ){
+    if( (toolAvailable && !(m_badFebMasker->febMissing(febid)) ) || !toolAvailable ){
 	// get RodID associated with the collection
       HWIdentifier rodId = m_larCablingSvc->getReadoutModuleID(febid); 
 	unsigned int rodId32 = m_conv.getRodIDFromROM(rodId);
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
index fa65b9a691a..0324a1222bb 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h
@@ -17,7 +17,7 @@
 #include "TrigT1CaloCalibTools/L1CaloCells2TriggerTowers.h"
 #include "TrigT1CaloCondSvc/L1CaloCondSvc.h"
 #include "CaloIdentifier/CaloIdManager.h"
-#include "LArRecConditions/ILArBadChanTool.h"
+#include "LArRecConditions/ILArBadFebMasker.h"
 #include "LArCabling/LArCablingLegacyService.h"
 #include "LArIdentifier/LArOnlineID.h"
 
@@ -76,7 +76,7 @@ private:
   CaloTriggerTowerService* m_ttService;
   ToolHandle<LVL1::IL1CaloCells2TriggerTowers> m_cells2tt;
 
-  ToolHandle< ILArBadChanTool > m_badChannelTool; // Handle to badChannelTool
+  ToolHandle< ILArBadFebMasker > m_badFebMasker; // Handle to badChannelTool
   ToolHandle<LArCablingLegacyService> m_larCablingSvc;  // Handle to LarCablingService
   ToolHandle<LVL1::IL1TriggerTowerTool> m_ttTool; // Handle to L1TriggerTowerTool
 
diff --git a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
index f355081bced..3ff8294621b 100644
--- a/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
+++ b/Trigger/TrigT1/TrigT1CaloCalibTools/src/L1CaloLArTowerEnergy.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h"
+#include "LArRecConditions/LArBadChannelCont.h"
 
 namespace LVL1{
 
@@ -14,7 +15,7 @@ namespace LVL1{
     m_LArOnlineHelper(nullptr),
     m_ttService(nullptr),
     m_cells2tt("LVL1::L1CaloCells2TriggerTowers/L1CaloCells2TriggerTowers"),
-    m_badChannelTool("LArBadChanLegacyTool"),
+    m_badFebMasker("LArBadFebMasker"),
     m_larCablingSvc("LArCablingLegacyService"),
     m_ttTool("LVL1::L1TriggerTowerTool/LVL1::L1TriggerTowerTool")
   {
@@ -43,14 +44,11 @@ namespace LVL1{
       return StatusCode::FAILURE;
     }
     
-    sc = m_cells2tt.retrieve();
-    if(sc.isFailure()){ATH_MSG_ERROR("Cannot get L1CaloCells2TriggerTowers !");return sc;}
+    ATH_CHECK(m_cells2tt.retrieve());
 
-    sc=m_badChannelTool.retrieve();
-    if(sc.isFailure()){ATH_MSG_ERROR( "Could not retrieve BadChannelTool" );return sc;}
+    ATH_CHECK(m_badFebMasker.retrieve());
 
-    sc=m_larCablingSvc.retrieve();
-    if(sc.isFailure()){ATH_MSG_ERROR( "Could not retrieve LArCablingService" );return sc;}    
+    ATH_CHECK(m_larCablingSvc.retrieve());
 
 
     //Retrieve cabling & tt services
@@ -243,7 +241,7 @@ namespace LVL1{
     {
       HWIdentifier chid = m_larCablingSvc->createSignalChannelID(*it);
       HWIdentifier febId = m_LArOnlineHelper->feb_Id(chid);
-      LArBadFeb febstatus = m_badChannelTool->febStatus(febId);
+      LArBadFeb febstatus = m_badFebMasker->febStatus(febId);
       bool deadReadout = febstatus.deadReadout();
       bool desactivatedInOKS = febstatus.deactivatedInOKS();
 
-- 
GitLab


From 153b945bc044f891efd1acb3c49885df6c5359f4 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Thu, 7 Mar 2019 11:37:13 +0000
Subject: [PATCH 301/404] Add ATLAS_CHECK_THREAD_SAFETY to SiDigitization
 package

---
 .../PixelDigitization/src/FEI3SimTool.cxx     |  2 +-
 .../PixelDigitization/src/FEI4SimTool.cxx     |  2 +-
 .../PixelDigitization/src/RD53SimTool.cxx     |  2 +-
 .../src/FEI3SimTool.cxx                       |  2 +-
 .../src/FEI4SimTool.cxx                       |  2 +-
 .../src/RD53SimTool.cxx                       |  2 +-
 .../src/SCT_DigitizationTool.cxx              |  4 +--
 .../SCT_Digitization/src/SCT_FrontEnd.cxx     | 18 ++++++-------
 .../SiDigitization/ATLAS_CHECK_THREAD_SAFETY  |  1 +
 .../SiDigitization/SiChargedDiode.h           |  6 ++---
 .../SiDigitization/SiChargedDiodeCollection.h | 11 +++++---
 .../SiDigitization/SiDigitization/SiHelper.h  | 27 +++++++------------
 .../src/SiChargedDiodeCollection.cxx          |  2 +-
 13 files changed, 40 insertions(+), 41 deletions(-)
 create mode 100644 InnerDetector/InDetDigitization/SiDigitization/SiDigitization/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
index 538b73db2b1..d7adbe43ef1 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
@@ -106,7 +106,7 @@ void FEI3SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
index 31bffcc877b..147ee43bb41 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
@@ -80,7 +80,7 @@ void FEI4SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  {  SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  {  SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx
index 477833db1d2..d3cd5b8b431 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx
@@ -88,7 +88,7 @@ void RD53SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI3SimTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI3SimTool.cxx
index 14daa8bd012..49e008842b8 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI3SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI3SimTool.cxx
@@ -106,7 +106,7 @@ void FEI3SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI4SimTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI4SimTool.cxx
index f6b32a4d30e..dbbe2dbe423 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI4SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/FEI4SimTool.cxx
@@ -82,7 +82,7 @@ void FEI4SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  {  SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  {  SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RD53SimTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RD53SimTool.cxx
index d073da70a5b..25e2810593c 100644
--- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RD53SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/RD53SimTool.cxx
@@ -74,7 +74,7 @@ void RD53SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle
       }
 
       if (bunchSim<0 || bunchSim>m_timeBCN) { SiHelper::belowThreshold((*i_chargedDiode).second,true,true); }
-      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim); }
+      else                                  { SiHelper::SetBunch((*i_chargedDiode).second,bunchSim, &msg()); }
     } 
     else {
       SiHelper::belowThreshold((*i_chargedDiode).second,true,true);
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
index 2d19f7601a5..f31b18eefd5 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DigitizationTool.cxx
@@ -645,7 +645,7 @@ SCT_RDO_Collection* SCT_DigitizationTool::createRDO(SiChargedDiodeCollection* co
               }
               if ((it2 != collection->end()) and !(it2->second.flag() & 0xDE)) {
                 SiHelper::ClusterUsed(it2->second, false);
-                SiHelper::SetStripNum(it2->second, size - cluscounter);
+                SiHelper::SetStripNum(it2->second, size - cluscounter, &msg());
               }
               // groupSize=tmp;
               size_rdo = tmp & 0xFFFF;
@@ -707,7 +707,7 @@ SCT_RDO_Collection* SCT_DigitizationTool::createRDO(SiChargedDiodeCollection* co
               }
               if (diode and !(diode->flag() & 0xDE)) {
                 SiHelper::ClusterUsed(*diode, false);
-                SiHelper::SetStripNum(*diode, size - cluscounter);
+                SiHelper::SetStripNum(*diode, size - cluscounter, &msg());
               }
               groupSize = tmp;
               break;
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
index 533d2446f14..8df88c7d7f0 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_FrontEnd.cxx
@@ -812,7 +812,7 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
             m_StripHitsOnWafer[strip] = -1;
           } else {
             m_StripHitsOnWafer[strip] = 1;
-            SiHelper::SetTimeBin(diode, 2); // set timebin info
+            SiHelper::SetTimeBin(diode, 2, &msg()); // set timebin info
           }
         } else if (m_data_compression_mode == 2 and m_data_readout_mode == 0) { // edge mode 01x
           if ((m_Analogue[0][strip] >= m_Threshold or m_Analogue[1][strip] < m_Threshold)) {
@@ -823,7 +823,7 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
             m_StripHitsOnWafer[strip] = -1;
           } else {
             m_StripHitsOnWafer[strip] = 1;
-            SiHelper::SetTimeBin(diode, 2); // set timebin info
+            SiHelper::SetTimeBin(diode, 2, &msg()); // set timebin info
           }
         } else if (m_data_compression_mode == 3 or m_data_readout_mode == 1) { // Check hit pattern
           int have_hit_bin = 0;
@@ -842,7 +842,7 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
           } else if (m_data_compression_mode == 1) { // !< level and expanded mode
             if (have_hit_bin == 2 or have_hit_bin == 3 or have_hit_bin == 6 or have_hit_bin == 7) {
               m_StripHitsOnWafer[strip] = 1;
-              SiHelper::SetTimeBin(diode, have_hit_bin);
+              SiHelper::SetTimeBin(diode, have_hit_bin, &msg());
             } else {
               SiHelper::belowThreshold(diode, true); // Below strip diode signal threshold
               m_StripHitsOnWafer[strip] = -1;
@@ -850,7 +850,7 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
           } else if (m_data_compression_mode == 2) { // !< edge and expanded mode
             if (have_hit_bin == 2 or have_hit_bin == 3) {
               m_StripHitsOnWafer[strip] = 1;
-              SiHelper::SetTimeBin(diode, have_hit_bin);
+              SiHelper::SetTimeBin(diode, have_hit_bin, &msg());
             } else {
               SiHelper::belowThreshold(diode, true); // Below strip diode signal threshold
               m_StripHitsOnWafer[strip] = -1;
@@ -862,9 +862,9 @@ StatusCode SCT_FrontEnd::doThresholdCheckForRealHits(SiChargedDiodeCollection& c
             } else {
               m_StripHitsOnWafer[strip] = 1;
               if (m_data_readout_mode == 1) { // !< check for exp mode or not
-                SiHelper::SetTimeBin(diode, have_hit_bin);
+                SiHelper::SetTimeBin(diode, have_hit_bin, &msg());
               } else {
-                SiHelper::SetTimeBin(diode, 2);
+                SiHelper::SetTimeBin(diode, 2, &msg());
               }
             }
           }
@@ -1003,7 +1003,7 @@ StatusCode SCT_FrontEnd::doClustering(SiChargedDiodeCollection& collection) cons
         clusterSize = (clusterLastStrip - clusterFirstStrip) + 1;
         hitStrip = m_sct_id->strip_id(collection.identify(), clusterFirstStrip);
         SiChargedDiode& HitDiode = *(collection.find(hitStrip));
-        SiHelper::SetStripNum(HitDiode, clusterSize);
+        SiHelper::SetStripNum(HitDiode, clusterSize, &msg());
                                                                                       
         SiChargedDiode *PreviousHitDiode = &HitDiode;
         for (int i = clusterFirstStrip+1; i <= clusterLastStrip; ++i) {
@@ -1037,7 +1037,7 @@ StatusCode SCT_FrontEnd::doClustering(SiChargedDiodeCollection& collection) cons
           previousHitDiode = &newHitDiode;
           clusterSize++;
         }
-        SiHelper::SetStripNum(hitDiode, clusterSize);
+        SiHelper::SetStripNum(hitDiode, clusterSize, &msg());
 
 #ifdef SCT_DIG_DEBUG
         ATH_MSG_DEBUG("RDO Strip = " << strip << ", tbin = " <<
@@ -1071,7 +1071,7 @@ StatusCode SCT_FrontEnd::addNoiseDiode(SiChargedDiodeCollection& collection, int
   if (NoiseDiode == nullptr) {
     return StatusCode::FAILURE;
   }
-  SiHelper::SetTimeBin(*NoiseDiode, tbin); // set timebin info
+  SiHelper::SetTimeBin(*NoiseDiode, tbin, &msg()); // set timebin info
 
   return StatusCode::SUCCESS;
 }
diff --git a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..9036d718adf
--- /dev/null
+++ b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDigitization/SiDigitization
diff --git a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiode.h b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiode.h
index 00727f5eac6..5184b361849 100755
--- a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiode.h
+++ b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiode.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
 */
 
 /////////////////////////////////////////////////////////////////// 
@@ -63,7 +63,7 @@ public:
   int flag() const;
   
   //neighbouring strip for navigation 
-  SiChargedDiode * nextInCluster() const;
+  SiChargedDiode * nextInCluster();
   ///////////////////////////////////////////////////////////////////
   // Non-const methods:
   ///////////////////////////////////////////////////////////////////
@@ -120,7 +120,7 @@ inline double SiChargedDiode::charge() const
   return m_totalCharge.charge();
 }
 
-inline SiChargedDiode * SiChargedDiode::nextInCluster() const
+inline SiChargedDiode * SiChargedDiode::nextInCluster()
 {
   return m_nextInCluster;
 }
diff --git a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiodeCollection.h b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiodeCollection.h
index 1da634de1c2..4cacf39857d 100755
--- a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiodeCollection.h
+++ b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiChargedDiodeCollection.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -27,7 +27,6 @@
 #include "Identifier/Identifiable.h"
 
 // Data member classes
-#include <map>
 #include <unordered_map>
 #include "SiDigitization/SiChargedDiode.h"
 #include "Identifier/Identifier.h"
@@ -35,6 +34,12 @@
 
 // Input/output classes 
 #include "InDetSimEvent/SiHit.h"
+
+// STL includes
+#include <atomic>
+#include <map>
+#include <memory>
+
 class AtlasDetectorID;
 namespace InDetDD{
   class SiDetectorElement;
@@ -153,7 +158,7 @@ class SiChargedDiodeCollection : Identifiable {
   //SiChargedDiodeMap is empty.
   SiTotalCharge::alloc_t m_allocator; 
   SiChargedDiodeMap m_chargedDiodes; // list of SiChargedDiodes 
-  mutable const InDetDD::SiDetectorElement *m_sielement; // detector element
+  const InDetDD::SiDetectorElement* m_sielement; // detector element
 };
 
 ///////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiHelper.h b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiHelper.h
index 56a6ea50685..af65b4e784a 100755
--- a/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiHelper.h
+++ b/InnerDetector/InDetDigitization/SiDigitization/SiDigitization/SiHelper.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
 */
 
 /*************************************************************************
@@ -24,13 +24,6 @@
 #include "AthenaKernel/getMessageSvc.h"
 #include "SiDigitization/SiChargedDiode.h"
 
-namespace {
-  MsgStream& silog() {
-    static MsgStream s_log(Athena::getMessageSvc(), "SiHelper");     
-    return s_log;
-  }
-}
-
 class SiHelper
 {
  public:
@@ -43,9 +36,9 @@ class SiHelper
   static void disconnected(SiChargedDiode& chDiode, bool flag, bool mask=false);
   static void maskOut(SiChargedDiode& chDiode, bool flag);
   static void ClusterUsed(SiChargedDiode& chDiode, bool flag);
-  static void SetBunch(SiChargedDiode& chDiode, int bunch);
-  static void SetStripNum(SiChargedDiode& chDiode, int bunch);
-  static void SetTimeBin(SiChargedDiode& chDiode, int time);
+  static void SetBunch(SiChargedDiode& chDiode, int bunch, MsgStream* log=nullptr);
+  static void SetStripNum(SiChargedDiode& chDiode, int nstrip, MsgStream* log=nullptr);
+  static void SetTimeBin(SiChargedDiode& chDiode, int time, MsgStream* log=nullptr);
 
   static bool isUsable(SiChargedDiode& chDiode);
   static bool isNoise(SiChargedDiode& chDiode);
@@ -133,32 +126,32 @@ inline void SiHelper::ClusterUsed(SiChargedDiode& chDiode, bool flag) {
   }
 }
 
-inline void SiHelper::SetBunch(SiChargedDiode& chDiode, int bunch) {
+inline void SiHelper::SetBunch(SiChargedDiode& chDiode, int bunch, MsgStream* log) {
   //
   // Code the bunch number in the 8 bits set corresponding to xx in xx00 
   //
   if (bunch > 0xff) {
-    silog() << MSG::ERROR << "Bunch Number not allowed" << endmsg;
+    if (log) (*log) << MSG::ERROR << "Bunch Number not allowed" << endmsg;
   }
   chDiode.m_word = chDiode.m_word | ( (bunch&0xff) <<8 )  ;
 }
 
-inline void SiHelper::SetStripNum(SiChargedDiode& chDiode, int nstrip) {
+inline void SiHelper::SetStripNum(SiChargedDiode& chDiode, int nstrip, MsgStream* log) {
   //
   // Code the number of strips in the 12 bits set corresponding to xxx in 0xxx0000 
   //
   if (nstrip > 0xfff) {
-    silog() << MSG::ERROR << "Number of strips not allowed" << endmsg;
+    if (log) (*log) << MSG::ERROR << "Number of strips not allowed" << endmsg;
   }
   chDiode.m_word = chDiode.m_word | ((nstrip&0xfff) << 16 ) ;
 }
 
-inline void SiHelper::SetTimeBin(SiChargedDiode& chDiode, int time) {
+inline void SiHelper::SetTimeBin(SiChargedDiode& chDiode, int time, MsgStream* log) {
   //
   // Code the SCT Timebin number in the 3 bits set corresponding to x in x0000000
   //
   if (time > 0xf) {
-    silog() << MSG::ERROR << "TimeBin not allowed" << endmsg;
+    if (log) (*log) << MSG::ERROR << "TimeBin not allowed" << endmsg;
   }
   chDiode.m_word = chDiode.m_word | ( (time&0xf) <<28 )  ;
 }
diff --git a/InnerDetector/InDetDigitization/SiDigitization/src/SiChargedDiodeCollection.cxx b/InnerDetector/InDetDigitization/SiDigitization/src/SiChargedDiodeCollection.cxx
index 9699fe13ead..64d7192e260 100755
--- a/InnerDetector/InDetDigitization/SiDigitization/src/SiChargedDiodeCollection.cxx
+++ b/InnerDetector/InDetDigitization/SiDigitization/src/SiChargedDiodeCollection.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
 */
 
 ///////////////////////////////////////////////////////////////////
-- 
GitLab


From 91312b066ff75f8ef586788e599f28b0db2b9954 Mon Sep 17 00:00:00 2001
From: Pavol Strizenec <pavol.strizenec@cern.ch>
Date: Thu, 7 Mar 2019 13:19:39 +0100
Subject: [PATCH 302/404] masking off

---
 .../TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
index 3fbcafd3194..e38041b52e7 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloCellMasking.py
@@ -5,13 +5,13 @@ from LArBadChannelTool.LArBadChannelToolConf import LArBadFebMasker, LArBadChann
 
 #The masker tool name must be "LArBadFebMasker", the same as retrieved in LArCellCont.cxx
 ToolSvc+=LArBadFebMasker("LArBadFebMasker")
-ToolSvc.LArBadFebMasker.DoMasking = True #Masking can easily be turned on and off here.
+ToolSvc.LArBadFebMasker.DoMasking = False #Masking can easily be turned on and off here.
 #ToolSvc.LArBadFebMasker.OutputLevel=DEBUG
 
 #The masker tool name must be "LArBadChannelMasker", the same as retrieved in LArCellCont.cxx
 ToolSvc+=LArBadChannelMasker("LArBadChannelMasker")
 ToolSvc.LArBadChannelMasker.ProblemsToMask=["unstable", "short", "highNoiseHG", "highNoiseMG","highNoiseLG", "problematicForUnknownReason"] #See LArBadChanBitPacking.cxx for the list of strings that can be used.
-ToolSvc.LArBadChannelMasker.DoMasking = True #Masking can easily be turned on and off here.
+ToolSvc.LArBadChannelMasker.DoMasking = False #Masking can easily be turned on and off here.
 #ToolSvc.LArBadChannelMasker.OutputLevel=DEBUG
 
 #IOVDbSvc=theApp.service('IOVDbSvc')
-- 
GitLab


From f93b0610b661a24b1a5b0038413cc4a17015bf4d Mon Sep 17 00:00:00 2001
From: Teng Jian Khoo <khoo@lxplus029.cern.ch>
Date: Thu, 7 Mar 2019 13:59:01 +0100
Subject: [PATCH 303/404] Change Negative E rejector to also reject 0 E

---
 ...ool.h => NonPositiveEnergyRejectionTool.h} | 11 +++--
 .../python/TrigHLTJetRecConfig.py             | 44 +++++++++++++++----
 .../src/NegativeEnergyRejectionTool.cxx       | 39 ----------------
 .../src/NonPositiveEnergyRejectionTool.cxx    | 39 ++++++++++++++++
 .../src/components/TrigHLTJetRec_entries.cxx  |  4 +-
 5 files changed, 81 insertions(+), 56 deletions(-)
 rename Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/{NegativeEnergyRejectionTool.h => NonPositiveEnergyRejectionTool.h} (72%)
 delete mode 100644 Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx
 create mode 100644 Trigger/TrigAlgorithms/TrigHLTJetRec/src/NonPositiveEnergyRejectionTool.cxx

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 e8a4f11838e..719ce2933ae 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/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index bb83cf9bd49..a93443634b7 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,)
@@ -1042,6 +1043,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 +1129,8 @@ class TrigHLTJetRecFromCluster(TrigHLTJetRecConf.TrigHLTJetRecFromCluster):
         # self.iIParticleSelector = _getIParticleSelectorAll(
         #    'iIParticleSelectorAll') 
 
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveJetRjectionTool', OutputLevel=OutputLevel)
         
         secondary_label = ''
         # FTK specific: do we want FTK? Set label to GhostTrack. 
@@ -1183,8 +1209,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
@@ -1255,8 +1281,8 @@ class TrigHLTJetRecFromJet(TrigHLTJetRecConf.TrigHLTJetRecFromJet):
         name = 'iIParticleEtaPtRejecter_%d_%d' % (int(10 * etaMaxCut),
                                                   int(ptMinCut))
         
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
 
         concrete_type = 'Jet'
 
@@ -1313,8 +1339,8 @@ class TrigHLTJetRecFromTriggerTower(
         #                                       int(ptMinCut)),
         #    **{'etaMax': etaMaxCut, 'ptMin': ptMinCut})
 
-        iIParticleRejecter = _getIParticleNullRejectionTool(
-            'iIParticleNullRejectionTool', OutputLevel=OutputLevel)
+        iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
         
 
 
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/NegativeEnergyRejectionTool.cxx
deleted file mode 100644
index 40d1c344acb..00000000000
--- 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 00000000000..c48cda14d0c
--- /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/components/TrigHLTJetRec_entries.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
index d9d7c446f0f..b07dae3b28f 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/components/TrigHLTJetRec_entries.cxx
@@ -27,13 +27,13 @@
 #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 )
-- 
GitLab


From f28790de237199f8b20941dfa899de974b4de244 Mon Sep 17 00:00:00 2001
From: Marilena Bandieramonte <marilena.bandieramonte@cern.ch>
Date: Thu, 7 Mar 2019 14:05:36 +0100
Subject: [PATCH 304/404] PsMap modified, handling of the Current Map is now
 thread-safe (ATLASSIM-4054)

PsMap is a singleton and SetMap method was not thread safe.
This caused data race in the LArBarrelPresamplerCalculator code, as different threads
were calling SetMap method at the same time. This resulted in differences in the Current values
retrieved from the map and consequently in the energy of the LArHitEMB.
A new method has been added to the class: CurrMap* GetMap(imodule) const,
that is used rather than m_psmap->SetMap(imodule) and m_psmap->Map() in the LArBarrelPresamplerCalculator code.
m_curr and m_module members have been removed.
---
 .../src/LArBarrelPresamplerCalculator.cxx         |  6 +++---
 LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.cxx    | 15 ++++++---------
 LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.h      |  6 +-----
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx
index aefc7478944..9370663a1c6 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx
@@ -301,15 +301,15 @@ G4bool LArBarrelPresamplerCalculator::Process(const G4Step* a_step, std::vector<
 #ifdef DEBUGSTEP
         ATH_MSG_DEBUG(" set current map for module " << imodule);
 #endif
-        m_psmap->SetMap(imodule);
-        if (!(m_psmap->Map())) {
+	CurrMap* cm = m_psmap->GetMap(imodule);
+        if (!cm) {
           ATH_MSG_INFO(" LArBarrelPresamplerCalculator: cannot get map for module " << imodule);
           continue;
         }
         double current0,current1,current2,gap;
 
         // get information from current map
-        m_psmap->Map()->GetAll(x0,y0,&gap,&current0,&current1,&current2);
+        cm->GetAll(x0,y0,&gap,&current0,&current1,&current2);
 #ifdef DEBUGSTEP
         ATH_MSG_DEBUG(" module,x0,y0,current0 from map " << imodule << " " << x0 << " " << y0 << " " << current0);
 #endif
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.cxx
index e2dd3189206..ed4ae3aac4e 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.cxx
@@ -13,7 +13,6 @@ PsMap* PsMap::s_thePointer=nullptr;
 
 PsMap::PsMap()
 {
-  m_module=-1;
   m_directory="/afs/cern.ch/atlas/offline/data/lar/calo_data";
 
 #ifndef LARG4_STAND_ALONE
@@ -39,7 +38,6 @@ PsMap::PsMap()
     int code=imap;
     m_theMap[code]=cm;
   }
-  m_curr=0;
 
 }
 
@@ -58,10 +56,8 @@ void PsMap::Reset()
   }
 }
 
-void PsMap::SetMap(int module)
+CurrMap* PsMap::GetMap(int module) const
 {
-  if (m_module==module) return;
-  m_module=module;
   // module 0 and 1 have their own maps (code = 0 and 1)
   // module 2 and 3 have the same map (same geometry) with code 2
   // module 4 and 5 have the same map (same geometry) with code 3
@@ -69,11 +65,12 @@ void PsMap::SetMap(int module)
   int code = -1;
   if (module==0 || module==1) code=module;
   if (module > 1 && module < 8) code=(module-2)/2 + 2;
-  if (m_theMap.find(code) != m_theMap.end())
-    m_curr = m_theMap[code];
+  auto it = m_theMap.find(code);
+  if (it != m_theMap.end())
+    return  it->second; 
   else {
-    std::cout << " Code " << code << " not found in map ..." << std::endl;
-    m_curr=0;
+    std::cout << " Code " << module << " not found in map ..." << std::endl;
+    return nullptr;
   }
 }
 
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.h b/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.h
index f3bec25de94..c5962bfc8bc 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.h
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/PsMap.h
@@ -19,15 +19,11 @@ class PsMap {
    static PsMap* GetPsMap();
    void SetDirectory(std::string dir);
    void Reset();
-   void SetMap(int module);
-   CurrMap* Map() const {return m_curr;}
+   CurrMap* GetMap (int module) const;
   private:
    PsMap();
    static PsMap* s_thePointer;
    curr_map m_theMap;
    std::string m_directory;
-// current map info
-   CurrMap* m_curr;
-   int m_module;
 };
 #endif // LARG4BARREL_PsMap_h
-- 
GitLab


From 1665fd6164c119654a2f84fcab686960a0076e72 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 7 Mar 2019 13:57:36 +0100
Subject: [PATCH 305/404] Fix typos in AtlasG4_tf configuration unit tests

---
 .../test/test_AtlasG4_cosmics_configuration.py       |  5 +++--
 .../test/test_AtlasG4_tf_configuration.py            | 12 ++++++------
 .../test/test_TestBeam_tf_configuration.py           |  6 +++---
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
index 4379e8f7155..5732423f86e 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py
@@ -113,7 +113,7 @@ class TestAtlasG4Cosmics(unittest.TestCase):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
         ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
-        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now.
         expected_last_ath_alg_sequence_entry = "CosmicGenerator/CosmicGenerator"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
@@ -198,7 +198,8 @@ class TestAtlasG4Cosmics(unittest.TestCase):
     def test___BeamEffectsAlg_is_before_G4AtlasAlg_in_AthAlgSeq(self):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[3] # Position 1 is the Sim Timer Alg, xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
index 3442d3f9050..5b678c6c698 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py
@@ -106,11 +106,11 @@ class TestAtlasG4(unittest.TestCase):
 
 
     def test___BeamEffectsAlg_is_before_G4AtlasAlg_in_AthAlgSeq(self):
-        ath_alg_seqence_as_str = self._job_config_dict['AthAlgSeq']['Members']
+        ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
         ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
-        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
-        actual_last_ath_alg_sequence_entry = ath_alg_seqence_list[1] #Position 0 should be the timer alg
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
+        actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] #Position 0 should be the timer alg
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
                          actual_last_ath_alg_sequence_entry)
@@ -142,11 +142,11 @@ class TestAtlasG4(unittest.TestCase):
 
 
     def test___G4AtlasAlg_is_at_end_of_AthAlgSeq(self):
-        ath_alg_seqence_as_str = self._job_config_dict['AthAlgSeq']['Members']
+        ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_seqence_list = eval(ath_alg_seqence_as_str)
+        ath_alg_sequence_list = eval(ath_alg_sequence_as_str)
 
-        actual_last_ath_alg_sequence_entry = ath_alg_seqence_list[-1]
+        actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[-1]
         expected_last_ath_alg_sequence_entry = "G4AtlasAlg/G4AtlasAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
                          actual_last_ath_alg_sequence_entry)
diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
index 147a61e9814..62154cb5ff6 100755
--- a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
+++ b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py
@@ -107,7 +107,7 @@ class TestTestBeam(unittest.TestCase):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
         ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
-        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "PyAthena::Alg/ParticleGun"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
@@ -118,7 +118,7 @@ class TestTestBeam(unittest.TestCase):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
         ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
-        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[2] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "CopyEventWeight/CopyEventWeight"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
@@ -129,7 +129,7 @@ class TestTestBeam(unittest.TestCase):
         ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
         ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
-        ath_alg_seqence_list = [ alg for alg in eval(ath_alg_seqence_as_str) if alg not in ignore_Algs ]
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
         actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[3] # xAODMaker::EventInfoCnvAlg/xAODMaker::EventInfoCnvAlg is in position 0 in master now
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
-- 
GitLab


From dbb9f7f2df4bbb748be47e53282168be0be43442 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 7 Mar 2019 14:15:18 +0100
Subject: [PATCH 306/404] Update ISF jobs to run EventInfoTagBuilder

---
 .../test/test_FullG4_Sim_tf_configuration.py       | 14 ++++++++------
 Simulation/ISF/ISF_Example/python/ISF_Output.py    |  4 ++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Simulation/ISF/ISF_Config/test/test_FullG4_Sim_tf_configuration.py b/Simulation/ISF/ISF_Config/test/test_FullG4_Sim_tf_configuration.py
index ce305ad1aa5..99b8da866a5 100755
--- a/Simulation/ISF/ISF_Config/test/test_FullG4_Sim_tf_configuration.py
+++ b/Simulation/ISF/ISF_Config/test/test_FullG4_Sim_tf_configuration.py
@@ -102,21 +102,23 @@ class TestFullG4(unittest.TestCase):
 
 
     def test___SimKernel_is_at_end_of_AthAlgSeq(self):
-        ath_alg_seqence_as_str = self._job_config_dict['AthAlgSeq']['Members']
+        ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_seqence_list = eval(ath_alg_seqence_as_str)
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
 
-        actual_last_ath_alg_sequence_entry = ath_alg_seqence_list[-1]
+        actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[-1]
         expected_last_ath_alg_sequence_entry = "ISF::SimKernel/ISF_Kernel_FullG4"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
                          actual_last_ath_alg_sequence_entry)
 
 
     def test___BeamEffectsAlg_is_before_SimKernel_in_AthAlgSeq(self):
-        ath_alg_seqence_as_str = self._job_config_dict['AthAlgSeq']['Members']
+        ath_alg_sequence_as_str = self._job_config_dict['AthAlgSeq']['Members']
         # need to evaluate to obtain actual Python object
-        ath_alg_seqence_list = eval(ath_alg_seqence_as_str)
-        actual_last_ath_alg_sequence_entry = ath_alg_seqence_list[1] #Position 0 should be the timer alg
+        ignore_Algs = ['EventInfoTagBuilder/EventInfoTagBuilder']
+        ath_alg_sequence_list = [ alg for alg in eval(ath_alg_sequence_as_str) if alg not in ignore_Algs ]
+        actual_last_ath_alg_sequence_entry = ath_alg_sequence_list[1] #Position 0 should be the timer alg
         expected_last_ath_alg_sequence_entry = "Simulation::BeamEffectsAlg/BeamEffectsAlg"
         self.assertEqual(expected_last_ath_alg_sequence_entry,
                          actual_last_ath_alg_sequence_entry)
diff --git a/Simulation/ISF/ISF_Example/python/ISF_Output.py b/Simulation/ISF/ISF_Example/python/ISF_Output.py
index becc859f4eb..2209375f0ca 100644
--- a/Simulation/ISF/ISF_Example/python/ISF_Output.py
+++ b/Simulation/ISF/ISF_Example/python/ISF_Output.py
@@ -153,7 +153,7 @@ class ISF_HITSStream:
         stream1 = None
         if athenaCommonFlags.PoolHitsOutput.statusOn:
             output_file = athenaCommonFlags.PoolHitsOutput()
-            stream1 = AthenaPoolOutputStream("StreamHITS", output_file, noTag=True)
+            stream1 = AthenaPoolOutputStream("StreamHITS", output_file)
             stream1.ForceRead = True
             stream1.ItemList = getHITSStreamItemList()
             ## Make stream aware of aborted events
@@ -165,7 +165,7 @@ class ISF_HITSStream:
         xAODStream = None
         if simFlags.SimulationFlavour == "ParametricSimulation":
             output_file = athenaCommonFlags.PoolAODOutput()
-            xAODStream = AthenaPoolOutputStream("StreamAOD", output_file, noTag=True)
+            xAODStream = AthenaPoolOutputStream("StreamAOD", output_file)
             xAODStream.ForceRead = True
             xAODStream.ItemList = getAODStreamItemList()
             ## Make stream aware of aborted events
-- 
GitLab


From d12fcc13d42d827c240da737087d3412d773342f Mon Sep 17 00:00:00 2001
From: William Axel Leight <william.axel.leight@cern.ch>
Date: Thu, 7 Mar 2019 14:03:56 +0000
Subject: [PATCH 307/404] Revert "Merge branch
 'master-MdtCalibrationDbSvcMT-v1' into 'master'"

This reverts merge request !21512
---
 .../MdtCalibData/MdtCorFuncSetCollection.h    |    3 -
 .../MdtCalibData/MdtRtRelationCollection.h    |    3 -
 .../MdtTubeCalibContainerCollection.h         |    3 -
 .../MdtCalibDbCoolStrTool/MdtCalibDbAlg.h     |  137 --
 .../src/MdtCalibDbAlg.cxx                     | 1103 -----------------
 .../src/MdtCalibDbCoolStrTool.cxx             |   16 +-
 .../MdtCalibDbCoolStrTool_entries.cxx         |    4 +-
 .../MdtCalibSvc/MdtCalibrationDbSvc.h         |   28 +-
 .../MdtCalibSvc/src/MdtCalibrationDbSvc.cxx   |  144 ++-
 .../MuonCnvExample/python/MuonCalibConfig.py  |   29 +-
 .../share/MuonCombinedRec_myTopOptions.py     |    2 +-
 11 files changed, 140 insertions(+), 1332 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
 delete mode 100644 MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx

diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
index b2025f61605..05590256213 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtCorFuncSetCollection.h
@@ -25,7 +25,4 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtCorFuncSet> MdtCorFuncSetCollection;
 CLASS_DEF(MdtCorFuncSetCollection , 1176811704 , 1 )
 
-#include "AthenaKernel/CondCont.h"
-CONDCONT_DEF( MdtCorFuncSetCollection, 1338477494 );
-
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
index 806acd06420..290a5de7260 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtRtRelationCollection.h
@@ -25,7 +25,4 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtRtRelation> MdtRtRelationCollection;
 CLASS_DEF(MdtRtRelationCollection, 1270996316, 1 )
 
-#include "AthenaKernel/CondCont.h"
-CONDCONT_DEF( MdtRtRelationCollection, 1160701058 );
-
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
index 0b18baef327..10d2d60aceb 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/MdtCalibData/MdtTubeCalibContainerCollection.h
@@ -25,7 +25,4 @@ It is a DataVector. It can be saved to storegate.
 typedef DataVector<MuonCalib::MdtTubeCalibContainer> MdtTubeCalibContainerCollection;
 CLASS_DEF(MdtTubeCalibContainerCollection, 1221928754, 1 )
 
-#include "AthenaKernel/CondCont.h"
-CONDCONT_DEF( MdtTubeCalibContainerCollection, 1164762092 );
-
 #endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
deleted file mode 100644
index 5b960727eea..00000000000
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool/MdtCalibDbAlg.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-   MdtCalibDbAlg reads raw condition data and writes derived condition data to the condition store
-*/
-
-#ifndef MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
-#define MDTCALIBDBCOOLSTRTOOL_MDTCALIBDBALG_H
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "StoreGate/ReadCondHandleKey.h"
-#include "StoreGate/WriteCondHandleKey.h"
-#include "GaudiKernel/ICondSvc.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-
-//from MdtCalibDbCoolStrTool.h
-//removing obsolete ones
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "MdtCalibInterfaces/IMdtCalibDBTool.h"
-#include "MdtCalibData/MdtTubeCalibContainerCollection.h"
-#include "MdtCalibData/MdtRtRelationCollection.h"
-#include "MdtCalibData/MdtCorFuncSetCollection.h"
-#include "MuonCalibITools/IIdToFixedIdTool.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "CLHEP/Random/RandomEngine.h"
-
-#include "AthenaKernel/IAtRndmGenSvc.h"
-
-//c - c++
-#include "zlib.h"
-#include "vector"
-
-class MdtCalibrationRegionSvc;
-class Identifier; 
-class MdtIdHelper;
-class IIOVDbSvc;
-class MsgStream;
-class IAtRndmGenSvc;
-
-namespace MuonGM{
-  class MuonDetectorManager;
-}
-
-namespace coral	{
-  class Blob;
-}
-
-#include "MdtCalibData/RtResolutionLookUp.h"
-#include "MuonCalibMath/SamplePoint.h"
-
-class MdtCalibDbAlg: public AthAlgorithm {
-
- public:
-
-  MdtCalibDbAlg (const std::string& name, ISvcLocator* pSvcLocator);
-  virtual ~MdtCalibDbAlg() = default;
-  virtual StatusCode initialize() override;
-  virtual StatusCode execute() override;
-  virtual StatusCode finalize() override;
-  
- private:
-  
-  ServiceHandle<ICondSvc> m_condSvc;
-
-  //like MdtCalibDbCoolStrTool
-  //removing obsolete ones
-
-  MuonCalib::MdtTubeCalibContainer* buildMdtTubeCalibContainer(const Identifier &id);
-  
-  StatusCode loadRt();
-  StatusCode defaultRt(std::unique_ptr<MdtRtRelationCollection>& writeCdoRt);
-  StatusCode loadTube();
-  StatusCode defaultT0s(std::unique_ptr<MdtTubeCalibContainerCollection>& writeCdoTube);
-
-  const MdtIdHelper *m_mdtIdHelper;
-  const MuonGM::MuonDetectorManager *m_detMgr;
-  ToolHandle<MuonCalib::IIdToFixedIdTool> m_idToFixedIdTool;
-  ServiceHandle<MdtCalibrationRegionSvc> m_regionSvc;
-
-  std::string      m_rtFolder;
-  std::string      m_tubeFolder;
-
-  //like MdtCalibrationDbSvc
-  //for corData in loadRt
-  bool m_create_b_field_function;
-  bool m_createWireSagFunction;
-  bool m_createSlewingFunction;
-  void initialize_B_correction(MuonCalib::MdtCorFuncSet *funcSet, const MuonCalib::MdtRtRelation *rt);
-  void initializeSagCorrection(MuonCalib::MdtCorFuncSet *funcSet);
-
-  //if m_TimeSlewingCorrection is set to true then it is assumed that the
-  //time slewing correction is applied. If false not. If this flag does
-  //not match the bit in the creation parameters, the rt-relation and t0
-  //will be corrected.
-  //NOTE: This was a preliminary solution for 17.2. In principle each
-  //MdtDriftCircleOnTrackCreator could decide individually if it wants to
-  //have TS-correction. In the default reco-jobs however, this is
-  //configured by one muonRecFlag, that will be used to set this job-option.
-  
-  bool   m_TimeSlewingCorrection;
-  bool   m_UseMLRt;
-  std::vector<float> m_MeanCorrectionVsR;
-  float  m_TsCorrectionT0;
-  double m_defaultT0;
-  double m_t0Shift;
-  double m_t0Spread;
-  double m_rtShift;
-  double m_rtScale;
-  double m_prop_beta;
-  const double m_speed_of_light;
-  ServiceHandle<IAtRndmGenSvc> m_AtRndmGenSvc;
-  CLHEP::HepRandomEngine *p_engine;
-
-  StringArrayProperty m_RTfileNames; //temporary!!!
-
-  //decompression buffer and length of buffer
-  uLongf m_buffer_length;
-  std::unique_ptr<Bytef> m_decompression_buffer;
-  
-  //wrapper function for the zlib uncompress, 
-  //that automatically creates or increases the buffer if needed.    
-  inline bool uncompressInMyBuffer(const coral::Blob &blob);
-  inline MuonCalib::RtResolutionLookUp* getRtResolutionInterpolation(const std::vector<MuonCalib::SamplePoint> &sample_points);
-  inline StatusCode extractString(std::string& input, std::string& output, std::string separator);  
-
-  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyRt;
-  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyTube;
-  SG::WriteCondHandleKey<MdtRtRelationCollection> m_writeKeyRt;
-  SG::WriteCondHandleKey<MdtTubeCalibContainerCollection> m_writeKeyTube;
-  SG::WriteCondHandleKey<MdtCorFuncSetCollection> m_writeKeyCor;
-   
-};
-
-#endif
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
deleted file mode 100644
index f1be8322d46..00000000000
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbAlg.cxx
+++ /dev/null
@@ -1,1103 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "MdtCalibDbCoolStrTool/MdtCalibDbAlg.h"
-
-//from MdtCalibDbCoolStrTool.cxx
-
-#include "StoreGate/StoreGateSvc.h"
-#include "SGTools/TransientAddress.h"
-#include "CoralBase/Attribute.h"
-#include "CoralBase/AttributeListSpecification.h"
-#include "CoralBase/Blob.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-
-#include "Identifier/IdentifierHash.h"
-#include "MuonIdHelpers/MdtIdHelper.h"
-
-#include "MdtCalibData/CalibFunc.h"
-#include "MuonCalibStl/ToString.h"
-#include "MdtCalibUtils/RtDataFromFile.h"
-#include "PathResolver/PathResolver.h"
-#include "MdtCalibData/MdtCalibrationFactory.h"
-#include "MdtCalibData/IRtRelation.h"
-#include "MdtCalibData/IRtResolution.h"
-#include "MuonCalibMath/SamplePoint.h"
-#include "MuonCalibTools/IdToFixedIdTool.h"
-#include "MuonCalibIdentifier/MuonFixedId.h"
-#include "MuonCalibIdentifier/MdtCalibCreationFlags.h"
-#include <fstream>
-#include <string>
-#include <vector>
-
-#include "MdtCalibSvc/MdtCalibrationRegionSvc.h"
-#include "MdtCalibSvc/MdtCalibrationDbSvc.h"
-
-#include "MdtCalibData/MdtRtRelationCollection.h"
-#include "MdtCalibData/MdtTubeCalibContainerCollection.h"
-#include "MdtCalibData/RtFromPoints.h"
-#include "MdtCalibData/RtResolutionFromPoints.h"
-
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
-#include "MuonReadoutGeometry/MdtReadoutElement.h"
-
-#include "AthenaKernel/IIOVDbSvc.h"
-#include "AthenaKernel/IAtRndmGenSvc.h"
-#include "CLHEP/Random/RandGaussZiggurat.h"
-
-#include "TSpline.h"
-#include "TFile.h"
-
-//like MdtCalibrationDbSvc
-//for corData in loadRt
-
-#include "MdtCalibData/MdtCorFuncSetCollection.h"
-#include "MdtCalibData/MdtFullCalibData.h"
-#include "MdtCalibData/BFieldCorFunc.h"
-#include "MdtCalibData/WireSagCorFunc.h"
-#include "MdtCalibData/MdtSlewCorFuncHardcoded.h"
-#include "MdtCalibData/CalibFunc.h"
-
-
-MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator) :
-  AthAlgorithm(name, pSvcLocator),
-  m_condSvc{"CondSvc", name},
-  m_idToFixedIdTool("MuonCalib::IdToFixedIdTool"),
-  m_regionSvc("MdtCalibrationRegionSvc", name),
-  m_rtFolder("/MDT/RTBLOB"),
-  m_tubeFolder("/MDT/T0BLOB"),
-  m_TimeSlewingCorrection(false),
-  m_UseMLRt(true),
-  m_TsCorrectionT0(0.),
-  m_defaultT0(40.),
-  m_t0Shift(0.),
-  m_t0Spread(0.),
-  m_rtShift(0.),
-  m_rtScale(1.),
-  m_prop_beta(1.0),
-  m_speed_of_light(299.792458),
-  m_AtRndmGenSvc ("AtRndmGenSvc", name),
-  m_buffer_length(0),
-  m_decompression_buffer(nullptr),
-  m_readKeyRt("/MDT/RTBLOB"),
-  m_readKeyTube("/MDT/T0BLOB"),
-  m_writeKeyRt("MdtRtRelationCollection"),
-  m_writeKeyTube("MdtTubeCalibContainerCollection"),
-  m_writeKeyCor("MdtCorFuncSetCollection")
-{
-
-  //Db Folders
-  declareProperty("TubeFolder",m_tubeFolder,"DB folder containing the tube constants");
-  declareProperty("RtFolder",m_rtFolder,"DB folder containing the RT calibrations");
-  
-  //Properties to deform the t0 and rt relationship
-  declareProperty("T0Shift",m_t0Shift,"for simulation: common shift of all T0s, in ns");
-  declareProperty("T0Spread",m_t0Spread,"for simulation: sigma for random smeraing of T0s, in ns");
-  declareProperty("RTShift",m_rtShift,"for simulations: maximum RT distortion, in mm");
-  declareProperty("RTScale",m_rtScale,"for simulations: a muliplicitive scale to the drift r");
-
-  //is this the simplest way to initialize a list?
-  std::ostringstream myse;
-  std::vector<std::string> myord;
-  myse << "DC2_rt_default.dat";
-  myord.push_back(myse.str());
-
-  declareProperty("RT_InputFiles",m_RTfileNames=myord,"single input ascii file for default RT to be applied in absence of DB information");
-
-  //defaultT0, used for tubes not found in DB
-  declareProperty("defaultT0",m_defaultT0,"default T0 value to be used in absence of DB information");
-  declareProperty("TimeSlewingCorrection", m_TimeSlewingCorrection);
-  declareProperty("MeanCorrectionVsR", m_MeanCorrectionVsR);
-  declareProperty("UseMLRt", m_UseMLRt,"Enable use of ML-RTs from COOL");
-  declareProperty("PropagationSpeedBeta", m_prop_beta);
-
-  //like MdtCalibrationDbSvc
-  //for corData in loadRt
-  declareProperty("CreateBFieldFunctions", m_create_b_field_function = false,
-		  "If set to true, the B-field correction functions are initialized for each rt-relation that is loaded.");
-  declareProperty("CreateWireSagFunctions", m_createWireSagFunction = false,
-		  "If set to true, the wire sag correction functions are initialized for each rt-relation that is loaded.");
-  declareProperty("CreateSlewingFunctions", m_createSlewingFunction = false,
-		  "If set to true, the slewing correction functions are initialized for each rt-relation that is loaded.");
-
-}
-
-StatusCode MdtCalibDbAlg::initialize(){
-
-  ATH_MSG_DEBUG( "initialize " << name() );
-  ATH_CHECK(m_condSvc.retrieve());
-
-  //if timeslew correction vector m_MeanCorrectionVsR has non-zero size then set
-  //m_TsCorrectionT0=m_MeanCorrectionVsR[0] and subtract this each value in the vector.
-  if(m_MeanCorrectionVsR.size()) {
-    m_TsCorrectionT0 = m_MeanCorrectionVsR[0];
-    for(std::vector<float>::iterator it=m_MeanCorrectionVsR.begin(); it!=m_MeanCorrectionVsR.end(); it++) {
-      (*it) -= m_TsCorrectionT0;
-    }
-  }
-
-  ATH_CHECK( detStore()->retrieve(m_mdtIdHelper, "MDTIDHELPER" ) );
-  ATH_CHECK( detStore()->retrieve( m_detMgr ) );
-  ATH_CHECK( m_regionSvc.retrieve() );
-  ATH_CHECK( m_idToFixedIdTool.retrieve() );
-
-  // initialize MdtRtRelationCollection 
-  // if COOL RT folder is called /MDT/RTUNIQUE then only read one RT from COOL and use for all chambers
-  // Not sure this option has ever been used, perhaps could be used for simulated data.
-  // Job option RtFolder would need to be set to "/MDT/RTUNIQUE" to make this work.
-  if(m_rtFolder == "/MDT/RTUNIQUE") {
-    m_regionSvc->remapRtRegions("OneRt"); 
-  } else if( m_UseMLRt ) {
-    m_regionSvc->remapRtRegions("OnePerMultilayer");
-  } else {
-    m_regionSvc->remapRtRegions("OnePerChamber");
-  }
-  
-  //initiallize random number generator if doing t0 smearing (for robustness studies)
-  if( m_t0Spread != 0. ) {
-    ATH_CHECK( m_AtRndmGenSvc.retrieve() );
-    ATH_MSG_DEBUG( " initialize Random Number Service: running with t0 shift "
-                    << m_t0Shift << " spread " << m_t0Spread << " rt shift " << m_rtShift );
-      
-    // getting our random numbers stream
-    p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBALG");
-    //p_engine = m_AtRndmGenSvc->GetEngine("MDTCALIBDBASCIITOOL");
-    //if we need to reproduce something
-  }
-
-  if ( m_rtShift != 0. || m_rtScale != 1. || m_t0Shift != 0. || m_t0Spread != 0.) {
-    ATH_MSG_INFO( "************************************" << std::endl
-                   << " Running with Calibration Deformations! " << std::endl
-                   << " For performance studies only!" << std::endl
-                   << " **************************************" );
-    ATH_MSG_DEBUG( " rt scale " << m_rtScale << " t0 shift " 
-                    << m_t0Shift << " spread " << m_t0Spread << " rt shift " << m_rtShift );
-  }
-
-  ATH_CHECK(m_readKeyRt.initialize());
-  ATH_CHECK(m_readKeyTube.initialize());
-  ATH_CHECK(m_writeKeyRt.initialize());
-  ATH_CHECK(m_writeKeyTube.initialize());
-  ATH_CHECK(m_writeKeyCor.initialize());
-
-  if(m_condSvc->regHandle(this, m_writeKeyRt).isFailure()) {
-    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyRt.fullKey() << " with CondSvc");
-    return StatusCode::FAILURE;
-  }
-  if(m_condSvc->regHandle(this, m_writeKeyTube).isFailure()) {
-    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyTube.fullKey() << " with CondSvc");
-    return StatusCode::FAILURE;
-  }
-  if(m_condSvc->regHandle(this, m_writeKeyCor).isFailure()) {
-    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKeyCor.fullKey() << " with CondSvc");
-    return StatusCode::FAILURE;
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-StatusCode MdtCalibDbAlg::execute(){
-  
-  ATH_MSG_DEBUG( "execute " << name() );  
-
-  if ( loadRt().isFailure() ) {
-    ATH_MSG_FATAL("loadRt().isFailure()");
-    return StatusCode::FAILURE;
-  }
-
-  if ( loadTube().isFailure() ) {
-    ATH_MSG_FATAL("loadTube().isFailure()");
-    return StatusCode::FAILURE;
-  }
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode MdtCalibDbAlg::defaultRt(std::unique_ptr<MdtRtRelationCollection>& writeCdoRt){
-  ATH_MSG_DEBUG( "defaultRt " << name() );
-
-  if ( writeCdoRt == nullptr ) {
-    ATH_MSG_ERROR("writeCdoRt == nullptr");
-    return StatusCode::FAILURE; 
-  }   
-
-  //Build the transient structure in StoreGate and load default RT function read from a text file
-  //In principle, a list of text files can be specified in the job options, and each text file
-  //may potentially contain multiple RT functions.  However, only the first valid RT function in
-  //the first text file is used as the default for all chambers.
-
-  writeCdoRt->resize(m_regionSvc->numberOfRegions());
-  ATH_MSG_DEBUG( "Created new MdtRtRelationCollection size " << writeCdoRt->size() );
-
-  // Check that an RT text file has been specified in job options
-  std::vector<std::string>::const_iterator it     = m_RTfileNames.value().begin();
-  std::vector<std::string>::const_iterator it_end = m_RTfileNames.value().end();
-  if (it == it_end ) {
-    ATH_MSG_FATAL( "No input RT file declared in jobOptions");
-    return StatusCode::FAILURE;
-  } else if (it_end-it>1) {
-    ATH_MSG_WARNING( "Only first RT file declared in jobOptions will be used");
-  }
-
-  // Open the Ascii file with the RT relations
-  std::string fileName = PathResolver::find_file(it->c_str(),"DATAPATH");
-  if(fileName.length() == 0) {
-    ATH_MSG_ERROR( "RT Ascii file \"" <<  it->c_str() << "\" not found" );
-  }
-  std::ifstream inputFile( fileName.c_str() );
-  if( !inputFile ) {
-    ATH_MSG_ERROR( "Unable to open RT Ascii file: " << fileName.c_str() );
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_DEBUG( "Opened RT Ascii file: " <<  fileName.c_str() );
-  }
-
-  // Read the RTs from the text file
-  MuonCalib::RtDataFromFile rts;
-  rts.read(inputFile);
-  ATH_MSG_VERBOSE( "File contains " << rts.nRts() << " RT relations " );
-
-  // Loop over all RTs in the file (but the default file only has 1 RT)
-  // Use the first valid RT found in the file as the default for all chambers.
-  for(unsigned int n=0;n<rts.nRts();++n) {
-    std::unique_ptr<MuonCalib::RtDataFromFile::RtRelation> rt(rts.getRt(n));
-
-    const MuonCalib::RtDataFromFile::RtRelation::DataVec &times = rt->times();
-    const MuonCalib::RtDataFromFile::RtRelation::DataVec &radii = rt->radii();
-    const MuonCalib::RtDataFromFile::RtRelation::DataVec &reso  = rt->resolution();
-
-    // check if rt contains data, at least two points on the rt are required
-    if( times.size() < 2 ) {
-      ATH_MSG_ERROR( " defaultRt rt table has too few entries" );
-      continue;
-    }
-    // check if all tables have same size
-    if( times.size() != radii.size() || times.size() != reso.size() ) {
-      ATH_MSG_ERROR( "defaultRt rt table size mismatch " );
-      continue;
-    }
-    // check for negative time bins, i.e. decreasing time value with radius
-    double t_min    = times[0];
-    double bin_size = times[1]-t_min;
-    if( bin_size <= 0 ) {
-      ATH_MSG_ERROR( "defaultRt rt table negative binsize " );
-      continue;
-    }
-
-    // create a vector to hold the r values,
-    // we need two extra fields to store t_min and bin_size
-    MuonCalib::CalibFunc::ParVec rtPars;
-    rtPars.push_back( t_min );
-    rtPars.push_back( bin_size );
-
-    // copy r values into vector
-    rtPars.insert( rtPars.end(), radii.begin(), radii.end() );
-
-    ATH_MSG_DEBUG( "defaultRt new MuonCalib::IRtRelation" );
-
-    MuonCalib::CalibFunc::ParVec resoPars;
-    resoPars.push_back( t_min );
-    resoPars.push_back( bin_size );
-
-    // copy r values into vector
-    resoPars.insert( resoPars.end(), reso.begin(), reso.end() );
-
-    ATH_MSG_DEBUG( "defaultRt new MuonCalib::IRtResolution" );
-
-    // create RT and resolution "I" objects
-    MuonCalib::IRtRelation *rtRel = 
-      MuonCalib::MdtCalibrationFactory::createRtRelation( "RtRelationLookUp", rtPars );
-    if( !rtRel ) ATH_MSG_WARNING( "ERROR creating RtRelationLookUp " );
-
-    MuonCalib::IRtResolution *resoRel = 
-      MuonCalib::MdtCalibrationFactory::createRtResolution( "RtResolutionLookUp", resoPars );
-    if( !resoRel ) ATH_MSG_WARNING( "ERROR creating RtResolutionLookUp " );
-
-    // if either RT and resolution are not OK then delete both and try next RT in file
-    if( !resoRel || !rtRel ) {
-      if(resoRel) delete resoRel;
-      if(rtRel) delete rtRel;
-      continue;
-    }
-
-    //Since the same RT is loaded for all chambers you might be tempted to create it once
-    //and simply store the same pointer in writeCdoRt for all regions.
-    //However it seems that when StoreGate clears writeCdoRt (which will happen in LoadRt
-    //by detStore()->removeDataAndProxy) it will crash unless there are unique pointers/objects
-    //for rtRel, resoRel, and MdtRtRelation
-
-    //Loop over RT regions and store the default RT in each
-    for(unsigned int iregion=0; iregion<writeCdoRt->size(); iregion++) {
-      ATH_MSG_DEBUG( "Inserting default Rt for region "<<iregion);
-      // create RT and resolution "I" objects, again, so they can all be cleanly deleted later.
-      rtRel   = MuonCalib::MdtCalibrationFactory::createRtRelation( "RtRelationLookUp", rtPars );
-      resoRel = MuonCalib::MdtCalibrationFactory::createRtResolution( "RtResolutionLookUp", resoPars );
-      (*writeCdoRt)[iregion] = new MuonCalib::MdtRtRelation( rtRel, resoRel, 0. );
-    }   //end loop over RT regions
-
-    //if VERBOSE enabled print out RT function
-    if( msgLvl(MSG::VERBOSE) ) {
-      int npoints = rtRel->nPar()-2;
-      ATH_MSG_VERBOSE( "defaultRt npoints from rtRel="<< npoints );
-      for( int ipt=0;ipt<npoints;++ipt ){
-	double t = t_min + ipt*bin_size;
-	ATH_MSG_VERBOSE(" "<<ipt<<" "<<t<<" "<< rtRel->radius(t)<<" "<< resoRel->resolution(t));
-      }
-    }
-    break; //only need the first good RT from the text file
-  } //end loop over RTs in file
-
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode MdtCalibDbAlg::loadRt(){
-  ATH_MSG_DEBUG( "loadRt " << name() );
-
-  SG::WriteCondHandle<MdtRtRelationCollection> writeHandleRt{m_writeKeyRt};
-  if ( writeHandleRt.isValid() ) {
-    ATH_MSG_DEBUG("CondHandle " << writeHandleRt.fullKey() << " is already valid.");
-    return StatusCode::SUCCESS; 
-  }
-  std::unique_ptr<MdtRtRelationCollection> writeCdoRt{std::make_unique<MdtRtRelationCollection>()};
-
-  SG::WriteCondHandle<MdtCorFuncSetCollection> writeHandleCor{m_writeKeyCor};
-  if ( writeHandleCor.isValid() ) {
-    ATH_MSG_DEBUG("CondHandle " << writeHandleCor.fullKey() << " is already valid.");
-    return StatusCode::SUCCESS;
-  }
-  std::unique_ptr<MdtCorFuncSetCollection> writeCdoCor{std::make_unique<MdtCorFuncSetCollection>()};
-
-  //like MdtCalibDbCoolStrTool::loadRt()
-  //m_rtData is writeCdoRt here
-  //atrc is readCdoRt here
-
-  //tr-relation creators
-  MuonCalib::RtFromPoints rt_fromPoints;
-
-  if ( defaultRt(writeCdoRt).isFailure() ){
-    ATH_MSG_FATAL("defaultRt(writeCdoRt).isFailure()");
-    return StatusCode::FAILURE;
-  }
-  
-  //Read Cond Handle  
-  SG::ReadCondHandle<CondAttrListCollection> readHandleRt{ m_readKeyRt };
-  const CondAttrListCollection* readCdoRt{*readHandleRt}; 
-  if ( readCdoRt==nullptr ) {
-    ATH_MSG_ERROR("readCdoRt==nullptr");
-    return StatusCode::FAILURE; 
-  }   
-  EventIDRange rangeRt;
-  if ( !readHandleRt.range(rangeRt) ) {
-    ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleRt.key());
-    return StatusCode::FAILURE;
-  }  
-  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleRt.fullKey() << " readCdoRt->size()= " << readCdoRt->size());
-  ATH_MSG_INFO("Range of input is " << rangeRt);
-
-  // unpack the strings in the collection and update the writeCdoRt
-  CondAttrListCollection::const_iterator itr;
-  for (itr = readCdoRt->begin(); itr != readCdoRt->end(); ++itr) {
-    const coral::AttributeList &atr=itr->second;
-    bool rt_ts_applied = (atr["tech"].data<int>() & MuonCalib::TIME_SLEWING_CORRECTION_APPLIED);
-    std::string header="",payload="",trailer="";
-    // if BLOB data
-    if (atr["data"].specification().type() == typeid(coral::Blob)){
-      ATH_MSG_VERBOSE( "Data load is a blob. Uncompressing");
-      if(!uncompressInMyBuffer(atr["data"].data<coral::Blob>())) {
-	ATH_MSG_FATAL( "Cannot uncompress buffer" );
-	return StatusCode::FAILURE;
-      }
-      std::string istr(reinterpret_cast<char*>(m_decompression_buffer.get()));
-      ATH_CHECK( extractString(istr, header, "\n") );
-      ATH_CHECK( extractString(istr, payload, "\n") );
-      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
-    } else {      // else CLOB data
-      std::string data;
-      data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
-      ATH_MSG_VERBOSE( "Data load is " << data );
-      // interpret as string stream
-      std::string istr(data.c_str());
-      ATH_CHECK( extractString(istr, header, " ") );
-      ATH_CHECK( extractString(istr, payload, " ") );
-      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, " ") );
-    }
-    ATH_MSG_VERBOSE( "Read header:" << header << " payload:" << payload << " trailer:" << trailer );
-
-    // the header contains the muonfixedid rather than the hash
-    char *parameters = new char [header.size()+1];
-    strncpy(parameters, header.c_str(), header.size()+1);
-    parameters[header.size()]='\0';
-    unsigned int regionId, npoints(0);
-    Identifier  athenaId; 
-    char *pch = strtok(parameters," _,");
-    regionId = atoi(pch);
-    //Long ago the hash was put in the RT file header, but now (2016) 
-    //the muonfixedid of the chamber is in the header.  Hence the "if" below will always be true.    
-    if(regionId>2500) {
-      MuonCalib::MuonFixedId id(regionId);
-      athenaId = m_idToFixedIdTool->fixedIdToId(id);
-      // If using chamber RTs skip RTs for ML2 -- use ML1 RT for entire chamber
-      if( m_regionSvc->RegionType()==ONEPERCHAMBER && m_mdtIdHelper->multilayer(athenaId)==2 ) {
-        ATH_MSG_VERBOSE("MdtCalibDbAlg::loadRt Ignore ML2 RT for region "<<regionId<<" "<<
-			m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(athenaId))<<"_"<<
-			m_mdtIdHelper->stationPhi(athenaId)<<"_"<<m_mdtIdHelper->stationEta(athenaId)<<
-			" ML"<<m_mdtIdHelper->multilayer(athenaId));  //TEMP
-	continue;
-      }
-      IdentifierHash hash;  //chamber hash
-      IdContext idCont = m_mdtIdHelper->module_context();
-      idCont = m_mdtIdHelper->module_context();
-      m_mdtIdHelper->get_hash( athenaId, hash, &idCont );
-      ATH_MSG_VERBOSE( "Fixed region Id "<<regionId<<" converted into athena Id "<<athenaId <<" and then into hash "<<hash);
-      regionId = hash;      //reset regionId to chamber hash
-    }
-    // extract npoints in RT function
-    pch = strtok (NULL, "_,");
-    npoints = atoi(pch);
-    delete [] parameters;
-    MuonCalib::CalibFunc::ParVec rtPars;
-    MuonCalib::CalibFunc::ParVec resoPars;
-
-    MuonCalib::SamplePoint tr_point, ts_point;  //pairs of numbers; tr = (time,radius); ts = (time,sigma)  [sigma=resolution]
-    std::vector<MuonCalib::SamplePoint> tr_points(0), ts_points(0);  //all the points in time,radius [RT] and time,sigma [resolution func]
-    float multilayer_tmax_diff(-9e9);
-
-    double innerTubeRadius = -9999.;
-    const MuonGM::MdtReadoutElement *detEl = m_detMgr->getMdtReadoutElement( m_mdtIdHelper->channelID(athenaId,1,1,1) );
-    if( !detEl ){
-      ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_mdtIdHelper->print_to_string(athenaId) );
-    } else {
-      innerTubeRadius = detEl->innerTubeRadius();
-    }
-
-    char *RTPar= new char [payload.size()+1];
-    strncpy(RTPar, payload.c_str(), payload.size()+1);
-    RTPar[payload.size()]='\0';   //terminate string (not sure this is really needed because payload.c_str() should be terminated in \0)
-    char *pch1 = strtok (RTPar,",");
-    unsigned int n=0;
-    //loop over RT function payload (triplets of radius,time,sigma(=resolution) )
-    for( int k=1; pch1!=NULL && n<=npoints; pch1=strtok(NULL,", "), k++ ) {
-      if(k==1) {    //radius point
-	float radius = atof(pch1);       
-	if( m_rtShift != 0. ) {
-	  float oldradius = radius;
-	  float rshift = m_rtShift*1.87652e-2*radius*(radius-innerTubeRadius);
-	  radius = oldradius + rshift;
-	  ATH_MSG_DEBUG( "DEFORM RT: old radius " << oldradius << " new radius " 
-			  << radius << " shift " << rshift << " max shift " << m_rtShift );
-	}
-       
-	if( m_rtScale !=1. ) {
-	  radius = radius*m_rtScale;
-	  ATH_MSG_DEBUG( "DEFORM RT: old radius " << radius << " new radius " 
-			  << radius << " scale factor " << m_rtScale );
-	}
-       
-	tr_point.set_x2(radius);
-      } else if(k==2) {     //time
-	float time= atof(pch1);
-	tr_point.set_x1(time);
-	ts_point.set_x1(time);
-      } else if(k==3) {     //sigma or resolution
-	float sigma= atof(pch1);
-	ts_point.set_x2(sigma);
-	ts_point.set_error(1.0);
-	tr_point.set_error(1.0);
-	if(tr_point.x2()<-99) {    //if radius is < -99 then treat time as ML Tmax difference
-	  //		std::cout<<"XXxxXX Multilayer t_max diff found!"<<tr_point.x1() <<std::endl;
-	  multilayer_tmax_diff = tr_point.x1();
-	} else if(n==0 || (tr_points[n-1].x1()<tr_point.x1() && tr_points[n-1].x2()<tr_point.x2())) {
-	  tr_points.push_back(tr_point);	       
-	  ts_points.push_back(ts_point);
-	  n++;  //count points in RT
-	}
-	k=0;
-      }
-    }   //end loop over RT function payload (triplets of radius,time,resolution)
-    delete [] RTPar;
-
-    //Must have at least 3 points to have a valid RT
-    if(ts_points.size()<3) {
-      ATH_MSG_FATAL( "Rt relation broken!");
-      ATH_MSG_FATAL( "file='"<<atr["file"].data<std::string>()<<"'");
-      ATH_MSG_FATAL( "header='"<<header<<"'");
-      return StatusCode::FAILURE;
-    }
-
-    if(rt_ts_applied != m_TimeSlewingCorrection) {
-      float sign(rt_ts_applied ? -1.0 : 1.0);
-      float slice_width = innerTubeRadius/static_cast<float>(m_MeanCorrectionVsR.size());
-      for(std::vector<MuonCalib::SamplePoint>::iterator it=tr_points.begin(); it!=tr_points.end(); it++) {
-	int slice_number=static_cast<int>(std::floor(it->x2()/slice_width));		
-	if (slice_number<0)
-	  slice_number=0;
-	if (slice_number >= static_cast<int>(m_MeanCorrectionVsR.size()))
-	  slice_number = static_cast<int>(m_MeanCorrectionVsR.size()) - 1;
-	it->set_x1(it->x1() + sign * m_MeanCorrectionVsR[slice_number]);	
-      }
-    }
-    
-    //Create resolution function from ts_points
-    MuonCalib::IRtResolution *reso = getRtResolutionInterpolation(ts_points);
-    if (msgLvl(MSG::DEBUG)) {
-      ATH_MSG_DEBUG( "Resolution points :");
-      for(std::vector<MuonCalib::SamplePoint>::const_iterator it=tr_points.begin(); it!=tr_points.end(); it++) {
-	ATH_MSG_DEBUG( it->x1()<<"|"<<it->x2()<<"|"<<it->error());
-      }
-	
-      ATH_MSG_DEBUG( "Resolution parameters :");
-      for(unsigned int i=0; i<reso->nPar(); i++) {
-	ATH_MSG_DEBUG(  i<<" "<<reso->par(i) );
-      }
-    }
-
-    //Create RT function from tr_points and load RT and resolution functions 
-    try {
-      MuonCalib::IRtRelation *rt = new MuonCalib::RtRelationLookUp(rt_fromPoints.getRtRelationLookUp(tr_points));
-      if( reso && rt ){
-	if(regionId>=writeCdoRt->size()) {
-	  delete reso; delete rt;
-	  ATH_MSG_WARNING( "Illegal regionId "<< regionId );
-	} else { 
-	  if (rt->par(1)==0.) {
-	    ATH_MSG_WARNING( "Bin size is 0");
-	    for(std::vector<MuonCalib::SamplePoint>::const_iterator it=tr_points.begin(); it!=tr_points.end(); it++)
-	      ATH_MSG_WARNING( it->x1() << " " <<it->x2() <<" "<< it->error() );
-	  }
-	  //Save ML difference if it is available
-	  if(multilayer_tmax_diff>-8e8) {
-	    rt->SetTmaxDiff(multilayer_tmax_diff);
-	  }
-	  //Store RT and resolution functions for this region
-	  if( m_regionSvc->RegionType() == ONERT ) {
-	    (*writeCdoRt)[0] = new MuonCalib::MdtRtRelation( rt, reso, 0.);
-	    break;   // only read one RT from COOL for ONERT option.
-	  // If doing ML2 RTs, and this is a ML2 RT function then add it to the end of writeCdoRt
-	  } else if( m_regionSvc->RegionType()==ONEPERMULTILAYER && m_mdtIdHelper->multilayer(athenaId)==2 ) {
-	    ATH_MSG_VERBOSE("MdtCalibDbAlg::loadRt Load ML2 RT for region "<<regionId<<" "<<
-			 m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(athenaId))<<"_"<<
-			 m_mdtIdHelper->stationPhi(athenaId)<<"_"<<m_mdtIdHelper->stationEta(athenaId)<<
-			 " ML"<<m_mdtIdHelper->multilayer(athenaId));
-	    (*writeCdoRt).push_back(new MuonCalib::MdtRtRelation( rt, reso, 0.));
-	    IdentifierHash mlHash;
-	    m_mdtIdHelper->get_detectorElement_hash( athenaId, mlHash ); 
-	    m_regionSvc->setRegionHash(mlHash);
-	  } else {   //store RT for chamber or ML1 if doing ONEPERMULTILAYER
-	    (*writeCdoRt)[regionId] = new MuonCalib::MdtRtRelation( rt, reso, 0.);
-	  }
-	}      //end else regionId is OK
-      }        //end if reso && rt
-    }          //end try
-    catch (int i) {
-      ATH_MSG_FATAL( "Error in creating rt-relation!" );
-      ATH_MSG_FATAL( "npoints="<<tr_points.size());
-      ATH_MSG_FATAL( "Offending input: header=" << header );
-      ATH_MSG_FATAL( "Offending input: payload=" << payload );
-      return StatusCode::FAILURE;
-    }
-    
-  }//end loop over itr (strings read from COOL)
-  ATH_MSG_INFO("MdtCalibDbAlg::loadRt Read "<<m_regionSvc->numberOfRegions()<<"RTs from COOL");
-
-  //like MdtCalibrationDbSvc
-  //for corData in loadRt
-
-  //Check if doing corrections; return if not
-  //if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ) return StatusCode::SUCCESS;
-  //here at least record default as an Alg
-  //and then check flags again in the DbSvc
-
-  writeCdoCor->resize(writeCdoRt->size());
-  ATH_MSG_DEBUG( "Initializing " << writeCdoCor->size() << " b-field functions" );
-  for (unsigned int i=0; i < writeCdoCor->size(); i++) {
-    (*writeCdoCor)[i] = new MuonCalib::MdtCorFuncSet();
-    if(m_create_b_field_function) initialize_B_correction((*writeCdoCor)[i], (*writeCdoRt)[i]);
-    if(m_createWireSagFunction)   initializeSagCorrection((*writeCdoCor)[i]);
-    if(m_createSlewingFunction)   (*writeCdoCor)[i]->setSlewing(new MuonCalib::MdtSlewCorFuncHardcoded(MuonCalib::CalibFunc::ParVec()));
-  }
-
-  //finally record writeCdo
-
-  if ( writeCdoRt->size()==0 ) {
-    ATH_MSG_WARNING("writeCdoRt->size()==0"); 
-    return StatusCode::FAILURE;
-  }
-  if (writeHandleRt.record(rangeRt, std::move(writeCdoRt)).isFailure()) {
-    ATH_MSG_FATAL("Could not record " << writeHandleRt.key()
-		  << " with EventRange " << rangeRt
-		  << " into Conditions Store");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("recorded new " << writeHandleRt.key()
-	       << " with range " << rangeRt
-	       << " into Conditions Store");
-
-  if ( writeCdoCor->size()==0 ) {
-    ATH_MSG_WARNING("writeCdoCor->size()==0");
-    return StatusCode::FAILURE;
-  }
-  if (writeHandleCor.record(rangeRt, std::move(writeCdoCor)).isFailure()) {
-    ATH_MSG_FATAL("Could not record " << writeHandleCor.key()
-		  << " with EventRange " << rangeRt
-		  << " into Conditions Store");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("recorded new " << writeHandleCor.key()
-	       << " with range " << rangeRt
-	       << " into Conditions Store");
-  
-  return StatusCode::SUCCESS;
-}
-
-
-// build the transient structure and load some defaults for T0s
-StatusCode MdtCalibDbAlg::defaultT0s(std::unique_ptr<MdtTubeCalibContainerCollection>& writeCdoTube) {
-
-  if ( writeCdoTube == nullptr ) {
-    ATH_MSG_ERROR("writeCdoTube == nullptr");
-    return StatusCode::FAILURE; 
-  }
-  
-  //like MdtCalibDbCoolStrTool::defaultT0s()
-  //m_tubeData is writeCdoTube here
-
-  writeCdoTube->resize( m_mdtIdHelper->module_hash_max() );
-  ATH_MSG_DEBUG( " Created new MdtTubeCalibContainerCollection size " << writeCdoTube->size() );
-
-  // Inverse of wire propagation speed
-  float inversePropSpeed = 1./(m_speed_of_light*m_prop_beta);
-
-  //loop over modules (MDT chambers) and create an MdtTubeContainer for each
-  MdtIdHelper::const_id_iterator it     = m_mdtIdHelper->module_begin();
-  MdtIdHelper::const_id_iterator it_end = m_mdtIdHelper->module_end();
-  for(; it!=it_end;++it ) {
-    MuonCalib::MdtTubeCalibContainer *tubes=0;
-    //create an MdtTubeContainer
-    tubes = buildMdtTubeCalibContainer(*it);
-
-    // is tubes ever 0?  how could that happen?
-    if(tubes) {
-      std::string rName=tubes->regionKey();
-      double t0 = m_defaultT0;
-
-      int nml=tubes->numMultilayers();
-      int nlayers=tubes->numLayers();
-      int ntubes=tubes->numTubes();
-      int size = nml*nlayers*ntubes;
-      ATH_MSG_VERBOSE( "Adding chamber " << m_mdtIdHelper->print_to_string(*it) );
-      ATH_MSG_VERBOSE( " size " << size << " ml " << nml << " l " << nlayers << " t " 
-		       << ntubes << " address " << tubes );
-      for( int ml=0;ml<nml;++ml ){
-	for( int l=0;l<nlayers;++l ){
-	  for( int t=0;t<ntubes;++t ){
-	    MuonCalib::MdtTubeCalibContainer::SingleTubeCalib data;
-	    data.t0 = t0;
-	    data.adcCal = 1.;
-	    data.inversePropSpeed = inversePropSpeed;
-	    tubes->setCalib( ml,l,t,data );
-	  }
-	}
-      }
-    }  //end loop over chambers (modules)
-    ATH_MSG_VERBOSE( " set t0's done " );
-    IdentifierHash hash;
-    IdContext idCont = m_mdtIdHelper->module_context();
-    m_mdtIdHelper->get_hash( *it, hash, &idCont );
-
-    if( hash < writeCdoTube->size() ){
-      (*writeCdoTube)[hash] = tubes;
-      ATH_MSG_VERBOSE( " adding tubes at " << hash << " current size " << writeCdoTube->size() );
-//write out string for chamberlist
-      if(tubes) {
-	int nml     = tubes->numMultilayers();
-	int nlayers = tubes->numLayers();
-	int ntubes  = tubes->numTubes();	
-	ATH_MSG_VERBOSE( "CHAMBERLIST: " << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(*it)) << " " << m_mdtIdHelper->stationEta(*it) << " " << m_mdtIdHelper->stationPhi(*it) << " " << nml*nlayers*ntubes << " " << nml << " " << nlayers << " " << ntubes << " dummy " << hash );
-      }
-    } else {
-      if(tubes) delete tubes;
-      ATH_MSG_WARNING( " HashId out of range " << hash << " max " << writeCdoTube->size() );
-    }
-  }
-  ATH_MSG_DEBUG( " Done defaultT0s " << writeCdoTube->size() );
-
-  return StatusCode::SUCCESS;
-}  //end MdtCalibDbAlg::defaultT0s
-
-
-StatusCode MdtCalibDbAlg::loadTube(){
-  ATH_MSG_DEBUG( "loadTube " << name() );
-
-  SG::WriteCondHandle<MdtTubeCalibContainerCollection> writeHandleTube{m_writeKeyTube};
-  if ( writeHandleTube.isValid() ) {
-    ATH_MSG_DEBUG("CondHandle " << writeHandleTube.fullKey() << " is already valid.");
-    return StatusCode::SUCCESS; 
-  }
-  std::unique_ptr<MdtTubeCalibContainerCollection> writeCdoTube{std::make_unique<MdtTubeCalibContainerCollection>()};
-
-  //like MdtCalibDbCoolStrTool::loadTube()
-  //m_tubeData is writeCdoTube here
-  //atrc is readCdoTube here
-
-  if ( defaultT0s(writeCdoTube).isFailure() ) {
-    ATH_MSG_FATAL("defaultT0s().isFailure()");
-    return StatusCode::FAILURE;
-  }
-  
-  //Read Cond Handle  
-  SG::ReadCondHandle<CondAttrListCollection> readHandleTube{ m_readKeyTube };
-  const CondAttrListCollection* readCdoTube{*readHandleTube}; 
-  if ( readCdoTube==nullptr ) {
-    ATH_MSG_ERROR("readCdoTube==nullptr");
-    return StatusCode::FAILURE; 
-  }   
-  EventIDRange rangeTube;
-  if ( !readHandleTube.range(rangeTube) ) {
-    ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleTube.key());
-    return StatusCode::FAILURE;
-  }  
-  ATH_MSG_INFO("Size of CondAttrListCollection " << readHandleTube.fullKey() << " readCdoTube->size()= " << readCdoTube->size());
-  ATH_MSG_INFO("Range of input is " << rangeTube);
-  
-  // Inverse of wire propagation speed
-  float inversePropSpeed = 1./(m_speed_of_light*m_prop_beta);
-
-  // unpack the strings in the collection and update the 
-  // MdtTubeCalibContainers in TDS
-  CondAttrListCollection::const_iterator itr;
-  for (itr = readCdoTube->begin(); itr != readCdoTube->end(); ++itr) {
-    const coral::AttributeList &atr = itr->second;
-    std::string header="",payload="",trailer="";
-
-    bool t0_ts_applied = (atr["tech"].data<int>() & MuonCalib::TIME_SLEWING_CORRECTION_APPLIED);
-    // If BLOB data then uncompress
-    if (atr["data"].specification().type() == typeid(coral::Blob)) {
-      ATH_MSG_VERBOSE( "Data load is a blob. Uncompressing");
-      if(!uncompressInMyBuffer(atr["data"].data<coral::Blob>())) {
-	ATH_MSG_FATAL( "Cannot uncompress buffer" );
-	return StatusCode::FAILURE;
-      }
-      std::string istr(reinterpret_cast<char*>(m_decompression_buffer.get()));
-      ATH_CHECK( extractString(istr, header, "\n") );
-      ATH_CHECK( extractString(istr, payload, "\n") );
-      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
-    } else {        //else is uncompressed CLOB (no longer used)
-      std::string data;
-      data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
-      ATH_MSG_VERBOSE( "Data load is " << data );
-
-      // interpret as string stream
-      std::string istr(data.c_str());
-      ATH_CHECK( extractString(istr, header, "\n") );
-      ATH_CHECK( extractString(istr, payload, "\n") );
-      if( istr.size() ) ATH_CHECK( extractString(istr, trailer, "\n") );
-    }
-    ATH_MSG_VERBOSE( "Read header:" << header << " payload:" << payload << " trailer:" << trailer );
-
-    // Extract info from the header line, chamber name, number of tubes.
-    int ieta=-99, iphi=-99, region=-99, ntubes=-99;
-    //    std::string rName;
-
-    // parameters for the MdtTubeContainer
-    // header filename,version,region,tubes
-    char *parameters = new char [header.size()+1];
-    strncpy(parameters, header.c_str(), header.size()+1);
-    parameters[header.size()] = '\0';      //terminate string
-    char *pch = strtok(parameters," _,");  //split using delimiters "_" and ","
-    std::string name(pch,2,3);             //extract 3-character station to "name" (e.g. BIL) 
-
-    // Split header line and extract phi, eta, region, ntubes
-    pch = strtok (NULL, "_,");
-    for( int i=1; pch!=NULL; pch=strtok(NULL,"_,"), i++ ) {
-      std::istringstream is(pch);
-      if(i==1) {
-	is >> iphi; 
-      } else if(i==2) {
-	is >> ieta; 
-      } else if(i==4) {
-	is >> region; 
-      } else if(i==5) {
-	is >> ntubes; 
-      }
-    }
-    delete [] parameters;
-
-    // find chamber ID
-    Identifier chId = m_mdtIdHelper->elementID(name,ieta,iphi);
- 
-    MuonCalib::MdtTubeCalibContainer *tubes = NULL;
-
-    // get chamber hash
-    IdentifierHash hash;
-    IdContext idCont = m_mdtIdHelper->module_context();
-    m_mdtIdHelper->get_hash( chId , hash, &idCont );
-
-    if( msgLvl(MSG::VERBOSE) ) {
-      ATH_MSG_VERBOSE( "name of chamber is " << pch << " station name is " << name );
-      ATH_MSG_VERBOSE( "phi value is " << iphi );
-      ATH_MSG_VERBOSE( "eta value is " << ieta );
-      ATH_MSG_VERBOSE( "region value is " << region );
-      ATH_MSG_VERBOSE( "ntubes value is " << ntubes );
-      ATH_MSG_VERBOSE( "station name is " << name << " chamber ID  is " << chId );
-      ATH_MSG_VERBOSE( "corresponding hash is " << hash );
-    }
-    
-   //skip illegal stations.     
-    if (hash>=writeCdoTube->size()) {
-      ATH_MSG_INFO( "Illegal station (1)! (" << name << "," << iphi << "," << ieta << ")" );
-      continue;
-    }
-                                                                                
-    // retrieve the existing one (created by defaultt0() )
-    tubes = (*writeCdoTube)[hash];
-
-    if(tubes==NULL) {
-      ATH_MSG_INFO( "Illegal station (2)! (" << name << "," << iphi << "," << ieta << ")" );
-      continue;
-    }
-    
-    int nml       = tubes->numMultilayers();
-    int nlayers   = tubes->numLayers();
-    int ntubesLay = tubes->numTubes();
-    int size      = nml*nlayers*ntubesLay;
-
-    if(size!=ntubes) {
-      ATH_MSG_ERROR( "Pre-existing MdtTubeCalibContainer for chamber ID " <<chId<< " size does not match the one found in DB ");
-      return StatusCode::FAILURE;
-    }
-
-    //Extract T0, ADCcal, valid flag for each tube from payload.
-    MuonCalib::MdtTubeCalibContainer::SingleTubeCalib datatube;
-    char *TubePar= new char [payload.size()+1];
-    strncpy(TubePar, payload.c_str(), payload.size()+1);
-    TubePar[payload.size()]='\0';
-    
-    //Loop over payload 
-    char *pch1=strtok(TubePar,",");
-    int ml=1, l=1, t=1;
-    for( int k=1; pch1!=NULL; pch1=strtok(NULL,", "), k++) { 
-      if(k==1) {
-	double tzero = atof(pch1);
-	if( m_t0Shift != 0. ){
-	  tzero += m_t0Shift;
-	  ATH_MSG_VERBOSE( "T0 shift " << m_t0Shift << " t0 " << tzero 
-			   << " id " << ml << " " << l << " " << t );
-	}
-	if(m_t0Spread != 0. ){
-	  double sh = CLHEP::RandGaussZiggurat::shoot(p_engine,0.,m_t0Spread);
-	  tzero += sh;
-	  ATH_MSG_VERBOSE( "T0 spread " << sh << " t0 " << tzero 
-			   << " id " << ml << " " << l << " " << t );
-	}
-	if(!t0_ts_applied && m_TimeSlewingCorrection) {
-	  tzero += m_TsCorrectionT0;
-	}
-	if(t0_ts_applied && !m_TimeSlewingCorrection) {
-	  tzero -= m_TsCorrectionT0;
-	}
-	datatube.t0=tzero;
-      } else if(k==2) {
-	datatube.statusCode = atoi(pch1);
-      } else if(k==3) {
-        datatube.adcCal = atof(pch1);
-        datatube.inversePropSpeed = inversePropSpeed;
-        tubes->setCalib( ml-1,l-1,t-1,datatube);
-        ATH_MSG_VERBOSE( "Loading T0s "<<ml << " " << l << " " << t << " " << datatube.t0 );
-        t++; k=0;
-        if (t>ntubesLay) {
-          l++; 
-          t=1;
-        }
-        if (l>nlayers) {
-          ml++;
-          l=1;
-        }
-      }
-    }
-    delete [] TubePar;
-  }//end loop over readCdoTube
-
-  //finally record writeCdo
-
-  if ( writeCdoTube->size()==0 ) {
-    ATH_MSG_WARNING("writeCdoTube->size()==0"); 
-    return StatusCode::FAILURE;
-  }
-  if (writeHandleTube.record(rangeTube, std::move(writeCdoTube)).isFailure()) {
-    ATH_MSG_FATAL("Could not record " << writeHandleTube.key()
-		  << " with EventRange " << rangeTube
-		  << " into Conditions Store");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("recorded new " << writeHandleTube.key()
-	       << " with range " << rangeTube
-	       << " into Conditions Store");
-
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode MdtCalibDbAlg::finalize(){  
-  ATH_MSG_DEBUG( "finalize " << name() );
-  return StatusCode::SUCCESS;
-}
-
-
-// Build a MuonCalib::MdtTubeCalibContainer for a given Identifier
-MuonCalib::MdtTubeCalibContainer* MdtCalibDbAlg::buildMdtTubeCalibContainer(const Identifier &id) {    
-  MuonCalib::MdtTubeCalibContainer *tubes = 0;
-
-  const MuonGM::MdtReadoutElement *detEl = m_detMgr->getMdtReadoutElement( m_mdtIdHelper->channelID(id,1,1,1) );
-  const MuonGM::MdtReadoutElement *detEl2 = 0;
-  if (m_mdtIdHelper->numberOfMultilayers(id) == 2){
-    detEl2 = m_detMgr->getMdtReadoutElement(m_mdtIdHelper->channelID(id,2,1,1) );
-  } else {
-    ATH_MSG_VERBOSE( "A single multilayer for this station " << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(id))<<","<< m_mdtIdHelper->stationPhi(id) <<","<< m_mdtIdHelper->stationEta(id) );
-  }
-
-  ATH_MSG_VERBOSE( " new det el " << detEl );
-  
-  if( !detEl ){ 
-    ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_mdtIdHelper->print_to_string(id) );
-  } else {
-    int nml = 2;
-    if( !detEl2 ) nml = 1;
-    
-    int nlayers = detEl->getNLayers();
-    if( detEl2 && detEl2->getNLayers() > nlayers ){
-      ATH_MSG_DEBUG( "Second multilayer has more layers " << detEl2->getNLayers() << " then first " << nlayers );
-      nlayers = detEl2->getNLayers();
-    }
-
-    int ntubes = detEl->getNtubesperlayer();
-    if( detEl2 && detEl2->getNtubesperlayer() > ntubes ){
-      ATH_MSG_DEBUG( "Second multilayer has more tubes " << detEl2->getNtubesperlayer() << " then first " << ntubes );
-      ntubes = detEl2->getNtubesperlayer();
-    }
-
-    // build the region name in the format STATION_ETA_PHI
-    std::string rName;
-
-    int stName = m_mdtIdHelper->stationName(id);
-    int stPhi  = m_mdtIdHelper->stationPhi(id);
-    int stEta  = m_mdtIdHelper->stationEta(id);
-  
-    std::string separator("_");
-    MuonCalib::ToString ts;
-    rName = m_mdtIdHelper->stationNameString(stName);
-    rName += separator + ts( stPhi ) + separator + ts( stEta );
-    tubes = new MuonCalib::MdtTubeCalibContainer( rName,nml, nlayers, ntubes );
-  }
-
-  return tubes;
-}  //end MdtCalibDbAlg::buildMdtTubeCalibContainer
-
-inline bool MdtCalibDbAlg::uncompressInMyBuffer(const coral::Blob &blob) {
-  if (!m_decompression_buffer) {
-    m_buffer_length= 50000;
-    m_decompression_buffer.reset(new Bytef[m_buffer_length]);
-  }
-  uLongf actual_length;	
-  while(1) {
-    actual_length=m_buffer_length;
-    int res(uncompress(m_decompression_buffer.get(), &actual_length, reinterpret_cast<const Bytef *>(blob.startingAddress()), static_cast<uLongf>(blob.size())));
-    if (res == Z_OK) break;
-    //double buffer if it was not big enough
-    if( res == Z_BUF_ERROR) {
-      m_buffer_length*=2;
-      ATH_MSG_VERBOSE(  "Increasing buffer to " << m_buffer_length);
-      m_decompression_buffer.reset();
-      m_decompression_buffer.reset(new Bytef[m_buffer_length]);
-      continue;
-    }
-    //something else is wrong
-    return false;
-  }
-  //append 0 to terminate string, increase buffer if it is not big enough
-  if (actual_length >= m_buffer_length)	{
-    std::unique_ptr<Bytef> old_buffer(std::move(m_decompression_buffer));
-    size_t old_length=m_buffer_length;
-    m_buffer_length*=2;
-    m_decompression_buffer.reset(new Bytef[m_buffer_length]);
-    memcpy(m_decompression_buffer.get(), old_buffer.get(), old_length);
-    old_buffer.reset();
-  }
-  m_decompression_buffer.get()[actual_length]=0;
-  return true;
-}
-
-inline MuonCalib::RtResolutionLookUp* MdtCalibDbAlg::getRtResolutionInterpolation( const std::vector<MuonCalib::SamplePoint> &sample_points) {
-
-  ///////////////
-  // VARIABLES //
-  ///////////////
-  Double_t *x = new Double_t[sample_points.size()];
-  Double_t *y = new Double_t[sample_points.size()];
-	
-  for (unsigned int i=0; i<sample_points.size(); i++) {
-    x[i] = sample_points[i].x1();
-    y[i] = sample_points[i].x2();
-  }
-  TSpline3 sp("Rt Res Tmp", x, y, sample_points.size());
-  ///////////////////////////////////////////////////////////////////
-  // CREATE AN RtRelationLookUp OBJECT WITH THE CORRECT PARAMETERS //
-  ///////////////////////////////////////////////////////////////////
-  unsigned int nb_points(100);
-  std::vector<double> res_param(nb_points+2); // r-t parameters
-  Double_t bin_width=(x[sample_points.size() -1] - x[0]) / static_cast<Double_t>(nb_points);
-	
-  res_param[0] = x[0];
-  res_param[1] = bin_width;
-  for (unsigned int k=0; k<nb_points; k++) {
-    Double_t xx = x[0] + k*bin_width;
-    res_param[k+2] = sp.Eval(xx);
-    if (std::isnan(res_param[k+2])) {
-      TFile outf("kacke.root", "RECREATE");
-      sp.Write("kacke");
-      exit(99);
-    }
-  }
-  delete [] x;
-  delete [] y;
-  return new MuonCalib::RtResolutionLookUp(res_param);
-}
-
-inline StatusCode MdtCalibDbAlg::extractString(std::string &input, std::string &output, std::string separator) {
-  unsigned long int pos = 0;
-  std::string::size_type start = input.find_first_not_of(separator.c_str(),pos);
-  if(start == std::string::npos) {
-    ATH_MSG_ERROR("MdtCalibDbAlg::extractString: Cannot extract string in a proper way!");
-    return StatusCode::FAILURE;
-  }
-  std::string::size_type stop = input.find_first_of(separator.c_str(),start+1);
-  if (stop == std::string::npos) stop = input.size();
-  output = input.substr(start,stop-start);
-  input.erase(pos,stop-pos);
-
-  return StatusCode::SUCCESS;
-}
-
-
-//like MdtCalibrationDbSvc
-//for corData in loadRt
-void MdtCalibDbAlg::initialize_B_correction(MuonCalib::MdtCorFuncSet *funcSet,
-                                                  const MuonCalib::MdtRtRelation *rt_rel) {
-  if (rt_rel==NULL) {
-    funcSet->setBField(NULL);
-    return;
-  }
-  ATH_MSG_VERBOSE( "initialize_B_correction..." );
-  std::vector<double> corr_params(2);
-  corr_params[0] = 3080.0; // high voltage (not correct for sMDT which use 2730V!)
-  corr_params[1] = 0.11;   // epsilon parameter
-  funcSet->setBField(new MuonCalib::BFieldCorFunc(std::string("medium"), corr_params, rt_rel->rt()));
-}
-
-void MdtCalibDbAlg::initializeSagCorrection(MuonCalib::MdtCorFuncSet *funcSet) {
-  ATH_MSG_VERBOSE( "initializeSagCorrection..." );
-  std::vector<double> corr_params(0);
-  funcSet->wireSag(new MuonCalib::WireSagCorFunc(corr_params));
-}
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
index 65afa3249e1..b706960cc7a 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/MdtCalibDbCoolStrTool.cxx
@@ -161,10 +161,18 @@ StatusCode MdtCalibDbCoolStrTool::initialize() {
 
   ATH_CHECK( m_idToFixedIdTool.retrieve() );
 
-  //In 2019 for the AthenaMT migration,
-  //Callback functions and member data cache were removed from MdtCalibrationDbSvc
-  //Registration of the callback functions was also removed here
-  //Please use MdtCalibDbAlg to provide derived data via the condition store
+  ServiceHandle<MdtCalibrationDbSvc> dbSvc("MdtCalibrationDbSvc", name());
+  ATH_CHECK( dbSvc.retrieve() );
+  ATH_MSG_DEBUG( "Retrieved MdtCalibrationDbSvc" );
+
+  ATH_CHECK( detStore()->regFcn(&IMdtCalibDBTool::loadTube,
+				dynamic_cast<IMdtCalibDBTool*>(this),
+				&MdtCalibrationDbSvc::loadTube,
+				dynamic_cast<MdtCalibrationDbSvc*>(&*dbSvc)) );
+  ATH_CHECK( detStore()->regFcn(&IMdtCalibDBTool::loadRt,
+				dynamic_cast<IMdtCalibDBTool*>(this),
+				&MdtCalibrationDbSvc::loadRt,
+				dynamic_cast<MdtCalibrationDbSvc*>(&*dbSvc)) );
 
   // initialize MdtTubeCalibContainers 
   ATH_CHECK( defaultT0s() );
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
index fc50e753e77..ba05e576b4a 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibDbCoolStrTool/src/components/MdtCalibDbCoolStrTool_entries.cxx
@@ -1,8 +1,6 @@
 #include "MdtCalibDbCoolStrTool/MdtCalibDbCoolStrTool.h"
-#include "MdtCalibDbCoolStrTool/MdtCalibDbAlg.h"
-#include "MdtCalibSvc/MdtCalibrationRegionSvc.h"
 
 using namespace MuonCalib;
 
 DECLARE_COMPONENT( MdtCalibDbCoolStrTool )
-DECLARE_COMPONENT( MdtCalibDbAlg )
+
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
index 7fa7a07ef50..1056500b973 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationDbSvc.h
@@ -34,8 +34,6 @@ namespace MuonCalib{
   struct MdtFullCalibData;
 }
 
-#include "StoreGate/ReadCondHandleKey.h"
-
 /** handles the retreival of constants from the DB: it uses a Tool 
  * derived from MuonCalib::IMdtCalibDBTool to access different types of DB
  * (currently implemented ASCII files and COOL CLOBS)*/
@@ -58,7 +56,15 @@ public:
   virtual StatusCode initialize(void);
   /** finalization */
   virtual StatusCode finalize(void);  
-
+    
+  /** to be called back to update the Collections : retrieve from database */
+  virtual StatusCode LoadCalibration(IOVSVC_CALLBACK_ARGS);
+  /** to be called back to update the Collections : retrieve RTs from database*/
+  virtual StatusCode loadRt(IOVSVC_CALLBACK_ARGS);
+  /** to be called back to update the Collections : 
+   * retrieve Tube inforsmation  from database */
+  virtual StatusCode loadTube(IOVSVC_CALLBACK_ARGS);
+    
   /** Access to calibration constants per calibration region/chamber */
   MuonCalib::MdtFullCalibData getCalibration( const Identifier &id ) const; 
     
@@ -87,6 +93,15 @@ public:
   const MuonCalib::MdtCorFuncSet* getCorFunctions( const IdentifierHash &detElHash ) const;
     
 private:
+  /** Indexed with MdtRegionHash for rt relations*/
+  mutable MdtRtRelationCollection *m_rtData;
+    
+  /** Indexed with MdtChamberHash */
+  mutable MdtTubeCalibContainerCollection *m_tubeData;
+    
+  /** Indexed with MdtRegionHash for correction function regions */
+  mutable MdtCorFuncSetCollection *m_corData;
+
   /** handle to region service */
   ServiceHandle<MdtCalibrationRegionSvc> m_regionSvc;
     
@@ -103,16 +118,15 @@ private:
   ServiceHandle<StoreGateSvc> m_detStore;
 
   /** Properties: */
+  std::string m_tubeDataLocation;
+  std::string m_rtDataLocation;
+  std::string m_corDataLocation;
   bool m_create_b_field_function; //<! flag to switch on loading of B field correction
   bool m_createWireSagFunction;   //<! flag to switch on loading of wire sag correction
   bool m_createSlewingFunction;   //<! flag to switch on loading of slewing correction
 
   bool m_getTubeConstants; //<! flag to switch off loading of tube constants
   bool m_getCorrections;   //<! flag to switch off loading of correction function constants
-
-  SG::ReadCondHandleKey<MdtRtRelationCollection> m_readKeyRt;
-  SG::ReadCondHandleKey<MdtTubeCalibContainerCollection> m_readKeyTube;
-  SG::ReadCondHandleKey<MdtCorFuncSetCollection> m_readKeyCor;
     
 };
 
diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
index 9716e798491..c9cf4d6ec26 100644
--- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
+++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationDbSvc.cxx
@@ -26,14 +26,14 @@
 #include "MdtCalibData/CalibFunc.h"
 
 MdtCalibrationDbSvc::MdtCalibrationDbSvc(const std::string &n,ISvcLocator *sl)
-  : AthService(n,sl),
+  : AthService(n,sl), m_rtData(0), m_tubeData(0), m_corData(0), 
     m_regionSvc("MdtCalibrationRegionSvc", name()),
     m_mdtIdHelper(0),
     m_dbTool("MuonCalib::MdtCalibDbAsciiTool"),
     m_detStore("StoreGateSvc/DetectorStore", name()),
-    m_readKeyRt("MdtRtRelationCollection"),
-    m_readKeyTube("MdtTubeCalibContainerCollection"),
-    m_readKeyCor("MdtCorFuncSetCollection")
+    m_tubeDataLocation("TubeKey"),
+    m_rtDataLocation("RtKey"),
+    m_corDataLocation("CorKey")
 {
   declareProperty("DBTool", m_dbTool,
 		  "the Tool to be used to retrieve the constants");
@@ -87,14 +87,85 @@ StatusCode MdtCalibrationDbSvc::initialize() {
     return StatusCode::FAILURE;
   }
 
-  ATH_CHECK(m_readKeyRt.initialize());
-  ATH_CHECK(m_readKeyTube.initialize());
-  ATH_CHECK(m_readKeyCor.initialize());
-
+  // register call backs requiring to be called after the Tool 
+  // will work for Ascii Tool only
+  // for real DB access the callback is registered with 2 functions 
+  // within the Tool
+  if(m_dbTool.type()=="MuonCalib::MdtCalibDbAsciiTool"){
+    const DataHandle<MdtTubeCalibContainerCollection> tubeData;
+    if(m_detStore->regFcn(&MdtCalibrationDbSvc::LoadCalibration,dynamic_cast<MdtCalibrationDbSvc*>(this),tubeData,m_tubeDataLocation).isFailure()){
+      ATH_MSG_ERROR("Failed to register call-back on tube data");
+      return StatusCode::FAILURE;
+    }
+    const DataHandle<MdtRtRelationCollection> rtData;
+    if(m_detStore->regFcn(&MdtCalibrationDbSvc::LoadCalibration,
+			  dynamic_cast<MdtCalibrationDbSvc*>(this),
+			  rtData,m_rtDataLocation).isFailure() ){
+      ATH_MSG_ERROR("Failed to register call-back on rt data");
+      return StatusCode::FAILURE;
+    }
+  }
+    
   return StatusCode::SUCCESS;
 }  //end MdtCalibrationDbSvc::initialize
 
+StatusCode MdtCalibrationDbSvc::LoadCalibration(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
+  std::list<std::string>::const_iterator itr;
+  if( msgLvl(MSG::DEBUG) ) {
+    ATH_MSG_DEBUG( "LoadCalibration has been triggered for the following keys " );
+    for (itr=keys.begin(); itr!=keys.end(); ++itr) {
+      msg(MSG::DEBUG) << *itr << " I="<<I<<" ";
+    }
+    msg(MSG::DEBUG) << endmsg;
+  }
+  for (itr=keys.begin(); itr!=keys.end(); ++itr) {
+    msg(MSG::INFO) << *itr << " I="<<I<<" ";
+  }
+  msg(MSG::INFO) << endmsg;
+
+  for (itr=keys.begin(); itr!=keys.end(); ++itr) {
+    if(*itr==m_tubeDataLocation) {
+      if(loadTube(I,keys).isFailure()) return StatusCode::FAILURE;
+    }
+    if(*itr==m_rtDataLocation) {
+      if(loadRt(I,keys).isFailure()) return StatusCode::FAILURE;
+    }
+  }
+  return StatusCode::SUCCESS;
+}  //end MdtCalibrationDbSvc::LoadCalibration
+
+StatusCode MdtCalibrationDbSvc::loadTube(IOVSVC_CALLBACK_ARGS) { 
+  ATH_MSG_DEBUG( "In loadTube " );  
+  return m_detStore->retrieve(m_tubeData, m_tubeDataLocation);
+}
+
+StatusCode MdtCalibrationDbSvc::loadRt(IOVSVC_CALLBACK_ARGS) {
+  ATH_MSG_DEBUG( "In loadRt " );  
+
+  // Retrieve RT functions from StoreGate
+  if( m_detStore->retrieve(m_rtData, m_rtDataLocation).isFailure() ) return StatusCode::FAILURE;
+
+  // Check if doing corrections; return if not  
+  if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ) return StatusCode::SUCCESS;
+
+  //Delete old correction functions and create new ones
+  //The correction functions are made with the same regions as are used for RTs.
+  if( m_corData ) delete m_corData;
+  m_corData = new MdtCorFuncSetCollection();
+  m_corData->resize(m_rtData->size());
+  ATH_MSG_DEBUG( "Initializing " << m_corData->size() << " b-field functions" );
+  for (unsigned int i=0; i < m_corData->size(); i++) {
+    (*m_corData)[i] = new MuonCalib::MdtCorFuncSet();
+    if(m_create_b_field_function) initialize_B_correction((*m_corData)[i], (*m_rtData)[i]);
+    if(m_createWireSagFunction)   initializeSagCorrection((*m_corData)[i]);
+    if(m_createSlewingFunction)   (*m_corData)[i]->setSlewing(new MuonCalib::MdtSlewCorFuncHardcoded(MuonCalib::CalibFunc::ParVec()));
+  }
+
+  return StatusCode::SUCCESS;
+}  //end MdtCalibrationDbSvc::loadRt
+
 StatusCode MdtCalibrationDbSvc::finalize()  {
+  if( m_corData ) delete m_corData;
   return AthService::finalize();
 }
 
@@ -163,15 +234,11 @@ const MuonCalib::MdtTubeCalibContainer* MdtCalibrationDbSvc::getTubeCalibContain
 }
 
 const MuonCalib::MdtTubeCalibContainer* MdtCalibrationDbSvc::getTubeCalibContainer( const IdentifierHash &hash ) const {
+  if( !m_tubeData ) return 0;
 
-  SG::ReadCondHandle<MdtTubeCalibContainerCollection> readHandleTube{ m_readKeyTube };
-  const MdtTubeCalibContainerCollection* readCdoTube{*readHandleTube};
-  if ( readCdoTube==nullptr ) {
-    ATH_MSG_ERROR("readCdoTube==nullptr");
-    return 0;
-  }
-  if ( hash.is_valid() && hash < readCdoTube->size() ) {
-    return (*readCdoTube)[ hash ];
+  // single tube calibrations are accessed per chamber 
+  if ( hash.is_valid() && hash < m_tubeData->size() ) { 
+    return (*m_tubeData)[ hash ]; 
   }
   return 0;
 }
@@ -191,22 +258,22 @@ const MuonCalib::MdtRtRelation* MdtCalibrationDbSvc::getRtCalibration( const Ide
 }
 
 const MuonCalib::MdtRtRelation* MdtCalibrationDbSvc::getRtCalibration( const IdentifierHash &hash ) const {
-  // check if hash is ok
-  if ( !hash.is_valid() ) {
-    ATH_MSG_WARNING( "cannot get rt, invalid hash"  );
+  // check whether there are cached rt's
+  if( !m_rtData ) {
+    ATH_MSG_WARNING( "No rt-calibrations loaded"  );
     return 0;
   }
-  SG::ReadCondHandle<MdtRtRelationCollection> readHandleRt{ m_readKeyRt };
-  const MdtRtRelationCollection* readCdoRt{*readHandleRt};
-  if ( readCdoRt==nullptr ) {
-    ATH_MSG_ERROR("readCdoRt==nullptr");
+  // check if hash is ok
+  if ( !hash.is_valid() ) {
+    ATH_MSG_WARNING( "cannot get rt, invalid hash"  ); 
     return 0;
   }
+
   // Get the RT using the hash as an index
-  if( hash < readCdoRt->size() ) {
-    return (*readCdoRt)[ hash ];
+  if( hash < m_rtData->size() ) { 
+    return (*m_rtData)[ hash ]; 
   }
-  ATH_MSG_WARNING( "cannot get RT, region hash out of range"  );
+  ATH_MSG_WARNING( "cannot get RT, region hash out of range"  ); 
   return 0;
 }
 
@@ -225,22 +292,17 @@ const MuonCalib::MdtCorFuncSet* MdtCalibrationDbSvc::getCorFunctions( const Iden
 }
 
 const MuonCalib::MdtCorFuncSet* MdtCalibrationDbSvc::getCorFunctions( const IdentifierHash &hash ) const {
-  if ( !hash.is_valid() ){
-    return 0;
-  }
-  //the loadRt was intended to keep m_corData nullptr and return 0 here so
-  if( !m_createSlewingFunction && !m_createWireSagFunction && !m_create_b_field_function ){
-    return 0;
-  }
-  SG::ReadCondHandle<MdtCorFuncSetCollection> readHandleCor{ m_readKeyCor };
-  const MdtCorFuncSetCollection* readCdoCor{*readHandleCor};
-  if ( readCdoCor==nullptr ) {
-    ATH_MSG_ERROR("readCdoCor==nullptr");
-    return 0;
-  }
-  if( hash < readCdoCor->size() ) {
-    return (*readCdoCor)[ hash ];
+  // check whether there are cached correction functions
+  if( !m_corData ) return 0;
+
+  // check if hash is ok
+  if ( !hash.is_valid() ) return 0;
+
+  // Get the correction functions using the hash as an index
+  if( hash < m_corData->size() ) { 
+    return (*m_corData)[ hash ]; 
   }
+
   return 0;
 }
 
diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
index b0411708424..f887b3d422e 100644
--- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
+++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py
@@ -143,38 +143,13 @@ def setupMdtCondDB():
     from IOVDbSvc.CondDB import conddb
 
     if mdtCalibFlags.mdtCalibrationSource()=="MDT":
-        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix, className='CondAttrListCollection')
-        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix, className='CondAttrListCollection')
+        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix)
+        conddb.addFolderSplitOnline("MDT", '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix)
     else:
         from AthenaCommon.AppMgr import ServiceMgr
         ServiceMgr.TagInfoMgr.ExtraTagValuePairs += ["MDTCalibrationSource", mdtCalibFlags.mdtCalibrationSource()]
         specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(), '/MDT/Onl/RT' + mdt_folder_name_appendix,'/MDT/RT' + mdt_folder_name_appendix)
         specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(), '/MDT/Onl/T0' + mdt_folder_name_appendix,'/MDT/T0' + mdt_folder_name_appendix)
-
-    from AthenaCommon.AlgSequence import AthSequencer
-    from MdtCalibDbCoolStrTool.MdtCalibDbCoolStrToolConf import MdtCalibDbAlg
-    condSequence = AthSequencer("AthCondSeq")
-    condSequence += MdtCalibDbAlg("MdtCalibDbAlg")
-
-    if conddb.isOnline and not conddb.isMC:
-        MdtCalibDbAlg.TubeFolder = "/MDT/T0"
-        MdtCalibDbAlg.RtFolder = "/MDT/RT"
-    else:
-        MdtCalibDbAlg.TubeFolder = "/MDT/T0" + mdt_folder_name_appendix
-        MdtCalibDbAlg.RtFolder = "/MDT/RT" + mdt_folder_name_appendix
-    MdtCalibDbAlg.RT_InputFiles = ["Muon_RT_default.data"]
-    if globalflags.DataSource == 'data':
-        MdtCalibDbAlg.defaultT0 = 40
-    elif globalflags.DataSource == 'geant4':
-        MdtCalibDbAlg.defaultT0 = 799
-    MdtCalibDbAlg.UseMLRt = mdtCalibFlags.useMLRt()
-    MdtCalibDbAlg.TimeSlewingCorrection = mdtCalibFlags.correctMdtRtForTimeSlewing()
-    MdtCalibDbAlg.MeanCorrectionVsR = [ -5.45973, -4.57559, -3.71995, -3.45051, -3.4505, -3.4834, -3.59509, -3.74869, -3.92066, -4.10799, -4.35237, -4.61329, -4.84111, -5.14524 ]
-    MdtCalibDbAlg.PropagationSpeedBeta = mdtCalibFlags.mdtPropagationSpeedBeta()
-    MdtCalibDbAlg.CreateBFieldFunctions = mdtCalibFlags.correctMdtRtForBField()
-    MdtCalibDbAlg.CreateWireSagFunctions = mdtCalibFlags.correctMdtRtWireSag()
-    MdtCalibDbAlg.CreateSlewingFunctions = mdtCalibFlags.correctMdtRtForTimeSlewing()
-
 # end of function setupMdtCondDB()
 
 def MdtCalibDbTool(name="MdtCalibDbTool",**kwargs):
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
index 1445305ce66..127c0386c32 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/share/MuonCombinedRec_myTopOptions.py
@@ -277,7 +277,7 @@ muonCombinedRecFlags.doMuonSegmentTagger = True
 #muonCombinedRecFlags.doxAOD = True
 muonCombinedRecFlags.doAOD = False
 muonCombinedRecFlags.doCaloTrkMuId = True
-muonCombinedRecFlags.doMuGirlLowBeta = True
+muonCombinedRecFlags.doMuGirlLowBeta = False
 
 muonRecFlags.doCreateClusters = False 
 muonRecFlags.prdToxAOD = False
-- 
GitLab


From ca93f47d5103f807db30cb1f392ce8a97e71af8e Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Thu, 7 Mar 2019 15:34:11 +0100
Subject: [PATCH 308/404] Dropped redundant dependency on the EventInfo package
 from TGC_Digitization

Also moved all headers over to the src directory. It's a component package.
---
 .../MuonDigitization/TGC_Digitization/CMakeLists.txt       | 4 +---
 .../MuonDigitization/TGC_Digitization/src/TGCDigitizer.cxx | 2 +-
 .../{TGC_Digitization => src}/TGCDigitizer.h               | 0
 .../TGC_Digitization/src/TgcDigitMaker.cxx                 | 2 +-
 .../{TGC_Digitization => src}/TgcDigitMaker.h              | 0
 .../TGC_Digitization/src/TgcDigitizationTool.cxx           | 7 ++-----
 .../{TGC_Digitization => src}/TgcDigitizationTool.h        | 2 --
 .../src/components/TGC_Digitization_entries.cxx            | 4 ++--
 8 files changed, 7 insertions(+), 14 deletions(-)
 rename MuonSpectrometer/MuonDigitization/TGC_Digitization/{TGC_Digitization => src}/TGCDigitizer.h (100%)
 rename MuonSpectrometer/MuonDigitization/TGC_Digitization/{TGC_Digitization => src}/TgcDigitMaker.h (100%)
 rename MuonSpectrometer/MuonDigitization/TGC_Digitization/{TGC_Digitization => src}/TgcDigitizationTool.h (98%)

diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt b/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
index 3625119cac8..2e3b90e3c30 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
@@ -12,7 +12,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/PileUpTools
                           DetectorDescription/GeoPrimitives
                           DetectorDescription/Identifier
-                          Event/EventInfo
                           GaudiKernel
                           MuonSpectrometer/MuonSimEvent
                           Simulation/HitManagement
@@ -38,10 +37,9 @@ atlas_add_component( TGC_Digitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib GeoPrimitives Identifier EventInfo GaudiKernel MuonSimEvent HitManagement xAODEventInfo GeneratorObjects MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonSimData PathResolver )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib GeoPrimitives Identifier GaudiKernel MuonSimEvent HitManagement xAODEventInfo GeneratorObjects MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonSimData PathResolver )
 
 # Install files from the package:
-atlas_install_headers( TGC_Digitization )
 atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py )
 atlas_install_runtime( share/*.dat )
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.cxx
index 1374ee8a028..26cd90d476a 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "TGC_Digitization/TGCDigitizer.h"
+#include "TGCDigitizer.h"
 #include "PileUpTools/IPileUpTool.h"
 
 
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TGCDigitizer.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.h
similarity index 100%
rename from MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TGCDigitizer.h
rename to MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TGCDigitizer.h
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
index 4be755864c1..368f8dd7399 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
@@ -8,7 +8,7 @@
 // Y. HASEGAWA
 //-----------------------------------------------------
 
-#include "TGC_Digitization/TgcDigitMaker.h"
+#include "TgcDigitMaker.h"
 
 #include <iostream>
 #include <fstream>
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
similarity index 100%
rename from MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TgcDigitMaker.h
rename to MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
index 250efe6adc6..588785dda04 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "TGC_Digitization/TgcDigitizationTool.h"
+#include "TgcDigitizationTool.h"
 
 #include "AthenaKernel/errorcheck.h"
 #include "AthenaKernel/RNGWrapper.h"
@@ -17,10 +17,7 @@
 
 #include "MuonIdHelpers/TgcIdHelper.h"
 #include "MuonSimEvent/TgcHitIdHelper.h"
-#include "TGC_Digitization/TgcDigitMaker.h"
-
-// for the tool
-//#include "GaudiKernel/IToolSvc.h"
+#include "TgcDigitMaker.h"
 
 #include "PileUpTools/PileUpMergeSvc.h"
 #include "PileUpTools/IPileUpTool.h" // for SubEventIterator
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TgcDigitizationTool.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
similarity index 98%
rename from MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TgcDigitizationTool.h
rename to MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
index bc3fbb319e0..68353408e2c 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/TGC_Digitization/TgcDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
@@ -13,8 +13,6 @@
 
 #include "PileUpTools/PileUpToolBase.h"
 
-#include "EventInfo/PileUpEventInfo.h"  /*SubEvent*/
-
 #include "GaudiKernel/ServiceHandle.h"
 #include "AthenaKernel/IAthRNGSvc.h"
 
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/components/TGC_Digitization_entries.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/components/TGC_Digitization_entries.cxx
index fefdfeefb00..a605a1273fe 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/components/TGC_Digitization_entries.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/components/TGC_Digitization_entries.cxx
@@ -1,5 +1,5 @@
-#include "TGC_Digitization/TGCDigitizer.h"
-#include "TGC_Digitization/TgcDigitizationTool.h"
+#include "../TGCDigitizer.h"
+#include "../TgcDigitizationTool.h"
 
 DECLARE_COMPONENT( TGCDigitizer )
 DECLARE_COMPONENT( TgcDigitizationTool )
-- 
GitLab


From be529e97435ce87b7f136acc247600f2740f88e3 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sun, 3 Mar 2019 09:25:54 +0100
Subject: [PATCH 309/404] TRTOverlay cleanup and modernisation

---
 .../InDetOverlay/InDetOverlay/TRTOverlay.h    |  35 +-
 .../InDetOverlay/src/TRTOverlay.cxx           | 359 +++++++++---------
 2 files changed, 185 insertions(+), 209 deletions(-)

diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
index f733d00712f..22cdd04a59e 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/TRTOverlay.h
@@ -5,8 +5,8 @@
 #ifndef INDETOVERLAY_TRTOVERLAY_H
 #define INDETOVERLAY_TRTOVERLAY_H
 
-#include "IDC_OverlayBase/IDC_OverlayBase.h"
-#include "InDetRawData/TRT_RDO_Container.h"
+#include <AthenaBaseComps/AthAlgorithm.h>
+#include <InDetRawData/TRT_RDO_Container.h>
 
 #include "AthenaKernel/IAthRNGSvc.h"
 #include "GaudiKernel/ServiceHandle.h"
@@ -20,31 +20,28 @@ namespace CLHEP {
   class HepRandomEngine;
 }
 
-typedef InDetRawDataCollection<TRT_RDORawData> TRT_RDO_Collection;
-
-class TRTOverlay : public IDC_OverlayBase
+class TRTOverlay : public AthAlgorithm
 {
 public:
 
   TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator);
 
-  virtual StatusCode initialize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
 
 private:
 
-  void overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
-                            const TRT_RDO_Container *signalContainer,
-                            TRT_RDO_Container *outputContainer,
-                            std::map<int, double> &occupancyMap,
-                            const InDetSimDataCollection &SDO_Map);
-
-  void mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
-                           TRT_RDO_Collection *signalCollection,
-                           TRT_RDO_Collection *outputCollection,
-                           double occupancy,
-                           const InDetSimDataCollection &SDO_Map,
-                           CLHEP::HepRandomEngine* rndmEngine);
+  StatusCode overlayContainer(const TRT_RDO_Container *bkgContainer,
+                              const TRT_RDO_Container *signalContainer,
+                              TRT_RDO_Container *outputContainer,
+                              const InDetSimDataCollection *signalSDOCollection);
+
+  void mergeCollections(TRT_RDO_Collection *bkgCollection,
+                        TRT_RDO_Collection *signalCollection,
+                        TRT_RDO_Collection *outputCollection,
+                        double occupancy,
+                        const InDetSimDataCollection *signalSDOCollection,
+                        CLHEP::HepRandomEngine *rndmEngine);
 
   const TRT_ID *m_trtId{};
 
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
index 38d74e08d09..ee8ff11590e 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/TRTOverlay.cxx
@@ -14,40 +14,21 @@
 #include "InDetRawData/TRT_RDORawData.h"
 #include "InDetSimData/InDetSimDataCollection.h"
 
+#include "IDC_OverlayBase/IDC_OverlayCommon.h"
 #include "IDC_OverlayBase/IDC_OverlayHelpers.h"
 
 #include "StoreGate/ReadHandle.h"
 #include "StoreGate/WriteHandle.h"
 
+
 namespace Overlay
 {
-  // Specialize mergeChannelData() for the TRT
-  template<> void mergeChannelData(TRT_RDORawData &r1,
-                                   const TRT_RDORawData &r2,
-                                   TRTOverlay *)
-  {
-    // ----------------------------------------------------------------
-    // FIXME: That should really be a call to r1.merge(r2);
-
-    TRT_LoLumRawData *pr1 = dynamic_cast<TRT_LoLumRawData*>(&r1);
-    const TRT_LoLumRawData *pr2 = dynamic_cast<const TRT_LoLumRawData*>(&r2);
-
-    if (pr1 && pr2) {
-      // the actual merging
-      pr1->merge(*pr2);
-    }
-  } // mergeChannelData()
-
   // Specialize copyCollection() for the TRT
   template<>
   std::unique_ptr<TRT_RDO_Collection> copyCollection(const IdentifierHash &hashId,
                                                      const TRT_RDO_Collection *collection)
   {
     auto outputCollection = std::make_unique<TRT_RDO_Collection>(hashId);
-    if (!collection) {
-      return outputCollection;
-    }
-
     outputCollection->setIdentifier(collection->identify());
 
     for (const TRT_RDORawData *existingDatum : *collection) {
@@ -62,7 +43,7 @@ namespace Overlay
 
 
 TRTOverlay::TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
-  : IDC_OverlayBase(name, pSvcLocator)
+  : AthAlgorithm(name, pSvcLocator)
 {
   declareProperty("TRT_HT_OccupancyCorrectionBarrel", m_HTOccupancyCorrectionB=0.110);
   declareProperty("TRT_HT_OccupancyCorrectionEndcap", m_HTOccupancyCorrectionEC=0.090);
@@ -70,6 +51,7 @@ TRTOverlay::TRTOverlay(const std::string &name, ISvcLocator *pSvcLocator)
   declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE", m_HTOccupancyCorrectionEC_noE=0.050);
 }
 
+
 StatusCode TRTOverlay::initialize()
 {
   ATH_MSG_DEBUG("Initializing...");
@@ -101,26 +83,25 @@ StatusCode TRTOverlay::initialize()
   // Retrieve TRT local occupancy tool
   CHECK(m_TRT_LocalOccupancyTool.retrieve());
 
-  if (!m_TRTStrawSummarySvc.empty() && m_TRTStrawSummarySvc.retrieve().isFailure() ) {
-    ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummarySvc);
-    ATH_MSG_ERROR ("configure as 'None' to avoid its loading.");
-    return StatusCode::FAILURE;
-  } else {
-    if ( !m_TRTStrawSummarySvc.empty()) 
-      ATH_MSG_INFO( "Retrieved tool " << m_TRTStrawSummarySvc );
+  if (!m_TRTStrawSummarySvc.empty()) {
+    if (m_TRTStrawSummarySvc.retrieve().isFailure() ) {
+      ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummarySvc);
+      ATH_MSG_ERROR ("configure as 'None' to avoid its loading.");
+      return StatusCode::FAILURE;
+    } else {
+      ATH_MSG_DEBUG( "Retrieved tool " << m_TRTStrawSummarySvc );
+    }
   }
 
-
-
   return StatusCode::SUCCESS;
 }
 
-StatusCode TRTOverlay::execute() {
+
+StatusCode TRTOverlay::execute()
+{
   ATH_MSG_DEBUG("execute() begin");
 
   // Reading the input RDOs
-  ATH_MSG_VERBOSE("Retrieving input RDO containers");
-
   const TRT_RDO_Container *bkgContainerPtr = nullptr;
   if (m_includeBkg) {
     SG::ReadHandle<TRT_RDO_Container> bkgContainer(m_bkgInputKey);
@@ -152,178 +133,178 @@ StatusCode TRTOverlay::execute() {
   // Creating output RDO container
   SG::WriteHandle<TRT_RDO_Container> outputContainer(m_outputKey);
   ATH_CHECK(outputContainer.record(std::make_unique<TRT_RDO_Container>(signalContainer->size())));
+  if (!outputContainer.isValid()) {
+    ATH_MSG_ERROR("Could not record output TRT RDO container " << outputContainer.name() << " to store " << outputContainer.store());
+    return StatusCode::FAILURE;
+  }
   ATH_MSG_DEBUG("Recorded output TRT RDO container " << outputContainer.name() << " in store " << outputContainer.store());
 
-  if (outputContainer.isValid()) {
-    // Calculate occupancy here
-    if (m_includeBkg) {
-      std::map<int, double> occupancy = m_TRT_LocalOccupancyTool->getDetectorOccupancy(bkgContainerPtr);
-
-      //Merge containers
-      overlayTRTContainers(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr(), occupancy, *signalSDOContainer);
-    } else {
-      ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
-    }
-
-    ATH_MSG_DEBUG("TRT Result   = " << Overlay::debugPrint(outputContainer.ptr()));
-  }
+  ATH_CHECK(overlayContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr(), signalSDOContainer.cptr()));
+  ATH_MSG_DEBUG("TRT Result   = " << Overlay::debugPrint(outputContainer.ptr()));
 
   ATH_MSG_DEBUG("execute() end");
   return StatusCode::SUCCESS;
 }
 
-void TRTOverlay::overlayTRTContainers(const TRT_RDO_Container *bkgContainer,
-                                      const TRT_RDO_Container *signalContainer,
-                                      TRT_RDO_Container *outputContainer,
-                                      std::map<int, double> &occupancyMap,
-                                      const InDetSimDataCollection &SDO_Map)
+
+StatusCode TRTOverlay::overlayContainer(const TRT_RDO_Container *bkgContainer,
+                                        const TRT_RDO_Container *signalContainer,
+                                        TRT_RDO_Container *outputContainer,
+                                        const InDetSimDataCollection *signalSDOCollection)
 {
-   /** Add data from the background container to the output one */
-   if (bkgContainer) {
-     TRT_RDO_Container::const_iterator p_bkg = bkgContainer->begin();
-     TRT_RDO_Container::const_iterator p_bkg_end = bkgContainer->end();
-
-     for(; p_bkg != p_bkg_end; ++p_bkg) {
-       IdentifierHash hashId = p_bkg.hashId();
-       auto coll_bkg = Overlay::copyCollection(hashId, *p_bkg);
-
-       if (outputContainer->addCollection(coll_bkg.release(), p_bkg.hashId() ).isFailure()) {
-         ATH_MSG_WARNING("add background Collection failed for output " << p_bkg.hashId());
-       }
-     }
-   }
-
-   ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
-   rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
-   CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
-
-   /** Add data from the signal container to the output one */
-   TRT_RDO_Container::const_iterator p_signal = signalContainer->begin();
-   TRT_RDO_Container::const_iterator p_signal_end = signalContainer->end();
-
-   for (; p_signal != p_signal_end; ++p_signal) {
-
-      IdentifierHash coll_id = p_signal.hashId();
-      auto coll_signal = Overlay::copyCollection( coll_id, *p_signal ) ;
-
-      /** The newly created stuff will go to the output EventStore SG */
-      auto coll_out = std::make_unique<TRT_RDO_Collection>(coll_id);
-      coll_out->setIdentifier((*p_signal)->identify());
-
-      /** Look for the same ID in the main StoreGate EventStore */
-      auto q = outputContainer->indexFind( coll_id );
-      if ( q != outputContainer->end() ) {
-      /**Need to merge the collections
-         Retrieve q */
-         std::unique_ptr <TRT_RDO_Collection> coll_bkg ((TRT_RDO_Collection *) *q);
-         int det =  m_trtId->barrel_ec( (*p_signal)->identify() );
-         mergeTRTCollections(coll_bkg.get(), coll_signal.get(), coll_out.get(), occupancyMap[det], SDO_Map, rndmEngine);
-
-         outputContainer->removeCollection(p_signal.hashId());
-         if (outputContainer->addCollection(coll_out.release(), coll_id).isFailure() ) {
-            ATH_MSG_WARNING( "overlay addCollection failed " );
-         }
-      }
-      else {
-       /** Copy the complete collection from signal to output,
-           hopefully preserving the "most derived" type of its raw data */
-       if ( outputContainer->addCollection(coll_signal.release(), coll_id).isFailure() ) {
-          ATH_MSG_WARNING("add signal Collection failed for output " << coll_id);
+  // Get all the hashes for the signal container
+  const std::vector<IdentifierHash> signalHashes = signalContainer->GetAllCurrentHashes();
+
+  // There are some use cases where background is empty
+  if (!bkgContainer) {
+    // Only loop through the signal collections and copy them over
+    for (const IdentifierHash &hashId : signalHashes) {
+      // Copy the signal collection
+      std::unique_ptr<TRT_RDO_Collection> signalCollection = Overlay::copyCollection(hashId, signalContainer->indexFindPtr(hashId));
+
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
       }
     }
+
+    return StatusCode::SUCCESS;
   }
-}
 
-void TRTOverlay::mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
-                                     TRT_RDO_Collection *signalCollection,
-                                     TRT_RDO_Collection *outputCollection,
-                                     double occupancy,
-                                     const InDetSimDataCollection& SDO_Map,
-                                     CLHEP::HepRandomEngine* rndmEngine)
-{
+  // Setup the random engine
+  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
+  rngWrapper->setSeed( name(), Gaudi::Hive::currentContext() );
+  CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
 
-  if (bkgCollection->identify() != signalCollection->identify()) {
-    std::ostringstream os;
-    os << "mergeTRTCollections<generic>(): collection Id mismatch";
-    ATH_MSG_FATAL(os.str());
-    throw std::runtime_error(os.str());
-  }
+  // Retrieve the occupancy map
+  std::map<int, double> occupancyMap = m_TRT_LocalOccupancyTool->getDetectorOccupancy(bkgContainer);
 
-  const Identifier idColl = bkgCollection->identify();
+  // Get all the hashes for the background container
+  const std::vector<IdentifierHash> bkgHashes = bkgContainer->GetAllCurrentHashes();
 
-  // ----------------------------------------------------------------
-  // debug
-  static bool first_time = true;
-  if (first_time) {
-    first_time = false;
-    ATH_MSG_INFO( "mergeTRTCollections():  code is called ");
+  // 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);
   }
 
-  // ----------------------------------------------------------------
-
-  TRT_RDO_Collection bkg(bkgCollection->identifyHash());
-  bkg.setIdentifier(idColl);
-  bkgCollection->swap(bkg);
+  // 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<TRT_RDO_Collection> bkgCollection = Overlay::copyCollection(hashId, 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;
+    }
+  }
 
-  TRT_RDO_Collection sig(signalCollection->identifyHash());
-  sig.setIdentifier(idColl);
-  signalCollection->swap(sig);
+  // Finally loop through the map and process the signal and overlay if
+  // necessary
+  for (const auto &[hashId, overlap] : overlapMap) {
+    // Copy the signal collection
+    std::unique_ptr<TRT_RDO_Collection> signalCollection = Overlay::copyCollection(hashId, signalContainer->indexFindPtr(hashId));
+
+    if (overlap) { // Do overlay
+      // Create the output collection, only works for Inner Detector
+      auto outputCollection = std::make_unique<TRT_RDO_Collection>(hashId);
+      outputCollection->setIdentifier(signalCollection->identify());
+      // Copy the background collection
+      std::unique_ptr<TRT_RDO_Collection> bkgCollection = Overlay::copyCollection(hashId, bkgContainer->indexFindPtr(hashId));
+
+      // Merge collections
+      int det = m_trtId->barrel_ec(signalCollection->identify());
+      mergeCollections(bkgCollection.get(), signalCollection.get(), outputCollection.get(), occupancyMap[det], signalSDOCollection, rndmEngine);
+
+      if (outputContainer->addCollection(outputCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding overlaid Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        outputCollection.release();
+      }
+    } else { // Only write signal out
+      if (outputContainer->addCollection(signalCollection.get(), hashId).isFailure()) {
+        ATH_MSG_ERROR("Adding signal Collection with hashId " << hashId << " failed");
+        return StatusCode::FAILURE;
+      } else {
+        signalCollection.release();
+      }
+    }
+  }
 
-  //################################################################
-  // Merge by copying ptrs from background and signal to signalCollection
+  return StatusCode::SUCCESS;
+}
 
-  unsigned int ibkg = 0;
-  unsigned int isig = 0;
 
-  while( (ibkg < bkg.size()) || (isig < sig.size())) {
+void TRTOverlay::mergeCollections(TRT_RDO_Collection *bkgCollection,
+                                  TRT_RDO_Collection *signalCollection,
+                                  TRT_RDO_Collection *outputCollection,
+                                  double occupancy,
+                                  const InDetSimDataCollection *signalSDOCollection,
+                                  CLHEP::HepRandomEngine *rndmEngine)
+{
+  if (bkgCollection->identify() != signalCollection->identify()) {
+    throw std::runtime_error("mergeCollections(): collection Id mismatch");
+  }
 
+  // Merge by copying ptrs from background and signal to output collection
+  TRT_RDO_Collection::size_type ibkg = 0, isig = 0;
+  while ((ibkg < bkgCollection->size()) || (isig < signalCollection->size())) {
     // The RDO that goes to the output at the end of this step.
-    TRT_RDORawData *p_rdo(0);
-
-    if(isig == sig.size()) {
-      // just copy the remaining data inputs
-      bkg.swapElement(ibkg++, 0, p_rdo);
-    }
-    else if(ibkg == bkg.size()) {
-      //just copy the remaining MC digits
-      sig.swapElement(isig++, 0, p_rdo);
-    }
-    else {
+    TRT_RDORawData *tmp{};
+
+    if (isig == signalCollection->size()) {
+      // just copy the remaining background digits
+      bkgCollection->swapElement(ibkg++, nullptr, tmp);
+    } else if (ibkg == bkgCollection->size()) {
+      // just copy the remaining signal digits
+      signalCollection->swapElement(isig++, nullptr, tmp);
+    } else {
       // Need to decide which one goes first.
       // See comments in TRTDigitization.cxx about the assumption that id1<id2 <=> hash1<hash2
-      if( sig[isig]->identify() < bkg[ibkg]->identify() ) {
-        sig.swapElement(isig++, 0, p_rdo);
-      }
-      else if(bkg[ibkg]->identify() < sig[isig]->identify()) {
-        bkg.swapElement(ibkg++, 0, p_rdo);
-      }
-      else {
+      if (signalCollection->at(isig)->identify() < bkgCollection->at(ibkg)->identify()) {
+        signalCollection->swapElement(isig++, nullptr, tmp);
+      } else if (bkgCollection->at(ibkg)->identify() < signalCollection->at(isig)->identify()) {
+        bkgCollection->swapElement(ibkg++, nullptr, tmp);
+      } else {
         // The hits are on the same channel.
-        TRT_RDORawData *p2(0);
-        bkg.swapElement(ibkg++, 0, p2);
-        sig.swapElement(isig++, 0, p_rdo);
+        TRT_RDORawData *tmpBkg{};
+        bkgCollection->swapElement(ibkg++, nullptr, tmpBkg);
+        signalCollection->swapElement(isig++, nullptr, tmp);
 
-        TRT_LoLumRawData *pr1 = dynamic_cast<TRT_LoLumRawData*>(p_rdo);
-        const TRT_LoLumRawData *pr2 = dynamic_cast<const TRT_LoLumRawData*>(p2);
+        TRT_LoLumRawData *sigRdo = dynamic_cast<TRT_LoLumRawData *>(tmp);
+        const TRT_LoLumRawData *bkgRdo = dynamic_cast<const TRT_LoLumRawData *>(tmpBkg);
 
-        if(pr1 && pr2) {
+        if (sigRdo && bkgRdo) {
           // the actual merging
-          pr1->merge(*pr2);
-
-          //If the hit is not already a high level hit
-          if( !(pr1->getWord() & 0x04020100) ) {
+          sigRdo->merge(*bkgRdo);
 
-            //Determine if the hit is from an electron or not
+          // If the hit is not already a high level hit
+          if (!(sigRdo->getWord() & 0x04020100)) {
+            // Determine if the hit is from an electron or not
             bool isElectron = false;
-            Identifier rdoId = p_rdo->identify();
-            InDetSimDataCollection::const_iterator sdoIter(SDO_Map.find(rdoId));
-            if( sdoIter != SDO_Map.end() ){
-              const std::vector< InDetSimData::Deposit >& deposits = sdoIter->second.getdeposits();
-              for ( const auto& deposit: deposits ){
-                const auto& particleLink = deposit.first;
-                if( particleLink.isValid() ){
-                  if( abs( particleLink->pdg_id() ) == 11 ){
+            Identifier rdoId = sigRdo->identify();
+            InDetSimDataCollection::const_iterator sdoIter = signalSDOCollection->find(rdoId);
+            if (sdoIter != signalSDOCollection->end()) {
+              const std::vector<InDetSimData::Deposit> &deposits = sdoIter->second.getdeposits();
+              for (const InDetSimData::Deposit &deposit : deposits) {
+                const HepMcParticleLink &particleLink = deposit.first;
+                if (particleLink.isValid()) {
+                  if (std::abs(particleLink->pdg_id()) == 11) {
                     isElectron = true;
+                    break;
                   }
                 }
               }
@@ -337,33 +318,31 @@ void TRTOverlay::mergeTRTCollections(TRT_RDO_Collection *bkgCollection,
               }
             }
 
-
-
-            unsigned int newword = 0;
-            //Get random number
-            int det =  m_trtId->barrel_ec( pr1->identify() );
+            // Get random number
+            int det = m_trtId->barrel_ec(rdoId);
             float HTOccupancyCorrection = 0;
-            if(isElectron){
-              HTOccupancyCorrection = abs(det) > 1 ? m_HTOccupancyCorrectionEC : m_HTOccupancyCorrectionB;
+            if (isElectron) {
+              HTOccupancyCorrection = std::abs(det) > 1 ? m_HTOccupancyCorrectionEC : m_HTOccupancyCorrectionB;
             } else {
-              HTOccupancyCorrection = abs(det) > 1 ? m_HTOccupancyCorrectionEC_noE : m_HTOccupancyCorrectionB_noE;
+              HTOccupancyCorrection = std::abs(det) > 1 ? m_HTOccupancyCorrectionEC_noE : m_HTOccupancyCorrectionB_noE;
             }
 
-            if( isXenonStraw && occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot( rndmEngine, 0, 1) )
-              newword += 1 << (26-9);
-            //
-            TRT_LoLumRawData newrdo( pr1->identify(), newword);
-            pr1->merge(newrdo);
+            unsigned int newWord = 0;
+            if (isXenonStraw && occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot(rndmEngine, 0, 1)) {
+              newWord += 1 << (26-9);
+            }
+  
+            TRT_LoLumRawData newRdo(rdoId, newWord);
+            sigRdo->merge(newRdo);
           }
         } else {
           ATH_MSG_WARNING("TRT RDO is the wrong format");
         }
 
-        Overlay::mergeChannelData(*p_rdo, *p2, this);
-        delete p2;
+        delete tmpBkg;
       }
     }
 
-    outputCollection->push_back(p_rdo);
+    outputCollection->push_back(tmp);
   } // <= while
 }
-- 
GitLab


From 70f5b7e3bc0d6a668f68231f9a3afe286394831e Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Thu, 7 Mar 2019 15:01:59 +0100
Subject: [PATCH 310/404] Dropped redundant dependency on the EventInfo package
 from AFP_Digitization

---
 .../AFP/AFP_Digitization/AFP_Digitization/AFP_PileUpTool.h   | 3 +--
 ForwardDetectors/AFP/AFP_Digitization/CMakeLists.txt         | 3 +--
 ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx | 5 +----
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/ForwardDetectors/AFP/AFP_Digitization/AFP_Digitization/AFP_PileUpTool.h b/ForwardDetectors/AFP/AFP_Digitization/AFP_Digitization/AFP_PileUpTool.h
index e1054228ec2..6d3751b6715 100644
--- a/ForwardDetectors/AFP/AFP_Digitization/AFP_Digitization/AFP_PileUpTool.h
+++ b/ForwardDetectors/AFP/AFP_Digitization/AFP_Digitization/AFP_PileUpTool.h
@@ -1,11 +1,10 @@
 /*
-  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 AFP_DIGITIZATION_TOOL_H
 #define AFP_DIGITIZATION_TOOL_H
 
-#include "EventInfo/PileUpEventInfo.h"  /*SubEvent*/
 #include "PileUpTools/PileUpToolBase.h"
 #include "xAODEventInfo/EventInfo.h"             // NEW EDM
 #include "xAODEventInfo/EventAuxInfo.h"          // NEW EDM
diff --git a/ForwardDetectors/AFP/AFP_Digitization/CMakeLists.txt b/ForwardDetectors/AFP/AFP_Digitization/CMakeLists.txt
index 1d11236260a..c9581326d8d 100644
--- a/ForwardDetectors/AFP/AFP_Digitization/CMakeLists.txt
+++ b/ForwardDetectors/AFP/AFP_Digitization/CMakeLists.txt
@@ -10,7 +10,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/PileUpTools
-                          Event/EventInfo
                           Event/xAOD/xAODEventInfo
                           ForwardDetectors/AFP/AFP_DigiEv
                           ForwardDetectors/AFP/AFP_SimEv
@@ -28,7 +27,7 @@ atlas_add_component( AFP_Digitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib EventInfo xAODEventInfo AFP_DigiEv AFP_SimEv GaudiKernel HitManagement Identifier )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib xAODEventInfo AFP_DigiEv AFP_SimEv GaudiKernel HitManagement Identifier )
 
 # Install files from the package:
 atlas_install_headers( AFP_Digitization )
diff --git a/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx b/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx
index 43011becb1d..82754b30510 100644
--- a/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx
+++ b/ForwardDetectors/AFP/AFP_Digitization/src/AFP_PileUpTool.cxx
@@ -1,12 +1,10 @@
 /*
-  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 "AFP_Digitization/AFP_PileUpTool.h"
 #include <algorithm>
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 #include "AFP_SimEv/AFP_TDSimHit.h"
 #include "AFP_SimEv/AFP_TDSimHitCollection.h"
 #include "AFP_DigiEv/AFP_TDDigiCollection.h"
@@ -17,7 +15,6 @@
 #include "CLHEP/Random/RandFlat.h"
 #include "CLHEP/Random/RandGaussQ.h"
 #include "CLHEP/Random/RandPoissonQ.h"
-//#include "AFP_G4_SD/AFP_SensitiveDetector.h" 
 
 AFP_PileUpTool::AFP_PileUpTool(const std::string& type,
 			       const std::string& name,
-- 
GitLab


From ef54d7f931704400e8ad9c4c994492d642ef7f92 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Thu, 7 Mar 2019 15:07:52 +0100
Subject: [PATCH 311/404] Dropped redundant dependency on the EventInfo package
 from ALFA_Digitization

---
 .../ALFA_Digitization/ALFA_Digitization/ALFA_PileUpTool.h    | 3 +--
 ForwardDetectors/ALFA/ALFA_Digitization/CMakeLists.txt       | 3 +--
 .../ALFA/ALFA_Digitization/src/ALFA_PileUpTool.cxx           | 5 +----
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/ForwardDetectors/ALFA/ALFA_Digitization/ALFA_Digitization/ALFA_PileUpTool.h b/ForwardDetectors/ALFA/ALFA_Digitization/ALFA_Digitization/ALFA_PileUpTool.h
index 5acad297996..21e3913a3c6 100644
--- a/ForwardDetectors/ALFA/ALFA_Digitization/ALFA_Digitization/ALFA_PileUpTool.h
+++ b/ForwardDetectors/ALFA/ALFA_Digitization/ALFA_Digitization/ALFA_PileUpTool.h
@@ -1,11 +1,10 @@
 /*
-  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 ALFA_PILEUP_TOOL_H
 #define ALFA_PILEUP_TOOL_H
 
-#include "EventInfo/PileUpEventInfo.h"  /*SubEvent*/
 #include "PileUpTools/PileUpToolBase.h"
 
 #include "GaudiKernel/Property.h"
diff --git a/ForwardDetectors/ALFA/ALFA_Digitization/CMakeLists.txt b/ForwardDetectors/ALFA/ALFA_Digitization/CMakeLists.txt
index 9dbaa7655e5..d845ffc73b2 100644
--- a/ForwardDetectors/ALFA/ALFA_Digitization/CMakeLists.txt
+++ b/ForwardDetectors/ALFA/ALFA_Digitization/CMakeLists.txt
@@ -10,7 +10,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/PileUpTools
-                          Event/EventInfo
                           ForwardDetectors/ALFA/ALFA_RawEv
                           ForwardDetectors/ALFA/ALFA_SimEv
                           GaudiKernel
@@ -30,7 +29,7 @@ atlas_add_component( ALFA_Digitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib EventInfo ALFA_RawEv ALFA_SimEv GaudiKernel HitManagement Identifier GeneratorObjects PathResolver )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib ALFA_RawEv ALFA_SimEv GaudiKernel HitManagement Identifier GeneratorObjects PathResolver )
 
 # Install files from the package:
 atlas_install_headers( ALFA_Digitization )
diff --git a/ForwardDetectors/ALFA/ALFA_Digitization/src/ALFA_PileUpTool.cxx b/ForwardDetectors/ALFA/ALFA_Digitization/src/ALFA_PileUpTool.cxx
index 65bf632f965..a4cce2f2d08 100644
--- a/ForwardDetectors/ALFA/ALFA_Digitization/src/ALFA_PileUpTool.cxx
+++ b/ForwardDetectors/ALFA/ALFA_Digitization/src/ALFA_PileUpTool.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 "ALFA_Digitization/ALFA_PileUpTool.h"
@@ -18,9 +18,6 @@
 
 #include <algorithm>
 
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
 #include <map>
 
 #include "PileUpTools/PileUpMergeSvc.h"
-- 
GitLab


From d2acbe5642df4dabcba94b7f6f7b4df93d8e8703 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Thu, 7 Mar 2019 15:12:25 +0100
Subject: [PATCH 312/404] Dropped redundant dependency on the EventInfo package
 from ZDC_SimuDigitization

---
 ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt      | 3 +--
 .../ZDC_SimuDigitization/ZDC_PileUpTool.h                     | 3 +--
 .../ZDC/ZDC_SimuDigitization/src/ZDC_PileUpTool.cxx           | 4 +---
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt b/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt
index 79c7cf2a247..4f35e4c85db 100644
--- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt
+++ b/ForwardDetectors/ZDC/ZDC_SimuDigitization/CMakeLists.txt
@@ -10,7 +10,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           Control/AthenaKernel
                           Control/PileUpTools
-                          Event/EventInfo
                           ForwardDetectors/ZDC/ZDC_SimEvent
                           ForwardDetectors/ZDC/ZdcEvent
                           GaudiKernel
@@ -26,7 +25,7 @@ atlas_add_component( ZDC_SimuDigitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib EventInfo ZDC_SimEvent ZdcEvent GaudiKernel HitManagement Identifier )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib ZDC_SimEvent ZdcEvent GaudiKernel HitManagement Identifier )
 
 # Install files from the package:
 atlas_install_headers( ZDC_SimuDigitization )
diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/ZDC_SimuDigitization/ZDC_PileUpTool.h b/ForwardDetectors/ZDC/ZDC_SimuDigitization/ZDC_SimuDigitization/ZDC_PileUpTool.h
index 325a1cfc257..40b5ece4185 100644
--- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/ZDC_SimuDigitization/ZDC_PileUpTool.h
+++ b/ForwardDetectors/ZDC/ZDC_SimuDigitization/ZDC_SimuDigitization/ZDC_PileUpTool.h
@@ -1,11 +1,10 @@
 /*
-  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 ZDC_DIGITIZATION_TOOL_H
 #define ZDC_DIGITIZATION_TOOL_H
 
-#include "EventInfo/PileUpEventInfo.h"  /*SubEvent*/
 #include "PileUpTools/PileUpToolBase.h"
 #include "GaudiKernel/Property.h"
 #include "GaudiKernel/ServiceHandle.h"
diff --git a/ForwardDetectors/ZDC/ZDC_SimuDigitization/src/ZDC_PileUpTool.cxx b/ForwardDetectors/ZDC/ZDC_SimuDigitization/src/ZDC_PileUpTool.cxx
index b2e463f7f6d..43e656221b4 100644
--- a/ForwardDetectors/ZDC/ZDC_SimuDigitization/src/ZDC_PileUpTool.cxx
+++ b/ForwardDetectors/ZDC/ZDC_SimuDigitization/src/ZDC_PileUpTool.cxx
@@ -1,12 +1,10 @@
 /*
-  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 "ZDC_SimuDigitization/ZDC_PileUpTool.h"
 #include <algorithm>
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
 #include "ZDC_SimEvent/ZDC_SimStripHit_Collection.h"
 #include "ZDC_SimEvent/ZDC_SimPixelHit_Collection.h"
 #include "ZDC_SimEvent/ZDC_SimStripHit.h"
-- 
GitLab


From a5f09f9a500a5137617de0e04ef2bb60b225f168 Mon Sep 17 00:00:00 2001
From: sherwood <peter.sherwood@cern.ch>
Date: Thu, 7 Mar 2019 15:27:46 +0000
Subject: [PATCH 313/404] Add support for complex jet chains. Temporarily limit
 menu items for simple chains.

---
 .../TrigHLTJetHypoUtils/DijetMTCondition.h    |  61 +++
 .../TrigHLTJetHypoUtils/conditionsFactory2.h  |   8 +
 .../TrigHLTJetHypo/python/ChainLabelParser.py | 390 +++++++++++++++++
 .../TrigHLTJetHypo/python/ToolSetter.py       | 134 ++++++
 .../python/TrigJetHypoToolConfig.py           | 102 ++---
 .../python/chainDict2jetLabel.py              | 106 +++++
 .../TrigHLTJetHypo/python/chainDictDumper.py  |  22 +
 .../TrigHLTJetHypo/python/constants.py        |   6 +
 .../TrigHLTJetHypo/python/node.py             |  69 +++
 .../TrigHLTJetHypo/python/test_cases.py       |  70 ++++
 .../TrigHLTJetHypo/python/treeVisitors.py     | 392 ++++++++++++++++++
 .../TrigHLTJetHypoUtils/DijetMTCondition.cxx  | 101 +++++
 .../conditionsFactory2.cxx                    |  25 ++
 .../TrigHLTJetHypo/src/TrigJetAndToolMT.cxx   |  62 +++
 .../TrigHLTJetHypo/src/TrigJetAndToolMT.h     |  68 +++
 .../src/TrigJetHypoToolConfig_dijet.cxx       |  94 +++++
 .../src/TrigJetHypoToolConfig_dijet.h         |  76 ++++
 .../src/TrigJetHypoToolConfig_simple.cxx      |  92 ++++
 .../src/TrigJetHypoToolConfig_simple.h        |  71 ++++
 .../TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx  |  10 +-
 .../TrigHLTJetHypo/src/TrigJetHypoToolMT.h    |   5 +-
 .../TrigHLTJetHypo/src/TrigJetNotToolMT.cxx   |  63 +++
 .../TrigHLTJetHypo/src/TrigJetNotToolMT.h     |  66 +++
 .../TrigHLTJetHypo/src/TrigJetOrToolMT.cxx    |  60 +++
 .../TrigHLTJetHypo/src/TrigJetOrToolMT.h      |  68 +++
 .../src/components/TrigHLTJetHypo_entries.cxx |  12 +-
 .../TrigUpgradeTest/python/jetDefs.py         |   2 -
 .../TrigUpgradeTest/share/fullMenu.py         |   2 +-
 .../TrigUpgradeTest/share/fullMenu.ref        |  23 +-
 .../TrigUpgradeTest/share/jet.menu.py         |   2 +-
 .../TrigUpgradeTest/share/jetMenu.ref         |  23 +-
 .../TrigUpgradeTest/share/simpleJetJob.py     |  16 +-
 .../HLTMenuConfig/Menu/SignatureDicts.py      |   6 +-
 33 files changed, 2209 insertions(+), 98 deletions(-)
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
 create mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
new file mode 100644
index 00000000000..84aef0dc56a
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGHLTJETHYPO_DIJETMTCONDITION_H
+#define TRIGHLTJETHYPO_DIJETMTCONDITION_H
+
+/********************************************************************
+ *
+ * NAME:     DijetMTCondition.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ * Cuts on paris of jets makling up a dijet
+ *
+ * AUTHOR:   P. Sherwood
+ * CREATED:  February 21, 2019
+ *           
+ *********************************************************************/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICondition.h"
+
+
+class DijetMTCondition: public ICondition{
+ public:
+  DijetMTCondition(
+                   double massMin,
+                   double massMax,
+                   double detaMin,
+                   double detaMax,
+                   double dphiMin,
+                   double dphiMax
+                 );
+
+  ~DijetMTCondition() override {}
+
+  bool isSatisfied(const HypoJetVector&) const override;
+  
+  double orderingParameter() const noexcept override;
+  
+  std::string toString() const noexcept override;
+
+ private:
+
+  bool passJetCuts(pHypoJet, pHypoJet) const;
+  bool passDijetCuts(pHypoJet, pHypoJet) const;
+
+  // cuts on sum of jets
+  double m_massMin;
+  double m_massMax;
+
+  // cuts on the two jets
+  double m_detaMin;
+  double m_detaMax;
+  
+  double m_dphiMin;
+  double m_dphiMax;
+
+};
+
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
index 92078f82269..03492681722 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
@@ -44,6 +44,14 @@ Conditions conditionsFactoryDijet(const std::vector<double>& etThresholds1,
                                   const std::vector<double>& dphiMins,
                                   const std::vector<double>& dphiMaxs);
 
+Conditions conditionsFactoryDijetMT(const std::vector<double>& massMins,
+                                    const std::vector<double>& massMaxs,
+                                    const std::vector<double>& detaMins,
+                                    const std::vector<double>& detaMaxs,
+                                    const std::vector<double>& dphiMins,
+                                    const std::vector<double>& dphiMaxs);
+
+
 
 // for conditionsFactory2
 Conditions conditionsFactoryDijetEtaMass(const std::vector<double>& etasMin,
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
new file mode 100644
index 00000000000..46230e0139d
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
@@ -0,0 +1,390 @@
+from node import Node
+from constants import (lchars,
+                       digits,
+                       delims)
+
+
+
+def get_char(s):
+    """character generator"""
+
+    while s:
+        c = s[0]
+        s = s[1:]
+        yield c
+
+def _check_parens(s, pars):
+    pl = pars[0]
+    pr = pars[1]
+    np = 0
+    for c in s:
+        if c == pl: np += 1
+        if c == pr: np -= 1
+        if np < 0:
+            raise RuntimeError('Paren mismatch for parens %s, %s' % (pars, s))
+
+def check_parens(s):
+    _check_parens(s, '()')
+    _check_parens(s, '[]')
+    
+            
+
+def preprocess(s):
+    llines  = s.split('\n')
+
+    lines  = [l.split('#')[0].strip() for l in llines]
+    s = ''.join(lines)
+    ss = ''
+    reject = ' \n'
+    for c in s:
+        # keep white space whn within square brackets, reject otherwise
+        if c not in reject:
+            ss += c
+    s = ss      
+
+    check_parens(s)
+    print s
+    from constants import alphabet
+    for c in s:
+        if not c in alphabet:
+            raise RuntimeError('bad character %s in string %s' % (c, s))
+    print 'end of preprocess: ', s
+    return s
+
+
+class ChainLabelParser(object):
+    def __init__(self, label, debug=False):
+        self.label = label
+        self.state = 'start'
+        pp = preprocess(label)
+        print 'preprocessd string', pp, 'length', len(pp)
+        self.gc = get_char(pp)
+        self.state_history = []
+        self.states = {
+            'start': self.start,
+            'scenario': self.scen,
+            'start_params_0': self.start_params_0,
+            'start_params_1': self.start_params_1,
+            'params': self.params,
+            'end_params_0': self.end_params_0,
+            'end_params': self.end_params,
+            'end_scenario': self.end_scenario,
+            'error': self.error,
+        }
+        self.debug = debug
+
+    def paramAppend(self, c):
+        self.parameters += c
+        if self.debug:
+            print 'parameters', self.parameters
+
+    def scenAppend(self, c):
+        self.scenario += c
+        if self.debug:
+            print 'scenario', self.scenario
+            
+    def start(self):
+        "initialise"
+
+        self.state = 'scenario'
+        self.scenario = ''
+        self.parameters = ''
+        self.tree = [Node('dummy')]
+        self.msg = ''
+        
+
+    def scen(self):
+        """accumulate scenario name string into self.scenario"""
+        
+        c = self.gc.next()
+    
+        if c in lchars: 
+            self.scenAppend(c)
+            return
+    
+        if c == '(':
+            self.state = 'start_params_0'
+
+            return
+    
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+
+    def start_params_0(self):
+        """accumulate parameter string into self.parameter"""
+
+        self.tree.append(Node(self.scenario))
+        self.scenario = ''
+
+        c = self.gc.next()
+    
+        if c == '[':
+            self.state = 'start_params_1'
+            return
+
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+
+    def start_params_1(self):
+        """accumulate parameter string into self.parameter"""
+        
+        c = self.gc.next()
+    
+        if c == '(':
+            self.paramAppend(c)
+            self.state = 'params'
+            return
+
+        if c == ']':
+            self.state = 'end_params'
+            return
+
+
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+
+    def params(self):
+        """accumulate parameter string into self.parameter"""
+        
+        c = self.gc.next()
+    
+        if c in lchars or c in digits or c ==',':
+            self.paramAppend(c)
+            return
+
+        if c == ')':
+            self.paramAppend(c)
+            self.state = 'end_params_0'
+            return
+
+
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+    
+
+    def end_params_0(self):
+        """Check whether there are more prameters to accumulate"""
+
+        c = self.gc.next()
+
+        # more parameters
+        if c == '(':
+            self.paramAppend(c)
+            self.state = 'params'
+            return
+
+        # end of paramter lists
+        if c == ']':
+            self.tree[-1].parameters = self.parameters.strip()
+            self.parameters = ''
+            self.state = 'end_params'
+            return
+
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+    
+
+    def end_params(self):
+        """after accumulating params, drop white space, then add node to tree
+        or process next scenario"""
+        
+        c = self.gc.next()
+        
+        if c == ')':
+            self.state = 'end_scenario'
+            return
+        
+        if c in lchars:
+            self.scenAppend(c)
+            self.state = 'scenario'
+            return
+        
+        self.msg = 'state %s, bad character %s in string %s' % (self.state,
+                                                                c,
+                                                                self.label)
+        self.state = 'error'
+        
+    def end_scenario(self):
+        """Add current node to its parent"""
+        
+        n = self.tree.pop()
+        self.tree[-1].add_child(n)
+
+        while True:
+            c = self.gc.next()
+            if c == ')':
+                n = self.tree.pop()
+                self.tree[-1].add_child(n)
+            else:
+
+                # more input means a new scenario is starting
+                self.scenario = c
+                self.parameters = ''
+                self.msg = ''
+                self.state = 'scenario'
+        
+                return    
+
+        
+    def error(self):
+        """From error state, dump error report and raise exception"""
+        
+        print '---error state report ---'
+        print ' state', self.state
+        print ' scenario', self.scenario
+        print ' parameters', self.parameters
+        print ' msg', self.msg
+        print 'state history', self.state_history
+        print ' tree dump:'
+        print self.tree[0].dump()
+        print '--end error state report---'
+        raise RuntimeError('error state')
+    
+    def get_state(self):
+        self.state_history.append(self.state)
+        return self.states[self.state]
+    
+
+    
+    def parse(self):
+        "parse a chain label"
+        
+        error = False
+        terminated = False
+
+        self.start()  # re-initialise
+        
+        try:   # parsing ends with an exception
+            while True:   # continue until exception
+
+                # print 'current state', self.state
+                # print 'current scenario', self.scenario
+                # print 'current parameters', self.parameters
+                
+                # self.states[self.state]()  # process the current state
+                self.get_state()()
+                
+        except StopIteration:  # generator has reached the end of the string
+            print 'parse terminated'
+            terminated = True
+        except AssertionError, e:
+            print 'assertion err'
+            print e
+            error = True
+        except RuntimeError, e:
+            print e
+            error = True
+            
+    
+        if not terminated:
+            s = ''
+            try:
+                while True:
+                    s += self.gc.next()
+            except StopIteration:
+                if s:
+                    print 'error: remaining characters:', s
+     
+        if len(self.tree) != 1:
+            error = True
+            print 'error, stack size', len(self.tree), 'expected 2'
+            print self.state_history
+            
+        if len(self.tree[0].children) != 1:
+            error = True
+            print 'error, top node has %d cdildren, expected 1' % (
+                len(self.tree[0].children))
+
+        final_state = 'end_scenario'
+        if self.state != final_state:
+            error = True
+            print 'error: final state is %s, expected %s' % (self.state,
+                                                             final_state)
+        # print 'tree dump:'
+        # print self.tree[0].dump()
+        print 'parse',
+        if not error:
+            print 'succeeded'
+        else:
+            print 'state: %s scenario: %s parameters: %s stack len %d' % (
+                self.state, self.scenario, self.parameters, len(self.tree))
+            print 'failed'
+
+        # Kludge: mark the tops of the trees. The visitor which
+        # creates Tool instances with give the Tool for this node
+        # the name of the chain
+    
+        for c in self.tree[0].children:
+            c.tree_top = True
+
+        # for now (02/01/2019), no reco. First tree is only tree is hypo
+        return self.tree[0].children[0]
+
+def _test(s):
+    from ChainLabelParser import ChainLabelParser
+    parser = ChainLabelParser(s, debug=True)
+    tree = parser.parse()
+    print tree.dump()
+
+
+def test(index):
+    from test_cases import test_strings
+    c = sys.argv[1]
+    index = -1
+    try:
+        index = int(c)
+    except:
+        print 'expected int in [1,%d] ]on comand line, got %s' % (
+            len(test_strins), c)
+        sys.exit()
+
+    print 'index', index
+    print '========== Test %d ==============' % index
+    s = test_strings[index]
+    print s
+    _test(s)
+
+
+def usage(options):
+    print 'usage: ChainLabelPaers -[%s]' % options
+
+  
+if __name__ == '__main__':
+
+    import getopt, sys
+    from test_cases import test_strings
+    ncases = len(test_strings)
+    try:
+        options = "1234567"
+        opts, args = getopt.getopt(sys.argv[1:], options, [])
+    except getopt.GetoptError as err:
+        # print help information and exit:
+        print str(err) # will print something like "option -a not recognized"
+        usage(options)
+        sys.exit(2)
+
+    assert len(args) == 1
+    o = args[0]
+    try:
+        index = int(o)
+    except:
+        print 'Supply an test case integer index  on the command line '
+        sys.exit(0)
+    
+    if index < 0 or index >= ncases:
+        print 'no such test case ind %d, expect val in [0, %d]'  %(index,
+                                                                   ncases-1)
+        sys.exit(0)
+
+    test(int(o))
+    
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
new file mode 100644
index 00000000000..87c1114df9c
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
@@ -0,0 +1,134 @@
+from TrigHLTJetHypo.TrigHLTJetHypoConf import (TrigJetHypoToolConfig_simple,
+                                               TrigJetHypoToolConfig_dijet,
+                                               TrigJetNotToolMT,
+                                               TrigJetAndToolMT,
+                                               TrigJetOrToolMT,
+                                               TrigJetHypoToolMT)
+
+
+class ToolSetter(object):
+    """Visitor to set instantiated AlgTools to a jet hypo tree"""
+    
+    def __init__(self, name, dump_jets=True):
+
+        self.chain_name = name
+        self.dump_jets = dump_jets
+        
+        self.tool_factories = {
+            'simple': [TrigJetHypoToolConfig_simple, 0],
+            'not': [TrigJetNotToolMT, 0],
+            'and': [TrigJetAndToolMT, 0],
+            'or': [TrigJetOrToolMT, 0],
+            'dijet': [TrigJetHypoToolConfig_dijet, 0],
+            }
+
+        self.mod_router = {
+            'not': self.mod_logical_unary,
+            'and': self.mod_logical_binary,
+            'or': self.mod_logical_binary,
+            # 'not': self.mod_logical_unary,
+        }
+
+    def mod_logical_binary(self, node):
+        """Set the HypoConfigTool instance the 'and' and 'or' scenarios
+        these take two predicates"""
+        
+        scen = node.scenario
+        klass = self.tool_factories[scen][0]
+        sn = self.tool_factories[scen][1]
+        name = '%s_%d' % (scen, sn)
+        self.tool_factories[scen][1] += 1
+
+        # kludgy. The name of the tool seen by the trigger must be
+        # the trigger name, so have to figure  out if this is the top
+        # level node (actually first daughter, as the start node is the top)
+        # note that the name can only be set once so have to know
+        # if we are the top of the tree while traversing it. kludgy...
+        # also - will break when using a forest...
+
+        print 'Toolsetter, node.tree_top', node.tree_top
+        if node.tree_top:
+            tool = klass(name=self.chain_name)
+        else:
+            tool = klass(name=name)
+
+        print 'ToolSetter, setting lhs ', node.children[0].tool
+        tool.lhs = node.children[0].tool
+        tool.rhs = node.children[1].tool
+        node.tool = tool
+
+
+    def mod_logical_unary(self, node):
+        """Set the HypoConfigTool instance for the 'not' scenario
+        this takes a single predicate"""
+        
+        scen = node.scenario
+        klass = self.tool_factories[scen][0]
+        sn = self.tool_factories[scen][1]
+        name = '%s_%d' % (scen, sn)
+        self.tool_factories[scen][1] += 1
+
+        # kludgy. The name of the tool seen by the trigger must be
+        # the trigger name, so have to figure  out if this is the top
+        # level node (actually first daughter, as the start node is the top)
+        # note that the name can only be set once so have to know
+        # if we are the top of the tree while traversing it. kludgy...
+        # also - will break when using a forest...
+
+        print 'Toolsetter, node.tree_top', node.tree_top
+        if node.tree_top:
+            tool = klass(name=self.chain_name)
+        else:
+            tool = klass(name=name)
+
+        print 'ToolSetter, setting lhs ', node.children[0].tool
+        tool.hypoTool = node.children[0].tool
+        node.tool = tool
+                               
+
+                               
+    def mod_simple(self, node):
+        """Set the HypoConfigTool instance in a hypo tree node"""
+
+        scen = node.scenario
+        klass = self.tool_factories[scen][0]
+        sn = self.tool_factories[scen][1]
+        name = '%s_%d' % (scen, sn)
+        
+        self.tool_factories[scen][1] += 1
+
+        config_tool = klass(name=name+'_config')
+        [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()]
+        
+        # kludgy. The name of the tool seen by the trigger must be
+        # the trigger name, so have to figure  out if this is the top
+        # level node (actually first daughter, as the start node is the top)
+        # note that the name can only be set once so have to know
+        # if we are the top of the tree while traversing it. kludgy...
+        # also - will break when using a forest...
+        print 'Toolsetter, node.tree_top', node.tree_top
+        if node.tree_top:
+            tool = TrigJetHypoToolMT(name=self.chain_name)
+        else:
+            tool = TrigJetHypoToolMT(name=name)
+            
+        tool.HypoConfigurer = config_tool
+        tool.dumpJets  = self.dump_jets
+        node.tool = tool
+                               
+    def mod(self, node):
+        """Set the HypoConfigTool instance according to the scenario.
+        Note: node.accept must perform depth first navigation to ensure
+        child tools are set."""
+        
+        self.mod_router.get(node.scenario, self.mod_simple)(node)
+
+    def report(self):
+        wid = max(len(k) for k in self.tool_factories.keys())
+        rep = '\n%s: ' % self.__class__.__name__
+
+        rep += '\n'.join(
+            ['%s: %d' % (k.ljust(wid), v[1])
+             for k, v in self.tool_factories.items()])
+
+        return rep
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
index 538ed52e796..908fcb0454a 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
@@ -1,67 +1,73 @@
-from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoToolMT, TrigJetHypoToolConfig_EtaEt
-import re
+from TrigHLTJetHypo.TrigHLTJetHypoConf import (TrigJetHypoToolMT,
+                                               TrigJetHypoToolConfig_EtaEt)
 
-re_EtEta0 = re.compile(
-    r'^HLT_j(?P<thresh>\d+)(_(?P<etalo>\d{3})eta(?P<etahi>\d{3}))?$')
-# re_EtEta1 = re.compile(r'^HLT_j\d+(_\d{1-3}eta\d{3})?_L1')
-# re_EtEta2 = re.compile(r'^HLT_j\d+(_\d{3}eta\d{3})?_(jes|nojcalib|lcw)*$')
+from  TrigHLTJetHypo.ToolSetter import ToolSetter
+from  TrigHLTJetHypo.treeVisitors import TreeParameterExpander
+from  TrigHLTJetHypo.chainDict2jetLabel import (make_simple_label,
+                                                make_vbenf_label)
+from  TrigHLTJetHypo.ChainLabelParser import ChainLabelParser
 
+from GaudiKernel.Constants import (VERBOSE,
+                                   DEBUG,
+                                   INFO,
+                                   WARNING,
+                                   ERROR,
+                                   FATAL,)
 
-def decodeEtEta(match, chain):
-    """Create a hypo tool for the Et - Eta scenario"""
-    default = {'etalo': '0', 'etahi': '320'}
-    conf_dict = match.groupdict()
-    for k, v in default.items():
-        if k not in conf_dict: conf_dict[k] = v
-        if conf_dict[k] is None: conf_dict[k] = v
 
-    conf_tool = TrigJetHypoToolConfig_EtaEt(name=chain+"config")
-    conf_tool.EtThresholds = [float(conf_dict['thresh'])]
-    conf_tool.eta_mins = [float(conf_dict['etalo'])]
-    conf_tool.eta_maxs = [float(conf_dict['etahi'])]
-    conf_tool.asymmetricEtas = [0]
-    conf_tool.OutputLevel = 0
-    return conf_tool
+def  trigJetHypoToolFromDict(chain_dict):
+    """Produce  a jet trigger hypo tool from a chainDict"""
 
+    print 'trigJetHypoToolFromDict starts'
+    chain_label = ''    
+    if 'vbenf' in chain_dict['chainParts'][0]['hypoScenario']:
+        assert len(chain_dict['chainParts']) == 1
+        chain_label = make_vbenf_label(chain_dict)
+    else:
+        chain_label = make_simple_label(chain_dict)
+    parser = ChainLabelParser(chain_label)
+    tree = parser.parse()
 
-def  trigJetHypoToolFromDict(chainDict):
-    return trigJetHypoToolFromName( chainDict['chainName'], chainDict['chainName'])
+    #expand strings of cuts to a cut dictionary
+    visitor = TreeParameterExpander()
+    tree.accept(visitor)
+    visitor.report()
 
-def  trigJetHypoToolFromName(name, jetconfig):
-    """Configure a jet hypo tool from chain name.
+    # create - possibly nested - tools
 
-    Delegate to functions according to the hypo scenartio."""
-    scenario_dict = {re_EtEta0: decodeEtEta}
+    # chain name in run 2 dicts were missing the 'HLT_' prefix
+    # but it seems it is necessary to run the hypos in AthenaMT ?...?
+    
+    chain_name = chain_dict['chainName']
+    if not chain_name.startswith('HLT_'):
+        chain_name = 'HLT_' + chain_name
 
-    chain = jetconfig
-    for k, v in scenario_dict.items():
-        match = k.match(chain)
-        if match:
-            hypo_tool = TrigJetHypoToolMT(chain)
-            hypo_tool.HypoConfigurer = v(match, chain)
-            return hypo_tool
+    print 'trigJetHypoToolFromDict chain_name', chain_name
+    visitor = ToolSetter(chain_name)
+    tree.accept(visitor)
+    visitor.report()
 
-    msg = 'trigJetHypoToolFromName(%s) - decode error' % chain
-    raise NotImplementedError(msg)
+    print 'Dumping jet config for', chain_name
+    print tree.dump()
+    tool = tree.tool
+    tool.OutputLevel = DEBUG
+    return tool
 
 
 import unittest
 class TestStringMethods(unittest.TestCase):
     def testValidConfigs(self):
-        # EtaEt hypos
-        # from MC_pp_v7 import  TriggerFlags.JetSlice.signatures
-        # exception or any other issue will make the ctest for this package fail
-        chains = ('HLT_j85', 'HLT_j35_320eta490')
-        wid = max(len(c) for c in chains)
-        for c in chains:
-            tool = trigJetHypoToolFromName(c, c)
-            self.assertIsNotNone( tool ) 
-            print '%s' % c.rjust(wid), tool
-
-    def testInvalidConfig(self):
-        with self.assertRaises(NotImplementedError):
-            tool = trigJetHypoToolFromName('HLT_nonsense', 'HLT_nonsense')
+        from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
 
+        chainNameDecoder = DictFromChainName.DictFromChainName()
+        # chain_names = ('HLT_j85', 'HLT_j35_0eta320')
+        chain_names = ('HLT_j0hs_vbenf',)
+        wid = max(len(c) for c in chain_names)
+        for chain_name in chain_names:
+            chain_dict = chainNameDecoder.getChainDict(chain_name)
+            tool = trigJetHypoToolFromDict(chain_dict)
+            self.assertIsNotNone(tool) 
+            print '%s' % chain_name.rjust(wid), tool
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
new file mode 100644
index 00000000000..89047bbe9e7
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
@@ -0,0 +1,106 @@
+import re
+
+# substrings that cannot occur in any chainPartName for simple chains.
+reject_substr = (
+    'gsc',
+    'ion',
+    'dphi',
+    'deta',
+    'invm',
+    '0i1',
+    '1i2',
+    'dphi',
+    'ht\d',)
+
+reject_substr_res = re.compile(r'%s' % '|'.join(reject_substr))
+
+
+def select_simple_chains(cd):
+    """Select chains for which to make an simple chain label.
+
+    Chains selected by reuiring that the signature os 'Jet'. Chains are
+    vetoed if specific substrings occur in any of the chainPartNames"""
+
+
+    # print cd
+    # assert False
+    chain_parts = [c for c in cd['chainParts'] if c['signature'] == 'Jet']
+    chain_name = cd['chainName']
+                       
+    for cp in chain_parts:
+        if  reject_substr_res.search(cp['chainPartName']):
+            return []
+
+    return chain_parts
+
+
+def make_simple_label(chain_dict):
+    """Marshal information deom the selected chainParts to create a
+    'simple' label.
+    """
+    
+    cps = select_simple_chains(chain_dict)
+    if not cps:
+        raise NotImplementedError(
+            'chain fails substring selection: not "simple": %s' % (
+                chain_dict['chainName']))
+    
+    label = 'simple(['
+    for cp in cps:
+        smcstr =  str(cp['smc'])
+        if smcstr == 'nosmc':
+            smcstr = ''
+        for i in range(int(cp['multiplicity'])):
+            # condition_str = '(%set,%s,%s)' % (str(cp['threshold']),
+            #                                  str(cp['etaRange']),
+            #                                  smcstr,)
+            condition_str = '(%set,%s' % (str(cp['threshold']),
+                                              str(cp['etaRange']),)
+            if smcstr:
+                condition_str += ',%s)'
+            else:
+                condition_str += ')'
+            label += condition_str
+    label += '])'
+    return label
+
+
+def select_vbenf_chains(cd):
+    """Select chains for which to make a vbenf chain label.
+    Chains selected by reuiring that the signature os 'Jet'. Chains are
+    vetoed if specific substrings occur in any of the chainPartNames"""
+
+
+    # print cd
+    # assert False
+    chain_parts = [c for c in cd['chainParts'] if c['signature'] == 'Jet']
+    return any(['vbenf' in cp['chainPartName'] for cp in chain_parts])
+
+def make_vbenf_label(chain_dict):
+    """Marshal information from the selected chainParts to create a
+    vbenf label.
+    """
+
+    # toy label for developement: run simple and dijet independently.
+    # simple makes Et cuts on two jets. Independently (sharing possible)
+    # of jets choosean by simple,  the dijet
+    # scenario requires a dijet of mass > 900, and opening angle in phi > 2.6
+               
+    return 'and([] simple([(50et)(70et)])dijet([(900mass, 26dphi)]))'
+
+if __name__ == '__main__':
+    """Read chainDicts from files, cread simple label if possible"""
+    from chainDictSource import chainDictSource
+
+    for cd in chainDictSource():
+        f = cd['chainName']
+        print '\n---------'
+        print f
+        try:
+            label = make_simple_label(cd)
+        except Exception, e:
+            print e
+            continue
+        
+        print 'chain label', label
+        print '-----------\n'
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
new file mode 100644
index 00000000000..608d8b49228
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
@@ -0,0 +1,22 @@
+from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
+from TriggerMenuMT.HLTMenuConfig.Menu.SignatureDicts import JetChainParts
+import sys
+
+from pprint import PrettyPrinter
+
+pp = PrettyPrinter(indent=4)
+pp.pprint(JetChainParts)
+
+decodeChainName = DictFromChainName.DictFromChainName()
+
+def do_it():
+    print '\n------------------\n'
+    chain_dict = decodeChainName.getChainDict(chain_name)
+    pp.pprint(chain_dict)
+
+if __name__ == '__main__':
+    chain_name = sys.argv[1]
+    do_it()
+    # chain_names = ('HLT_j85', 'j85', 'HLT_j55_0eta320_2j20_0eta320',)
+    # for chain_name in chain_names:
+    #      do_it()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
new file mode 100644
index 00000000000..33afe422d31
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
@@ -0,0 +1,6 @@
+lchars = 'abcdefghijklmnopqrstuvwxyz'
+digits = '0123456789'
+delims = '()[],'
+logicals = ('and', 'or', 'not')
+alphabet = lchars + digits + delims
+
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
new file mode 100644
index 00000000000..7ce56d947df
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
@@ -0,0 +1,69 @@
+from constants import logicals
+    
+class Node(object):
+    
+    def __init__(self, scenario):
+        self.scenario = scenario
+        self.parameters = ''
+        self.children = []
+        self.conf_attrs = {}
+        self.tool = None
+
+        # self.tree_top kludge carensure top level tools get chain name
+        # as Tool name
+        self.tree_top = False
+
+    def add_child(self, c):
+        self.children.append(c)
+        
+    def accept(self, modifier):
+        "call self before children"
+
+        modifier.mod(self)
+        for c in self.children:
+            c.accept(modifier)
+
+    def accept_cf(self, modifier):
+        "call children before self"
+        
+        for c in self.children:
+            c.accept_cf(modifier)
+        modifier.mod(self)
+
+    def makeTool(self):
+        if self.scenario not in logicals:
+            self.tool = DummyTool(self.toolName)
+            
+    def buildTree(self, treeVisitor):
+        if self.children:
+            if self.scenario in logicals:
+                treeVisitor.add(self.scenario + '(')
+            else: 
+                treeVisitor.add(self.tool.name() + '(')
+                
+            for c in self.children:
+                c.buildTree(treeVisitor)
+            treeVisitor.add(') ')
+
+        else:
+            treeVisitor.add(self.tool.name() + ' ')
+            
+
+    
+        return s
+        
+    def dump(self, n_in=0):
+        indent = ' '*n_in
+        s = '\n'
+        s =  indent + 'Node. scenario: %s \n' % self.scenario
+        s +=  indent + 'is tree top? %s \n' % self.tree_top
+        s += indent + 'parameters: %s\n' % str(self.parameters)
+        s += indent + 'conf_attrs: %s\n' % str(self.conf_attrs)
+        s += indent + 'AlgTool: %s\n' % str(self.tool)
+        # s += indent + 'AlgTool dict: %s\n' % str(self.tool.__dict__)
+        s += indent + 'No of children: %d\n\n' % len(self.children)
+        for c in self.children:
+            s += c.dump(n_in+5)
+
+        return s
+        
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
new file mode 100644
index 00000000000..549dc54109a
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
@@ -0,0 +1,70 @@
+test_strings = [
+    'ijet([(10et, 0eta320)])',
+     'ijet([(10et, 0eta320)(20et, 0eta320)])',
+    # 'or([] ijet([10et]) and([] ijet([20et]) ijet([30et])))',
+    'or([] ijet([(10et)]) ijet([(20et)(40et)]))',
+    'and([] ijet([(10et)]) ijet([(20et)]))',
+    'not([] ijet([(10et)]) )',
+    'not([] and([] ijet([(40et, 0eta320)]) ijet([(100et, 0eta320)])))',
+    'or([] not([] ijet([(40et, 0eta320)])) not([] ijet([(100et, 0eta320)])))',
+    'or([] and([] ijet([(40et, 0eta320)]) ijet([(40et, 0eta320)])) not([] ijet([(100et, 0eta320)])))',
+
+
+
+"""
+partition     
+(
+  [(4,2)]   # partition 6 input jets to 4, 2 
+  splitter  # send the 4s to first 2 children, 2 to third.
+    assert len(o) == 1
+  (
+    [(1,1)(2)]
+    sum # mass cut on sum of input jets (ord.=4)
+    (
+      [(800m900)]
+    )
+    partition        #  partition 4 jets into non-overlapping
+                     #  sets ord 2, 2
+    (
+      [(2,2)]
+      pair           # sum inputs, apply deta cut to the 2 sums
+      (
+        [(40deta)]
+        sum          # child gets two lists, applys mass cuts
+        ( 
+          [(75m85)(80m90)]
+          partition  # passes on 2 sum to regroup to single jets
+          (
+            [() (1)]
+            ijet     # apply aoverlapping mod, et cuts
+            (
+              [(30width50, 30et) (35width45, 40et)]
+            )
+          )
+        )
+      )
+    )
+  )
+               
+  ijet([(p320etap500, 100et) (n500etan320)]),
+)""",
+
+
+#     """cascade(
+#    [800m900]             # conditions for cascade (only one here)
+#      dijet(              # first daughter scenario
+#        [ 80m90]          # condition(s) for first daughter scenario
+#         ijet([10et])     # grandaughter scenario 1 for first daugh scen.
+#         ijet([20et])     # grandaughter scenario 2 for first daugh scen.
+#           )              # end of first dijet scenario 
+#      dijet(              # second daughter scenario
+#        [85m95]
+#          ijet([30et]) 
+#          ijet([40et])
+#            )             # end of second dijet scenario
+#    )                     # end of cascade scenario
+#    """
+
+    'and([] ijet([(50et)(70et)]) dijet([(900mass, 26dphi)]))',
+    'and([]simple([(50et)(70et)])dijet([(900m,26dphi)]))',
+]
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
new file mode 100644
index 00000000000..5dcc580ce23
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
@@ -0,0 +1,392 @@
+from constants import lchars
+
+import re
+import math
+
+from ToolSetter import ToolSetter
+class Checker(object):
+    def __init__(self):
+        self.known = {
+            'simple': ('Et'),
+            'cascade': ('m')
+        }
+
+        self.msgs = []
+        self.nchecked = 0
+
+    def mod(self, node):
+        self.nchecked += 1
+        if node.scenario not in self.known:
+            self.msgs.append('unknown scenario %s' % node.scenario)
+    
+    def report(self):
+        s = ['Checker: %d nodes checked' % self.nchecked]
+        s.extend(self.msgs)
+        return '\n'.join(s)
+
+
+class TreeBuilder(object):
+    def __init__(self):
+        self.tree = '('
+        
+    def add(self, s):
+        self.tree += s
+
+    def report(self):
+        return self.tree
+
+
+class TreeToBooleanExpression(object):
+    """visit a hypo tree. If boolean scenarios are present, build a
+    boolean expression string."""
+    
+    def __init__(self):
+        self.stack = []
+
+    def mod(self, node):
+        if node.scenario == 'not':
+            self.stack.append(' ! ')
+            return
+
+        if node.scenario == 'and':
+            self.stack.append(' x ')
+            return
+
+        if node.scenario == 'or':
+            self.stack.append(' + ')
+            return
+
+        self.stack.append(' %s ' %node.tool.name())
+
+    def report(self):
+        s = '%s: ' % self.__class__.__name__
+        while self.stack: s += self.stack.pop()
+        return s.strip()
+
+
+class TreeParameterExpander_simple(object):
+    """Convert parameter string into duction holding low, high window
+    cut vals. Specialistaion for the 'simple' scenario
+
+    parameter strings look like '40et, 0eta320, nosmc'
+    """
+    
+    window_re = re.compile(
+        r'^(?P<lo>\d*)(?P<attr>[%s]+)(?P<hi>\d*)' % lchars)
+
+    defaults = {'etalo': 0.0,
+                'etahi': 3.2,
+    }
+
+    scale_factors = {'eta': 0.01,
+                     'et': 1000.,
+                     'smc': 1000.,
+    }
+
+    def __init__(self):
+        self.msgs = []
+
+    def mod(self, node):
+
+        def get_conditions(params):
+            """Split conditions string into list of condition strings
+            Condition string looks like
+            '(10et,0eta320)(20et,0eta320)(40et,0eta320)'
+            returned is ['10et,0eta320', '20et,0eta320', '40et,0eta320']
+            """
+
+            alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789,'
+            pat = re.compile(r'(^\([%s]+\))'% alphabet )
+            s = params
+            m = True
+            conditions = []
+            while m:
+                m = pat.match(s)
+                if m is not None:
+                    conditions.append(m.group(0))
+                    s = s[len(conditions[-1]):]
+            assert params == ''.join(conditions)
+            conditions = [c[1:-1] for c in conditions]  # strip parens
+            return conditions
+
+
+        conditions = get_conditions(node.parameters)
+
+        
+        node.conf_attrs['EtThresholds'] = []
+        node.conf_attrs['eta_mins'] = []
+        node.conf_attrs['eta_maxs'] = []
+        node.conf_attrs['asymmetricEtas'] = []
+
+        for c in conditions:
+            toks = c.split(',')
+            toks = [t.strip() for t in toks]
+
+
+            for t in toks:
+                m = self.window_re.match(t)
+                if m is None:
+                    self.msgs.append('match failed for parameter %s' % t)
+                    return
+                group_dict = m.groupdict()
+                attr = group_dict['attr']
+                lo = group_dict['lo']
+                hi = group_dict['hi']
+                if lo == '':
+                    lo = self.defaults.get(attr+'lo', '')
+                if hi == '':
+                    hi = self.defaults.get(attr+'hi', '')
+
+                sf = self.scale_factors[attr]
+                if lo:
+                    if attr == 'eta':
+                        node.conf_attrs['eta_mins'].append(sf * float(lo))
+                    elif attr == 'et':
+                        node.conf_attrs['EtThresholds'].append(sf * float(lo))
+                if hi:
+                    if attr == 'eta':
+                        node.conf_attrs['eta_maxs'].append(sf * float(hi))
+                
+        #01/01/2019 PS  KLUDGE !! FIX ME!!!  asymmetric eta hardwired to 0.
+
+        [node.conf_attrs['asymmetricEtas'].append(0) for i in range(
+                len(conditions))]
+        self.msgs = ['All OK']
+
+        
+    def report(self):
+        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
+
+    
+
+
+class TreeParameterExpander_dijet(object):
+    """Convert parameter string into duction holding low, high window
+    cut vals. Specialistaion for the dijet scenario
+
+    parameter strings look like '40m,100deta200, 50dphi300'
+    """
+    
+    window_re = re.compile(
+        r'^(?P<lo>\d*)(?P<attr>[%s]+)(?P<hi>\d*)' % lchars)
+
+    defaults = {'mass_mins': 0.0,
+                'mass_maxs': 100000.,
+                'deta_mins': 0.,
+                'deta_maxs': 20.,
+                'dphi_mins': 0.,
+                'dphi_maxs': math.pi,
+    }
+
+    scale_factors = {'deta': 0.01,
+                     'mass': 1000.,
+                     'dphi': 0.01,
+    }
+
+    def __init__(self):
+        self.msgs = []
+
+    def mod(self, node):
+
+        def get_conditions(params):
+            """Split conditions string into list of condition strings
+            Condition string looks like
+            '(75m85,100dEta200, 50dphi200)(80m90, 110dEta210)'
+            returned is ['10et,0eta320', '20et,0eta320', '40et,0eta320']
+            """
+
+            alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789,'
+            pat = re.compile(r'(^\([%s]+\))'% alphabet )
+            s = params
+            m = True
+            conditions = []
+            while m:
+                m = pat.match(s)
+                if m is not None:
+                    conditions.append(m.group(0))
+                    s = s[len(conditions[-1]):]
+            assert params == ''.join(conditions)
+            conditions = [c[1:-1] for c in conditions]  # strip parens
+            return conditions
+
+        ok = True # status flag
+        conditions = get_conditions(node.parameters)
+
+        bare_attrs = ['mass', 'deta', 'dphi']
+        all_attrs = []
+        for attr in bare_attrs:
+            all_attrs.extend([attr+'_mins', attr+'_maxs'])
+
+        for attr in all_attrs:
+            node.conf_attrs[attr] = []
+
+        for c in conditions:
+            toks = c.split(',')
+            toks = [t.strip() for t in toks]
+
+
+            processed_attrs = []
+            for t in toks:
+                m = self.window_re.match(t)
+                if m is None:
+                    self.msgs.append('match failed for parameter %s' % t)
+                    return
+                group_dict = m.groupdict()
+                attr = group_dict['attr']
+                lo = group_dict['lo']
+                hi = group_dict['hi']
+                if lo == '':
+                    lo = self.defaults.get(attr+'_min', '')
+                if hi == '':
+                    hi = self.defaults.get(attr+'_max', '')
+
+                sf = self.scale_factors[attr]
+                if lo:
+                    if attr == 'mass':
+                        node.conf_attrs['mass_mins'].append(sf * float(lo))
+                    elif attr == 'deta':
+                        node.conf_attrs['deta_mins'].append(sf * float(lo))
+                    elif attr == 'dphi':
+                        node.conf_attrs['dphi_mins'].append(sf * float(lo))
+
+                    processed_attrs.append(attr+'_mins')
+                if hi:
+                    if attr == 'mass':
+                        node.conf_attrs['mass_maxs'].append(sf * float(lo))
+                    elif attr == 'deta':
+                        node.conf_attrs['deta_maxs'].append(sf * float(lo))
+                    elif attr == 'dphi':
+                        node.conf_attrs['dphi_maxs'].append(sf * float(lo))
+
+                    processed_attrs.append(attr+'_maxs')
+
+
+
+            for a in all_attrs:
+                if a not in processed_attrs:
+                    node.conf_attrs[a].append(self.defaults[a])
+
+            for a in processed_attrs:
+                if a not in all_attrs:
+                    self.msgs.append('Unknown attribute: %s' % a)
+                    ok = False
+
+        if ok:
+            self.msgs = ['All OK']
+        else:
+            self.msgs.append('Error')
+
+        
+    def report(self):
+        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
+
+    
+class TreeParameterExpander_null(object):
+    """Does nothing except check the parameter string is empty"""
+
+    def __init__(self):
+        self.msgs = ['Do nothing paramter expander']
+
+    def mod(self, node):
+        assert node.parameters == ''
+        
+    def report(self):
+        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
+    
+
+
+class TreeParameterExpander(object):
+    """Class to exapnder node.paramters string. Delegates to
+    specialised exanders."""
+    
+    router = {
+        'simple': TreeParameterExpander_simple,
+        'dijet': TreeParameterExpander_dijet,
+        'not': TreeParameterExpander_null,
+        'and': TreeParameterExpander_null,
+        'or': TreeParameterExpander_null,
+    }
+
+    def __init__(self):
+        self.expander = None
+
+    def mod(self, node):
+        self.expander = self.router[node.scenario]()
+        self.expander.mod(node)
+        print self.expander.report()
+    def report(self):
+        return self.expander.report()
+        
+
+
+class TreeToCascade(object):
+    def __init__(self):
+        self.stack = []
+
+    def mod(self, node):
+        
+        self.stack.append(
+            '(%s < (%s))' %(node.tool.name(), 
+                            ' '.join([c.tool.name  for c in node.children])))
+
+    def report(self):
+        s = ''
+        while self.stack:
+            s += self.stack.pop()
+        return s.strip()
+
+
+def _test(s):
+
+    from ChainLabelParser import ChainLabelParser
+    parser = ChainLabelParser(s)
+    tree = parser.parse()
+    print tree.dump()
+    # exapnd the window cuts (strings) obtained from the chain label
+    # to attributes and floating point numbers, set defaults
+    # for unspecified vallues
+    visitor = TreeParameterExpander()
+    tree.accept(visitor)
+    print visitor.report()
+    print tree.dump()
+
+
+    # set the node attribute node.tool to be the hypo  Al\gTool.
+    print 'sending in the ToolSetter visitor'
+    ts_visitor = ToolSetter(s)
+    tree.accept_cf(ts_visitor)
+    print ts_visitor.report()
+
+
+    print tree.dump()
+
+
+def test(index):
+    from test_cases import test_strings
+    import sys
+    c = sys.argv[1]
+    index = -1
+    try:
+        index = int(c)
+    except:
+        print 'expected int in [1,%d] ]on comand line, got %s' % (
+            len(test_strings), c)
+        sys.exit()
+
+    print 'index', index
+    print '========== Test %d ==============' % index
+    s = test_strings[index]
+    print s
+    _test(s)
+
+
+if __name__ == '__main__':
+    import sys
+    c = sys.argv[1]
+    ic = -1
+    try:
+        ic = int(c)
+    except:
+        print 'expected int on command line, got ',c
+        sys.exit()
+    test(ic)
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
new file mode 100644
index 00000000000..8e1c5d29314
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
@@ -0,0 +1,101 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h"
+#include <sstream>
+#include <stdexcept>
+#include <TLorentzVector.h>
+#include <limits>
+// #include <iostream>
+DijetMTCondition::DijetMTCondition(double massMin,
+                                   double massMax,
+                                   double detaMin,
+                                   double detaMax,
+                                   double dphiMin,
+                                   double dphiMax
+                                   ){
+  m_massMin = massMin;
+  m_massMax = massMax;
+  m_detaMin = detaMin;
+  m_detaMax = detaMax;
+  m_dphiMin = dphiMin;
+  m_dphiMax = dphiMax;
+}
+
+
+bool DijetMTCondition::isSatisfied(const HypoJetVector& ips) const{
+  if(ips.size() != 2){
+    std::stringstream ss;
+    ss << "DijetMT::isSatisfied must see exactly 2 particles, but received "
+       << ips.size()
+       << '\n';
+    
+    throw std::runtime_error(ss.str());
+  }
+
+  auto j0 = ips[0];
+  auto j1 = ips[1];
+
+  auto rj0 = 0.001 * (j0 -> p4());
+  auto rj1 = 0.001 * (j1 -> p4());
+
+  auto mass = (rj0 + rj1).M();
+  if (m_massMin > mass or mass >= m_massMax){return false;}
+
+  
+  auto eta0 =  j0->eta();
+  auto eta1 =  j1->eta();
+  auto adeta = std::abs(eta0 -eta1);
+  if (m_detaMin > adeta or adeta >= m_detaMax){return false;}
+
+
+  auto dphi = std::abs(rj0.DeltaPhi(rj1));
+  if (m_dphiMin > dphi or dphi >= m_dphiMax){return false;}
+
+  return true;
+
+  /*
+  auto result =  test(et0, et1, absEta0, absEta1, dEta, mass);
+  std::cout << "DijetMTCondition : " << std::boolalpha << result << '\n'
+            << std::setprecision(3) << std::scientific 
+            << "jet 0 et " << m_etThreshold0 << " " << et0 << '\n'
+            << "jet 1 et " << m_etThreshold1 << " " << et1 << '\n'
+            << "jet 0 eta " << m_etaMin0 << " " << eta0 << " " << m_etaMax0 << '\n'
+            << "jet 1 eta " << m_etaMin1 << " " << eta1 << " " << m_etaMax1 << '\n'
+            << "dEta " << m_dEtaMin << " " << dEta << " " << m_dEtaMax << '\n'
+            << "mass " << m_massMin << " " << mass << " " <<m_massMax << '\n';
+
+  return result;
+  */
+
+}
+
+std::string DijetMTCondition::toString() const noexcept {
+  std::stringstream ss;
+  ss << "DijetMTCondition: "
+
+     << " mass min: " 
+     << m_massMin
+     << " mass max: " 
+     << m_massMax
+
+     << " dEta min: " 
+     << m_detaMin
+     << " dEta max: " 
+     << m_detaMax
+
+     << " dPhi min: " 
+     << m_dphiMin
+     << " dPhi max: " 
+     << m_dphiMax
+
+     <<'\n';
+
+  return ss.str();
+}
+
+
+double DijetMTCondition::orderingParameter() const noexcept {
+  return m_massMin;
+}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
index 20299f147ee..ce9babaa9a7 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
@@ -19,6 +19,7 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetDEtaMassCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetDPhiCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetCondition.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HTCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TLACondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
@@ -104,6 +105,30 @@ Conditions conditionsFactoryDijet(const std::vector<double>& etThresholds1,
   return conditions;
 }
 
+
+Conditions conditionsFactoryDijetMT(const std::vector<double>& massMins,
+                                    const std::vector<double>& massMaxs,
+                                    const std::vector<double>& detaMins,
+                                    const std::vector<double>& detaMaxs,
+                                    const std::vector<double>& dphiMins,
+                                    const std::vector<double>& dphiMaxs){  
+  Conditions conditions;
+  
+  for(std::size_t i = 0; i < massMins.size(); ++i){
+    std::shared_ptr<ICondition>
+      pCondition(new DijetMTCondition(massMins[i],
+                                      massMaxs[i],
+                                      detaMins[i],
+                                      detaMaxs[i],
+                                      dphiMins[i],
+                                      dphiMaxs[i]));
+    
+    conditions.push_back(ConditionBridge(pCondition));
+  }
+  return conditions;
+}
+
+
 Conditions conditionsFactoryDijetEtaMass(const std::vector<double>& etaMins,
                                          const std::vector<double>& etaMaxs,
                                          const std::vector<double>& etMins,
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
new file mode 100644
index 00000000000..4b169a56a5f
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
@@ -0,0 +1,62 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ********************************************************************
+//
+// NAME:     TrigJetAndToolMT.cxx
+// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+//
+//
+// ********************************************************************
+
+#include "TrigJetAndToolMT.h"
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "DecisionHandling/HLTIdentifier.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionContainer;
+
+TrigJetAndToolMT::TrigJetAndToolMT(const std::string& type,
+                                 const std::string& name,
+                                 const IInterface* parent) :
+  base_class(type, name, parent),
+  m_decisionId(HLT::Identifier::fromToolName(name)) {
+}
+
+
+TrigJetAndToolMT::~TrigJetAndToolMT(){
+}
+
+StatusCode TrigJetAndToolMT::initialize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetAndToolMT::finalize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetAndToolMT::decide(const xAOD::JetContainer* jets,
+                                           bool& pass) const {
+
+  m_lhs->decide(jets, pass);
+  if (pass){
+    ATH_MSG_DEBUG("LHS passed");
+    m_rhs->decide(jets, pass);
+    ATH_MSG_DEBUG("RHS " <<std::boolalpha << pass);
+  } else {
+    ATH_MSG_DEBUG("LHS failed");
+  }    
+
+
+  return StatusCode::SUCCESS;
+}
+
+
+const HLT::Identifier& TrigJetAndToolMT::getId() const{
+  return m_decisionId;
+} 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
new file mode 100644
index 00000000000..f2140fc2a75
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGJETANDTOOLMT_H
+#define TRIGJETANDTOOLMT_H
+/********************************************************************
+ *
+ * NAME:     TrigJetAndToolMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ *
+ *********************************************************************/
+
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "DecisionHandling/HLTIdentifier.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "AthenaMonitoring/GenericMonitoringTool.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+
+#include "ITrigJetHypoToolMT.h"
+#include "ITrigJetHypoToolConfig.h"
+
+class TrigJetAndToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
+
+ public:
+  
+  TrigJetAndToolMT(const std::string& type,
+                    const std::string& name,
+                    const IInterface* parent);
+  virtual ~TrigJetAndToolMT();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  // ITrigJetHypoToolMT interface
+  virtual StatusCode
+    decide(const xAOD::JetContainer*, bool& pass) const override;
+  virtual const HLT::Identifier& getId() const override; 
+ private:
+
+  // Identifier is used to keep track of which tool made which decision.
+  // The information is stored in the event store.
+  HLT::Identifier m_decisionId;  
+  
+  ToolHandle<ITrigJetHypoToolMT> m_lhs {
+    this, "lhs", {}, "LHS boolean binary expression"}; 
+  ToolHandle<ITrigJetHypoToolMT> m_rhs {
+    this, "rhs", {}, "RHS boolean binary expression"}; 
+
+ 
+ // Monitored variables...
+ /*
+  declareMonitoredVariable("NJet", m_njet);
+  declareMonitoredVariable("Et", m_et);
+  declareMonitoredVariable("Eta", m_eta);
+  declareMonitoredVariable("Phi", m_phi);
+*/
+
+
+};
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
new file mode 100644
index 00000000000..c079a5328ca
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
@@ -0,0 +1,94 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+/*
+  Instatniation of JetHypo components for  the DiMass scenario
+ */
+#include "TrigJetHypoToolConfig_dijet.h"
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsSorter.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CombinationsGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/groupsMatcherFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
+
+#include "DecisionHandling/TrigCompositeUtils.h"
+
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionContainer;
+
+TrigJetHypoToolConfig_dijet::TrigJetHypoToolConfig_dijet(const std::string& type,
+                                                 const std::string& name,
+                                                 const IInterface* parent) :
+  base_class(type, name, parent){
+
+}
+
+
+TrigJetHypoToolConfig_dijet::~TrigJetHypoToolConfig_dijet(){
+}
+
+StatusCode TrigJetHypoToolConfig_dijet::initialize() {
+  CHECK(checkVals());
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+Conditions TrigJetHypoToolConfig_dijet::getConditions() const {
+  auto conditions = conditionsFactoryDijetMT(m_massMins,
+                                             m_massMaxs,
+                                             m_dEtaMins,
+                                             m_dEtaMaxs,
+                                             m_dPhiMins,
+                                             m_dPhiMaxs);
+ 
+  std::sort(conditions.begin(), conditions.end(), ConditionsSorter());
+  
+  return conditions;
+}
+
+ 
+std::unique_ptr<IJetGrouper> TrigJetHypoToolConfig_dijet::getJetGrouper() const {
+  return std::make_unique<CombinationsGrouper>(2);
+}
+
+StatusCode TrigJetHypoToolConfig_dijet::checkVals() const {
+  // check cionsistent sizes
+
+  auto sz = m_massMins.size();
+  if (sz != m_massMaxs.size() or
+      sz != m_dEtaMins.size() or
+      sz != m_dEtaMaxs.size() or
+      sz != m_dPhiMins.size() or
+      sz != m_dPhiMaxs.size()){
+    ATH_MSG_ERROR(name()
+                  << ": mismatch between number of thresholds "
+                  << "and min, max fro mass, dEta, dPhi "
+                  << m_massMins.size() << " "
+                  << m_massMaxs.size() << " "
+                  << m_dEtaMins.size() << " "
+                  << m_dEtaMaxs.size() << " "
+                  << m_dPhiMins.size() << " "
+                  << m_dPhiMaxs.size() << " ");
+    
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
+}
+
+std::vector<std::shared_ptr<ICleaner>> 
+TrigJetHypoToolConfig_dijet::getCleaners() const {
+  std::vector<std::shared_ptr<ICleaner>> v;
+  return v;
+}
+
+
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
new file mode 100644
index 00000000000..0f47ee6b7ca
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
@@ -0,0 +1,76 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGJETHYPOTOOLConfig_DIJET_H
+#define TRIGJETHYPOTOOLConfig_DIJET_H
+/********************************************************************
+ *
+ * NAME:     TrigJetHypoToolConfig_dijetTool.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ *
+ *********************************************************************/
+
+
+#include "ITrigJetHypoToolConfig.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "DecisionHandling/HLTIdentifier.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "AthenaMonitoring/GenericMonitoringTool.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+
+class TrigJetHypoToolConfig_dijet:
+public extends<AthAlgTool, ITrigJetHypoToolConfig> {
+
+ public:
+  
+  TrigJetHypoToolConfig_dijet(const std::string& type,
+                          const std::string& name,
+                          const IInterface* parent);
+  virtual ~TrigJetHypoToolConfig_dijet();
+
+  virtual StatusCode initialize() override;
+  virtual std::vector<std::shared_ptr<ICleaner>> getCleaners() const override;
+  virtual std::unique_ptr<IJetGrouper> getJetGrouper() const override;
+  virtual Conditions getConditions() const override;
+
+ private:
+
+  Gaudi::Property<std::vector<double>>
+    m_massMins{this, "mass_mins", {}, "min mass for each dijet"};
+
+  Gaudi::Property<std::vector<double>>
+    m_massMaxs{this, "mass_maxs", {}, "max mass for each dijet"};
+
+  Gaudi::Property<std::vector<double>>
+    m_dEtaMins{this, "deta_mins", {}, "min dEta for jets in each dijet"};
+
+  Gaudi::Property<std::vector<double>>
+    m_dEtaMaxs{this, "deta_maxs", {}, "max dEta for jets in each dijet"};
+
+  Gaudi::Property<std::vector<double>>
+    m_dPhiMins{this, "dphi_mins", {}, "min dPhi for jets in each dijet"};
+
+  Gaudi::Property<std::vector<double>>
+    m_dPhiMaxs{this, "dphi_maxs", {}, "max dPhi for jets in each dijet"};
+
+  virtual StatusCode checkVals()  const override;
+ 
+ // Monitored variables...
+ /*
+  declareMonitoredVariable("NJet", m_njet);
+  declareMonitoredVariable("Et", m_et);
+  declareMonitoredVariable("Eta", m_eta);
+  declareMonitoredVariable("Phi", m_phi);
+*/
+
+
+};
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
new file mode 100644
index 00000000000..9eaa545f00f
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
@@ -0,0 +1,92 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ********************************************************************
+//
+// NAME:     TrigJetHypoToolMT_simple.cxx
+// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+//
+//
+// ********************************************************************
+
+#include "TrigJetHypoToolConfig_simple.h"
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsSorter.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/SingleJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/groupsMatcherFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
+
+#include "DecisionHandling/TrigCompositeUtils.h"
+
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionContainer;
+
+TrigJetHypoToolConfig_simple::TrigJetHypoToolConfig_simple(const std::string& type,
+                                                 const std::string& name,
+                                                 const IInterface* parent) :
+  base_class(type, name, parent){
+
+}
+
+
+TrigJetHypoToolConfig_simple::~TrigJetHypoToolConfig_simple(){
+}
+
+StatusCode TrigJetHypoToolConfig_simple::initialize() {
+  CHECK(checkVals());
+  return StatusCode::SUCCESS;
+}
+
+
+
+
+Conditions TrigJetHypoToolConfig_simple::getConditions() const {
+  auto conditions = conditionsFactoryEtaEt(m_etaMins,
+                                           m_etaMaxs,
+                                           m_EtThresholds,
+                                           m_asymmetricEtas);
+  std::sort(conditions.begin(), conditions.end(), ConditionsSorter());
+  
+  return conditions;
+}
+
+ 
+std::unique_ptr<IJetGrouper>
+TrigJetHypoToolConfig_simple::getJetGrouper() const {
+  return std::make_unique<SingleJetGrouper>();
+}
+
+StatusCode TrigJetHypoToolConfig_simple::checkVals() const {
+  if (m_EtThresholds.size() != m_etaMins.size() or
+      m_EtThresholds.size() != m_etaMaxs.size() or
+      m_asymmetricEtas.size() != m_etaMaxs.size()){
+    
+    ATH_MSG_ERROR(name()
+                  << ": mismatch between number of thresholds "
+                  << "and eta min, max boundaries or asymmetric eta flags: "
+                  << m_EtThresholds.size() << " "
+                  << m_etaMins.size() << " "
+                  << m_etaMaxs.size() << " "
+                  << m_asymmetricEtas.size() << " "
+                  );
+    
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
+}
+
+std::vector<std::shared_ptr<ICleaner>> 
+TrigJetHypoToolConfig_simple::getCleaners() const {
+  std::vector<std::shared_ptr<ICleaner>> v;
+  return v;
+}
+
+
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
new file mode 100644
index 00000000000..6f8b04e489d
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
@@ -0,0 +1,71 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGJETHYPOTOOLConfig_SIMPLE_H
+#define TRIGJETHYPOTOOLConfig_SIMPLE_H
+/********************************************************************
+ *
+ * NAME:     TrigJetHypoToolConfig_simple.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ *
+ *********************************************************************/
+
+
+#include "ITrigJetHypoToolConfig.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "DecisionHandling/HLTIdentifier.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "AthenaMonitoring/GenericMonitoringTool.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+
+class TrigJetHypoToolConfig_simple:
+public extends<AthAlgTool, ITrigJetHypoToolConfig> {
+
+ public:
+  
+  TrigJetHypoToolConfig_simple(const std::string& type,
+                          const std::string& name,
+                          const IInterface* parent);
+  virtual ~TrigJetHypoToolConfig_simple();
+
+  virtual StatusCode initialize() override;
+  virtual std::vector<std::shared_ptr<ICleaner>> getCleaners() const override;
+  virtual std::unique_ptr<IJetGrouper> getJetGrouper() const override;
+  virtual Conditions getConditions() const override;
+
+ private:
+  
+  Gaudi::Property<std::vector<double>>
+    m_EtThresholds{this, "EtThresholds", {}, "Etthresholds by eta region"};
+  
+  Gaudi::Property<std::vector<double>>
+    m_etaMins{this, "eta_mins", {}, "Eta min for eta regions"};
+  
+  Gaudi::Property<std::vector<double>>
+    m_etaMaxs{this, "eta_maxs", {}, "Eta max for eta regions"};
+
+  Gaudi::Property<std::vector<int>>
+    m_asymmetricEtas{this, "asymmetricEtas", {}, "Apply asym. eta cuts"};
+
+
+  virtual StatusCode checkVals()  const override;
+ 
+ // Monitored variables...
+ /*
+  declareMonitoredVariable("NJet", m_njet);
+  declareMonitoredVariable("Et", m_et);
+  declareMonitoredVariable("Eta", m_eta);
+  declareMonitoredVariable("Phi", m_phi);
+*/
+
+
+};
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
index 4faa51b87fb..90fcef39694 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
@@ -71,7 +71,7 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
                                       std::move(matcher));
 
   /* apply cleaning and hypothesis alg */
-  ATH_MSG_DEBUG("hypo helper start... " << m_chainName
+  ATH_MSG_DEBUG("hypo helper start... "
                 << " no of jets ... " 
                 << jets->size() 
                 << "...");
@@ -88,7 +88,7 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
 
   // accumulateTime(steady_clock::now() - t);
   
-  ATH_MSG_DEBUG("hypo testing done chain  " << m_chainName
+  ATH_MSG_DEBUG("hypo testing done chain  "
                 << " no of input jets " << jets->size()
                 << " pass " << pass );
   
@@ -144,12 +144,12 @@ void TrigJetHypoToolMT::writeDebug(bool pass,
                                        const HypoJetVector& passedJets,
                                        const HypoJetVector& failedJets
                                        ) const{
-  ATH_MSG_INFO("Writing debug start" << m_chainName << "...");
+  ATH_MSG_INFO("Writing debug start...");
   
   if(pass){
-    ATH_MSG_DEBUG(m_chainName<< " event passed");
+    ATH_MSG_DEBUG(" event passed");
   } else {
-    ATH_MSG_DEBUG(m_chainName<< " event failed");
+    ATH_MSG_DEBUG(" event failed");
   }
 
   for (auto j :  passedJets) {
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
index 0b9fac33e1e..0e3744f582b 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
@@ -53,7 +53,7 @@ class TrigJetHypoToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
   // Paraphanalia needed for the Jet Hypo Helper class:
   Conditions m_conditions;
 
-  bool m_dumpJets{false};
+  Gaudi::Property<bool> m_dumpJets{this, "dumpJets", {}, "verbose jet dump flag"};
   
   void setCleaners();
  
@@ -152,9 +152,6 @@ class TrigJetHypoToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
  Gaudi::Property<float>
    m_avLarQFLlpThreshold{this, "AverageLArQFLlpThreshold", 0.8*65535, ""};
 
- Gaudi::Property<std::string>
-   m_chainName{this, "chain_name", {}, "chain name (dbg)"};
-  
  Gaudi::Property<bool>
    m_acceptAll{this, "AcceptAll", false, "flag to turn of hypo"};
  
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
new file mode 100644
index 00000000000..2ec75ba2f8c
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
@@ -0,0 +1,63 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ********************************************************************
+//
+// NAME:     TrigJetNotToolMT.cxx
+// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+//
+//
+// ********************************************************************
+
+#include "TrigJetNotToolMT.h"
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "DecisionHandling/HLTIdentifier.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionContainer;
+
+TrigJetNotToolMT::TrigJetNotToolMT(const std::string& type,
+                                 const std::string& name,
+                                 const IInterface* parent) :
+  base_class(type, name, parent),
+  m_decisionId(HLT::Identifier::fromToolName(name)) {
+}
+
+
+TrigJetNotToolMT::~TrigJetNotToolMT(){
+}
+
+StatusCode TrigJetNotToolMT::initialize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetNotToolMT::finalize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetNotToolMT::decide(const xAOD::JetContainer* jets,
+                                           bool& pass) const {
+
+  m_hypoTool->decide(jets, pass);
+
+  if(pass){
+    ATH_MSG_DEBUG("hypoTool passed");
+  } else {
+    ATH_MSG_DEBUG("hypoTool failed");
+  }
+
+  pass = !pass;
+
+  return StatusCode::SUCCESS;
+}
+
+
+const HLT::Identifier& TrigJetNotToolMT::getId() const{
+  return m_decisionId;
+} 
+ 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
new file mode 100644
index 00000000000..05504bb5184
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
@@ -0,0 +1,66 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collabnotation
+*/
+
+#ifndef TRIGJETNOTTOOLMT_H
+#define TRIGJETNOTTOOLMT_H
+/********************************************************************
+ *
+ * NAME:     TrigJetNotToolMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ *
+ *********************************************************************/
+
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "DecisionHandling/HLTIdentifier.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "AthenaMonitoring/GenericMonitoringTool.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+
+#include "ITrigJetHypoToolMT.h"
+#include "ITrigJetHypoToolConfig.h"
+
+class TrigJetNotToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
+
+ public:
+  
+  TrigJetNotToolMT(const std::string& type,
+                    const std::string& name,
+                    const IInterface* parent);
+  virtual ~TrigJetNotToolMT();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  // ITrigJetHypoToolMT interface
+  virtual StatusCode
+    decide(const xAOD::JetContainer*, bool& pass) const override;
+  virtual const HLT::Identifier& getId() const override; 
+ private:
+
+  // Identifier is used to keep track of which tool made which decision.
+  // The information is stored in the event store.
+  HLT::Identifier m_decisionId;  
+  
+  ToolHandle<ITrigJetHypoToolMT> m_hypoTool {
+    this, "hypoTool", {}, "predicate to be inverted"};
+
+ 
+ // Monitored variables...
+ /*
+  declareMonitoredVariable("NJet", m_njet);
+  declareMonitoredVariable("Et", m_et);
+  declareMonitoredVariable("Eta", m_eta);
+  declareMonitoredVariable("Phi", m_phi);
+*/
+
+
+};
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
new file mode 100644
index 00000000000..80846e55aea
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
@@ -0,0 +1,60 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ********************************************************************
+//
+// NAME:     TrigJetOrToolMT.cxx
+// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+//
+//
+// ********************************************************************
+
+#include "TrigJetOrToolMT.h"
+
+#include "GaudiKernel/StatusCode.h"
+
+#include "DecisionHandling/HLTIdentifier.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+
+using TrigCompositeUtils::DecisionID;
+using TrigCompositeUtils::Decision;
+using TrigCompositeUtils::DecisionContainer;
+
+TrigJetOrToolMT::TrigJetOrToolMT(const std::string& type,
+                                 const std::string& name,
+                                 const IInterface* parent) :
+  base_class(type, name, parent),
+  m_decisionId(HLT::Identifier::fromToolName(name)) {
+}
+
+
+TrigJetOrToolMT::~TrigJetOrToolMT(){
+}
+
+StatusCode TrigJetOrToolMT::initialize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetOrToolMT::finalize(){
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrigJetOrToolMT::decide(const xAOD::JetContainer* jets,
+                                           bool& pass) const {
+
+  m_lhs->decide(jets, pass);
+  if (not pass){
+    m_rhs->decide(jets, pass);
+    ATH_MSG_DEBUG("LHS failed " << " RHS " <<std::boolalpha << pass);
+  } else {
+    ATH_MSG_DEBUG("LHS passed");
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
+const HLT::Identifier& TrigJetOrToolMT::getId() const{
+  return m_decisionId;
+} 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h
new file mode 100644
index 00000000000..3af3941dc69
--- /dev/null
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h
@@ -0,0 +1,68 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGJETORTOOLMT_H
+#define TRIGJETORTOOLMT_H
+/********************************************************************
+ *
+ * NAME:     TrigJetOrToolMT.h
+ * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
+ *
+ *
+ *********************************************************************/
+
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "DecisionHandling/HLTIdentifier.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "AthenaMonitoring/GenericMonitoringTool.h"
+
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
+#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
+
+#include "ITrigJetHypoToolMT.h"
+#include "ITrigJetHypoToolConfig.h"
+
+class TrigJetOrToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
+
+ public:
+  
+  TrigJetOrToolMT(const std::string& type,
+                    const std::string& name,
+                    const IInterface* parent);
+  virtual ~TrigJetOrToolMT();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  // ITrigJetOrToolMT interface
+  virtual StatusCode
+    decide(const xAOD::JetContainer*, bool& pass) const override;
+  virtual const HLT::Identifier& getId() const override; 
+ private:
+
+  // Identifier is used to keep track of which tool made which decision.
+  // The information is stored in the event store.
+  HLT::Identifier m_decisionId;  
+  
+  ToolHandle<ITrigJetHypoToolMT> m_lhs {
+    this, "lhs", {}, "LHS boolean binary expression"}; 
+  ToolHandle<ITrigJetHypoToolMT> m_rhs {
+    this, "rhs", {}, "RHS boolean binary expression"}; 
+
+ 
+ // Monitored variables...
+ /*
+  declareMonitoredVariable("NJet", m_njet);
+  declareMonitoredVariable("Et", m_et);
+  declareMonitoredVariable("Eta", m_eta);
+  declareMonitoredVariable("Phi", m_phi);
+*/
+
+
+};
+#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
index 6b4ad114a9a..014d7bb1b88 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
@@ -10,6 +10,11 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypo_SMC.h"
 #include "../TrigJetHypoAlgMT.h"
 #include "../TrigJetHypoToolConfig_EtaEt.h"
+#include "../TrigJetHypoToolConfig_simple.h"
+#include "../TrigJetHypoToolConfig_dijet.h"
+#include "../TrigJetNotToolMT.h"
+#include "../TrigJetAndToolMT.h"
+#include "../TrigJetOrToolMT.h"
 #include "../TrigJetHypoToolMT.h"
 
 DECLARE_COMPONENT( TrigHLTJetHypo2 )
@@ -19,7 +24,12 @@ DECLARE_COMPONENT( TrigEFDPhiMetJetAllTE )
 DECLARE_COMPONENT( TrigHLTJetHypo_Dijet )
 DECLARE_COMPONENT( TrigHLTJetHypo_DijetMassDEta )
 DECLARE_COMPONENT( TrigHLTJetHypo_DijetMassDEtaDPhi )
-DECLARE_COMPONENT( TrigHLTJetHypo_EtaEt )
+DECLARE_COMPONENT( TrigJetHypoToolConfig_EtaEt )
+DECLARE_COMPONENT( TrigJetHypoToolConfig_simple )
+DECLARE_COMPONENT( TrigJetHypoToolConfig_dijet )
+DECLARE_COMPONENT( TrigJetNotToolMT)
+DECLARE_COMPONENT( TrigJetAndToolMT)
+DECLARE_COMPONENT( TrigJetOrToolMT)
 DECLARE_COMPONENT( TrigHLTJetHypo_SMC )
 DECLARE_COMPONENT( TrigHLTJetHypo_HT )
 DECLARE_COMPONENT( TrigHLTJetHypo_TLA )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
index 9393ed844a8..934c2ca704f 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
@@ -7,8 +7,6 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 from AthenaCommon.Constants import VERBOSE,DEBUG,INFO
 from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq
 
-
-
 ## def jetFSInputMaker( ):
 ##   """ Creates the jet inputMaker for FS"""
 ##   RoIs = jetCollections.L1RoIs
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
index 9e36ab4f49b..00344d62048 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
@@ -119,7 +119,7 @@ if (doJet):
     
     jetChains  = [
         Chain(name='HLT_j85',  Seed="L1_J20",  ChainSteps=[jetstep1]  ),
-        Chain(name='HLT_j100', Seed="L1_J20",  ChainSteps=[jetstep1]  )
+        Chain(name='HLT_j45', Seed="L1_J20",  ChainSteps=[jetstep1] )  
         ]
     testChains += jetChains
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
index f235b86abb8..c3ef3fd3315 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
@@ -1,23 +1,20 @@
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j45 ID#3664574289
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -33,12 +30,10 @@ TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e7_etcut ID#243
 TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -100,12 +95,11 @@ TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e7_etcut ID#243
 TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     9   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j45 ID#3664574289
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -129,12 +123,10 @@ TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_g5_etcut ID#140
 TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -173,12 +165,11 @@ TriggerSummaryStep1                     18  0     DEBUG  +++ HLT_e3_etcut ID#271
 TriggerSummaryStep2                     18  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j45 ID#3664574289
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -199,10 +190,10 @@ TrigSignatureMoniMT                                INFO HLT_e7_etcut
 TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        205       
 TrigSignatureMoniMT                                INFO HLT_g5_etcut                  20        20        17        17        17        
 TrigSignatureMoniMT                                INFO HLT_g5_etcut decisions                            50        50        
-TrigSignatureMoniMT                                INFO HLT_j100                      20        20        6         0         6         
-TrigSignatureMoniMT                                INFO HLT_j100 decisions                                6         0         
-TrigSignatureMoniMT                                INFO HLT_j85                       20        20        6         0         6         
-TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 6         0         
+TrigSignatureMoniMT                                INFO HLT_j45                       20        20        3         0         3         
+TrigSignatureMoniMT                                INFO HLT_j45 decisions                                 3         0         
+TrigSignatureMoniMT                                INFO HLT_j85                       20        20        0         0         0         
+TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 0         0         
 TrigSignatureMoniMT                                INFO HLT_mu6                       20        20        3         0         3         
 TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         0         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb                   20        20        3         2         2         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
index 936f01378a6..668f87183b7 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
@@ -16,7 +16,7 @@ step1=ChainStep("Step1_jet", [jetSeq1])
 
 testChains  = [
     Chain(name='HLT_j85',  Seed="L1_J20",  ChainSteps=[step1]  ),
-    Chain(name='HLT_j100', Seed="L1_J20",  ChainSteps=[step1]  )
+    Chain(name='HLT_j45', Seed="L1_J20",  ChainSteps=[step1]  )
     ]
     
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
index ce932a38433..f9072a28f11 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
@@ -1,16 +1,7 @@
-TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j85 ID#3478728990
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j85 ID#3478728990
-TrigSignatureMoniMT                                INFO HLT_j100                      20        20        6         6         
-TrigSignatureMoniMT                                INFO HLT_j100 decisions                                6         
-TrigSignatureMoniMT                                INFO HLT_j85                       20        20        6         6         
-TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 6         
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j45 ID#3664574289
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j45 ID#3664574289
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j45 ID#3664574289
+TrigSignatureMoniMT                                INFO HLT_j45                       20        20        3         3         
+TrigSignatureMoniMT                                INFO HLT_j45 decisions                                 3         
+TrigSignatureMoniMT                                INFO HLT_j85                       20        20        0         0         
+TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 0         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
index e5fb55effd1..b4702163378 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
@@ -27,7 +27,10 @@ if TriggerFlags.doCalo:
 
 
     # menu items
-     CTPToChainMapping = {"HLT_j85":       "L1_J20"  , "HLT_j100" : "L1_J20" }
+     CTPToChainMapping = {
+       "HLT_j85":       "L1_J20"  ,
+       "HLT_j45" : "L1_J20"
+     }
      testChains =[x for x, y in CTPToChainMapping.items()]
      topSequence.L1DecoderTest.ChainToCTPMapping = CTPToChainMapping
      print testChains
@@ -67,13 +70,20 @@ if TriggerFlags.doCalo:
      (recoSequence, sequenceOut) = jetRecoSequence(inputRoIs)
 
      from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT
-     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromName
+     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict
      hypo = TrigJetHypoAlgMT("jethypo")
      hypo.OutputLevel = DEBUG
      hypo.Jets = sequenceOut
      hypo.HypoInputDecisions = hypoDecisions
      hypo.HypoOutputDecisions = "jetDecisions"
-     hypo.HypoTools = [ trigJetHypoToolFromName( c, c ) for c in testChains ] 
+     
+     def make_dict(chain_name):
+       from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
+       chainNameDecoder = DictFromChainName.DictFromChainName()
+       return chainNameDecoder.getChainDict(chain_name)
+       
+     hypo.HypoTools = [trigJetHypoToolFromDict(make_dict(c))
+                       for c in testChains] 
      print hypo
      for tool in hypo.HypoTools:
          print tool
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 1637d01b074..249691380e5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -126,7 +126,9 @@ JetChainParts = {
     'bTracking'    : [],
     'bConfig'      : ['split',],
     'bMatching'    : ['antimatchdr05mu'],
-    'trkopt'       : []
+    'trkopt'       : [],
+    'hypoScenario' : ['simple', 'vbenf'],
+    'smc'          : ['30smcINF', '35smcINF', '40smcINF', '50smcINF', '60smcINF', 'nosmc'],
 }
 
 # ---- Jet Dictinary of default Values ----
@@ -153,6 +155,8 @@ JetChainParts_Default = {
     'bMatching'    : [],
     'dataScouting' : '',
     'trkopt'       : 'notrk',
+    'hypoScenario' : 'simple',
+    'smc'          : 'nosmc',
     }
 
 #==========================================================
-- 
GitLab


From 3465119ff3097a3a13f0433b170cb6b2552070d9 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Thu, 7 Mar 2019 16:50:37 +0100
Subject: [PATCH 314/404] TrackCaloClusterRecValidation migrated to
 xAOD::EventInfo

Also moved all header files over to src. This is a component package
---
 .../CMakeLists.txt                            |  8 ++----
 .../src/CalibrationNtupleMakerTool.cxx        | 22 ++++++----------
 .../CalibrationNtupleMakerTool.h              |  6 ++++-
 .../src/TrackCaloClusterRecValidationTool.cxx | 25 +++++++------------
 .../TrackCaloClusterRecValidationTool.h       | 10 +++++---
 .../TrackCaloClusterRecValidation_entries.cxx |  4 +--
 6 files changed, 33 insertions(+), 42 deletions(-)
 rename Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/{TrackCaloClusterRecValidation => src}/CalibrationNtupleMakerTool.h (93%)
 rename Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/{TrackCaloClusterRecValidation => src}/TrackCaloClusterRecValidationTool.h (92%)

diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/CMakeLists.txt b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/CMakeLists.txt
index 879eba5ca63..036d10a7604 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/CMakeLists.txt
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/CMakeLists.txt
@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODTruth
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODPFlow
-                          Event/EventInfo
                           GaudiKernel
                           InnerDetector/InDetValidation/InDetPhysValMonitoring
                           Tracking/TrkValidation/TrkValHistUtils
@@ -45,10 +44,7 @@ atlas_add_component( TrackCaloClusterRecValidation
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}  ${EIGEN_INCLUDE_DIRS}
                      LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} 
                      AthenaBaseComps AthenaMonitoringLib xAODCore xAODTracking xAODTruth xAODPFlow GaudiKernel TrkValHistUtils InDetPhysValMonitoringLib
-                     AsgTools AthenaKernel GeoPrimitives EventPrimitives xAODBase xAODParticleEvent xAODEventInfo EventInfo xAODJet PathResolver)
+                     AsgTools AthenaKernel GeoPrimitives EventPrimitives xAODBase xAODParticleEvent xAODEventInfo xAODJet PathResolver)
 # Install files from the package:
-atlas_install_headers( TrackCaloClusterRecValidation )
-#atlas_install_python_modules( python/*.py )
-#atlas_install_runtime( share/*.hdef  share/*.xml  share/*.xsl} )
 atlas_install_runtime( share/*.xml  share/*.xsl )
-#atlas_install_runtime( test/TrackCaloClusterRecValidation_TestConfiguration.xml )
\ No newline at end of file
+
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.cxx
index b432633df7d..970fa1863c5 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.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,15 +7,9 @@
 // CalibrationNtupleMakerTool.cxx, (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
 
-#include "TrackCaloClusterRecValidation/CalibrationNtupleMakerTool.h"
+#include "CalibrationNtupleMakerTool.h"
 
 #include "xAODJet/JetContainer.h"
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEventInfo/EventAuxInfo.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventType.h"
-
 #include "xAODPFlow/TrackCaloClusterContainer.h"
 
 #include "xAODParticleEvent/IParticleLink.h"
@@ -89,6 +83,8 @@ StatusCode CalibrationNtupleMakerTool::initialize()
     return StatusCode::FAILURE;
   }
 
+  ATH_CHECK( m_evt.initialize() );
+
   return StatusCode::SUCCESS;
 }
 
@@ -165,14 +161,12 @@ StatusCode CalibrationNtupleMakerTool::execute()
 {
   m_h_events->Fill(0);
   
-  const EventInfo* info = nullptr;
-  if (evtStore()->retrieve(info).isFailure()){
+  SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
+  if(!evt.isValid()) {
     ATH_MSG_FATAL( "Unable to retrieve Event Info" );
-    return StatusCode::FAILURE;
   } 
+  float ev_weight = evt->mcEventWeight();
 
-  float ev_weight = info->event_type()->mc_event_weight();
-  
   const auto truths = getContainer<xAOD::JetContainer>(m_truthJetContainerName);  
   if (not truths) return StatusCode::FAILURE;
   
@@ -180,7 +174,7 @@ StatusCode CalibrationNtupleMakerTool::execute()
   if (not vertices) return StatusCode::FAILURE;
   
   // get mu
-  float mu= info->averageInteractionsPerCrossing();
+  float mu= evt->averageInteractionsPerCrossing();
   
   //get NPV
   float npv = 0.;
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/CalibrationNtupleMakerTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.h
similarity index 93%
rename from Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/CalibrationNtupleMakerTool.h
rename to Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.h
index 60418e47ef7..8fcc0509407 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/CalibrationNtupleMakerTool.h
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/CalibrationNtupleMakerTool.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 TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_CALIBRATIONNTUPLEMAKERTOOL_H
 #define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_CALIBRATIONNTUPLEMAKERTOOL_H
@@ -7,6 +7,8 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 
 #include "xAODJet/JetContainer.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODEventInfo/EventInfo.h"
 
 #include <vector>
 
@@ -87,6 +89,8 @@ private:
   std::vector < double >*                      m_eTrue;
   std::vector < double >*                      m_mTrue;
   
+  // EventInfo
+  SG::ReadHandleKey<xAOD::EventInfo>    m_evt  {this, "EvtInfo", "EventInfo", "EventInfo name"};
   
 };
 
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.cxx
index 482ead05926..8480da339ff 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.cxx
@@ -1,18 +1,10 @@
 /*
-  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 "TrackCaloClusterRecValidation/TrackCaloClusterRecValidationTool.h"
+#include "TrackCaloClusterRecValidationTool.h"
 //
 #include "xAODTruth/TruthParticle.h"
 #include "xAODJet/JetContainer.h"
-#include "xAODEventInfo/EventInfo.h"
-#include "xAODEventInfo/EventAuxInfo.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventType.h"
-#include "EventInfo/PileUpEventInfo.h"
-#include "EventInfo/PileUpTimeEventIndex.h"
 
 #include "xAODCaloEvent/CaloClusterContainer.h"
 #include "xAODCore/ShallowCopy.h"
@@ -26,7 +18,6 @@
 #include <algorithm>
 #include <limits>
 #include <cmath> // to get std::isnan(), std::abs etc.
-// #include <functional> // to get std::plus
 #include <utility>
 #include <cstdlib> // to getenv
 #include <vector>
@@ -129,17 +120,19 @@ TrackCaloClusterRecValidationTool::initialize() {
     }
   }
   
+  ATH_CHECK( m_evt.initialize() );
+
   return StatusCode::SUCCESS;
 }
 
 StatusCode
 TrackCaloClusterRecValidationTool::fillHistograms() {
-  
-  const EventInfo* info = nullptr;
-  if (evtStore()->retrieve(info).isFailure()){
+
+  SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
+  if(!evt.isValid()) {
     ATH_MSG_FATAL( "Unable to retrieve Event Info" );
   } 
-  float mcEventWeight = info->event_type()->mc_event_weight();
+  float mcEventWeight = evt->mcEventWeight();
   
   if (m_saveJetInfo) {
     ATH_MSG_DEBUG("Filling hists " << name() << "...");
@@ -474,4 +467,4 @@ const xAOD::JetContainer* TrackCaloClusterRecValidationTool::calibrateAndRecordS
   }
   
   return jetContainerShallowCopy; 
-}
\ No newline at end of file
+}
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/TrackCaloClusterRecValidationTool.h b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.h
similarity index 92%
rename from Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/TrackCaloClusterRecValidationTool.h
rename to Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.h
index f74b647bebd..7f6aa421375 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/TrackCaloClusterRecValidation/TrackCaloClusterRecValidationTool.h
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/TrackCaloClusterRecValidationTool.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 TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_TRACKCALOCLUSTERRECVALIDATIONTOOL_H
 #define TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_TRACKCALOCLUSTERRECVALIDATIONTOOL_H
@@ -23,7 +23,8 @@
 #include <vector>
 
 #include "xAODJet/JetContainer.h"
-#include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODEventInfo/EventInfo.h"
 
 class TCCPlots;
 class IJetCalibrationTool;
@@ -108,6 +109,9 @@ private:
     
     //histograms
     std::map<std::string, TCCPlots*>    m_tccPlots;
+
+    // EventInfo
+    SG::ReadHandleKey<xAOD::EventInfo>    m_evt  {this, "EvtInfo", "EventInfo", "EventInfo name"};
 };
 
 template<class T>
@@ -119,4 +123,4 @@ inline const T* TrackCaloClusterRecValidationTool::getContainer(const std::strin
   return ptr;
 }
 
-#endif //TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_TRACKCALOCLUSTERRECVALIDATIONTOOL_H
\ No newline at end of file
+#endif //TRACKCALOCLUSTERREC_TRACKCALOCLUSTERRECVALIDATION_TRACKCALOCLUSTERRECVALIDATIONTOOL_H
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/components/TrackCaloClusterRecValidation_entries.cxx b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/components/TrackCaloClusterRecValidation_entries.cxx
index b4fa76c4ece..0fe6cec787a 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/components/TrackCaloClusterRecValidation_entries.cxx
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecValidation/src/components/TrackCaloClusterRecValidation_entries.cxx
@@ -1,5 +1,5 @@
-#include "TrackCaloClusterRecValidation/TrackCaloClusterRecValidationTool.h"
-#include "TrackCaloClusterRecValidation/CalibrationNtupleMakerTool.h"
+#include "../TrackCaloClusterRecValidationTool.h"
+#include "../CalibrationNtupleMakerTool.h"
 
 DECLARE_COMPONENT( TrackCaloClusterRecValidationTool )
 DECLARE_COMPONENT( CalibrationNtupleMakerTool )
-- 
GitLab


From 62cf11bb2c2c9c91d094ce869d45828994aa852e Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 7 Mar 2019 16:51:53 +0100
Subject: [PATCH 315/404] Update ICscCalibTool to use DeclareInterfaceID syntax
 and CscCalibTool to use extends<...> syntax

---
 .../CscCalibTools/ICscCalibTool.h             | 162 ++++++++----------
 .../CscCalibTools/src/CscCalibTool.cxx        |  14 +-
 .../CscCalib/CscCalibTools/src/CscCalibTool.h | 127 +++++++-------
 3 files changed, 140 insertions(+), 163 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/CscCalibTools/ICscCalibTool.h b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/CscCalibTools/ICscCalibTool.h
index ac325341b24..410ef527bbb 100644
--- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/CscCalibTools/ICscCalibTool.h
+++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/CscCalibTools/ICscCalibTool.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 MUONCALIBTOOLS_ICSCCALIBTOOL
@@ -11,7 +11,7 @@
  Author  : Ketevi A. Assamagan
  Created : March 2005
 
- DESCRIPTION:	
+ DESCRIPTION:
      Abstract interface for run CSC calibration tools. Theses need the conditions
      data. The Tools to write and read the conditions data are elsewhere
 *********************************************************************************/
@@ -21,85 +21,83 @@
 
 #include <vector>
 
-static const InterfaceID IID_IICscCalibTool("ICscCalibTool", 1, 0);
-
 class ICscCalibTool : virtual public IAlgTool {
 
-   public:
-
-     static const InterfaceID& interfaceID();
-    
-     /** given a charge on the CSC strip, convert that to ADC counts 
-         this is needed in the digitization for example where it is the charges
-         on the strips that are simulated first and converter to AOD samples in
-         a subsequent step. */
-     virtual int femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const = 0; 
-
-     /** Here the charge on the CSC strip is given in number of equivalent electrons;
-         conversion to ADC counts */
-     virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const = 0;
-
-     /** given one CSC ADC sample value, convert that to charge in femtoCoulomb */
-     virtual double adcCountToFemtoCoulomb (const float adcValue, const float slope) const = 0;     
-     virtual double adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcValue) const = 0;     
-
-     /** given one CSC ADC sample value, convert that to charge in number of equivalent electrons */
-     virtual double adcCountToNumberOfElectrons (const float adcValue, const float slope) const = 0;     
-     virtual double adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const = 0;     
-
-     /** Conversion of ADC value to charge -
-          Here the charges is returned in numbers of equivalent electrons */
-     virtual bool adcToCharge(const std::vector<uint16_t>& samples, uint32_t stripHashId, 
-                                    std::vector<float>& charges) const = 0;
-
-     /** Given sampling values for a CSC strip, find the corresponding charge by fitting the time
-         samples. By default, a parabolic fit is done. The charge and the time are returned.
-         The time is calculated with respect to the time of the first sample */
-     virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase, 
-                             const std::vector<float>& samples, double & charge, double & time) const = 0;
-
-     /** return the noise (sigma) on the readout strip in ADC counts or Number of Electrons 
-         - number of electrons by default: convert=true */
-     virtual double stripNoise ( uint32_t stripHashId, const bool convert=true ) const = 0;
-
-     /** return the RMS on the readout strip in ADC counts or Number of Electrons 
-         - number of electrons by default: convert=true */
-     virtual double stripRMS ( uint32_t stripHashId, const bool convert=true ) const = 0;
-
-     /** return the F001 on the readout strip in ADC counts or Number of Electrons 
-         - number of electrons by default: convert=true */
-     virtual double stripF001 ( uint32_t stripHashId, const bool convert=true ) const = 0;
-
-     /** return the pedestal on the readout strip in ADC counts or Number of Electrons 
-         - in number of electrons by default: convert=true */
-     virtual double stripPedestal ( uint32_t stripHashId, const bool convert=true ) const = 0;
-
-     /** return the status of this strip, good channel, dead channel, noisy channel -  
-         it will return true for strip that working fine, false is returned for dead/noisy channels */
-     virtual bool isGood ( uint32_t stripHashId ) const = 0;
-     virtual int stripStatusBit ( uint32_t stripHashId ) const =0;
-
-     /** these function used in the AOD <-> conversion; may not be needed once we integrate the calibration
-         service */ 
-     virtual double func (const double x, const float slope) const = 0;     
-     virtual double func_prime (const double x, const float slope) const = 0;     
-
-     virtual double signal (const double z) const=0;     
-     virtual double signal_amplitude (const double driftTime, const double samplingTime) const=0;     
-     virtual double getZ0() const=0;
-     virtual double getSamplingTime() const=0;
-     virtual double getSignalWidth() const=0;
-     virtual double getTimeOffset() const=0;
-     virtual double getNumberOfIntegration() const=0;
-     virtual double getNumberOfIntegration2() const=0;
-
-     virtual bool stripT0phase ( uint32_t stripHashId ) const =0;
-     virtual double stripT0base ( uint32_t stripHashId ) const =0;
-
-  
-     virtual std::pair<double,double> addBipfunc(const double driftTime0, const double stripCharge0,
+public:
+
+  DeclareInterfaceID(ICscCalibTool, 1, 0);
+
+  /** given a charge on the CSC strip, convert that to ADC counts
+      this is needed in the digitization for example where it is the charges
+      on the strips that are simulated first and converter to AOD samples in
+      a subsequent step. */
+  virtual int femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const = 0;
+
+  /** Here the charge on the CSC strip is given in number of equivalent electrons;
+      conversion to ADC counts */
+  virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const = 0;
+
+  /** given one CSC ADC sample value, convert that to charge in femtoCoulomb */
+  virtual double adcCountToFemtoCoulomb (const float adcValue, const float slope) const = 0;
+  virtual double adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcValue) const = 0;
+
+  /** given one CSC ADC sample value, convert that to charge in number of equivalent electrons */
+  virtual double adcCountToNumberOfElectrons (const float adcValue, const float slope) const = 0;
+  virtual double adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const = 0;
+
+  /** Conversion of ADC value to charge -
+      Here the charges is returned in numbers of equivalent electrons */
+  virtual bool adcToCharge(const std::vector<uint16_t>& samples, uint32_t stripHashId,
+                           std::vector<float>& charges) const = 0;
+
+  /** Given sampling values for a CSC strip, find the corresponding charge by fitting the time
+      samples. By default, a parabolic fit is done. The charge and the time are returned.
+      The time is calculated with respect to the time of the first sample */
+  virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase,
+                          const std::vector<float>& samples, double & charge, double & time) const = 0;
+
+  /** return the noise (sigma) on the readout strip in ADC counts or Number of Electrons
+      - number of electrons by default: convert=true */
+  virtual double stripNoise ( uint32_t stripHashId, const bool convert=true ) const = 0;
+
+  /** return the RMS on the readout strip in ADC counts or Number of Electrons
+      - number of electrons by default: convert=true */
+  virtual double stripRMS ( uint32_t stripHashId, const bool convert=true ) const = 0;
+
+  /** return the F001 on the readout strip in ADC counts or Number of Electrons
+      - number of electrons by default: convert=true */
+  virtual double stripF001 ( uint32_t stripHashId, const bool convert=true ) const = 0;
+
+  /** return the pedestal on the readout strip in ADC counts or Number of Electrons
+      - in number of electrons by default: convert=true */
+  virtual double stripPedestal ( uint32_t stripHashId, const bool convert=true ) const = 0;
+
+  /** return the status of this strip, good channel, dead channel, noisy channel -
+      it will return true for strip that working fine, false is returned for dead/noisy channels */
+  virtual bool isGood ( uint32_t stripHashId ) const = 0;
+  virtual int stripStatusBit ( uint32_t stripHashId ) const =0;
+
+  /** these function used in the AOD <-> conversion; may not be needed once we integrate the calibration
+      service */
+  virtual double func (const double x, const float slope) const = 0;
+  virtual double func_prime (const double x, const float slope) const = 0;
+
+  virtual double signal (const double z) const=0;
+  virtual double signal_amplitude (const double driftTime, const double samplingTime) const=0;
+  virtual double getZ0() const=0;
+  virtual double getSamplingTime() const=0;
+  virtual double getSignalWidth() const=0;
+  virtual double getTimeOffset() const=0;
+  virtual double getNumberOfIntegration() const=0;
+  virtual double getNumberOfIntegration2() const=0;
+
+  virtual bool stripT0phase ( uint32_t stripHashId ) const =0;
+  virtual double stripT0base ( uint32_t stripHashId ) const =0;
+
+
+  virtual std::pair<double,double> addBipfunc(const double driftTime0, const double stripCharge0,
                                               const double driftTime1, const double stripCharge1) const =0;
-     virtual std::string getDetDescr() const =0;
+  virtual std::string getDetDescr() const =0;
 
   virtual std::vector<float> getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const =0;
   virtual double getLatency() const =0;
@@ -108,12 +106,4 @@ protected:
 
 };
 
-inline const InterfaceID& ICscCalibTool::interfaceID() { 
-   return IID_IICscCalibTool; 
-}
-
 #endif // MUONCALIBTOOLS_ICSCCALIBTOOL
-
-
-
-
diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx
index 8e83524fe0a..9caf26b6e67 100644
--- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx
+++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.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
 */
 
 /** Author: Ketevi A. Assamagan */
@@ -17,11 +17,9 @@ using std::setw;
 
 CscCalibTool::CscCalibTool
 ( const std::string& t, const std::string& n, const IInterface*  p )
-  : AthAlgTool(t,n,p),
+  : base_class(t,n,p),
     m_cscCoolStrSvc("MuonCalib::CscCoolStrSvc", n)
 {
-  declareInterface<ICscCalibTool>(this);
-  
   declareProperty( "Slope", m_slope = 0.19 );
   declareProperty( "Noise", m_noise = 3.5 );
   declareProperty( "Pedestal", m_pedestal = 2048.0 );
@@ -45,14 +43,6 @@ CscCalibTool::CscCalibTool
   declareProperty( "Use2Samples", m_use2Samples = false); // force 2 sample
 }
 
-CscCalibTool::~CscCalibTool() {}
-
-StatusCode CscCalibTool::finalize() {
-  return StatusCode::SUCCESS;
-}
-
-
-
 // ROOT USER Function
 Double_t bipfunc(const Double_t *x, const Double_t *par){
   if (x[0] < par[1]) return 0.;
diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h
index e3c46795db2..94db810e391 100644
--- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h
+++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h
@@ -11,8 +11,8 @@
  Author  : Ketevi A. Assamagan
  Created : March 2005
 
- DESCRIPTION:	
-     This class is the base class for run time CSC calibration tools. 
+ DESCRIPTION:
+     This class is the base class for run time CSC calibration tools.
      These calibration tools need theCSC conditions data. The conditions data
      are written and read with a different set of tools. The production of the
      conditions data can be done via ATHENA or standalone
@@ -30,88 +30,87 @@
 #include "TH1.h"
 
 
-class CscCalibTool : virtual public ICscCalibTool, public AthAlgTool {
+class CscCalibTool : public extends<AthAlgTool, ICscCalibTool> {
 
 public:
   CscCalibTool(const std::string&, const std::string&, const IInterface*);
-  virtual ~CscCalibTool ();
-  
-  virtual StatusCode initialize();
-  virtual StatusCode finalize  ();
-  
+  virtual ~CscCalibTool () = default;
+
+  virtual StatusCode initialize() override final;
+
   /** given a charge on the CSC strip, convert that to ADC counts
       this is needed in the digitization for example where it is the charges
       on the strips that are simulated first and converter to AOD samples in
       a subsequent step. */
-  virtual int femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const ;
-  
+  virtual int femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const override final;
+
   /** Here the charge on the CSC strip is given in number of equivalent electrons;
       conversion to ADC counts */
-  virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const ;
-  
-  /** given one CSC ADC sample value, convert that to charge in femtoCoulomb */ 
-  virtual double adcCountToFemtoCoulomb (const float adcCounts, const float slope) const ;     
-  virtual double adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcCounts) const;     
-  
+  virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const override final;
+
+  /** given one CSC ADC sample value, convert that to charge in femtoCoulomb */
+  virtual double adcCountToFemtoCoulomb (const float adcCounts, const float slope) const override final;
+  virtual double adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcCounts) const override final;
+
   /** given one CSC ADC sample value, convert that to charge in number of equivalent electrons */
-  virtual double adcCountToNumberOfElectrons (const float adcValue, const float slope) const;
-  virtual double adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const ;
-  
+  virtual double adcCountToNumberOfElectrons (const float adcValue, const float slope) const override final;
+  virtual double adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const override final;
+
   /** Conversion of ADC value to charge -
       Here the charges is returned in numbers of equivalent electrons */
   virtual bool adcToCharge(const std::vector<uint16_t>& samples, uint32_t stripHashId,
-                                 std::vector<float>& charges) const;
-  
+                                 std::vector<float>& charges) const override final;
+
   /** Given sampling values for a CSC strip, find the corresponding charge by fitting the time
       samples. By default, a parabolic fit is done. The charge and the time are returned.
       The time is calculated with respect to the time of the first sample. */
   virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase,
-                                const std::vector<float>& samples,double & charge, double & time) const;
-  
-  
-  /** return the noise(sigma) on the readout strip in ADC counts or Number of Electrons 
+                                const std::vector<float>& samples,double & charge, double & time) const override final;
+
+
+  /** return the noise(sigma) on the readout strip in ADC counts or Number of Electrons
       number of electrons by default: convert=true */
-  virtual double stripNoise ( uint32_t stripHashId, const bool convert=true ) const;
+  virtual double stripNoise ( uint32_t stripHashId, const bool convert=true ) const override final;
 
-  /** return the RMS on the readout strip in ADC counts or Number of Electrons 
+  /** return the RMS on the readout strip in ADC counts or Number of Electrons
       number of electrons by default: convert=true */
-  virtual double stripRMS ( uint32_t stripHashId, const bool convert=true ) const;
-  
-  /** return the F001 on the readout strip in ADC counts or Number of Electrons 
+  virtual double stripRMS ( uint32_t stripHashId, const bool convert=true ) const override final;
+
+  /** return the F001 on the readout strip in ADC counts or Number of Electrons
       number of electrons by default: convert=true */
-  virtual double stripF001 ( uint32_t stripHashId, const bool convert=true ) const;
-  
-  /** return the pedestal on the readout strip in ADC counts or Number of Electrons 
+  virtual double stripF001 ( uint32_t stripHashId, const bool convert=true ) const override final;
+
+  /** return the pedestal on the readout strip in ADC counts or Number of Electrons
       - number of electrons by default: convert=true */
-  virtual double stripPedestal ( uint32_t stripHashId, const bool convert=true ) const;
+  virtual double stripPedestal ( uint32_t stripHashId, const bool convert=true ) const override final;
 
-  /** return the status of this strip, good channel, dead channel, noisy channel -  
+  /** return the status of this strip, good channel, dead channel, noisy channel -
       it will return true for strip that working fine, false is returned for dead/noisy channels */
-  virtual bool isGood ( uint32_t stripHashId ) const;
+  virtual bool isGood ( uint32_t stripHashId ) const override final;
 
   /** return status bit **/
-  virtual int stripStatusBit ( uint32_t stripHashId ) const;
+  virtual int stripStatusBit ( uint32_t stripHashId ) const override final;
 
   /** return T0phase related to 5 ASM. For convenience, we use stripHashId to get it **/
-  virtual bool stripT0phase ( uint32_t stripHashId ) const ;
+  virtual bool stripT0phase ( uint32_t stripHashId ) const override final;
 
   /** return T0base related to 5 ASM. For convenience, we use stripHashId to get it **/
-  virtual double stripT0base ( uint32_t stripHashId ) const ;
+  virtual double stripT0base ( uint32_t stripHashId ) const override final;
 
-  /** these function used in the AOD <-> conversion; may not be needed once 
+  /** these function used in the AOD <-> conversion; may not be needed once
       we integrate the calibration service */
-  virtual double func (const double x, const float slope) const;     
-  virtual double func_prime (const double x, const float slope) const;     
-
-  virtual double signal (const double z) const;     
-  virtual double signal_amplitude (const double driftTime, const double samplingTime) const;     
-  virtual double getZ0() const;
-  
-  virtual double getSamplingTime() const;
-  virtual double getTimeOffset() const;
-  virtual double getSignalWidth() const;
-  virtual double getNumberOfIntegration() const;
-  virtual double getNumberOfIntegration2() const;
+  virtual double func (const double x, const float slope) const override final;
+  virtual double func_prime (const double x, const float slope) const override final;
+
+  virtual double signal (const double z) const override final;
+  virtual double signal_amplitude (const double driftTime, const double samplingTime) const override final;
+  virtual double getZ0() const override final;
+
+  virtual double getSamplingTime() const override final;
+  virtual double getTimeOffset() const override final;
+  virtual double getSignalWidth() const override final;
+  virtual double getNumberOfIntegration() const override final;
+  virtual double getNumberOfIntegration2() const override final;
 
   //  virtual Double_t bipfunc (const Double_t *x, const Double_t *par);
   //  virtual Double_t dualbipfunc (const Double_t *x, const Double_t *par);
@@ -119,12 +118,12 @@ public:
   // To add bipolar functions and extract drftTime and stripCharge after addition,
   // this function is defined. Return value is pair and the first one is driftTime.
   virtual std::pair<double,double> addBipfunc(const double driftTime0, const double stripCharge0,
-                                              const double driftTime1, const double stripCharge1) const;
-  virtual std::string getDetDescr() const;
+                                              const double driftTime1, const double stripCharge1) const override final;
+  virtual std::string getDetDescr() const override final;
 
   // 09/2010
-  virtual std::vector<float> getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const;
-  virtual double getLatency() const;
+  virtual std::vector<float> getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const override final;
+  virtual double getLatency() const override final;
 
 
   mutable int m_messageCnt_t0base;
@@ -138,15 +137,15 @@ public:
 
 private:
   float getPSlope(uint32_t stripHashId) const;
-  
-  
+
+
 protected:
-  
+
   ServiceHandle<MuonCalib::CscICoolStrSvc> m_cscCoolStrSvc;
 
   bool  m_readFromDatabase;
   bool  m_slopeFromDatabase;
- 
+
   float m_slope;
   float m_noise;
   float m_pedestal;
@@ -165,16 +164,14 @@ protected:
 
   float m_latency; // new in 2010....latency may be controlled in CscCalibTool.
   float m_latencyInDigitization; // new in 12/2010 for New Digitization package...
-  
-  unsigned int m_nSamples; 
+
+  unsigned int m_nSamples;
   mutable TF1* m_addedfunc;
   mutable TF1* m_bipolarFunc;
 
   bool m_onlineHLT;
   bool m_use2Samples; // for the use of only 2 samples for strip charge
-  
+
 };
 
 #endif
-
-
-- 
GitLab


From 9040144af1a54e08edf45a0f58c8728dc161549a Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 7 Mar 2019 16:53:36 +0100
Subject: [PATCH 316/404] Update ICSC_RDO_Decoder to use DeclareInterfaceID
 syntax and CscRDO_Decoder to use extends<...> syntax

---
 .../MuonCSC_CnvTools/ICSC_RDO_Decoder.h       | 15 ++++----
 .../MuonCSC_CnvTools/src/CscRDO_Decoder.cxx   | 10 ++----
 .../MuonCSC_CnvTools/src/CscRDO_Decoder.h     | 36 +++++++++----------
 3 files changed, 24 insertions(+), 37 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/MuonCSC_CnvTools/ICSC_RDO_Decoder.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/MuonCSC_CnvTools/ICSC_RDO_Decoder.h
index cc5e8668680..12c7102ccdf 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/MuonCSC_CnvTools/ICSC_RDO_Decoder.h
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/MuonCSC_CnvTools/ICSC_RDO_Decoder.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 MUONCSC_CNVTOOL_ICSC_RDO_Decoder_H
@@ -10,8 +10,6 @@
 class Identifier;
 class CscRawData;
 
-static const InterfaceID IID_ICSC_RDO_Decoder("Muon::ICSC_RDO_Decoder", 1, 0);
-
 namespace Muon {
 
 /** This class provides conversion from RDO data to CSC RDO
@@ -21,16 +19,15 @@ namespace Muon {
 
 class ICSC_RDO_Decoder : virtual public IAlgTool {
 
-public: 
-  static const InterfaceID& interfaceID( ) { return IID_ICSC_RDO_Decoder; };
-  
-  virtual void getDigit(const CscRawData * rawData, Identifier& moduleId, 
+public:
+  DeclareInterfaceID(ICSC_RDO_Decoder, 1, 0);
+
+  virtual void getDigit(const CscRawData * rawData, Identifier& moduleId,
                 Identifier& channelId, double& adc, double& time) const=0;
   virtual Identifier stationIdentifier(const CscRawData* rawData) const=0;
   virtual Identifier channelIdentifier(const CscRawData * rawData, int j) const=0;
-}; 
+};
 
 }
 
 #endif
-
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.cxx b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.cxx
index d536894fec7..15e2806e5d6 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.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 "CscRDO_Decoder.h"
@@ -10,20 +10,14 @@
 /** constructor */ 
 Muon::CscRDO_Decoder::CscRDO_Decoder
 ( const std::string& type, const std::string& name,const IInterface* parent )
-  :  AthAlgTool(type,name,parent),
+  :  base_class(type,name,parent),
      m_cscHelper(0),
      m_cabling( "CSCcablingSvc" ,name),
      m_cscCalibTool( "CscCalibTool") {
   
-  declareInterface<ICSC_RDO_Decoder>( this );
   declareProperty("CscCalibTool",        m_cscCalibTool );
 }
 
-/** destructor 
-*/ 
-Muon::CscRDO_Decoder::~CscRDO_Decoder() 
-{}
-
 StatusCode Muon::CscRDO_Decoder::initialize()
 {
   
diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.h b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.h
index 5b04a6f73f3..f27223083c3 100644
--- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.h
+++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/src/CscRDO_Decoder.h
@@ -1,11 +1,11 @@
 /*
-  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 MUONCSC_CNVTOOLS_CSCRDO_DECODER_H
 #define MUONCSC_CNVTOOLS_CSCRDO_DECODER_H
 
-#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h"        
+#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h"
 #include "CscCalibTools/ICscCalibTool.h"
 
 #include "AthenaBaseComps/AthAlgTool.h"
@@ -30,27 +30,26 @@ class CscRawData;
    * BNL January 24 2004
    */
 namespace Muon {
-  
-  class CscRDO_Decoder : virtual public ICSC_RDO_Decoder, public AthAlgTool {
-    
+
+  class CscRDO_Decoder : public extends<AthAlgTool, ICSC_RDO_Decoder> {
+
   public:
-    
-    /** constructor 
+
+    /** constructor
      */
     CscRDO_Decoder(const std::string& type, const std::string& name,
                    const IInterface* parent ) ;
-    
-    /** destructor 
+
+    /** destructor
      */
-    ~CscRDO_Decoder(); 
-    
-    virtual StatusCode initialize();
-    virtual StatusCode finalize() { return StatusCode::SUCCESS; }
+    virtual ~CscRDO_Decoder() = default;
 
-    void getDigit(const CscRawData * rawData, Identifier& moduleId, 
-                  Identifier& channelId, double& adc, double& time) const;
-    Identifier stationIdentifier(const CscRawData* rawData) const;
-    Identifier channelIdentifier(const CscRawData * rawData, int j) const;
+    virtual StatusCode initialize() override final;
+
+    virtual void getDigit(const CscRawData * rawData, Identifier& moduleId,
+                  Identifier& channelId, double& adc, double& time) const override final;
+    virtual Identifier stationIdentifier(const CscRawData* rawData) const override final;
+    virtual Identifier channelIdentifier(const CscRawData * rawData, int j) const override final;
 
   private:
     std::string m_detdescr;
@@ -68,6 +67,3 @@ namespace Muon {
 
 
 #endif  // MUONCSC_CNVTOOL_CSCRDO_DECODER_H
-
-
-
-- 
GitLab


From 2ae06d10ccf946d1d9b80e3690bf6e7d95d4e440 Mon Sep 17 00:00:00 2001
From: Rupert Tombs <rupert.tombs@cern.ch>
Date: Thu, 7 Mar 2019 16:58:16 +0100
Subject: [PATCH 317/404] Update CI reference files map

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index 09236596115..3cd71dc09aa 100644
--- a/Tools/PROCTools/python/RunTier0TestsTools.py
+++ b/Tools/PROCTools/python/RunTier0TestsTools.py
@@ -24,5 +24,5 @@ ciRefFileMap = {
                 's3126-22.0'           : 'v2',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v1',
-                'overlay-d1498-22.0'   : 'v9',
+                'overlay-d1498-22.0'   : 'v10',
                }
-- 
GitLab


From c4c82a6e63a69a3ccf136ed7f3b5559ac7439597 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 2 Mar 2019 06:32:54 +0100
Subject: [PATCH 318/404] TrigSteering: Comment out write to EventInfo.

---
 Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx
index 15de84eae0a..c298c238a60 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;
-- 
GitLab


From 60e16bdef80d19eda73b6298904c74f1ddf1f66a Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 5 Mar 2019 03:38:44 +0100
Subject: [PATCH 319/404] IsolationSelection: Comment out muon cuts on
 topoetcone20.

Comment out muon cuts on topoetcone20; not calculated by default any more?
---
 .../Root/IsolationSelectionTool.cxx                  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx b/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationSelectionTool.cxx
index c04e13ce217..f9e0fb8307d 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") {
-- 
GitLab


From 4d154a4c845153044423139860c8cb0199c9fc47 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 5 Mar 2019 03:48:36 +0100
Subject: [PATCH 320/404] PhysValMonitoring: Remove assignment to
 AthenaMonTools.

public/private tool mixup?
---
 .../PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/share/PhysValTrigEgamma_jobOptions.py
index e7d5cfca434..a9f349ee4e9 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]
-- 
GitLab


From 67e557a1cb045f56152b3690ac65cdcaee95ee9e Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 5 Mar 2019 03:55:12 +0100
Subject: [PATCH 321/404] TrigEgammaAnalysisTools: Copy supportingTriggerList
 from r21.

Copy supportingTriggerList from r21.
---
 .../python/TrigEgammaProbelist.py             | 37 ++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/python/TrigEgammaProbelist.py
index 7a86304b75c..c0e9cfe8cca 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',
+] )
+
+
+
+
+
-- 
GitLab


From 7d58f2bf40db0401028895044b7c08c9cc12ad55 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 5 Mar 2019 04:09:31 +0100
Subject: [PATCH 322/404] TrigEgammaMonitoring: ToolList type fixes.

---
 .../python/TrigEgammaMonitoringConfig.py          | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringConfig.py
index 4942cdbfce4..b103620c89b 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]
-- 
GitLab


From de659957c653d0c4346b979785e1db44bf59f427 Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Thu, 7 Mar 2019 18:21:16 +0100
Subject: [PATCH 323/404] Remove debugging line

---
 Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
index 403092985db..e2a04a79ef9 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
@@ -257,7 +257,6 @@ class AlgFactory(object):
             'output_collection_label': "'%s'" % (self.fex_params.fex_label),
             'rclus': self.fex_params.rclus,
             'ptfrac': self.fex_params.ptfrac,
-            'OutputLevel':1
         }
 
         return [Alg(factory, (), kwds)]
-- 
GitLab


From 525378fa1360bf387c9106ec432a754f6c7819d4 Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Thu, 7 Mar 2019 18:21:24 +0100
Subject: [PATCH 324/404] Some cleanup

---
 .../TrigHLTJetRec/python/TrigHLTJetRecConfig.py              | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index a93443634b7..f14020ea95c 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -36,7 +36,7 @@ jetFlags.debug = 4
 
 from JetRec.JetRecStandard import jtm
 from JetRec.JetRecCalibrationFinder import jrcf
-# Calibration Configurarion file (now defined in offline code)
+# Calibration Configurarion file (nokw defined in offline code)
 #cfg_file = "JES_Full2012dataset_Preliminary_Trigger_NoPileup.config"
 #jrcf.configDict["triggerNoPileup"] = cfg_file
 
@@ -1130,7 +1130,7 @@ class TrigHLTJetRecFromCluster(TrigHLTJetRecConf.TrigHLTJetRecFromCluster):
         #    'iIParticleSelectorAll') 
 
         iIParticleRejecter = _getNonPositiveEnergyRejectionTool(
-            'nonPositiveJetRjectionTool', OutputLevel=OutputLevel)
+            'nonPositiveEnergyRejectionTool', OutputLevel=OutputLevel)
         
         secondary_label = ''
         # FTK specific: do we want FTK? Set label to GhostTrack. 
@@ -1274,7 +1274,6 @@ 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)
 
-- 
GitLab


From e254b0f3f376ced5eab44bbbbbbcadb67acf4c7c Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Thu, 7 Mar 2019 18:37:57 +0100
Subject: [PATCH 325/404] Remove debug statements

---
 Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
index 64e16c3da73..afa60b0044d 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTSoftKiller.cxx
@@ -79,10 +79,8 @@ HLT::ErrorCode TrigHLTSoftKiller::hltExecute(const HLT::TriggerElement* inputTE,
     const xAOD::IParticleContainer* IP_inputclusters = dynamic_cast<const xAOD::IParticleContainer*> (inputclusters);
     skclustModSeqTool->setInputClusterCollection(IP_inputclusters);
     //skclustModSeqTool->setInputClusterCollection(inputclusters);
-    ATH_MSG_INFO("Input cluster container: " << inputclusters);
     int process_status = skclustModSeqTool->execute();
     const xAOD::CaloClusterContainer* outputclusters = dynamic_cast<const xAOD::CaloClusterContainer*>(skclustModSeqTool->getOutputClusterCollection()); 
-    ATH_MSG_INFO("Output cluster container after: " << outputclusters);
     
     if (process_status == 0)
     {
-- 
GitLab


From 6757eb87ca963311dace8662b05fd7bd13e203c2 Mon Sep 17 00:00:00 2001
From: Denis Oliveira Damazio <damazio@mail.cern.ch>
Date: Thu, 7 Mar 2019 11:04:27 +0100
Subject: [PATCH 326/404] Correcting RoI part of HLTCaloCellMaker and fixing
 bug in TrigCaloDataAccessSvc for empty Robrequests

---
 .../TrigCaloRec/src/HLTCaloCellMaker.cxx      | 76 +++++++++++++++++--
 .../src/TrigCaloDataAccessSvc.cxx             |  2 +-
 2 files changed, 72 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx
index 1be6d9bca70..0b7ca1ab7f0 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/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/TrigCaloDataAccessSvc.cxx
index dc37eb0868f..689fda41a0a 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
   }
 
-- 
GitLab


From f6e932c110f7f98c87c39be9804ab7af4c9d293c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 7 Mar 2019 16:17:18 +0100
Subject: [PATCH 327/404] PathResolver: Enable thread-safety checker.

Enable thread-safety static checker and fix identified issues.

Commented out the code that was disabling ROOT error messages around a download
attempt as that was fundamentally not thread-safe.  Needs changes in ROOT to make
it workable.
---
 Tools/PathResolver/CMakeLists.txt             |  1 +
 .../PathResolver/ATLAS_CHECK_THREAD_SAFETY    |  1 +
 .../PathResolver/PathResolver/PathResolver.h  |  7 ++--
 Tools/PathResolver/Root/PathResolver.cxx      | 32 +++++++++++--------
 4 files changed, 23 insertions(+), 18 deletions(-)
 create mode 100644 Tools/PathResolver/PathResolver/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Tools/PathResolver/CMakeLists.txt b/Tools/PathResolver/CMakeLists.txt
index cbe00bc7167..f4bb5b712e3 100644
--- a/Tools/PathResolver/CMakeLists.txt
+++ b/Tools/PathResolver/CMakeLists.txt
@@ -16,6 +16,7 @@ endif()
 atlas_depends_on_subdirs(
    PUBLIC
    Control/AthToolSupport/AsgTools
+   Control/CxxUtils
    PRIVATE
    ${extra_deps} )
 
diff --git a/Tools/PathResolver/PathResolver/ATLAS_CHECK_THREAD_SAFETY b/Tools/PathResolver/PathResolver/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..e8ea8184a2a
--- /dev/null
+++ b/Tools/PathResolver/PathResolver/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Tools/PathResolver
diff --git a/Tools/PathResolver/PathResolver/PathResolver.h b/Tools/PathResolver/PathResolver/PathResolver.h
index ecac7513fba..7989bcc0bb6 100644
--- a/Tools/PathResolver/PathResolver/PathResolver.h
+++ b/Tools/PathResolver/PathResolver/PathResolver.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 PATHRESOLVER_PATHRESOLVER_H
@@ -8,6 +8,7 @@
 #include "AsgTools/AsgMessaging.h"
 
 #include <string>
+#include <atomic>
 
 
 class PathResolver
@@ -113,9 +114,7 @@ public:
          std::string& result );
 
 
-       static bool m_setLevel; //flag to say if the msg level has been set. This is so we can default to info
-
-
+       static std::atomic<MSG::Level> m_level;
 
        static bool msgLvl( const MSG::Level lvl ) { return asgMsg().msgLvl(lvl); }
        static MsgStream& msg() { return asgMsg().msg(); }
diff --git a/Tools/PathResolver/Root/PathResolver.cxx b/Tools/PathResolver/Root/PathResolver.cxx
index e521f202acc..6ac69e79509 100644
--- a/Tools/PathResolver/Root/PathResolver.cxx
+++ b/Tools/PathResolver/Root/PathResolver.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 "PathResolver/PathResolver.h"
@@ -19,6 +19,7 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/filesystem.hpp>
+#include "CxxUtils/checker_macros.h"
 
 
 
@@ -30,14 +31,18 @@ namespace bf = boost::filesystem;
 using namespace std;
 
 
-static const char* path_separator = ",:";
-bool PathResolver::m_setLevel=false; 
+static const char* const path_separator = ",:";
+std::atomic<MSG::Level> PathResolver::m_level=MSG::INFO; 
 
 PathResolver::PathResolver() { }
 
 asg::AsgMessaging& PathResolver::asgMsg() {
-   if(!m_setLevel) setOutputLevel(MSG::INFO);
-   static asg::AsgMessaging asgMsg("PathResolver");
+#ifdef ASGTOOL_STANDALONE
+   static thread_local asg::AsgMessaging asgMsg("PathResolver");
+#else
+   static asg::AsgMessaging asgMsg ATLAS_THREAD_SAFE ("PathResolver");
+#endif
+   asgMsg.msg().setLevel (m_level);
    return asgMsg;
 }
 
@@ -56,8 +61,6 @@ PathResolver::PR_find( const std::string& logical_file_name, const string& searc
          PR_file_type file_type, PathResolver::SearchType search_type,
          string& result ) {
 
-   if(!m_setLevel) setOutputLevel(MSG::INFO);
-
    std::string trimmed_logical_file_name = logical_file_name;
    boost::algorithm::trim(trimmed_logical_file_name); //trim again for extra safety
 
@@ -113,18 +116,20 @@ PathResolver::PR_find( const std::string& logical_file_name, const string& searc
          }
       }
       std::string fileToDownload = addr + "/" + file.string();
-      //disable error output from root while attempting to download 
-      long errLevel = gErrorIgnoreLevel;
-      gErrorIgnoreLevel = kError+1;
+      //disable error output from root while attempting to download
+      // FIXME: Disabling errors now commented out because it is not
+      //        thread-safe.  Needs changes in ROOT.
+      //long errLevel = gErrorIgnoreLevel;
+      //gErrorIgnoreLevel = kError+1;
       if(!TFile::Cp(fileToDownload.c_str(),(locationToDownloadTo+"/"+file.string()).c_str())) {
          msg(MSG::DEBUG) <<"Unable to download file : " << fileToDownload << endmsg;
       } else {
          msg(MSG::INFO) <<"Successfully downloaded " << fileToDownload << endmsg;
          result = (locationToDownloadTo+"/"+file.string()).c_str();
-         gErrorIgnoreLevel=errLevel;
+         //gErrorIgnoreLevel=errLevel;
          return true;
       }
-      gErrorIgnoreLevel=errLevel;
+      //gErrorIgnoreLevel=errLevel;
    } else if(locationToDownloadTo=="." && itr->find("/afs/cern.ch/atlas/www/")==std::string::npos) { //don't let it ever download back to the www area!
       //prefer first non-pwd location for downloading to. But must be fully accessible. This should be the local InstallArea in cmt
      FILE *fp = std::fopen((*itr+"/._pathresolver_dummy").c_str(), "a+");
@@ -351,8 +356,7 @@ std::string PathResolver::find_calib_directory (const std::string& logical_file_
 }
 
 void PathResolver::setOutputLevel(MSG::Level level) {
-   m_setLevel=true;
-   asgMsg().msg().setLevel(level);
+   m_level = level;
 }
 
 
-- 
GitLab


From aaa089045f877425445105831e195e58f5e7f587 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 7 Mar 2019 16:27:35 +0100
Subject: [PATCH 328/404] CaloDetMgrDetDescrCnv: Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../CaloDetMgrDetDescrCnv/CaloCellVolumes.h          |  5 +++--
 .../CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx    | 12 +++++-------
 .../CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx |  4 ++--
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv/CaloCellVolumes.h b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv/CaloCellVolumes.h
index 1baa3124e40..a21145ebcd4 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv/CaloCellVolumes.h
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv/CaloCellVolumes.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 CALOCELLVOLUMES_H
@@ -31,7 +31,8 @@ class CaloCellVolumes
 public:
 
   // Constructors:
-  CaloCellVolumes(ISvcLocator* svcLocator);
+  CaloCellVolumes(ISvcLocator* svcLocator,
+                  const CaloCell_ID* calocell_id);
   virtual ~CaloCellVolumes();
 
   double CellVolume(Identifier cell_id);
diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx
index bf72afb45c0..e0ae16125cd 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx
@@ -1,11 +1,10 @@
 /*
-  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 "CaloDetMgrDetDescrCnv/CaloCellVolumes.h"
 
 #include "Identifier/Identifier.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 
 #include "GaudiKernel/ISvcLocator.h"
@@ -30,17 +29,16 @@ struct CaloCellVolume_Compare
 };
 
 
-CaloCellVolumes::CaloCellVolumes(ISvcLocator* svcLocator):
-  m_svcLocator(svcLocator)
+CaloCellVolumes::CaloCellVolumes(ISvcLocator* svcLocator,
+                                 const CaloCell_ID* calocell_id)
+  : m_calocell_id (calocell_id),
+    m_svcLocator(svcLocator)
 {
   // default values for tube spacings
   m_fcalTubeSpacings[1] = 7.5;
   m_fcalTubeSpacings[2] = 8.179;
   m_fcalTubeSpacings[3] = 9.;
 
-  // Get Id Helper
-  m_calocell_id = CaloIdManager::instance()->getCaloCell_ID();
-
   //Get pointers to the IGeoModelSvc and IRDBAccessSvc
   IGeoModelSvc* geoModelSvc = 0;
   IRDBAccessSvc* rdbAccessSvc = 0; 
diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx
index d556ce6f2e1..3687f86f0ec 100755
--- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx
+++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.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 "CaloDetMgrDetDescrCnv/CaloMgrDetDescrCnv.h"
@@ -134,7 +134,7 @@ StatusCode CaloMgrDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pOb
   // --- --- Create CaloDetDescrManager object --- ---
 
   // Cell volumes
-  CaloCellVolumes cellVol (serviceLocator());
+  CaloCellVolumes cellVol (serviceLocator(), cell_id);
 
   // geometry layout
   caloMgr->set_lar_geometry(cellVol.layout());
-- 
GitLab


From ec25c0c5270b78461bee43c08097183571f9746b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 7 Mar 2019 16:26:08 +0100
Subject: [PATCH 329/404] CaloDetDescr: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../CaloDetDescr/CaloSubdetNames.h            |  16 --
 .../CaloDetDescr/src/CaloAlignTool.cxx        |  13 +-
 .../CaloDetDescr/src/CaloSubdetNames.cxx      | 106 +--------
 .../CaloDetDescr/src/CaloSuperCellIDTool.cxx  | 201 ++++++++----------
 .../CaloDetDescr/src/CaloSuperCellIDTool.h    |   8 +-
 5 files changed, 101 insertions(+), 243 deletions(-)

diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSubdetNames.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSubdetNames.h
index 17627c341bc..bcc29bc32b4 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSubdetNames.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloSubdetNames.h
@@ -15,7 +15,6 @@
 #ifndef CALODETDESCR_CALOSUBDETNAMES_H
 # define CALODETDESCR_CALOSUBDETNAMES_H
 
-class CaloCell_ID;
 
 #include <vector>
 #include "Identifier/Identifier.h"
@@ -60,12 +59,6 @@ class CaloSubdetNames
    */  
   CaloSubdetNames::ALIGNVOL alignVolEnum(std::string reconame);
  
-  /** @brief Matching between the reconstruction region descriptors and names
-   */
-  std::string alignVolName(Identifier regId);
-  /** @brief Matching between the reconstruction region descriptors and enum 
-   */
-  CaloSubdetNames::ALIGNVOL alignVolEnum(Identifier regId);
 
  private:
   /** @brief match names and enum
@@ -78,15 +71,6 @@ class CaloSubdetNames
   /** @brief vector of ALIGNVOL enum values
    */ 
   std::vector <CaloSubdetNames::ALIGNVOL>  m_alvol;
-
-  /** @brief Matching between Readout reagions and ALIGNVOL : array indexed by calo-hash-id
-   */
-  std::vector <std::string>                    m_regReconame;
-
-  /** @brief Calo Cell ID helper
-   */
-  const CaloCell_ID* m_calocell_id;
-  
 };
 
 #endif // CALODETDESCR_CALOSUBDETNAMES_H
diff --git a/Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx b/Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx
index ba207dc6194..823e5c7429c 100755
--- a/Calorimeter/CaloDetDescr/src/CaloAlignTool.cxx
+++ b/Calorimeter/CaloDetDescr/src/CaloAlignTool.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 "CaloDetDescr/CaloAlignTool.h"
@@ -30,7 +30,6 @@
 #include "LArReadoutGeometry/FCALDetectorManager.h"
  
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 
 #include "CaloConditions/CaloCellPositionShift.h"
 
@@ -126,12 +125,10 @@ StatusCode CaloAlignTool::align(IOVSVC_CALLBACK_ARGS)
   else 
     log << MSG::DEBUG << "Successfully retrieved CaloCellPositionShift from the DetectorStore" << endmsg;
 
-  const CaloIdManager* caloId_mgr = caloMgr->getCalo_Mgr();
-
-  const CaloCell_ID* cell_id = caloId_mgr->getCaloCell_ID();
-  const LArEM_ID* em_id = caloId_mgr->getEM_ID();
-  const LArHEC_ID* hec_id = caloId_mgr->getHEC_ID();
-  const LArFCAL_ID* fcal_id = caloId_mgr->getFCAL_ID();
+  const CaloCell_ID* cell_id = caloMgr->getCaloCell_ID();
+  const LArEM_ID* em_id = cell_id->em_idHelper();
+  const LArHEC_ID* hec_id = cell_id->hec_idHelper();
+  const LArFCAL_ID* fcal_id = cell_id->fcal_idHelper();
 
   // Get minimal value for Hash ID - needed to retrieve sagging information
   IdentifierHash emmin,emmax;
diff --git a/Calorimeter/CaloDetDescr/src/CaloSubdetNames.cxx b/Calorimeter/CaloDetDescr/src/CaloSubdetNames.cxx
index 4595e0f1ea8..f1ac9a277f7 100755
--- a/Calorimeter/CaloDetDescr/src/CaloSubdetNames.cxx
+++ b/Calorimeter/CaloDetDescr/src/CaloSubdetNames.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,11 +9,6 @@
 
 //<<<<<< INCLUDES                                                       >>>>>>
 #include "CaloDetDescr/CaloSubdetNames.h"
-#include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
-
-#include <iostream>
-#include <iomanip>
 
 
 CaloSubdetNames::~CaloSubdetNames() 
@@ -21,8 +16,6 @@ CaloSubdetNames::~CaloSubdetNames()
 
 CaloSubdetNames::CaloSubdetNames() 
 {
-
-  m_calocell_id = CaloIdManager::instance()->getCaloCell_ID();
   match_names();
 }
 
@@ -32,87 +25,6 @@ CaloSubdetNames::match_names()
   int alignsize = (int) CaloSubdetNames::UNKNOWN;
   m_reconame.resize( alignsize, "unknown" );
   m_alvol.resize( alignsize, CaloSubdetNames::UNKNOWN);
-  int matchsize = (int) m_calocell_id->calo_region_hash_max();
-  m_regReconame.resize( matchsize, "unknown");
-
-  for (  unsigned int i=0; i < m_calocell_id->calo_region_hash_max(); i++ ) {
- 
-    Identifier regId = m_calocell_id->region_id (i);
-    int samp = m_calocell_id->sampling(regId);
-    //int region = m_calocell_id->region(regId);
-    int pos_neg = m_calocell_id->pos_neg(regId);
-    int barrel_ec = std::abs(pos_neg);
-
-    if ( m_calocell_id->is_em(regId) ) {
-      // EM
-
-      if ( barrel_ec == 1 )  {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "EMB_NEG";
-	else
-	  m_regReconame [i] = "EMB_POS";
-
-	if ( samp == 0) {
-	  if ( pos_neg < 0)
-	    m_regReconame [i] = "PRESAMPLER_B_NEG";
-	  else
-	    m_regReconame [i] = "PRESAMPLER_B_POS";
-	}
-      }
-      if ( barrel_ec == 2 || barrel_ec == 3 )  {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "EMEC_NEG";
-	else
-	  m_regReconame [i] = "EMEC_POS";
-	
-	if ( samp == 0) {
-	  if ( pos_neg < 0)
-	    m_regReconame [i] = "PRESAMPLER_EC_NEG";
-	  else
-	    m_regReconame [i] = "PRESAMPLER_EC_POS";
-	}
-      }
-
-    } else if ( m_calocell_id->is_hec(regId) ) {
-      // HEC
-
-      if  ( samp == 0 || samp == 1 ) {      
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "HEC1_NEG";
-	else 
-	  m_regReconame [i] = "HEC1_POS";
-      }
-
-      if  ( samp == 2 || samp == 3 ) {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "HEC2_NEG";
-	else 
-	  m_regReconame [i] = "HEC2_POS";
-      }
-
-    } else if ( m_calocell_id->is_fcal(regId) ) {
-      // FCAL
-
-      if  ( samp == 1 ) {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "FCAL1_NEG";
-	else
-	  m_regReconame [i] = "FCAL1_POS";
-      }
-      if  ( samp == 2 ) {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "FCAL2_NEG";
-	else
-	  m_regReconame [i] = "FCAL2_POS";
-      }
-      if  ( samp == 3 ) {
-	if ( pos_neg < 0)
-	  m_regReconame [i] = "FCAL3_NEG";
-	else
-	  m_regReconame [i] = "FCAL3_POS";
-      }
-    }
-  }
 
   m_alvol [ (int)CaloSubdetNames::LARCRYO_B ] = CaloSubdetNames::LARCRYO_B;
   m_reconame [ (int)CaloSubdetNames::LARCRYO_B ] = "LARCRYO_B";
@@ -183,19 +95,3 @@ CaloSubdetNames::alignVolEnum(std::string reconame)
   return CaloSubdetNames::UNKNOWN;
 }
 
-std::string 
-CaloSubdetNames::alignVolName (Identifier regId)
-{
-  return m_regReconame[ (int )m_calocell_id->calo_region_hash(regId) ];
-}
-
-CaloSubdetNames::ALIGNVOL  
-CaloSubdetNames::alignVolEnum(Identifier regId)
-{
-  std::string recnam = this->alignVolName(regId);
-
-  for ( unsigned int i=0; i<m_reconame.size(); i++ )
-    if ( m_reconame[i] == recnam ) return m_alvol[i];
-  return CaloSubdetNames::UNKNOWN;
-
-}
diff --git a/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.cxx b/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.cxx
index 263628c3cc8..a27ec942148 100644
--- a/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.cxx
+++ b/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.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
 */
 
 // $Id$
@@ -15,7 +15,6 @@
 #include "CaloIdentifier/CaloCell_Base_ID.h"
 #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloIdentifier/CaloIdManager.h"
 #include "AthenaKernel/errorcheck.h"
 #include "boost/format.hpp"
 
@@ -56,7 +55,8 @@ CaloSuperCellIDTool::CaloSuperCellIDTool (const std::string& type,
                                           const std::string& name,
                                           const IInterface* parent)
   : base_class (type, name, parent),
-    m_calo_id_manager (0)
+    m_cell_helper(nullptr),
+    m_sc_helper(nullptr)
 {
 }
 
@@ -67,7 +67,8 @@ CaloSuperCellIDTool::CaloSuperCellIDTool (const std::string& type,
 StatusCode CaloSuperCellIDTool::initialize()
 {
   CHECK( base_class::initialize() );
-  CHECK( detStore()->retrieve (m_calo_id_manager, "CaloIdManager") );
+  CHECK( detStore()->retrieve (m_cell_helper, "CaloCell_ID") );
+  CHECK( detStore()->retrieve (m_sc_helper, "CaloCell_SuperCell_ID") );
 
   initIDMap ();
 
@@ -80,33 +81,30 @@ StatusCode CaloSuperCellIDTool::initialize()
  */
 void CaloSuperCellIDTool::initIDMap ()
 {
-  const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-  const CaloCell_Base_ID* sc_helper = m_calo_id_manager->getCaloCell_SuperCell_ID();
-
   m_offlineIndex.clear();
   m_superCellIndex.clear();
   m_superCellIndexEnd.clear();
   m_idmap.clear();
 
   // One entry in the index tables for each region hash; -1 means no entry.
-  m_offlineIndex.resize (cell_helper->calo_region_hash_max(), -1);
-  m_superCellIndex.resize (sc_helper->calo_region_hash_max(), -1);
-  m_superCellIndexEnd.resize (sc_helper->calo_region_hash_max(), -1);
+  m_offlineIndex.resize (m_cell_helper->calo_region_hash_max(), -1);
+  m_superCellIndex.resize (m_sc_helper->calo_region_hash_max(), -1);
+  m_superCellIndexEnd.resize (m_sc_helper->calo_region_hash_max(), -1);
 
   // Loop over all offline regions.
-  for (const Identifier& cell_reg : cell_helper->reg_range()) {
-    if (cell_helper->is_em(cell_reg) ||
-        cell_helper->is_hec(cell_reg) ||
-        cell_helper->is_fcal(cell_reg))
+  for (const Identifier& cell_reg : m_cell_helper->reg_range()) {
+    if (m_cell_helper->is_em(cell_reg) ||
+        m_cell_helper->is_hec(cell_reg) ||
+        m_cell_helper->is_fcal(cell_reg))
     {
-      int sub_calo = cell_helper->sub_calo (cell_reg);
-      int pos_neg = cell_helper->pos_neg (cell_reg);
-      int sampling = cell_helper->sampling (cell_reg);
-      int cell_ietamin = cell_helper->eta_min (cell_reg); 
-      int cell_ietamax = cell_helper->eta_max (cell_reg);
-      float cell_etasize = cell_helper->etaGranularity(cell_reg);
-      float cell_phisize = cell_helper->phiGranularity(cell_reg);
-      float cell_etamin = cell_helper->eta0 (cell_reg);
+      int sub_calo = m_cell_helper->sub_calo (cell_reg);
+      int pos_neg = m_cell_helper->pos_neg (cell_reg);
+      int sampling = m_cell_helper->sampling (cell_reg);
+      int cell_ietamin = m_cell_helper->eta_min (cell_reg); 
+      int cell_ietamax = m_cell_helper->eta_max (cell_reg);
+      float cell_etasize = m_cell_helper->etaGranularity(cell_reg);
+      float cell_phisize = m_cell_helper->phiGranularity(cell_reg);
+      float cell_etamin = m_cell_helper->eta0 (cell_reg);
       float cell_etamax = cell_etamin +
         cell_etasize*(cell_ietamax - cell_ietamin + 1);
 
@@ -116,17 +114,17 @@ void CaloSuperCellIDTool::initIDMap ()
       // Find all overlapping supercell regions in the same sampling
       // and make table entries.  HEC supercells are summed
       // over samplings, so don't make sampling requirements there.
-      for (const Identifier& sc_reg : sc_helper->reg_range()) {
-        if (sc_helper->sub_calo (sc_reg) == sub_calo &&
-            sc_helper->pos_neg (sc_reg) == pos_neg &&
+      for (const Identifier& sc_reg : m_sc_helper->reg_range()) {
+        if (m_sc_helper->sub_calo (sc_reg) == sub_calo &&
+            m_sc_helper->pos_neg (sc_reg) == pos_neg &&
             (sub_calo == CaloCell_ID::LARHEC ||
-             sc_helper->sampling (sc_reg) == sampling))
+             m_sc_helper->sampling (sc_reg) == sampling))
         {
-          int sc_ietamin = sc_helper->eta_min (sc_reg);
-          int sc_ietamax = sc_helper->eta_max (sc_reg);
-          float sc_etasize = sc_helper->etaGranularity(sc_reg);
-          float sc_phisize = sc_helper->phiGranularity(sc_reg);
-          float sc_etamin = sc_helper->eta0 (sc_reg);
+          int sc_ietamin = m_sc_helper->eta_min (sc_reg);
+          int sc_ietamax = m_sc_helper->eta_max (sc_reg);
+          float sc_etasize = m_sc_helper->etaGranularity(sc_reg);
+          float sc_phisize = m_sc_helper->phiGranularity(sc_reg);
+          float sc_etamin = m_sc_helper->eta0 (sc_reg);
           float sc_etamax= sc_etamin + sc_etasize*(sc_ietamax - sc_ietamin + 1);
 
           // Find the overlap between the offline and supercell regions.
@@ -136,8 +134,8 @@ void CaloSuperCellIDTool::initIDMap ()
           if (etamin < etamax - 1e-4) {
             // There's overlap --- make a table entry.
             IDMapElt elt;
-            elt.m_cell_reg = cell_helper->calo_region_hash (cell_reg);
-            elt.m_sc_reg = sc_helper->calo_region_hash (sc_reg);
+            elt.m_cell_reg = m_cell_helper->calo_region_hash (cell_reg);
+            elt.m_sc_reg = m_sc_helper->calo_region_hash (sc_reg);
             elt.m_etadiv = int (sc_etasize * inv_cell_etasize + 0.1);
             elt.m_phidiv = int (sc_phisize * inv_cell_phisize + 0.1);
 
@@ -166,25 +164,25 @@ void CaloSuperCellIDTool::initIDMap ()
         }
       }
     }
-    else if (cell_helper->is_tile(cell_reg)) {
-      int section = cell_helper->section (cell_reg);
+    else if (m_cell_helper->is_tile(cell_reg)) {
+      int section = m_cell_helper->section (cell_reg);
       if (section != TileID::BARREL && section != TileID::EXTBAR)
         continue;
-      int sub_calo = cell_helper->sub_calo (cell_reg);
-      int side = cell_helper->side (cell_reg);
-      Identifier sc_reg = sc_helper->region_id (sub_calo, section, side, 0);
+      int sub_calo = m_cell_helper->sub_calo (cell_reg);
+      int side = m_cell_helper->side (cell_reg);
+      Identifier sc_reg = m_sc_helper->region_id (sub_calo, section, side, 0);
 
       IDMapElt elt;
-      elt.m_cell_reg = cell_helper->calo_region_hash (cell_reg);
-      elt.m_sc_reg = sc_helper->calo_region_hash (sc_reg);
+      elt.m_cell_reg = m_cell_helper->calo_region_hash (cell_reg);
+      elt.m_sc_reg = m_sc_helper->calo_region_hash (sc_reg);
       elt.m_etadiv = 1;
       elt.m_phidiv = 1;
       elt.m_cell_ieta_adj = 0;
       elt.m_sc_ieta_adj = 0;
-      elt.m_cell_ietamin = cell_helper->eta_min (cell_reg);
-      elt.m_cell_ietamax = cell_helper->eta_max (cell_reg);
-      elt.m_sc_ietamin = sc_helper->eta_min (sc_reg);
-      elt.m_sc_ietamax = sc_helper->eta_max (sc_reg);
+      elt.m_cell_ietamin = m_cell_helper->eta_min (cell_reg);
+      elt.m_cell_ietamax = m_cell_helper->eta_max (cell_reg);
+      elt.m_sc_ietamin = m_sc_helper->eta_min (sc_reg);
+      elt.m_sc_ietamax = m_sc_helper->eta_max (sc_reg);
       addMapEntry (elt);
     }
   }
@@ -195,21 +193,21 @@ void CaloSuperCellIDTool::initIDMap ()
     msg(MSG::DEBUG) << "CaloSuperCellIDTool mapping table:\n";
     msg(MSG::DEBUG) << "LArEM ----------------------------\n";
     for (const IDMapElt& elt : m_idmap) {
-      Identifier cell_reg = cell_helper->region_id (elt.m_cell_reg);
-      Identifier sc_reg = sc_helper->region_id (elt.m_sc_reg);
+      Identifier cell_reg = m_cell_helper->region_id (elt.m_cell_reg);
+      Identifier sc_reg = m_sc_helper->region_id (elt.m_sc_reg);
       msg(MSG::DEBUG) <<
         boost::format
           ("  %3d %d/%2d/%2d/%d %3d %d/%2d/%2d/%d %d %d %3d %3d %3d %3d %3d %3d\n") %
         (int)elt.m_cell_reg %
-        cell_helper->sub_calo(cell_reg) %
-        posneg_or_section (cell_helper, cell_reg) %
-        sampling_or_side (cell_helper, cell_reg) %
-        cell_helper->region(cell_reg) %
+        m_cell_helper->sub_calo(cell_reg) %
+        posneg_or_section (m_cell_helper, cell_reg) %
+        sampling_or_side (m_cell_helper, cell_reg) %
+        m_cell_helper->region(cell_reg) %
         (int)elt.m_sc_reg %
-        sc_helper->sub_calo(sc_reg) %
-        posneg_or_section (sc_helper, sc_reg) %
-        sampling_or_side (sc_helper, sc_reg) %
-        sc_helper->region(sc_reg) %
+        m_sc_helper->sub_calo(sc_reg) %
+        posneg_or_section (m_sc_helper, sc_reg) %
+        sampling_or_side (m_sc_helper, sc_reg) %
+        m_sc_helper->region(sc_reg) %
 
         elt.m_etadiv % elt.m_phidiv %
         elt.m_cell_ietamin % elt.m_cell_ietamax %
@@ -249,8 +247,8 @@ void CaloSuperCellIDTool::addMapEntry (const IDMapElt& elt)
  */
 void CaloSuperCellIDTool::initFCALIDMap ()
 {
-  const LArFCAL_Base_ID* sfcal_helper = m_calo_id_manager->getFCAL_SuperCell_ID();
-  const LArFCAL_Base_ID* fcal_helper = m_calo_id_manager->getFCAL_ID();
+  const LArFCAL_Base_ID* sfcal_helper = m_sc_helper->fcal_idHelper();
+  const LArFCAL_Base_ID* fcal_helper = m_cell_helper->fcal_idHelper();
 
   m_fcal_fromCell.clear();
   m_fcal_fromSuperCell.clear();
@@ -313,14 +311,10 @@ void CaloSuperCellIDTool::initFCALIDMap ()
 Identifier
 CaloSuperCellIDTool::offlineToSuperCellID (const Identifier& id) const
 {
-  const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-
-  if (cell_helper->is_em(id) || cell_helper->is_hec(id)) {
+  if (m_cell_helper->is_em(id) || m_cell_helper->is_hec(id)) {
     // Look for the first entry in the mapping table for this offline region.
-    const CaloCell_Base_ID* sc_helper   = m_calo_id_manager->getCaloCell_SuperCell_ID();
-
-    Identifier reg_id = cell_helper->region_id (id);
-    IdentifierHash rhash = cell_helper->calo_region_hash (reg_id);
+    Identifier reg_id = m_cell_helper->region_id (id);
+    IdentifierHash rhash = m_cell_helper->calo_region_hash (reg_id);
     assert (rhash < m_offlineIndex.size());
     int ndx = m_offlineIndex[rhash];
     if (ndx < 0)
@@ -328,7 +322,7 @@ CaloSuperCellIDTool::offlineToSuperCellID (const Identifier& id) const
     
     // Now search through all entries for this offline region to find one
     // that includes this cell.
-    int ieta = cell_helper->eta (id);
+    int ieta = m_cell_helper->eta (id);
     
     do {
       const IDMapElt& elt = m_idmap[ndx];
@@ -340,24 +334,24 @@ CaloSuperCellIDTool::offlineToSuperCellID (const Identifier& id) const
 		       elt.m_etadiv) +
 	  elt.m_sc_ietamin - elt.m_sc_ieta_adj;
 
-	return sc_helper->cell_id (sc_helper->region_id (elt.m_sc_reg),
+	return m_sc_helper->cell_id (m_sc_helper->region_id (elt.m_sc_reg),
 				   ieta_sc,
-				   cell_helper->phi(id) / elt.m_phidiv);
+				   m_cell_helper->phi(id) / elt.m_phidiv);
       }
       ++ndx;
     } while (ndx < (int)m_idmap.size() && m_idmap[ndx].m_cell_reg == rhash);
   }
 
-  else if (cell_helper->is_fcal(id)) {
-    const LArFCAL_ID* fcal_helper = m_calo_id_manager->getFCAL_ID();
+  else if (m_cell_helper->is_fcal(id)) {
+    const LArFCAL_ID* fcal_helper = m_cell_helper->fcal_idHelper();
     IdentifierHash cell_hash = fcal_helper->channel_hash(id);
     return m_fcal_fromCell[ cell_hash ];
   }
 
-  else if (cell_helper->is_tile(id)) {
-    int section = cell_helper->section (id);
-    int sample_offline = cell_helper->sample(id);
-    int tower = cell_helper->tower(id);
+  else if (m_cell_helper->is_tile(id)) {
+    int section = m_cell_helper->section (id);
+    int sample_offline = m_cell_helper->sample(id);
+    int tower = m_cell_helper->tower(id);
 
     // A couple special cases in the transition region.
     // cf. http://hep.uchicago.edu/atlas/tilecal/level1/geometry.html
@@ -392,13 +386,10 @@ CaloSuperCellIDTool::offlineToSuperCellID (const Identifier& id) const
     int sample_sc = sample_offline;
     if (sample_sc != TileID::SAMP_D) sample_sc = TileID::SAMP_A;
 
-    const CaloCell_Base_ID* sc_helper   =
-      m_calo_id_manager->getCaloCell_SuperCell_ID();
-
-    return sc_helper->cell_id (cell_helper->sub_calo(id),
+    return m_sc_helper->cell_id (m_cell_helper->sub_calo(id),
                                section,
-                               cell_helper->side(id),
-                               cell_helper->module(id),
+                               m_cell_helper->side(id),
+                               m_cell_helper->module(id),
                                tower,
                                sample_sc);
   }
@@ -415,14 +406,11 @@ std::vector<Identifier>
 CaloSuperCellIDTool::superCellToOfflineID (const Identifier& id) const
 {
   std::vector<Identifier> out;
-  const CaloCell_SuperCell_ID* sc_helper =  m_calo_id_manager->getCaloCell_SuperCell_ID();
 
   // Look for the first entry in the mapping table for this supercell region.
-  if (sc_helper->is_em (id) || sc_helper->is_hec (id)) {
-    const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-
-    Identifier reg_id = sc_helper->region_id (id);
-    IdentifierHash rhash = sc_helper->calo_region_hash (reg_id);
+  if (m_sc_helper->is_em (id) || m_sc_helper->is_hec (id)) {
+    Identifier reg_id = m_sc_helper->region_id (id);
+    IdentifierHash rhash = m_sc_helper->calo_region_hash (reg_id);
     assert (rhash < m_superCellIndex.size());
     int ndx = m_superCellIndex[rhash];
     if (ndx < 0)
@@ -433,7 +421,7 @@ CaloSuperCellIDTool::superCellToOfflineID (const Identifier& id) const
     
     // Now search through all entries for this supercell region to find one
     // that includes this supercell.
-    int ieta = sc_helper->eta (id);
+    int ieta = m_sc_helper->eta (id);
     
     for (; ndx < end; ++ndx) {
       const IDMapElt& elt = m_idmap[ndx];
@@ -446,37 +434,36 @@ CaloSuperCellIDTool::superCellToOfflineID (const Identifier& id) const
 	
 	int ieta0 = (ieta - elt.m_sc_ietamin + elt.m_sc_ieta_adj) * elt.m_etadiv +
 	  elt.m_cell_ietamin - elt.m_cell_ieta_adj;
-	Identifier cell_reg_id = cell_helper->region_id (elt.m_cell_reg);
+	Identifier cell_reg_id = m_cell_helper->region_id (elt.m_cell_reg);
 	int ieta = std::max (ieta0, elt.m_cell_ietamin);
 	int ietamax = std::min (ieta0 + elt.m_etadiv - 1, elt.m_cell_ietamax);
 	
 	// Add all matching cells to the output list.
-	int iphi0 = sc_helper->phi (id) * elt.m_phidiv;
+	int iphi0 = m_sc_helper->phi (id) * elt.m_phidiv;
 	for (; ieta <= ietamax; ++ieta) {
 	  for (int ip = 0; ip < elt.m_phidiv; ip++) {
-	    out.push_back(cell_helper->cell_id (cell_reg_id, ieta, iphi0+ip));
+	    out.push_back(m_cell_helper->cell_id (cell_reg_id, ieta, iphi0+ip));
 	  }
 	}
       }
     }
   }
 
-  else if ( sc_helper->is_fcal( id ) ) {
-    const LArFCAL_Base_ID* sfcal_helper = sc_helper->fcal_idHelper();
+  else if ( m_sc_helper->is_fcal( id ) ) {
+    const LArFCAL_Base_ID* sfcal_helper = m_sc_helper->fcal_idHelper();
     IdentifierHash sc_hash = sfcal_helper->channel_hash( id );
     out = m_fcal_fromSuperCell[ sc_hash ];
   }
 
-  else if (sc_helper->is_tile (id)) {
-    int module = sc_helper->module(id);
-    int tower = sc_helper->tower(id);
-    int sample = sc_helper->sample(id);
+  else if (m_sc_helper->is_tile (id)) {
+    int module = m_sc_helper->module(id);
+    int tower = m_sc_helper->tower(id);
+    int sample = m_sc_helper->sample(id);
     
-    const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-    const Tile_Base_ID* tile_helper = cell_helper->tile_idHelper();
+    const Tile_Base_ID* tile_helper = m_cell_helper->tile_idHelper();
 
-    Identifier reg_id = tile_helper->region_id (sc_helper->section(id),
-                                                sc_helper->side(id));
+    Identifier reg_id = tile_helper->region_id (m_sc_helper->section(id),
+                                                m_sc_helper->side(id));
 
     Identifier cell_id;
 
@@ -487,7 +474,7 @@ CaloSuperCellIDTool::superCellToOfflineID (const Identifier& id) const
     }
     if (tower == 9) {
       Identifier greg_id = tile_helper->region_id (TileID::GAPDET,
-                                                   sc_helper->side(id));
+                                                   m_sc_helper->side(id));
       if (tile_helper->cell_id (greg_id, module, 8, TileID::SAMP_D, cell_id))
         out.push_back (cell_id);
       if (sample == TileID::SAMP_A) {
@@ -523,21 +510,17 @@ CaloSuperCellIDTool::superCellToOfflineID (const Identifier& id) const
 std::vector<Identifier>
 CaloSuperCellIDTool::offlineToSuperCellRegion (const Identifier& reg_id) const
 {
-  const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-  const CaloCell_Base_ID* sc_helper =
-    m_calo_id_manager->getCaloCell_SuperCell_ID();
-
   std::vector<Identifier> out;
 
   // Look for the first entry in the mapping table for this offline region.
-  IdentifierHash rhash = cell_helper->calo_region_hash (reg_id);
+  IdentifierHash rhash = m_cell_helper->calo_region_hash (reg_id);
   assert (rhash < m_offlineIndex.size());
   int ndx = m_offlineIndex[rhash];
   while (ndx >= 0 &&
          ndx < (int)m_idmap.size() &&
          m_idmap[ndx].m_cell_reg == rhash)
   {
-    out.push_back (sc_helper->region_id (m_idmap[ndx].m_sc_reg));
+    out.push_back (m_sc_helper->region_id (m_idmap[ndx].m_sc_reg));
     ++ndx;
   }
 
@@ -555,20 +538,16 @@ CaloSuperCellIDTool::offlineToSuperCellRegion (const Identifier& reg_id) const
 std::vector<Identifier>
 CaloSuperCellIDTool::superCellToOfflineRegion (const Identifier& reg_id) const
 {
-  const CaloCell_Base_ID* cell_helper = m_calo_id_manager->getCaloCell_ID();
-  const CaloCell_Base_ID* sc_helper =
-    m_calo_id_manager->getCaloCell_SuperCell_ID();
-
   std::vector<Identifier> out;
 
   // Look for the first entry in the mapping table for this offline region.
-  IdentifierHash rhash = sc_helper->calo_region_hash (reg_id);
+  IdentifierHash rhash = m_sc_helper->calo_region_hash (reg_id);
   assert (rhash < m_superCellIndex.size());
   int ndx = m_superCellIndex[rhash];
   int end = m_superCellIndexEnd[rhash];
   for (; ndx < end; ++ndx) {
     if (m_idmap[ndx].m_sc_reg == rhash)
-      out.push_back (cell_helper->region_id (m_idmap[ndx].m_cell_reg));
+      out.push_back (m_cell_helper->region_id (m_idmap[ndx].m_cell_reg));
   }
 
   return out;
diff --git a/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.h b/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.h
index a9a4142d2ba..fb0a3f40e92 100644
--- a/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.h
+++ b/Calorimeter/CaloDetDescr/src/CaloSuperCellIDTool.h
@@ -1,7 +1,7 @@
 // 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$
@@ -23,7 +23,8 @@
 #include "GaudiKernel/ToolHandle.h"
 
 
-class CaloIdManager;
+class CaloCell_ID;
+class CaloCell_SuperCell_ID;
 
 class CaloSuperCellIDTool
   : public extends1<AthAlgTool, ICaloSuperCellIDTool>
@@ -154,7 +155,8 @@ private:
   std::vector< std::vector<Identifier> > m_fcal_fromSuperCell;
 
   /// Entry point for calorimeter ID helpers.
-  const CaloIdManager* m_calo_id_manager;
+  const CaloCell_ID* m_cell_helper;
+  const CaloCell_SuperCell_ID* m_sc_helper;
 };
 
 
-- 
GitLab


From 01daf08b877d365957e1f46e4d34b2517a662ece Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 16:36:49 +0100
Subject: [PATCH 330/404] DataModelRunTests: Remove ARA test.

Remove AthenaROOTAccess test.
---
 .../DataModelRunTests/CMakeLists.txt          |  7 ----
 .../share/xAODTestReadARA_t.py                | 40 -------------------
 2 files changed, 47 deletions(-)
 delete mode 100644 Control/DataModelTest/DataModelRunTests/share/xAODTestReadARA_t.py

diff --git a/Control/DataModelTest/DataModelRunTests/CMakeLists.txt b/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
index 5ca21f23ced..3a9761d10db 100644
--- a/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
+++ b/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
@@ -62,10 +62,6 @@ datamodel_run_test (xAODTestReadRenameMT
                     DEPENDS xAODTestWrite)
 datamodel_run_test (xAODTestReadFilter DEPENDS xAODTestWrite)
 datamodel_run_test (xAODTestReadFilterRead DEPENDS xAODTestReadFilter)
-datamodel_run_test (xAODTestReadARA
-                    COMMAND python
-                    ARG ${CMAKE_CURRENT_SOURCE_DIR}/share/xAODTestReadARA_t.py
-                    DEPENDS xAODTestWrite)
 datamodel_run_test (xAODRootTestRead
                     COMMAND python
                     ARG ${CMAKE_CURRENT_SOURCE_DIR}/share/xAODRootTestRead_t.py
@@ -145,9 +141,6 @@ datamodel_run_test (CondReadWrite)
 # xAODTestReadFilterRead
 # reads xaoddata_filt.root
 #
-# xAODTestReadARA
-# reads xaoddata.root
-#
 # xAODRootTestRead
 # reads xaoddata.root
 # writes xaodroot.root
diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadARA_t.py b/Control/DataModelTest/DataModelRunTests/share/xAODTestReadARA_t.py
deleted file mode 100644
index db0704d1566..00000000000
--- a/Control/DataModelTest/DataModelRunTests/share/xAODTestReadARA_t.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from __future__ import print_function
-import ROOT
-import cppyy
-import AthenaROOTAccess.transientTree
-
-cppyy.loadDictionary("libDataModelTestDataCommonDict")
-cppyy.loadDictionary("libDataModelTestDataReadDict")
-ROOT.DMTest.B
-ROOT.DMTest.setPluginLibrary ('_PERS_DMTest::HAuxContainer_v1',
-                              'libDataModelTestDataReadCnvPoolCnv.so')
-ROOT.DMTest.setPluginLibrary ('_PERS_DMTest::HVec_v1',
-                              'libDataModelTestDataReadCnvPoolCnv.so')
-ROOT.DMTest.setPluginLibrary ('_PERS_DMTest__HAuxContainer_v1',
-                              'libDataModelTestDataReadCnvPoolCnv.so')
-ROOT.DMTest.setPluginLibrary ('_PERS_DataVector<DMTest::H_v1>',
-                              'libDataModelTestDataReadCnvPoolCnv.so')
-
-f = ROOT.TFile.Open ('xaoddata.root')
-assert f.IsOpen()
-
-
-from AthenaCommon.Include import Include
-include = Include(show = False)
-include('DataModelRunTests/xAODRootTest.py')
-
-
-tt = AthenaROOTAccess.transientTree.makeTree(f)
-reader = xAODTestRead()
-for i in range(tt.GetEntries()):
-    tt.GetEntry(i)
-    print ('\nEntry', i)
-    reader.execute(tt)
-    print ('gvec')
-    vec = getattr (tt, 'gvec')
-    for g in vec:
-        dump_auxdata (g)
-        print('')
-    print()
-    
-    
-- 
GitLab


From 0499ab3ac041a1ff49ec276610fe4308abc87a20 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 7 Mar 2019 16:35:11 +0100
Subject: [PATCH 331/404] CaloJiveXML: : Remove MT-unsafe uses of
 CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
Other cleanups.
---
 .../CaloJiveXML/CaloJiveXML/BadLArRetriever.h |  2 -
 .../CaloJiveXML/BadTileRetriever.h            |  2 -
 .../CaloJiveXML/CaloFCalRetriever.h           |  2 -
 .../CaloJiveXML/CaloHECRetriever.h            |  2 -
 .../CaloJiveXML/CaloLArRetriever.h            |  2 -
 .../CaloJiveXML/CaloTileRetriever.h           |  2 -
 .../CaloJiveXML/LArDigitRetriever.h           |  2 -
 .../CaloJiveXML/src/BadLArRetriever.cxx       | 36 +++++------
 .../CaloJiveXML/src/BadTileRetriever.cxx      | 34 ++++-------
 .../CaloJiveXML/src/CaloClusterRetriever.cxx  | 37 +++++-------
 .../CaloJiveXML/src/CaloFCalRetriever.cxx     | 37 +++++-------
 .../CaloJiveXML/src/CaloHECRetriever.cxx      | 43 ++++++-------
 .../CaloJiveXML/src/CaloLArRetriever.cxx      | 49 +++++++--------
 .../CaloJiveXML/src/CaloMBTSRetriever.cxx     | 51 +++++++---------
 .../CaloJiveXML/src/CaloTileRetriever.cxx     | 59 ++++++++----------
 .../CaloJiveXML/src/LArDigitRetriever.cxx     | 60 +++++++------------
 16 files changed, 166 insertions(+), 254 deletions(-)

diff --git a/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h b/Calorimeter/CaloCnv/CaloJiveXML/CaloJiveXML/BadLArRetriever.h
index 66e9a46fc55..d2b37ef42b1 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 84e8273c18a..0ed4ad4476e 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 62fe4e698fb..f84a02d3136 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 d06633e4995..e2e7fdf32c7 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 cc7157d011d..0b584dd0cdc 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 17aa9a9e89a..5506bd8ddb7 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 69a7c5b9c86..2f49b5f8958 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 a07815054c0..728dc4b6087 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 fac3afa6832..500224dd4fd 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 9e29cfb5a6d..67c661158b3 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 feaacd0c3b0..46c91572dc8 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 1b783e66fd2..3a778abc13b 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 0691e794f08..e7ac5110578 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 efe067e3733..10625ad22cc 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 92662bb3346..9817bf1c414 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 5dcaf68e7c1..96f13624db5 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;
-- 
GitLab


From 7914be4c02cbbc5606f56fb6c6205a0847e83f2a Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 7 Mar 2019 04:11:10 +0100
Subject: [PATCH 332/404] AthenaPoolExampleAlgorithms: Update reference files.

Fix test failures in master.
---
 .../share/AthenaPoolExample_Concat.ref        | 381 +++++++++++++-
 .../share/AthenaPoolExample_Copy.ref          | 201 ++++++--
 .../share/AthenaPoolExample_RCond.ref         | 264 +++++-----
 .../share/AthenaPoolExample_RMeta.ref         | 269 +++++-----
 .../share/AthenaPoolExample_ReWrite.ref       | 186 +++++--
 .../share/AthenaPoolExample_ReWriteAgain.ref  | 104 +++-
 .../share/AthenaPoolExample_ReWriteNext.ref   | 104 +++-
 .../share/AthenaPoolExample_Read.ref          | 240 +++++----
 .../share/AthenaPoolExample_ReadAgain.ref     | 200 +++++---
 .../share/AthenaPoolExample_ReadConcat.ref    | 476 ++++++++++--------
 .../share/AthenaPoolExample_WCond.ref         | 269 +++++-----
 .../share/AthenaPoolExample_WMeta.ref         | 237 ++++++++-
 .../share/AthenaPoolExample_Write.ref         | 188 ++++++-
 13 files changed, 2223 insertions(+), 896 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
index a6f08dfaccf..fc45b15a666 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref
@@ -1,21 +1,72 @@
+Wed Mar  6 20:40:23 CET 2019
+Preloading tcmalloc_minimal.so
+Athena               INFO including file "AthenaCommon/Preparation.py"
+Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
+Athena               INFO including file "AthenaCommon/Execution.py"
+Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ConcatJobOptions.py"
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
+Py:ConfigurableDb    INFO No duplicates have been found: that's good !
+Athena               INFO including file "AthenaCommon/runbatch.py"
+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 v31r0)
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:40:34 2019
+====================================================================================================================================
 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 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
+AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
+ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 571 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
+xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
+xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
+MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
+AthenaPoolCnvSvc    DEBUG Property update for OutputLevel : new value = 2
+AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
+PoolSvc             DEBUG Property update for OutputLevel : new value = 2
+PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok]
 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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
 PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:Catalog1.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
+xAODMaker::Even...WARNING Beam conditions service not available
+xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo
+xAODMaker::Even...   INFO Luminosity information not available
+xAODMaker::Even...   INFO Will take information from the EventInfo object
+ClassIDSvc           INFO  getRegistryEntries: read 1537 CLIDRegistry entries for module ALL
+WriteData           DEBUG Property update for OutputLevel : new value = 2
 WriteData            INFO in initialize()
+WriteData           DEBUG input handles: 0
+WriteData           DEBUG output handles: 2
+WriteData           DEBUG Data Deps for WriteData
   + OUTPUT  ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
   + OUTPUT  ( 'ExampleHitContainer' , 'StoreGateSvc+PetersHits' ) 
+ReWriteData         DEBUG Property update for OutputLevel : new value = 2
 ReWriteData          INFO in initialize()
+ReWriteData         DEBUG input handles: 1
+ReWriteData         DEBUG output handles: 1
+ReWriteData         DEBUG Data Deps for ReWriteData
   + INPUT   ( 'ExampleHitContainer' , 'StoreGateSvc+MyHits' ) 
   + OUTPUT  ( 'ExampleTrackContainer' , 'StoreGateSvc+MyTracks' ) 
+Stream1             DEBUG Property update for OutputLevel : new value = 2
+Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG In initialize 
 Stream1             DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
@@ -23,15 +74,27 @@ Stream1             DEBUG End initialize
 Stream1             DEBUG In initialize
 Stream1             DEBUG Found StoreGateSvc store.
 Stream1             DEBUG Found MetaDataStore store.
+OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
+Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
+Stream1.Stream1...   INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00
+Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
+Stream1.Stream1...   INFO Initializing Stream1.Stream1_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
 Stream1              INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream1_MakeEventStreamInfo'])
 Stream1              INFO Data output: SimplePoolFile1.root
-Stream1              INFO ../O reinitialization...
+Stream1              INFO I/O reinitialization...
+Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
 Stream1             DEBUG End initialize
+Stream1             DEBUG input handles: 0
+Stream1             DEBUG output handles: 0
 Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
-  + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
+Stream1             DEBUG Data Deps for Stream1
+  + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
+MakeInputDataHe...   INFO Initializing MakeInputDataHeader - package version OutputStreamAthenaPool-00-00-00
 MakeInputDataHe...   INFO Name of Stream to be made Input: Stream1
+Stream2             DEBUG Property update for OutputLevel : new value = 2
+Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG In initialize 
 Stream2             DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: Stream2 with no Algs
@@ -39,13 +102,21 @@ Stream2             DEBUG End initialize
 Stream2             DEBUG In initialize
 Stream2             DEBUG Found StoreGateSvc store.
 Stream2             DEBUG Found MetaDataStore store.
+Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
+Stream2.Stream2...   INFO Initializing Stream2.Stream2Tool - package version AthenaServices-00-00-00
+Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
+Stream2.Stream2...   INFO Initializing Stream2.Stream2_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00
 Stream2              INFO Found HelperTools = PrivateToolHandleArray(['MakeEventStreamInfo/Stream2_MakeEventStreamInfo'])
 Stream2              INFO Data output: SimplePoolFile3.root
-Stream2              INFO ../O reinitialization...
+Stream2              INFO I/O reinitialization...
+Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG End initialize
+Stream2             DEBUG input handles: 0
+Stream2             DEBUG output handles: 0
 Stream2             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream2             DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool)
+Stream2             DEBUG Data Deps for Stream2
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
 HistogramPersis...WARNING Histograms saving not required.
 EventSelector        INFO  Enter McEventSelector Initialization 
@@ -84,10 +155,14 @@ ReWriteData          INFO Element = 0x???? : 17.2845
 ReWriteData          INFO Element = 0x???? : 10.8645
 ReWriteData          INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector = Track made in: DummyHitDetector
 ReWriteData          INFO registered all data
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
 AthenaPoolCnvSvc    DEBUG setAttribute DEFAULT_SPLITLEVEL to 0
 AthenaPoolCnvSvc    DEBUG setAttribute STREAM_MEMBER_WISE to 1
 AthenaPoolCnvSvc    DEBUG setAttribute DEFAULT_BUFFERSIZE to 32000
+PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile1.root
 SimplePoolFile1...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Shapes
 ##Shapes            DEBUG Opening
@@ -107,13 +182,18 @@ SimplePoolFile1...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile1.root and cont: TTree=POOLContainerForm(DataHeaderForm)
+ClassIDSvc           INFO  getRegistryEntries: read 108 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 1
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 1
 StorageSvc           INFO Building shape according to reflection information using shape ID for:
@@ -164,8 +244,126 @@ SimplePoolFile1...  DEBUG ---->ClassID:????
 SimplePoolFile1...  DEBUG --->Adding Shape[3 , ????]:  [1 Column(s)] 
 SimplePoolFile1...  DEBUG ---->Class:DataHeader_p5
 SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO Token [????]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(Token)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'Token'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(Token) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Adding Shape[4 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG ---->Class:Token
+SimplePoolFile1...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO bool [????]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsSimulation)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsSimulation'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsSimulation) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Adding Shape[5 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG ---->Class:bool
+SimplePoolFile1...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsCalibration)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsCalibration'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsCalibration) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsTestBeam)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsTestBeam'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsTestBeam) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO unsigned int [????]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(McChannel)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'McChannel'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(McChannel) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Adding Shape[6 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG ---->Class:unsigned int
+SimplePoolFile1...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(RunNumber)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'RunNumber'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(RunNumber) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO unsigned long long [????]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventNumber)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventNumber'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventNumber) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Adding Shape[7 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG ---->Class:unsigned long long
+SimplePoolFile1...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(LumiBlockN)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'LumiBlockN'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(LumiBlockN) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(ConditionsRun)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'ConditionsRun'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(ConditionsRun) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventTime)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventTime'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventTime) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventTimeNanoSec)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventTimeNanoSec'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventTimeNanoSec) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(BunchId)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'BunchId'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(BunchId) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO float [????]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventWeight)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventWeight'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventWeight) of type ROOT_Tree
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Adding Shape[8 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG ---->Class:float
+SimplePoolFile1...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile1.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile1.root and cont: POOLContainerForm(DataHeaderForm)
+PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile3.root returned FID: '????' tech=ROOT_All
+Domain[ROOT_All]     INFO ->  Access   DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile3.root
 SimplePoolFile3...  DEBUG --> Access   DbContainer  CREATE    [ROOT_All] ##Shapes
 ##Shapes            DEBUG Opening
@@ -185,13 +383,18 @@ SimplePoolFile3...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile3...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile3.root and cont: TTree=POOLContainerForm(DataHeaderForm)
+ClassIDSvc           INFO  getRegistryEntries: read 78 CLIDRegistry entries for module ALL
 Stream2             DEBUG addItemObjects(2101,"*") called
 Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 1
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 1
 SimplePoolFile3...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
@@ -275,7 +478,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 2
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 2
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -284,7 +491,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 2
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
@@ -324,7 +535,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 3
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 3
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -333,7 +548,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 3
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
@@ -373,7 +592,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 4
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 4
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -382,7 +605,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 4
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
@@ -422,7 +649,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 5
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 5
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -431,7 +662,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 5
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
@@ -471,7 +706,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 6
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 6
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -480,7 +719,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 6
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
@@ -520,7 +763,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 7
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 7
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -529,7 +776,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 7
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
@@ -569,7 +820,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 8
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 8
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -578,7 +833,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 8
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
@@ -618,7 +877,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 9
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 9
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -627,7 +890,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 9
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
@@ -667,7 +934,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 10
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 10
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -676,7 +947,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 10
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
@@ -716,7 +991,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 11
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 11
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -725,7 +1004,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 11
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
@@ -765,7 +1048,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 12
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 12
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -774,7 +1061,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 12
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
@@ -814,7 +1105,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 13
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 13
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -823,7 +1118,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 13
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
@@ -863,7 +1162,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 14
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 14
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -872,7 +1175,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 14
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
@@ -913,7 +1220,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 15
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 15
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -922,7 +1233,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 15
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
@@ -962,7 +1277,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 16
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 16
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -971,7 +1290,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 16
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
@@ -1011,7 +1334,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 17
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 17
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -1020,7 +1347,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 17
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
@@ -1060,7 +1391,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 18
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 18
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -1069,7 +1404,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 18
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
@@ -1109,7 +1448,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 19
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 19
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -1118,7 +1461,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 19
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
@@ -1158,7 +1505,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"My*") called
 Stream1             DEBUG            Key:My*
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 20
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 20
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -1167,7 +1518,11 @@ Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9103,"*Tracks") called
 Stream2             DEBUG            Key:*Tracks
 Stream2             DEBUG  Added object 9103,"MyTracks"
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 20
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream2             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
@@ -1186,9 +1541,9 @@ MetaData(EventS...  DEBUG Opening
 MetaData(EventS...  DEBUG    attributes# = 1
 MetaData(EventS...  DEBUG Branch container 'EventStreamInfo_p3_Stream1'
 MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream1) of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (14 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Adding Shape[4 , ????]:  [1 Column(s)] 
+SimplePoolFile1...  DEBUG --->Adding Shape[9 , ????]:  [1 Column(s)] 
 SimplePoolFile1...  DEBUG ---->Class:EventStreamInfo_p3
 SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
@@ -1196,15 +1551,16 @@ MetaDataHdrForm...  DEBUG Opening
 MetaDataHdrForm...  DEBUG    attributes# = 1
 MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
 MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (15 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
 SimplePoolFile1...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (16 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
+ClassIDSvc           INFO  getRegistryEntries: read 7 CLIDRegistry entries for module ALL
 Stream1              INFO Records written: 21
 Stream1             DEBUG Leaving handle
 Stream2             DEBUG handle() incident type: MetaDataStop
@@ -1240,10 +1596,16 @@ SimplePoolFile3...  DEBUG ---->ClassID:????
 Stream2              INFO Records written: 21
 Stream2             DEBUG Leaving handle
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   CREATE    [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     UPDATE    [ROOT_All] 
 ApplicationMgr       INFO Application Manager Stopped successfully
+IncidentProcAlg1     INFO Finalize
 WriteData            INFO in finalize()
 ReWriteData          INFO in finalize()
+WriteData           DEBUG Calling destructor
+ReWriteData         DEBUG Calling destructor
+IncidentProcAlg2     INFO Finalize
 Stream1             DEBUG finalize: Optimize output
 Stream1             DEBUG finalize: end optimize output
 Stream2             DEBUG finalize: Optimize output
@@ -1256,6 +1618,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.238(+- 1.52)/    0/   10 [ms] #= 42
+cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.122(+-  1.1)/    0/   10 [ms] #=164
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0235(+-0.484)/    0/   10 [ms] #=426
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.244(+-  1.9)/    0/   20 [ms] #=164
+ChronoStatSvc        INFO Time User   : Tot= 0.58  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
index e336f0cad70..a87525ad4a8 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:21:49 CST 2019
+Wed Mar  6 21:26:57 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_CopyJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,20 +13,17 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:58 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 21:27:10 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
-Stream1             DEBUG Property update for OutputLevel : new value = 2
-Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 637 CLIDRegistry entries for module ALL
-Stream1             DEBUG In initialize 
+ClassIDSvc           INFO  getRegistryEntries: read 610 CLIDRegistry entries for module ALL
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
 AthenaPoolCnvSvc    DEBUG Property update for OutputLevel : new value = 2
 AthenaPoolCnvSvc     INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00
@@ -35,9 +32,9 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok]
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -115,7 +112,7 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 1706 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -124,6 +121,10 @@ MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
 MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
 AthenaPoolAddre...  DEBUG Property update for OutputLevel : new value = 2
 AthenaPoolAddre...  DEBUG Service base class initialized successfully
+Stream1             DEBUG Property update for OutputLevel : new value = 2
+Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
+ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
+Stream1             DEBUG In initialize 
 Stream1             DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: Stream1 with no Algs
 Stream1             DEBUG End initialize 
@@ -132,7 +133,6 @@ Stream1             DEBUG Found StoreGateSvc store.
 Stream1             DEBUG Found MetaDataStore store.
 OutputStreamSeq...   INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
-ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
 Stream1.Stream1...   INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00
 AthenaPoolAddre...  DEBUG Cannot find DataHeader in DetectorStore.
 Stream1.Stream1...  DEBUG Property update for OutputLevel : new value = 2
@@ -148,7 +148,7 @@ Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
-  + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
+  + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -159,7 +159,6 @@ RootDatabase.se...  DEBUG File name SimplePoolFile1.root
 RootDatabase.se...  DEBUG Got tree CollectionTree read entry -1
 RootDatabase.se...  DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_CACHE to -1 for db: SimplePoolFile1.root and cont: CollectionTree
-ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 EventSelector       DEBUG Get AttributeList from the collection
 EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
@@ -175,9 +174,10 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -187,6 +187,7 @@ CollectionTree(...  DEBUG Opened container CollectionTree(EventInfo_p4/McEventIn
 AthenaPoolConve...   INFO massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector 
 AthenaEventLoopMgr   INFO   ===>>>  start of run 1    <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #0, run #1 0 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
@@ -215,6 +216,7 @@ SimplePoolRepli...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolRepli...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolReplica1.root and cont: TTree=POOLContainerForm(DataHeaderForm)
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 ClassIDSvc           INFO  getRegistryEntries: read 20 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
@@ -228,6 +230,9 @@ CollectionTree(...  DEBUG Branch container 'ExampleHitContainer_p1_MyHits'
 CollectionTree(...  DEBUG Opened container CollectionTree(ExampleHitContainer_p1/MyHits) of type ROOT_Tree
 Stream1             DEBUG  Added object 9102,"MyHits"
 ClassIDSvc           INFO  getRegistryEntries: read 10 CLIDRegistry entries for module ALL
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 1
@@ -279,16 +284,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 1 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 2
@@ -298,16 +309,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 2 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 3
@@ -317,16 +334,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 3 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 4
@@ -336,16 +359,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 4 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 5
@@ -355,16 +384,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 5 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 6
@@ -374,16 +409,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 6 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 7
@@ -393,16 +434,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 7 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 8
@@ -412,16 +459,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 8 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 9
@@ -431,16 +484,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 9 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 10
@@ -450,16 +509,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 10 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 11
@@ -469,16 +534,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 11 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 12
@@ -488,16 +559,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 12 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 13
@@ -507,16 +584,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 13 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 14
@@ -526,16 +609,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 14 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 15
@@ -545,16 +634,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 15 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 16
@@ -564,16 +659,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 16 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 17
@@ -583,16 +684,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 17 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 18
@@ -602,16 +709,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 18 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 19
@@ -621,16 +734,22 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 19 events processed so far  <<<===
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
+Stream1.Stream1...WARNING Unable to retrieve AttributeList with key SimpleTag
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 20
@@ -688,13 +807,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
-cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
+fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
 cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 83
-fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 65
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.484(+- 2.15)/    0/   10 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot=  0.7  [s]                                             #=  1
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.476(+- 2.13)/    0/   10 [ms] #= 21
+cRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.154(+- 1.23)/    0/   10 [ms] #= 65
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.484(+-  2.8)/    0/   20 [ms] #= 62
+ChronoStatSvc        INFO Time User   : Tot= 0.59  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
index f5821ba46cf..96ba3d0902a 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RCond.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:23:48 CST 2019
+Wed Mar  6 20:23:41 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RCondJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:56 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:23:55 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -39,9 +39,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -57,7 +57,8 @@ EventSelector       DEBUG Service base class initialized successfully
 EventSelector        INFO reinitialization...
 EventSelector        INFO EventSelection with query 
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
+MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
+MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile1.root
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
@@ -73,8 +74,18 @@ SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21]
 SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[5 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[6 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[7 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[8 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[9 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
+##Shapes            DEBUG No objects passing selection criteria... Container has 10 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
 ##Links             DEBUG Opening
 ##Links             DEBUG    attributes# = 1
@@ -89,13 +100,39 @@ SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderFor
 SimplePoolFile1...  DEBUG ---->ClassID:????
 SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (14 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (15 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (16 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+##Links             DEBUG No objects passing selection criteria... Container has 21 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
 ##Params            DEBUG Opening
 ##Params            DEBUG    attributes# = 1
@@ -105,19 +142,12 @@ SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
 SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
 SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
 ##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -175,61 +205,7 @@ ReadData            DEBUG Data Deps for ReadData
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:ExampleHitContainer_p1 Typ:ExampleHitContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleHitContainer_p1/MyHits) [20?]  (4 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
-SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 ApplicationMgr       INFO Application Manager Started successfully
 RootDatabase.se...  DEBUG Request tree cache 
 RootDatabase.se...  DEBUG File name SimplePoolFile1.root
@@ -237,27 +213,28 @@ RootDatabase.se...  DEBUG Got tree CollectionTree read entry -1
 RootDatabase.se...  DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1
 MetaDataSvc         DEBUG handle() BeginInputFile for SimplePoolFile1.root
 MetaDataSvc         DEBUG initInputMetaDataStore: file name SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
 ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
 MetaDataSvc         DEBUG Loaded input meta data store proxies
 MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
+POOLContainer(D...  DEBUG Opening
+POOLContainer(D...  DEBUG    attributes# = 1
+POOLContainer(D...  DEBUG Branch container 'DataHeader'
+POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
 POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -297,6 +274,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -320,13 +298,14 @@ ReadData             INFO Hit x = 26.9145 y = 52.2238 z = 44.9265 detector = Dum
 ReadData             INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 1 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -335,6 +314,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -353,13 +333,14 @@ ReadData             INFO Hit x = 126.915 y = 52.2238 z = -55.0735 detector = Du
 ReadData             INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 2 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -368,6 +349,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -386,13 +368,14 @@ ReadData             INFO Hit x = 226.915 y = 52.2238 z = -155.073 detector = Du
 ReadData             INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 3 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -401,6 +384,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -419,13 +403,14 @@ ReadData             INFO Hit x = 326.915 y = 52.2238 z = -255.073 detector = Du
 ReadData             INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 4 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -434,6 +419,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -452,13 +438,14 @@ ReadData             INFO Hit x = 426.915 y = 52.2238 z = -355.073 detector = Du
 ReadData             INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 5 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -467,6 +454,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -485,13 +473,14 @@ ReadData             INFO Hit x = 526.914 y = 52.2238 z = -455.073 detector = Du
 ReadData             INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 6 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -500,6 +489,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -518,13 +508,14 @@ ReadData             INFO Hit x = 626.914 y = 52.2238 z = -555.073 detector = Du
 ReadData             INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 7 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -533,6 +524,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -551,13 +543,14 @@ ReadData             INFO Hit x = 726.914 y = 52.2238 z = -655.073 detector = Du
 ReadData             INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 8 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -566,6 +559,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -584,13 +578,14 @@ ReadData             INFO Hit x = 826.914 y = 52.2238 z = -755.073 detector = Du
 ReadData             INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 9 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -599,6 +594,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -617,13 +613,14 @@ ReadData             INFO Hit x = 926.914 y = 52.2238 z = -855.073 detector = Du
 ReadData             INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 10 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -632,6 +629,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -650,13 +648,14 @@ ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = Du
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 11 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -665,6 +664,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -683,13 +683,14 @@ ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = Du
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 12 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -698,6 +699,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -716,13 +718,14 @@ ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = Du
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 13 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -731,6 +734,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -749,13 +753,14 @@ ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = Du
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 14 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -764,6 +769,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -782,13 +788,14 @@ ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = Du
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 15 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -797,6 +804,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -815,13 +823,14 @@ ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = Du
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 16 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -830,6 +839,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -848,13 +858,14 @@ ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = Du
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 17 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -863,6 +874,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -881,13 +893,14 @@ ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = Du
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 18 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -896,6 +909,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -914,13 +928,14 @@ ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = Du
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 19 events processed so far  <<<===
 ReadCond            DEBUG in execute()
 ReadCond             INFO Pedestal x = 193136 y = 14420 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
@@ -929,6 +944,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -946,9 +962,9 @@ ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = Dum
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 MetaDataSvc         DEBUG MetaDataSvc::stop()
@@ -965,9 +981,9 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.217(+- 1.46)/    0/   10 [ms] #= 46
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.204(+- 1.41)/    0/   10 [ms] #= 49
-ChronoStatSvc        INFO Time User   : Tot= 0.56  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 49
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.652(+- 2.47)/    0/   10 [ms] #= 46
+ChronoStatSvc        INFO Time User   : Tot= 0.54  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
index 4c58119aee4..c73bae045a3 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_RMeta.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:24:13 CST 2019
+Wed Mar  6 20:06:52 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RMetaJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:24:22 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:07:03 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -36,9 +36,9 @@ PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.xml) [ok
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -54,7 +54,8 @@ EventSelector       DEBUG Service base class initialized successfully
 EventSelector        INFO reinitialization...
 EventSelector        INFO EventSelection with query 
 EventSelector       DEBUG Try item: "SimplePoolFile5.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile5.root returned FID: '????' tech=ROOT_All
+MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
+MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile5.root
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
@@ -70,8 +71,18 @@ SimplePoolFile5...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21]
 SimplePoolFile5...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
 SimplePoolFile5...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile5...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
+SimplePoolFile5...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --->Reading Shape[5 , ????]: [1 Column(s)]
+SimplePoolFile5...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --->Reading Shape[6 , ????]: [1 Column(s)]
+SimplePoolFile5...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --->Reading Shape[7 , ????]: [1 Column(s)]
+SimplePoolFile5...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --->Reading Shape[8 , ????]: [1 Column(s)]
+SimplePoolFile5...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --->Reading Shape[9 , ????]: [1 Column(s)]
 SimplePoolFile5...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
+##Shapes            DEBUG No objects passing selection criteria... Container has 10 Entries in total.
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
 ##Links             DEBUG Opening
 ##Links             DEBUG    attributes# = 1
@@ -86,15 +97,41 @@ SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderFor
 SimplePoolFile5...  DEBUG ---->ClassID:????
 SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(ExampleHitContainer_p1/PedestalWriteData) [20?]  (7 , ffffffff)
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (8 , ffffffff)
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (9 , ffffffff)
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (a , ffffffff)
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 9 Entries in total.
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(ExampleHitContainer_p1/PedestalWriteData) [20?]  (14 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (15 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (16 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (17 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+##Links             DEBUG No objects passing selection criteria... Container has 22 Entries in total.
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
 ##Params            DEBUG Opening
 ##Params            DEBUG    attributes# = 1
@@ -104,19 +141,12 @@ SimplePoolFile5...  DEBUG --->Reading Param:PFN=[SimplePoolFile5.root]
 SimplePoolFile5...  DEBUG --->Reading Param:POOL_VSN=[1.1]
 SimplePoolFile5...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
 ##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -134,66 +164,7 @@ ReadData            DEBUG Data Deps for ReadData
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "SimplePoolFile5.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile5.root returned FID: '????' tech=ROOT_All
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile5.root
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:ExampleHitContainer_p1 Typ:ExampleHitContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile5...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile5...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleHitContainer_p1/MyHits) [20?]  (4 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(ExampleHitContainer_p1/PedestalWriteData) [20?]  (7 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (8 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (9 , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (a , ffffffff)
-SimplePoolFile5...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 9 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile5...  DEBUG --->Reading Param:PFN=[SimplePoolFile5.root]
-SimplePoolFile5...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile5...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 ApplicationMgr       INFO Application Manager Started successfully
 RootDatabase.se...  DEBUG Request tree cache 
 RootDatabase.se...  DEBUG File name SimplePoolFile5.root
@@ -201,11 +172,6 @@ RootDatabase.se...  DEBUG Got tree CollectionTree read entry -1
 RootDatabase.se...  DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1
 MetaDataSvc         DEBUG handle() BeginInputFile for SimplePoolFile5.root
 MetaDataSvc         DEBUG initInputMetaDataStore: file name SimplePoolFile5.root
-SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
 ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
 MetaDataSvc         DEBUG Loaded input meta data store proxies
 MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
@@ -217,18 +183,24 @@ MetaData(Exampl...  DEBUG Branch container 'ExampleHitContainer_p1_PedestalWrite
 MetaData(Exampl...  DEBUG Opened container MetaData(ExampleHitContainer_p1/PedestalWriteData) of type ROOT_Tree
 ToolSvc.AthPool...   INFO Pedestal x = 193136 y = -5580.01 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o>
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
+POOLContainer(D...  DEBUG Opening
+POOLContainer(D...  DEBUG    attributes# = 1
+POOLContainer(D...  DEBUG Branch container 'DataHeader'
+POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
 POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile5...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -248,6 +220,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -271,19 +244,21 @@ ReadData             INFO Hit x = 26.9145 y = -47.7762 z = 44.9265 detector = Du
 ReadData             INFO Hit x = 30.1245 y = -53.4551 z = 43.831 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #0 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #0 1 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -302,19 +277,21 @@ ReadData             INFO Hit x = 126.915 y = -47.7762 z = -55.0735 detector = D
 ReadData             INFO Hit x = 130.125 y = -53.4551 z = -56.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #0 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #0 2 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -333,19 +310,21 @@ ReadData             INFO Hit x = 226.915 y = -47.7762 z = -155.073 detector = D
 ReadData             INFO Hit x = 230.125 y = -53.4551 z = -156.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #0 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #0 3 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -364,19 +343,21 @@ ReadData             INFO Hit x = 326.915 y = -47.7762 z = -255.073 detector = D
 ReadData             INFO Hit x = 330.125 y = -53.4551 z = -256.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #0 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #0 4 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -395,19 +376,21 @@ ReadData             INFO Hit x = 426.915 y = -47.7762 z = -355.073 detector = D
 ReadData             INFO Hit x = 430.125 y = -53.4551 z = -356.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #0 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #0 5 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -426,19 +409,21 @@ ReadData             INFO Hit x = 526.914 y = -47.7762 z = -455.073 detector = D
 ReadData             INFO Hit x = 530.125 y = -53.4551 z = -456.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #0 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #0 6 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -457,19 +442,21 @@ ReadData             INFO Hit x = 626.914 y = -47.7762 z = -555.073 detector = D
 ReadData             INFO Hit x = 630.125 y = -53.4551 z = -556.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #0 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #0 7 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -488,19 +475,21 @@ ReadData             INFO Hit x = 726.914 y = -47.7762 z = -655.073 detector = D
 ReadData             INFO Hit x = 730.125 y = -53.4551 z = -656.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #0 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #0 8 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -519,19 +508,21 @@ ReadData             INFO Hit x = 826.914 y = -47.7762 z = -755.073 detector = D
 ReadData             INFO Hit x = 830.125 y = -53.4551 z = -756.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #0 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #0 9 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -550,19 +541,21 @@ ReadData             INFO Hit x = 926.914 y = -47.7762 z = -855.073 detector = D
 ReadData             INFO Hit x = 930.125 y = -53.4551 z = -856.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #0 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #0 10 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -581,19 +574,21 @@ ReadData             INFO Hit x = 1026.91 y = -47.7762 z = -955.073 detector = D
 ReadData             INFO Hit x = 1030.12 y = -53.4551 z = -956.169 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #0 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #0 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -612,19 +607,21 @@ ReadData             INFO Hit x = 1126.91 y = -47.7762 z = -1055.07 detector = D
 ReadData             INFO Hit x = 1130.12 y = -53.4551 z = -1056.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #0 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #0 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -643,19 +640,21 @@ ReadData             INFO Hit x = 1226.91 y = -47.7762 z = -1155.07 detector = D
 ReadData             INFO Hit x = 1230.12 y = -53.4551 z = -1156.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #0 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #0 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -674,19 +673,21 @@ ReadData             INFO Hit x = 1326.91 y = -47.7762 z = -1255.07 detector = D
 ReadData             INFO Hit x = 1330.12 y = -53.4551 z = -1256.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #0 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #0 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -705,19 +706,21 @@ ReadData             INFO Hit x = 1426.91 y = -47.7762 z = -1355.07 detector = D
 ReadData             INFO Hit x = 1430.12 y = -53.4551 z = -1356.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #0 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #0 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -736,19 +739,21 @@ ReadData             INFO Hit x = 1526.91 y = -47.7762 z = -1455.07 detector = D
 ReadData             INFO Hit x = 1530.12 y = -53.4551 z = -1456.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #0 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #0 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -767,19 +772,21 @@ ReadData             INFO Hit x = 1626.91 y = -47.7762 z = -1555.07 detector = D
 ReadData             INFO Hit x = 1630.12 y = -53.4551 z = -1556.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #0 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #0 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -798,19 +805,21 @@ ReadData             INFO Hit x = 1726.91 y = -47.7762 z = -1655.07 detector = D
 ReadData             INFO Hit x = 1730.12 y = -53.4551 z = -1656.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #0 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #0 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -829,19 +838,21 @@ ReadData             INFO Hit x = 1826.91 y = -47.7762 z = -1755.07 detector = D
 ReadData             INFO Hit x = 1830.12 y = -53.4551 z = -1756.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #0 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #0 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -859,10 +870,10 @@ ReadData             INFO Hit x = 1923.7 y = -42.0973 z = -1853.68 detector = Du
 ReadData             INFO Hit x = 1926.91 y = -47.7762 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = -53.4551 z = -1856.17 detector = DummyHitDetector
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #0 20 events processed so far  <<<===
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 MetaDataSvc         DEBUG MetaDataSvc::stop()
@@ -878,7 +889,7 @@ ToolSvc.AthPool...   INFO in finalize()
 *****Chrono*****     INFO ****************************************************************************************************
 cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.213(+- 1.44)/    0/   10 [ms] #= 47
 cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.444(+- 2.06)/    0/   10 [ms] #= 45
-ChronoStatSvc        INFO Time User   : Tot= 0.56  [s]                                             #=  1
+ChronoStatSvc        INFO Time User   : Tot= 0.55  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
index 7c7ac2c1524..792b1e656e9 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:21:23 CST 2019
+Thu Mar  7 20:09:55 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,17 +13,18 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:32 2019
+                                          running on lxplus084.cern.ch on Thu Mar  7 20:10:05 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 ReadData            DEBUG Property update for OutputLevel : new value = 2
 ReadData             INFO in initialize()
 MetaDataSvc         DEBUG Property update for OutputLevel : new value = 2
@@ -35,9 +36,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-06T2144/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -170,7 +171,6 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -200,9 +200,10 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -222,6 +223,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -273,6 +275,7 @@ WriteTag             INFO EventInfo event: 0  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 0  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
@@ -308,6 +311,9 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 1
@@ -395,15 +401,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 1 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -450,12 +458,16 @@ WriteTag             INFO EventInfo event: 1  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 1  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
@@ -465,15 +477,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 2 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -520,12 +534,16 @@ WriteTag             INFO EventInfo event: 2  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 2  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
@@ -535,15 +553,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 3 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -590,12 +610,16 @@ WriteTag             INFO EventInfo event: 3  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 3  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
@@ -605,15 +629,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 4 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -660,12 +686,16 @@ WriteTag             INFO EventInfo event: 4  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 4  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
@@ -675,15 +705,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 5 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -730,12 +762,16 @@ WriteTag             INFO EventInfo event: 5  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 5  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
@@ -745,15 +781,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 6 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -800,12 +838,16 @@ WriteTag             INFO EventInfo event: 6  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 6  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
@@ -815,15 +857,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 7 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -870,12 +914,16 @@ WriteTag             INFO EventInfo event: 7  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 7  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
@@ -885,15 +933,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 8 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -940,12 +990,16 @@ WriteTag             INFO EventInfo event: 8  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 8  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
@@ -955,15 +1009,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 9 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1010,12 +1066,16 @@ WriteTag             INFO EventInfo event: 9  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 9  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
@@ -1025,15 +1085,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 10 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1080,12 +1142,16 @@ WriteTag             INFO EventInfo event: 10  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 10  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
@@ -1095,15 +1161,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1150,12 +1218,16 @@ WriteTag             INFO EventInfo event: 11  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 11  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
@@ -1165,15 +1237,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1220,12 +1294,16 @@ WriteTag             INFO EventInfo event: 12  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 12  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
@@ -1235,15 +1313,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1290,12 +1370,16 @@ WriteTag             INFO EventInfo event: 13  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 13  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
@@ -1305,15 +1389,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1360,12 +1446,16 @@ WriteTag             INFO EventInfo event: 14  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 14  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
@@ -1375,15 +1465,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1430,12 +1522,16 @@ WriteTag             INFO EventInfo event: 15  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 15  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
@@ -1445,15 +1541,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1500,12 +1598,16 @@ WriteTag             INFO EventInfo event: 16  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 16  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
@@ -1515,15 +1617,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1570,12 +1674,16 @@ WriteTag             INFO EventInfo event: 17  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 17  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
@@ -1585,15 +1693,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1640,12 +1750,16 @@ WriteTag             INFO EventInfo event: 18  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 18  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
@@ -1655,15 +1769,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1710,12 +1826,16 @@ WriteTag             INFO EventInfo event: 19  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 19  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
@@ -1781,13 +1901,13 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 66
-commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.476(+- 2.13)/    0/   10 [ms] #= 21
 cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0613(+-0.781)/    0/   10 [ms] #=163
-fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.323(+- 2.52)/    0/   20 [ms] #= 62
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot= 0.73  [s]                                             #=  1
+fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.323(+- 1.77)/    0/   10 [ms] #= 62
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.152(+- 1.22)/    0/   10 [ms] #= 66
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.159(+- 1.25)/    0/   10 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot= 0.55  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
index 73bf9a645d8..8b0ad4b5b22 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:22:02 CST 2019
+Thu Mar  7 20:06:56 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,17 +13,18 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:11 2019
+                                          running on lxplus084.cern.ch on Thu Mar  7 20:07:07 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 ReadData            DEBUG Property update for OutputLevel : new value = 2
 ReadData             INFO in initialize()
 MetaDataSvc         DEBUG Property update for OutputLevel : new value = 2
@@ -35,9 +36,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-06T2144/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -164,7 +165,6 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -324,6 +324,7 @@ WriteTag             INFO EventInfo event: 0  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 0  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
@@ -358,6 +359,9 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 1
@@ -504,6 +508,7 @@ WriteTag             INFO EventInfo event: 1  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 1  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 ClassIDSvc           INFO  getRegistryEntries: read 3 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
@@ -511,6 +516,9 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
@@ -575,12 +583,16 @@ WriteTag             INFO EventInfo event: 2  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 2  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
@@ -645,12 +657,16 @@ WriteTag             INFO EventInfo event: 3  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 3  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
@@ -715,12 +731,16 @@ WriteTag             INFO EventInfo event: 4  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 4  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
@@ -785,12 +805,16 @@ WriteTag             INFO EventInfo event: 5  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 5  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
@@ -855,12 +879,16 @@ WriteTag             INFO EventInfo event: 6  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 6  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
@@ -925,12 +953,16 @@ WriteTag             INFO EventInfo event: 7  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 7  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
@@ -995,12 +1027,16 @@ WriteTag             INFO EventInfo event: 8  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 8  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
@@ -1065,12 +1101,16 @@ WriteTag             INFO EventInfo event: 9  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 9  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
@@ -1135,12 +1175,16 @@ WriteTag             INFO EventInfo event: 10  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 10  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
@@ -1205,12 +1249,16 @@ WriteTag             INFO EventInfo event: 11  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 11  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
@@ -1275,12 +1323,16 @@ WriteTag             INFO EventInfo event: 12  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 12  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
@@ -1345,12 +1397,16 @@ WriteTag             INFO EventInfo event: 13  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 13  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
@@ -1415,12 +1471,16 @@ WriteTag             INFO EventInfo event: 14  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 14  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
@@ -1485,12 +1545,16 @@ WriteTag             INFO EventInfo event: 15  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 15  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
@@ -1555,12 +1619,16 @@ WriteTag             INFO EventInfo event: 16  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 16  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
@@ -1625,12 +1693,16 @@ WriteTag             INFO EventInfo event: 17  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 17  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
@@ -1695,12 +1767,16 @@ WriteTag             INFO EventInfo event: 18  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 18  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
@@ -1765,12 +1841,16 @@ WriteTag             INFO EventInfo event: 19  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 19  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
@@ -1838,11 +1918,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
+cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0613(+-0.781)/    0/   10 [ms] #=163
+fRep_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.161(+- 1.26)/    0/   10 [ms] #= 62
 cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.154(+- 1.23)/    0/   10 [ms] #= 65
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
-cRepR_ALL            INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.184(+- 1.74)/    0/   20 [ms] #=163
-fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.645(+- 3.04)/    0/   20 [ms] #= 62
-ChronoStatSvc        INFO Time User   : Tot= 0.67  [s]                                             #=  1
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+-  2.5)/    0/   20 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot=  0.6  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
index 70d5e12ca4d..2fa0820947c 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:22:15 CST 2019
+Thu Mar  7 20:01:12 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5462 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,17 +13,18 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:22:25 2019
+                                          running on lxplus084.cern.ch on Thu Mar  7 20:01:22 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 ReadData            DEBUG Property update for OutputLevel : new value = 2
 ReadData             INFO in initialize()
 MetaDataSvc         DEBUG Property update for OutputLevel : new value = 2
@@ -35,9 +36,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-06T2144/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -170,7 +171,6 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 673 CLIDRegistry entries for module ALL
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
@@ -241,6 +241,7 @@ WriteTag             INFO EventInfo event: 0  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 0  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     UPDATE    [ROOT_All] 
 AthenaPoolCnvSvc    DEBUG setAttribute TREE_MAX_SIZE to 1099511627776L
@@ -276,6 +277,9 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 1
@@ -384,12 +388,16 @@ WriteTag             INFO EventInfo event: 1  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 1  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 2
@@ -422,12 +430,16 @@ WriteTag             INFO EventInfo event: 2  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 2  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 3
@@ -460,12 +472,16 @@ WriteTag             INFO EventInfo event: 3  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 3  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 4
@@ -498,12 +514,16 @@ WriteTag             INFO EventInfo event: 4  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 4  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 5
@@ -536,12 +556,16 @@ WriteTag             INFO EventInfo event: 5  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 5  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 6
@@ -574,12 +598,16 @@ WriteTag             INFO EventInfo event: 6  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 6  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 7
@@ -612,12 +640,16 @@ WriteTag             INFO EventInfo event: 7  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 7  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 8
@@ -650,12 +682,16 @@ WriteTag             INFO EventInfo event: 8  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 8  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 9
@@ -688,12 +724,16 @@ WriteTag             INFO EventInfo event: 9  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 9  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 10
@@ -726,12 +766,16 @@ WriteTag             INFO EventInfo event: 10  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 10  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 11
@@ -764,12 +808,16 @@ WriteTag             INFO EventInfo event: 11  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 11  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 12
@@ -802,12 +850,16 @@ WriteTag             INFO EventInfo event: 12  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 12  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 13
@@ -840,12 +892,16 @@ WriteTag             INFO EventInfo event: 13  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 13  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 14
@@ -878,12 +934,16 @@ WriteTag             INFO EventInfo event: 14  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 14  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 15
@@ -916,12 +976,16 @@ WriteTag             INFO EventInfo event: 15  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 15  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 16
@@ -954,12 +1018,16 @@ WriteTag             INFO EventInfo event: 16  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 16  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 17
@@ -992,12 +1060,16 @@ WriteTag             INFO EventInfo event: 17  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 17  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 18
@@ -1030,12 +1102,16 @@ WriteTag             INFO EventInfo event: 18  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 18  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 19
@@ -1068,12 +1144,16 @@ WriteTag             INFO EventInfo event: 19  run: 1
 WriteTag             INFO registered all data
 MagicWriteTag        INFO EventInfo event: 19  run: 1
 MagicWriteTag        INFO registered all data
+EventInfoTagBui...WARNING Did not find xAOD::EventInfo
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9103,"MyTracks") called
 Stream1             DEBUG            Key:MyTracks
 Stream1             DEBUG  Added object 9103,"MyTracks"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  No object matching 40774348,"SimpleTag" found
 Stream1             DEBUG  Collected objects:
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleTrackContainer_MyTracks, 20
@@ -1141,11 +1221,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 62
-cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.154(+- 1.23)/    0/   10 [ms] #= 65
-cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0613(+-0.781)/    0/   10 [ms] #=163
+cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=163
 fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.323(+- 1.77)/    0/   10 [ms] #= 62
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot= 0.76  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 65
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.159(+- 1.25)/    0/   10 [ms] #= 63
+ChronoStatSvc        INFO Time User   : Tot= 0.57  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
index ccd005b6b21..c1c60b33ea3 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Read.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:21:37 CST 2019
+Wed Mar  6 21:41:44 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:45 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 21:41:56 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -34,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -278,9 +278,10 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -300,6 +301,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -321,7 +323,7 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -329,15 +331,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 1 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -354,7 +358,7 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -362,15 +366,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 2 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -387,7 +393,7 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -395,15 +401,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 3 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -420,7 +428,7 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -428,15 +436,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 4 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -453,7 +463,7 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -461,15 +471,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 5 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -486,7 +498,7 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -494,15 +506,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 6 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -519,7 +533,7 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -527,15 +541,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 7 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -552,7 +568,7 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -560,15 +576,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 8 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -585,7 +603,7 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -593,15 +611,17 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 9 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -618,7 +638,7 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20099
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20?36
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -784,8 +804,9 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 SimplePoolFile2...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
 CollectionTree(...  DEBUG    attributes# = 1
@@ -801,6 +822,7 @@ MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream2)
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -808,7 +830,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -816,13 +838,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -830,7 +854,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -838,13 +862,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -852,7 +878,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -860,13 +886,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -874,7 +902,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -882,13 +910,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -896,7 +926,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -904,13 +934,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -918,7 +950,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -926,13 +958,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -940,7 +974,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -948,13 +982,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -962,7 +998,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -970,13 +1006,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -984,7 +1022,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -992,13 +1030,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1006,7 +1046,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1014,13 +1054,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 20 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1028,7 +1070,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1036,13 +1078,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 21 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1050,7 +1094,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1058,13 +1102,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 22 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1072,7 +1118,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1080,13 +1126,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 23 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1094,7 +1142,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1102,13 +1150,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 24 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1116,7 +1166,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1124,13 +1174,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 25 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1138,7 +1190,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1146,13 +1198,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 26 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1160,7 +1214,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1168,13 +1222,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 27 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1182,7 +1238,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1190,13 +1246,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 28 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1204,7 +1262,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1212,13 +1270,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 29 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1226,7 +1286,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16796
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1369,7 +1429,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1395,7 +1455,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1421,7 +1481,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1447,7 +1507,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1473,7 +1533,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1499,7 +1559,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1525,7 +1585,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1551,7 +1611,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1577,7 +1637,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1603,7 +1663,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1629,7 +1689,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1655,7 +1715,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1681,7 +1741,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1707,7 +1767,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1733,7 +1793,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1759,7 +1819,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1785,7 +1845,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1811,7 +1871,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1837,7 +1897,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1863,7 +1923,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18973
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18945
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1882,9 +1942,9 @@ 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=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=101
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 1.78)/    0/   10 [ms] #= 92
-ChronoStatSvc        INFO Time User   : Tot= 0.64  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.099(+- 0.99)/    0/   10 [ms] #=101
+cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.217(+- 1.46)/    0/   10 [ms] #= 92
+ChronoStatSvc        INFO Time User   : Tot= 0.58  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
index cf738fb8201..9c8d91f3142 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadAgain.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:22:55 CST 2019
+Wed Mar  6 20:54:14 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadAgainJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:03 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:54:28 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -34,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -380,7 +380,7 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -413,7 +413,7 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -446,7 +446,7 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -479,7 +479,7 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -512,7 +512,7 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -545,7 +545,7 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -578,7 +578,7 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -611,7 +611,7 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -644,7 +644,7 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -677,7 +677,7 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19640
+PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [BYTES_READ]: 19623
 PoolSvc              INFO Database (SimplePoolReplica1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
@@ -844,8 +844,9 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 SimplePoolFile2...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
 CollectionTree(...  DEBUG    attributes# = 1
@@ -861,6 +862,7 @@ MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream2)
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -868,7 +870,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -876,13 +878,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -890,7 +894,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -898,13 +902,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -912,7 +918,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -920,13 +926,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -934,7 +942,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -942,13 +950,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -956,7 +966,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -964,13 +974,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -978,7 +990,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -986,13 +998,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1000,7 +1014,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1008,13 +1022,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1022,7 +1038,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1030,13 +1046,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1044,7 +1062,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1052,13 +1070,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1066,7 +1086,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1074,13 +1094,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 20 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1088,7 +1110,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1096,13 +1118,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 21 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1110,7 +1134,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1118,13 +1142,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 22 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1132,7 +1158,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1140,13 +1166,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 23 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1154,7 +1182,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1162,13 +1190,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 24 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1176,7 +1206,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1184,13 +1214,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 25 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1198,7 +1230,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1206,13 +1238,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 26 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1220,7 +1254,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1228,13 +1262,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 27 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1242,7 +1278,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1250,13 +1286,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 28 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1264,7 +1302,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1272,13 +1310,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 29 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1286,7 +1326,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16799
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1429,7 +1469,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1455,7 +1495,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1481,7 +1521,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1507,7 +1547,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1533,7 +1573,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1559,7 +1599,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1585,7 +1625,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1611,7 +1651,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1637,7 +1677,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1663,7 +1703,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1689,7 +1729,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1715,7 +1755,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1741,7 +1781,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1767,7 +1807,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1793,7 +1833,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1819,7 +1859,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1845,7 +1885,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1871,7 +1911,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1897,7 +1937,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1923,7 +1963,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19064
+PoolSvc              INFO Database (SimplePoolFile4.root) attribute [BYTES_READ]: 19048
 PoolSvc              INFO Database (SimplePoolFile4.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1942,9 +1982,9 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-cObj_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 92
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=101
-ChronoStatSvc        INFO Time User   : Tot= 0.68  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.099(+- 0.99)/    0/   10 [ms] #=101
+cObj_ALL             INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.109(+- 1.04)/    0/   10 [ms] #= 92
+ChronoStatSvc        INFO Time User   : Tot= 0.58  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
index c8a17acb6f1..277b7800a5a 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReadConcat.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:23:20 CST 2019
+Wed Mar  6 20:35:46 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReadJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:30 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:35:57 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 836 CLIDRegistry entries for module ALL
@@ -34,9 +34,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -93,7 +93,8 @@ EventSelector       DEBUG No events found in: EmptyPoolFile.root skipped!!!
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
+MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
+MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 DbSession            INFO     Open     DbSession    
 Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
@@ -111,8 +112,18 @@ SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21]
 SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[5 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[6 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[7 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[8 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[9 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
+##Shapes            DEBUG No objects passing selection criteria... Container has 10 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
 ##Links             DEBUG Opening
 ##Links             DEBUG    attributes# = 1
@@ -127,13 +138,39 @@ SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderFor
 SimplePoolFile1...  DEBUG ---->ClassID:????
 SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (14 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (15 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (16 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+##Links             DEBUG No objects passing selection criteria... Container has 21 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
 ##Params            DEBUG Opening
 ##Params            DEBUG    attributes# = 1
@@ -143,19 +180,12 @@ SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
 SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
 SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
 ##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2075 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2078 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -173,12 +203,8 @@ ReadData            DEBUG Data Deps for ReadData
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "EmptyPoolFile.root" from the collection list.
 PersistencySvc:...  DEBUG lookupPFN: EmptyPoolFile.root returned FID: '????' tech=ROOT_All
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO                           EmptyPoolFile.root
 EmptyPoolFile.root  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
@@ -234,63 +260,7 @@ MetaDataSvc         DEBUG Loaded input meta data store proxies
 MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
 MetaDataSvc         DEBUG handle() EndInputFile for eventless EmptyPoolFile.root
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:ExampleHitContainer_p1 Typ:ExampleHitContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleHitContainer_p1/MyHits) [20?]  (4 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
-SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 ApplicationMgr       INFO Application Manager Started successfully
 RootDatabase.se...  DEBUG Request tree cache 
 RootDatabase.se...  DEBUG File name SimplePoolFile1.root
@@ -305,16 +275,6 @@ PoolSvc              INFO Database (SimplePoolFile1.root) attribute [TREE_CACHE_
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [TREE_CACHE_SIZE]: 100000
 MetaDataSvc         DEBUG handle() BeginInputFile for SimplePoolFile1.root
 MetaDataSvc         DEBUG initInputMetaDataStore: file name SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
-MetaDataHdrForm...  DEBUG Opening
-MetaDataHdrForm...  DEBUG    attributes# = 1
-MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
-MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
 MetaDataSvc         DEBUG Loaded input meta data store proxies
 MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
 EventSelector        INFO skipping event 1
@@ -328,18 +288,24 @@ EventSelector        INFO skipping event 8
 EventSelector        INFO skipping event 9
 EventSelector        INFO skipping event 10
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
+POOLContainer(D...  DEBUG Opening
+POOLContainer(D...  DEBUG    attributes# = 1
+POOLContainer(D...  DEBUG Branch container 'DataHeader'
+POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
 POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -359,6 +325,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -380,23 +347,25 @@ ReadData             INFO Hit x = 1020.49 y = 63.5816 z = -951.864 detector = Du
 ReadData             INFO Hit x = 1023.7 y = 57.9027 z = -953.684 detector = DummyHitDetector
 ReadData             INFO Hit x = 1026.91 y = 52.2238 z = -955.073 detector = DummyHitDetector
 ReadData             INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 1 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -413,23 +382,25 @@ ReadData             INFO Hit x = 1120.49 y = 63.5816 z = -1051.86 detector = Du
 ReadData             INFO Hit x = 1123.7 y = 57.9027 z = -1053.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1126.91 y = 52.2238 z = -1055.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 2 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -446,23 +417,25 @@ ReadData             INFO Hit x = 1220.49 y = 63.5816 z = -1151.86 detector = Du
 ReadData             INFO Hit x = 1223.7 y = 57.9027 z = -1153.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1226.91 y = 52.2238 z = -1155.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 3 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -479,23 +452,25 @@ ReadData             INFO Hit x = 1320.49 y = 63.5816 z = -1251.86 detector = Du
 ReadData             INFO Hit x = 1323.7 y = 57.9027 z = -1253.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1326.91 y = 52.2238 z = -1255.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 4 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -512,23 +487,25 @@ ReadData             INFO Hit x = 1420.49 y = 63.5816 z = -1351.86 detector = Du
 ReadData             INFO Hit x = 1423.7 y = 57.9027 z = -1353.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1426.91 y = 52.2238 z = -1355.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 5 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -545,23 +522,25 @@ ReadData             INFO Hit x = 1520.49 y = 63.5816 z = -1451.86 detector = Du
 ReadData             INFO Hit x = 1523.7 y = 57.9027 z = -1453.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1526.91 y = 52.2238 z = -1455.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 6 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -578,23 +557,25 @@ ReadData             INFO Hit x = 1620.49 y = 63.5816 z = -1551.86 detector = Du
 ReadData             INFO Hit x = 1623.7 y = 57.9027 z = -1553.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1626.91 y = 52.2238 z = -1555.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 7 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -611,23 +592,25 @@ ReadData             INFO Hit x = 1720.49 y = 63.5816 z = -1651.86 detector = Du
 ReadData             INFO Hit x = 1723.7 y = 57.9027 z = -1653.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1726.91 y = 52.2238 z = -1655.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 8 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -644,23 +627,25 @@ ReadData             INFO Hit x = 1820.49 y = 63.5816 z = -1751.86 detector = Du
 ReadData             INFO Hit x = 1823.7 y = 57.9027 z = -1753.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1826.91 y = 52.2238 z = -1755.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 9 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -677,13 +662,13 @@ ReadData             INFO Hit x = 1920.49 y = 63.5816 z = -1851.86 detector = Du
 ReadData             INFO Hit x = 1923.7 y = 57.9027 z = -1853.68 detector = DummyHitDetector
 ReadData             INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = DummyHitDetector
 ReadData             INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
-PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 19701
+PoolSvc              INFO Database (SimplePoolFile1.root) attribute [BYTES_READ]: 20845
 PoolSvc              INFO Database (SimplePoolFile1.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 10 events processed so far  <<<===
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "EmptyPoolFile.root" from the collection list.
 PersistencySvc:...  DEBUG lookupPFN: EmptyPoolFile.root returned FID: '????' tech=ROOT_All
 DbSession            INFO     Open     DbSession    
@@ -821,7 +806,6 @@ MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 3 CLIDRegistry entries for module ALL
 SimplePoolFile2...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
 MetaDataHdrForm...  DEBUG    attributes# = 1
@@ -844,8 +828,9 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 SimplePoolFile2...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
 CollectionTree(...  DEBUG    attributes# = 1
@@ -861,6 +846,7 @@ MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream2)
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -868,7 +854,7 @@ ReadData             INFO EventInfo event: 0 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -876,13 +862,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -890,7 +878,7 @@ ReadData             INFO EventInfo event: 1 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -898,13 +886,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -912,7 +902,7 @@ ReadData             INFO EventInfo event: 2 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -920,13 +910,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -934,7 +926,7 @@ ReadData             INFO EventInfo event: 3 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -942,13 +934,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -956,7 +950,7 @@ ReadData             INFO EventInfo event: 4 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -964,13 +958,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -978,7 +974,7 @@ ReadData             INFO EventInfo event: 5 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -986,13 +982,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1000,7 +998,7 @@ ReadData             INFO EventInfo event: 6 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1008,13 +1006,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1022,7 +1022,7 @@ ReadData             INFO EventInfo event: 7 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1030,13 +1030,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1044,7 +1046,7 @@ ReadData             INFO EventInfo event: 8 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1052,13 +1054,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1066,7 +1070,7 @@ ReadData             INFO EventInfo event: 9 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 20 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1074,13 +1078,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 20 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1088,7 +1094,7 @@ ReadData             INFO EventInfo event: 10 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 21 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1096,13 +1102,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 21 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1110,7 +1118,7 @@ ReadData             INFO EventInfo event: 11 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 22 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1118,13 +1126,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 22 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1132,7 +1142,7 @@ ReadData             INFO EventInfo event: 12 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 23 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1140,13 +1150,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 23 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1154,7 +1166,7 @@ ReadData             INFO EventInfo event: 13 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 24 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1162,13 +1174,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 24 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1176,7 +1190,7 @@ ReadData             INFO EventInfo event: 14 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 25 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1184,13 +1198,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 25 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1198,7 +1214,7 @@ ReadData             INFO EventInfo event: 15 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 26 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1206,13 +1222,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 26 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1220,7 +1238,7 @@ ReadData             INFO EventInfo event: 16 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 27 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1228,13 +1246,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 27 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1242,7 +1262,7 @@ ReadData             INFO EventInfo event: 17 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 28 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1250,13 +1270,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 28 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1264,7 +1286,7 @@ ReadData             INFO EventInfo event: 18 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 29 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1272,13 +1294,15 @@ EventSelector       DEBUG AttributeList size 3
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000005-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 2 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 29 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1286,7 +1310,7 @@ ReadData             INFO EventInfo event: 19 run: 1
 ReadData             INFO Get Smart data ptr 1
 ReadData             INFO Could not find ExampleTrackContainer/MyTracks
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16732
+PoolSvc              INFO Database (SimplePoolFile2.root) attribute [BYTES_READ]: 16803
 PoolSvc              INFO Database (SimplePoolFile2.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 30 events processed so far  <<<===
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
@@ -1384,9 +1408,10 @@ POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 SimplePoolFile3...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
 CollectionTree(...  DEBUG    attributes# = 1
@@ -1403,6 +1428,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1417,7 +1443,7 @@ ReadData             INFO Track pt = 74.8928 eta = 3.1676 phi = 2.6161 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 31 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1425,15 +1451,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 31 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1443,7 +1471,7 @@ ReadData             INFO Track pt = 137.584 eta = -39.525 phi = 17.2679 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 32 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1451,15 +1479,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 32 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1469,7 +1499,7 @@ ReadData             INFO Track pt = 228.154 eta = -6.2704 phi = 31.9197 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 33 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1477,15 +1507,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 33 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1495,7 +1527,7 @@ ReadData             INFO Track pt = 324.306 eta = -15.8941 phi = 46.5715 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 34 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1503,15 +1535,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 34 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1521,7 +1555,7 @@ ReadData             INFO Track pt = 422.255 eta = -13.279 phi = 61.2233 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 35 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1529,15 +1563,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 35 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1547,7 +1583,7 @@ ReadData             INFO Track pt = 520.987 eta = -12.3511 phi = 75.8751 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 36 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1555,15 +1591,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 36 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1573,7 +1611,7 @@ ReadData             INFO Track pt = 620.127 eta = -11.8468 phi = 90.5269 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 37 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1581,15 +1619,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 37 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1599,7 +1639,7 @@ ReadData             INFO Track pt = 719.507 eta = -11.5247 phi = 105.179 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 38 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1607,15 +1647,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 38 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1625,7 +1667,7 @@ ReadData             INFO Track pt = 819.038 eta = -11.2998 phi = 119.831 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 39 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1633,15 +1675,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 39 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1651,7 +1695,7 @@ ReadData             INFO Track pt = 918.671 eta = -11.1334 phi = 134.482 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 40 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1659,15 +1703,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 40 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1677,7 +1723,7 @@ ReadData             INFO Track pt = 1018.38 eta = -11.0052 phi = 149.134 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 41 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1685,15 +1731,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 41 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1703,7 +1751,7 @@ ReadData             INFO Track pt = 1118.13 eta = -10.9031 phi = 163.786 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 42 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1711,15 +1759,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 42 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1729,7 +1779,7 @@ ReadData             INFO Track pt = 1217.93 eta = -10.82 phi = 178.438 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 43 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1737,15 +1787,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 43 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1755,7 +1807,7 @@ ReadData             INFO Track pt = 1317.76 eta = -10.751 phi = 193.09 detector
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 44 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1763,15 +1815,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 44 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1781,7 +1835,7 @@ ReadData             INFO Track pt = 1417.61 eta = -10.6927 phi = 207.741 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 45 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1789,15 +1843,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 45 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1807,7 +1863,7 @@ ReadData             INFO Track pt = 1517.49 eta = -10.6429 phi = 222.393 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 46 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1815,15 +1871,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 46 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1833,7 +1891,7 @@ ReadData             INFO Track pt = 1617.37 eta = -10.5997 phi = 237.045 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 47 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1841,15 +1899,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 47 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1859,7 +1919,7 @@ ReadData             INFO Track pt = 1717.27 eta = -10.562 phi = 251.697 detecto
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 48 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1867,15 +1927,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 48 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1885,7 +1947,7 @@ ReadData             INFO Track pt = 1817.19 eta = -10.5288 phi = 266.349 detect
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 49 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
@@ -1893,15 +1955,17 @@ EventSelector       DEBUG AttributeList size 0
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9103, name = MyTracks
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 49 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9103, key = MyTracks
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1911,7 +1975,7 @@ ReadData             INFO Track pt = 1917.11 eta = -10.4993 phi = 281 detector =
 DataProxy         WARNING accessData:  IOA pointer not set
 ReadData          WARNING Could not follow ExampleTrackContainer/MyTracks ElementLinks to ExampleHitContainer/MyHits
 ReadData             INFO Could not find ExampleHitContainer/MyHits
-PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18591
+PoolSvc              INFO Database (SimplePoolFile3.root) attribute [BYTES_READ]: 18731
 PoolSvc              INFO Database (SimplePoolFile3.root) attribute [READ_CALLS]: 21
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 50 events processed so far  <<<===
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
@@ -1931,8 +1995,8 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
 cObjR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.099(+- 0.99)/    0/   10 [ms] #=101
-cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 1.78)/    0/   10 [ms] #= 92
-ChronoStatSvc        INFO Time User   : Tot= 0.66  [s]                                             #=  1
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.326(+- 2.31)/    0/   20 [ms] #= 92
+ChronoStatSvc        INFO Time User   : Tot= 0.58  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
index 5fa7ff4b8fa..41d7d17714d 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WCond.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:23:35 CST 2019
+Wed Mar  6 20:31:08 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WCondJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,14 +13,14 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:23:43 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:31:19 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 1169 CLIDRegistry entries for module ALL
@@ -32,9 +32,9 @@ PoolSvc             DEBUG Property update for OutputLevel : new value = 2
 PoolSvc             DEBUG Service base class initialized successfully
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -56,7 +56,8 @@ EventSelector       DEBUG Service base class initialized successfully
 EventSelector        INFO reinitialization...
 EventSelector        INFO EventSelection with query 
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
+MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
+MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
 Domain[ROOT_All]     INFO                           SimplePoolFile1.root
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
@@ -72,8 +73,18 @@ SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21]
 SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[5 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[6 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[7 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[8 , ????]: [1 Column(s)]
+SimplePoolFile1...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
+SimplePoolFile1...  DEBUG --->Reading Shape[9 , ????]: [1 Column(s)]
 SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
+##Shapes            DEBUG No objects passing selection criteria... Container has 10 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
 ##Links             DEBUG Opening
 ##Links             DEBUG    attributes# = 1
@@ -88,13 +99,39 @@ SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderFor
 SimplePoolFile1...  DEBUG ---->ClassID:????
 SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (14 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (15 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (16 , ffffffff)
+SimplePoolFile1...  DEBUG ---->ClassID:????
+##Links             DEBUG No objects passing selection criteria... Container has 21 Entries in total.
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
 ##Params            DEBUG Opening
 ##Params            DEBUG    attributes# = 1
@@ -104,19 +141,12 @@ SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
 SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
 SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
 ##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
-MetaDataSvc         DEBUG handle() FirstInputFile for FID:????
-MetaDataSvc         DEBUG initInputMetaDataStore: file name FID:????
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-ClassIDSvc           INFO  getRegistryEntries: read 2070 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 2073 CLIDRegistry entries for module ALL
 EventPersistenc...   INFO Added successfully Conversion service:AthenaPoolCnvSvc
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
 MetaDataHdrForm...  DEBUG Opening
@@ -141,64 +171,7 @@ WriteCond           DEBUG Data Deps for WriteCond
 HistogramPersis...WARNING Histograms saving not required.
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
 ApplicationMgr       INFO Application Manager Initialized successfully
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 EventSelector       DEBUG Try item: "SimplePoolFile1.root" from the collection list.
-PersistencySvc:...  DEBUG lookupPFN: SimplePoolFile1.root returned FID: '????' tech=ROOT_All
-DbSession            INFO     Open     DbSession    
-Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
-Domain[ROOT_All]     INFO ->  Access   DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO                           SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Shapes
-##Shapes            DEBUG Opening
-##Shapes            DEBUG    attributes# = 1
-##Shapes            DEBUG Opened container ##Shapes of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Shape[0 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventInfo_p4 Typ:EventInfo_p4 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[1 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:ExampleHitContainer_p1 Typ:ExampleHitContainer_p1 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[2 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeaderForm_p5 Typ:DataHeaderForm_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[3 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
-SimplePoolFile1...  DEBUG --->Reading Shape[4 , ????]: [1 Column(s)]
-SimplePoolFile1...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
-##Shapes            DEBUG No objects passing selection criteria... Container has 5 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Links
-##Links             DEBUG Opening
-##Links             DEBUG    attributes# = 1
-##Links             DEBUG Opened container ##Links of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/##Params [200]  (2 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(EventInfo_p4/McEventInfo) [20?]  (3 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/CollectionTree(ExampleHitContainer_p1/MyHits) [20?]  (4 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainerForm(DataHeaderForm) [20?]  (5 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/POOLContainer(DataHeader) [20?]  (6 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (7 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdrForm(DataHeaderForm) [20?]  (8 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-SimplePoolFile1...  DEBUG --->Reading Assoc:????/MetaDataHdr(DataHeader) [20?]  (9 , ffffffff)
-SimplePoolFile1...  DEBUG ---->ClassID:????
-##Links             DEBUG No objects passing selection criteria... Container has 8 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_All] ##Params
-##Params            DEBUG Opening
-##Params            DEBUG    attributes# = 1
-##Params            DEBUG Opened container ##Params of type ROOT_Tree
-SimplePoolFile1...  DEBUG --->Reading Param:FID=[????]
-SimplePoolFile1...  DEBUG --->Reading Param:PFN=[SimplePoolFile1.root]
-SimplePoolFile1...  DEBUG --->Reading Param:POOL_VSN=[1.1]
-SimplePoolFile1...  DEBUG --->Reading Param:FORMAT_VSN=[1.1]
-##Params            DEBUG No objects passing selection criteria... Container has 4 Entries in total.
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
-POOLContainer(D...  DEBUG Opening
-POOLContainer(D...  DEBUG    attributes# = 1
-POOLContainer(D...  DEBUG Branch container 'DataHeader'
-POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 ApplicationMgr       INFO Application Manager Started successfully
 RootDatabase.se...  DEBUG Request tree cache 
 RootDatabase.se...  DEBUG File name SimplePoolFile1.root
@@ -206,27 +179,28 @@ RootDatabase.se...  DEBUG Got tree CollectionTree read entry -1
 RootDatabase.se...  DEBUG Using Tree cache. Size: -1 Nevents to learn with: -1
 MetaDataSvc         DEBUG handle() BeginInputFile for SimplePoolFile1.root
 MetaDataSvc         DEBUG initInputMetaDataStore: file name SimplePoolFile1.root
-SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] MetaDataHdr(DataHeader)
-MetaDataHdr(Dat...  DEBUG Opening
-MetaDataHdr(Dat...  DEBUG    attributes# = 1
-MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
-MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
 ClassIDSvc           INFO  getRegistryEntries: read 2 CLIDRegistry entries for module ALL
 MetaDataSvc         DEBUG Loaded input meta data store proxies
 MetaDataSvc         DEBUG  calling beginInputFile for ToolSvc.IOVDbMetaDataTool
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000000]
+SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainer(DataHeader)
+POOLContainer(D...  DEBUG Opening
+POOLContainer(D...  DEBUG    attributes# = 1
+POOLContainer(D...  DEBUG Branch container 'DataHeader'
+POOLContainer(D...  DEBUG Opened container POOLContainer(DataHeader) of type ROOT_Tree
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] POOLContainerForm(DataHeaderForm)
 POOLContainerFo...  DEBUG Opening
 POOLContainerFo...  DEBUG    attributes# = 1
 POOLContainerFo...  DEBUG Branch container 'DataHeaderForm'
 POOLContainerFo...  DEBUG Opened container POOLContainerForm(DataHeaderForm) of type ROOT_Tree
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AlgResourcePool      INFO TopAlg list empty. Recovering the one of Application Manager
 SimplePoolFile1...  DEBUG --> Access   DbContainer  READ      [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -246,6 +220,7 @@ ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -281,19 +256,21 @@ WriteCond            INFO Hit x = 30.1245 y = 46.5449 z = 43.831 detector = Dumm
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #1 1 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000001]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 1 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -324,19 +301,21 @@ WriteCond            INFO Hit x = 130.125 y = 46.5449 z = -56.169 detector = Dum
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000002]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 2 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -367,19 +346,21 @@ WriteCond            INFO Hit x = 230.125 y = 46.5449 z = -156.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000003]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 3 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -410,19 +391,21 @@ WriteCond            INFO Hit x = 330.125 y = 46.5449 z = -256.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000004]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 4 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -453,19 +436,21 @@ WriteCond            INFO Hit x = 430.125 y = 46.5449 z = -356.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000005]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 5 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -496,19 +481,21 @@ WriteCond            INFO Hit x = 530.125 y = 46.5449 z = -456.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000006]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 6 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -539,19 +526,21 @@ WriteCond            INFO Hit x = 630.125 y = 46.5449 z = -556.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000007]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 7 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -582,19 +571,21 @@ WriteCond            INFO Hit x = 730.125 y = 46.5449 z = -656.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000008]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 8 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -625,19 +616,21 @@ WriteCond            INFO Hit x = 830.125 y = 46.5449 z = -756.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000009]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 9 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -668,19 +661,21 @@ WriteCond            INFO Hit x = 930.125 y = 46.5449 z = -856.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000A]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 10 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -711,19 +706,21 @@ WriteCond            INFO Hit x = 1030.12 y = 46.5449 z = -956.169 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000B]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 11 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -754,19 +751,21 @@ WriteCond            INFO Hit x = 1130.12 y = 46.5449 z = -1056.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000C]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 12 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -797,19 +796,21 @@ WriteCond            INFO Hit x = 1230.12 y = 46.5449 z = -1156.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000D]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 13 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -840,19 +841,21 @@ WriteCond            INFO Hit x = 1330.12 y = 46.5449 z = -1256.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000E]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 14 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -883,19 +886,21 @@ WriteCond            INFO Hit x = 1430.12 y = 46.5449 z = -1356.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-0000000F]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 15 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -926,19 +931,21 @@ WriteCond            INFO Hit x = 1530.12 y = 46.5449 z = -1456.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000010]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 16 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -969,19 +976,21 @@ WriteCond            INFO Hit x = 1630.12 y = 46.5449 z = -1556.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000011]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 17 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1012,19 +1021,21 @@ WriteCond            INFO Hit x = 1730.12 y = 46.5449 z = -1656.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000012]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 18 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1055,19 +1066,21 @@ WriteCond            INFO Hit x = 1830.12 y = 46.5449 z = -1756.17 detector = Du
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 EventSelector       DEBUG Get AttributeList from the collection
-EventSelector       DEBUG AttributeList size 0
+EventSelector       DEBUG AttributeList size 12
 EventSelector       DEBUG record AthenaAttribute, name = Token = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG record AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013].
 EventSelector       DEBUG found AthenaAttribute, name = eventRef = [DB=????][CNT=POOLContainer(DataHeader)][CLID=????][TECH=0000020?][OID=00000006-00000013]
-AthenaPoolAddre...  DEBUG The current Event contains: 3 objects
+AthenaPoolAddre...  DEBUG The current Event contains: 4 objects
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 2101, name = McEventInfo
 AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 9102, name = MyHits
+AthenaPoolAddre...  DEBUG loadAddresses: DataObject address, clid = 40774348, name = SimpleTag
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 19 events processed so far  <<<===
 ReadData            DEBUG in execute()
 ReadData             INFO EventStreamInfo: Number of events = 20
 ReadData             INFO EventStreamInfo: ItemList:
 ReadData             INFO CLID = 2101, key = McEventInfo
 ReadData             INFO CLID = 9102, key = MyHits
+ReadData             INFO CLID = 40774348, key = SimpleTag
 ReadData             INFO CLID = 222376821, key = StreamX
 ReadData             INFO EventType: Event type: sim/data -  is sim , testbeam/atlas -  is atlas , calib/physics -  is physics 
 ReadData             INFO TagInfo: 
@@ -1097,10 +1110,10 @@ WriteCond            INFO Hit x = 1926.91 y = 52.2238 z = -1855.07 detector = Du
 WriteCond            INFO Hit x = 1930.12 y = 46.5449 z = -1856.17 detector = DummyHitDetector
 WriteCond            INFO registered all data
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
-Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
-Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 MetaDataSvc         DEBUG handle() EndInputFile for FID:????
 EventSelector        INFO Disconnecting input sourceID: ????
+Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] ????
+Domain[ROOT_All]     INFO >   Deaccess DbDomain     READ      [ROOT_All] 
 MetaDataSvc         DEBUG handle() LastInputFile for end
 AthenaEventLoopMgr   INFO No more events in event selection 
 WriteCond            INFO in finalize()
@@ -1185,9 +1198,9 @@ commitOutput         INFO Time User   : Tot=    0 [us]
 cRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  2
 fRep_ALL             INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  2
 cRepR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #=  3
-cObjR_ALL            INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 46
-cObj_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.455(+- 2.08)/    0/   10 [ms] #= 44
-ChronoStatSvc        INFO Time User   : Tot= 0.62  [s]                                             #=  1
+cObjR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.435(+- 2.04)/    0/   10 [ms] #= 46
+cObj_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.682(+- 2.52)/    0/   10 [ms] #= 44
+ChronoStatSvc        INFO Time User   : Tot= 0.55  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
index 1d3be638da1..4b6ad9e2ab5 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:24:00 CST 2019
+Wed Mar  6 20:15:05 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WMetaJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,17 +13,18 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:24:09 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 20:15:18 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 571 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
 xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
@@ -35,9 +36,9 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.xml) [ok]
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -83,7 +84,7 @@ Stream1             DEBUG Registering all Tools in ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) from ToolHandleArray HelperTools
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
-  + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
+  + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) 
 HistogramPersis...WARNING Histograms saving not required.
 EventSelector        INFO  Enter McEventSelector Initialization 
 AthenaEventLoopMgr   INFO Setup EventSelector service EventSelector
@@ -134,14 +135,18 @@ SimplePoolFile5...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile5.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 453 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 108 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 1
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 1
 StorageSvc           INFO Building shape according to reflection information using shape ID for:
@@ -192,6 +197,122 @@ SimplePoolFile5...  DEBUG ---->ClassID:????
 SimplePoolFile5...  DEBUG --->Adding Shape[3 , ????]:  [1 Column(s)] 
 SimplePoolFile5...  DEBUG ---->Class:DataHeader_p5
 SimplePoolFile5...  DEBUG ---->[0]:DataHeader_p5 Typ:DataHeader_p5 [21] Size:0 Offset:0 #Elements:1
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO Token [????]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(Token)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'Token'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(Token) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(Token) [20?]  (7 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Adding Shape[4 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG ---->Class:Token
+SimplePoolFile5...  DEBUG ---->[0]:Token Typ:Token [18] Size:0 Offset:0 #Elements:1
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO bool [????]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsSimulation)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsSimulation'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsSimulation) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsSimulation) [20?]  (8 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Adding Shape[5 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG ---->Class:bool
+SimplePoolFile5...  DEBUG ---->[0]:bool Typ:bool [9] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsCalibration)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsCalibration'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsCalibration) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsCalibration) [20?]  (9 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(IsTestBeam)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'IsTestBeam'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(IsTestBeam) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(IsTestBeam) [20?]  (a , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO unsigned int [????]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(McChannel)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'McChannel'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(McChannel) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(McChannel) [20?]  (b , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Adding Shape[6 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG ---->Class:unsigned int
+SimplePoolFile5...  DEBUG ---->[0]:unsigned int Typ:unsigned int [3] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(RunNumber)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'RunNumber'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(RunNumber) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(RunNumber) [20?]  (c , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO unsigned long long [????]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventNumber)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventNumber'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventNumber) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventNumber) [20?]  (d , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Adding Shape[7 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG ---->Class:unsigned long long
+SimplePoolFile5...  DEBUG ---->[0]:unsigned long long Typ:unsigned long long [23] Size:0 Offset:0 #Elements:1
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(LumiBlockN)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'LumiBlockN'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(LumiBlockN) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(LumiBlockN) [20?]  (e , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(ConditionsRun)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'ConditionsRun'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(ConditionsRun) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(ConditionsRun) [20?]  (f , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventTime)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventTime'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventTime) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventTime) [20?]  (10 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventTimeNanoSec)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventTimeNanoSec'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventTimeNanoSec) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventTimeNanoSec) [20?]  (11 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(BunchId)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'BunchId'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(BunchId) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(BunchId) [20?]  (12 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+StorageSvc           INFO Building shape according to reflection information using shape ID for:
+StorageSvc           INFO float [????]
+SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] POOLCollectionTree(EventWeight)
+POOLCollectionT...  DEBUG Opening
+POOLCollectionT...  DEBUG    attributes# = 1
+POOLCollectionT...  DEBUG Branch container 'EventWeight'
+POOLCollectionT...  DEBUG Opened container POOLCollectionTree(EventWeight) of type ROOT_Tree
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/POOLCollectionTree(EventWeight) [20?]  (13 , ffffffff)
+SimplePoolFile5...  DEBUG ---->ClassID:????
+SimplePoolFile5...  DEBUG --->Adding Shape[8 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG ---->Class:float
+SimplePoolFile5...  DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile5.root and cont: POOLContainer(DataHeader)
 AthenaPoolCnvSvc    DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile5.root and cont: POOLContainerForm(DataHeaderForm)
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #0, run #0 1 events processed so far  <<<===
@@ -210,14 +331,18 @@ WriteCond            INFO Hit x = 123.704 y = -42.0973 z = -53.6841 detector = D
 WriteCond            INFO Hit x = 126.915 y = -47.7762 z = -55.0735 detector = DummyHitDetector
 WriteCond            INFO Hit x = 130.125 y = -53.4551 z = -56.169 detector = DummyHitDetector
 WriteCond            INFO registered all data
-ClassIDSvc           INFO  getRegistryEntries: read 75 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 78 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 2
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 2
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #0 2 events processed so far  <<<===
@@ -242,7 +367,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 3
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 3
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #0 3 events processed so far  <<<===
@@ -267,7 +396,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 4
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 4
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #0 4 events processed so far  <<<===
@@ -292,7 +425,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 5
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 5
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #0 5 events processed so far  <<<===
@@ -317,7 +454,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 6
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 6
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #0 6 events processed so far  <<<===
@@ -342,7 +483,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 7
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 7
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #0 7 events processed so far  <<<===
@@ -367,7 +512,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 8
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 8
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #0 8 events processed so far  <<<===
@@ -392,7 +541,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 9
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 9
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #0 9 events processed so far  <<<===
@@ -417,7 +570,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 10
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 10
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #0 10 events processed so far  <<<===
@@ -442,7 +599,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 11
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 11
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #0 11 events processed so far  <<<===
@@ -467,7 +628,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 12
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 12
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #0 12 events processed so far  <<<===
@@ -492,7 +657,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 13
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 13
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #0 13 events processed so far  <<<===
@@ -517,7 +686,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 14
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 14
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #0 14 events processed so far  <<<===
@@ -543,7 +716,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 15
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 15
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #0 15 events processed so far  <<<===
@@ -568,7 +745,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 16
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 16
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #0 16 events processed so far  <<<===
@@ -593,7 +774,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 17
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 17
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #0 17 events processed so far  <<<===
@@ -618,7 +803,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 18
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 18
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #0 18 events processed so far  <<<===
@@ -643,7 +832,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 19
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 19
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #0 19 events processed so far  <<<===
@@ -668,7 +861,11 @@ Stream1             DEBUG  Added object 2101,"McEventInfo"
 Stream1             DEBUG addItemObjects(9102,"MyHits") called
 Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 20
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 20
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #0 20 events processed so far  <<<===
@@ -689,7 +886,7 @@ MetaData(Exampl...  DEBUG Opening
 MetaData(Exampl...  DEBUG    attributes# = 1
 MetaData(Exampl...  DEBUG Branch container 'ExampleHitContainer_p1_PedestalWriteData'
 MetaData(Exampl...  DEBUG Opened container MetaData(ExampleHitContainer_p1/PedestalWriteData) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaData(ExampleHitContainer_p1/PedestalWriteData) [20?]  (7 , ffffffff)
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaData(ExampleHitContainer_p1/PedestalWriteData) [20?]  (14 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
 StorageSvc           INFO Building shape according to reflection information using shape ID for:
 StorageSvc           INFO EventStreamInfo_p3 [????]
@@ -698,9 +895,9 @@ MetaData(EventS...  DEBUG Opening
 MetaData(EventS...  DEBUG    attributes# = 1
 MetaData(EventS...  DEBUG Branch container 'EventStreamInfo_p3_Stream1'
 MetaData(EventS...  DEBUG Opened container MetaData(EventStreamInfo_p3/Stream1) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (8 , ffffffff)
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaData(EventStreamInfo_p3/Stream1) [20?]  (15 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
-SimplePoolFile5...  DEBUG --->Adding Shape[4 , ????]:  [1 Column(s)] 
+SimplePoolFile5...  DEBUG --->Adding Shape[9 , ????]:  [1 Column(s)] 
 SimplePoolFile5...  DEBUG ---->Class:EventStreamInfo_p3
 SimplePoolFile5...  DEBUG ---->[0]:EventStreamInfo_p3 Typ:EventStreamInfo_p3 [21] Size:0 Offset:0 #Elements:1
 SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdrForm(DataHeaderForm)
@@ -708,14 +905,14 @@ MetaDataHdrForm...  DEBUG Opening
 MetaDataHdrForm...  DEBUG    attributes# = 1
 MetaDataHdrForm...  DEBUG Branch container 'DataHeaderForm'
 MetaDataHdrForm...  DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (9 , ffffffff)
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdrForm(DataHeaderForm) [20?]  (16 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
 SimplePoolFile5...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] MetaDataHdr(DataHeader)
 MetaDataHdr(Dat...  DEBUG Opening
 MetaDataHdr(Dat...  DEBUG    attributes# = 1
 MetaDataHdr(Dat...  DEBUG Branch container 'DataHeader'
 MetaDataHdr(Dat...  DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree
-SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (a , ffffffff)
+SimplePoolFile5...  DEBUG --->Adding Assoc :????/MetaDataHdr(DataHeader) [20?]  (17 , ffffffff)
 SimplePoolFile5...  DEBUG ---->ClassID:????
 ClassIDSvc           INFO  getRegistryEntries: read 7 CLIDRegistry entries for module ALL
 Stream1              INFO Records written: 21
@@ -739,11 +936,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.476(+- 2.13)/    0/   10 [ms] #= 21
-cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.119(+- 1.08)/    0/   10 [ms] #= 84
-fRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.317(+- 1.75)/    0/   10 [ms] #= 63
-cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.476(+- 2.78)/    0/   20 [ms] #= 63
-ChronoStatSvc        INFO Time User   : Tot= 0.66  [s]                                             #=  1
+commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 21
+cRep_ALL             INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.241(+- 2.18)/    0/   20 [ms] #= 83
+cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.0581(+- 1.08)/    0/   20 [ms] #=344
+fRep_ALL             INFO Time User   : Tot=   40 [ms] Ave/Min/Max=0.482(+- 2.65)/    0/   20 [ms] #= 83
+ChronoStatSvc        INFO Time User   : Tot= 0.63  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
index 2d920194bb0..850e562ec6a 100644
--- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
+++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref
@@ -1,11 +1,11 @@
-Tue Feb 26 09:21:07 CST 2019
+Wed Mar  6 21:34:32 CET 2019
 Preloading tcmalloc_minimal.so
 Athena               INFO including file "AthenaCommon/Preparation.py"
 Athena               INFO including file "AthenaCommon/Atlas.UnixStandardJob.py"
 Athena               INFO executing ROOT6Setup
 Athena               INFO including file "AthenaCommon/Execution.py"
 Athena               INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WriteJobOptions.py"
-Py:ConfigurableDb    INFO Read module info for 5462 configurables from 20 genConfDb files
+Py:ConfigurableDb    INFO Read module info for 5461 configurables from 48 genConfDb files
 Py:ConfigurableDb    INFO No duplicates have been found: that's good !
 Athena               INFO including file "AthenaCommon/runbatch.py"
 ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0
@@ -13,18 +13,19 @@ ApplicationMgr       INFO Updating Gaudi::PluginService::SetDebug(level) to leve
 ApplicationMgr    SUCCESS 
 ====================================================================================================================================
                                                    Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
-                                          running on atlaslogin01.hep.anl.gov on Tue Feb 26 09:21:19 2019
+                                          running on lxplus084.cern.ch on Wed Mar  6 21:34:47 2019
 ====================================================================================================================================
 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 3110 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 3167 CLIDRegistry entries for module ALL
 CoreDumpSvc          INFO install f-a-t-a-l handler... (flag = -1)
 AthenaEventLoopMgr   INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00
 ClassIDSvc           INFO  getRegistryEntries: read 770 CLIDRegistry entries for module ALL
 ClassIDSvc           INFO  getRegistryEntries: read 571 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
 xAODMaker::Even...   INFO Initializing - Package version: xAODEventInfoCnv-00-00-00
 MetaDataSvc          INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00
@@ -35,9 +36,9 @@ PoolSvc             DEBUG Service base class initialized successfully
 PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.xml) [ok]
 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-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(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/2019-02-25T2138/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
-DBReplicaSvc         INFO Total of 1 servers found for host atlaslogin01.hep.anl.gov [ATLF ]
+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/2019-03-05T2139/Athena/22.0.1/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config
+DBReplicaSvc         INFO Total of 10 servers found for host lxplus084.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             DEBUG OutputLevel is 
 PoolSvc              INFO Setting up APR FileCatalog and Streams
@@ -85,7 +86,6 @@ Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEve
 Stream1             DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool)
 Stream1             DEBUG Data Deps for Stream1
   + INPUT   ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) 
-ClassIDSvc           INFO  getRegistryEntries: read 345 CLIDRegistry entries for module ALL
 Stream2             DEBUG Property update for OutputLevel : new value = 2
 Stream2.Stream2...  DEBUG Property update for OutputLevel : new value = 2
 Stream2             DEBUG In initialize 
@@ -160,7 +160,7 @@ SimplePoolFile1...  DEBUG --->Adding Assoc :????/##Params [200]  (2 , ffffffff)
 SimplePoolFile1...  DEBUG ---->ClassID:????
 ##Params            DEBUG No objects passing selection criteria... Container has 0 Entries in total.
 AthenaPoolCnvSvc    DEBUG setAttribute CONTAINER_SPLITLEVEL to 99 for db: SimplePoolFile1.root and cont: TTree=POOLContainerForm(DataHeaderForm)
-ClassIDSvc           INFO  getRegistryEntries: read 540 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 543 CLIDRegistry entries for module ALL
 Stream1             DEBUG addItemObjects(2101,"*") called
 Stream1             DEBUG            Key:*
 Stream1             DEBUG  Added object 2101,"McEventInfo"
@@ -170,7 +170,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 1
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 1
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 1
 StorageSvc           INFO Building shape according to reflection information using shape ID for:
@@ -289,7 +293,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 1
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 1
 SimplePoolFile2...  DEBUG --> Access   DbContainer  CREA/UPDA [ROOT_Tree] CollectionTree(EventInfo_p4/McEventInfo)
 CollectionTree(...  DEBUG Opening
@@ -375,7 +383,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 2
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 2
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 2
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -383,7 +395,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 2
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 2
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 2 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #2, run #1 2 events processed so far  <<<===
@@ -403,7 +419,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 3
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 3
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 3
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -411,7 +431,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 3
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 3
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #2, run #1 3 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #3, run #1 3 events processed so far  <<<===
@@ -431,7 +455,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 4
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 4
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 4
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -439,7 +467,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 4
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 4
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #3, run #1 4 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #4, run #1 4 events processed so far  <<<===
@@ -459,7 +491,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 5
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 5
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 5
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -467,7 +503,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 5
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 5
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #4, run #1 5 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #5, run #1 5 events processed so far  <<<===
@@ -487,7 +527,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 6
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 6
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 6
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -495,7 +539,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 6
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 6
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #5, run #1 6 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #6, run #1 6 events processed so far  <<<===
@@ -515,7 +563,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 7
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 7
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 7
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -523,7 +575,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 7
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 7
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #6, run #1 7 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #7, run #1 7 events processed so far  <<<===
@@ -543,7 +599,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 8
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 8
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 8
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -551,7 +611,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 8
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 8
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #7, run #1 8 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #8, run #1 8 events processed so far  <<<===
@@ -571,7 +635,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 9
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 9
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 9
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -579,7 +647,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 9
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 9
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #8, run #1 9 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #9, run #1 9 events processed so far  <<<===
@@ -599,7 +671,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 10
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 10
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 10
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -607,7 +683,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 10
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 10
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #9, run #1 10 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #10, run #1 10 events processed so far  <<<===
@@ -627,7 +707,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 11
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 11
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 11
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -635,7 +719,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 11
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 11
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #10, run #1 11 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #11, run #1 11 events processed so far  <<<===
@@ -655,7 +743,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 12
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 12
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 12
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -663,7 +755,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 12
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 12
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #11, run #1 12 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #12, run #1 12 events processed so far  <<<===
@@ -683,7 +779,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 13
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 13
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 13
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -691,7 +791,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 13
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 13
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #12, run #1 13 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #13, run #1 13 events processed so far  <<<===
@@ -711,7 +815,11 @@ Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
 Stream1             DEBUG  No object matching 9102,"PetersHits" found
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 14
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 14
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 14
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -719,7 +827,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 14
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 14
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #13, run #1 14 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #14, run #1 14 events processed so far  <<<===
@@ -739,7 +851,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 15
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 15
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 15
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -747,7 +863,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 15
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 15
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #14, run #1 15 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #15, run #1 15 events processed so far  <<<===
@@ -766,7 +886,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 16
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 16
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 16
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -774,7 +898,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 16
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 16
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #15, run #1 16 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #16, run #1 16 events processed so far  <<<===
@@ -793,7 +921,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 17
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 17
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 17
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -801,7 +933,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 17
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 17
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #16, run #1 17 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #17, run #1 17 events processed so far  <<<===
@@ -820,7 +956,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 18
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 18
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 18
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -828,7 +968,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 18
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 18
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #17, run #1 18 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #18, run #1 18 events processed so far  <<<===
@@ -847,7 +991,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 19
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 19
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 19
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -855,7 +1003,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 19
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 19
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #18, run #1 19 events processed so far  <<<===
 AthenaEventLoopMgr   INFO   ===>>>  start processing event #19, run #1 19 events processed so far  <<<===
@@ -874,7 +1026,11 @@ Stream1             DEBUG            Key:MyHits
 Stream1             DEBUG  Added object 9102,"MyHits"
 Stream1             DEBUG addItemObjects(9102,"PetersHits") called
 Stream1             DEBUG            Key:PetersHits
+Stream1             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream1             DEBUG            Key:SimpleTag
+Stream1             DEBUG  Added object 40774348,"SimpleTag"
 Stream1             DEBUG  Collected objects:
+Stream1             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 20
 Stream1             DEBUG  Object/count: EventInfo_McEventInfo, 20
 Stream1             DEBUG  Object/count: ExampleHitContainer_MyHits, 20
 Stream2             DEBUG addItemObjects(2101,"*") called
@@ -882,7 +1038,11 @@ Stream2             DEBUG            Key:*
 Stream2             DEBUG  Added object 2101,"McEventInfo"
 Stream2             DEBUG addItemObjects(9102,"*") called
 Stream2             DEBUG            Key:*
+Stream2             DEBUG addItemObjects(40774348,"SimpleTag") called
+Stream2             DEBUG            Key:SimpleTag
+Stream2             DEBUG  Added object 40774348,"SimpleTag"
 Stream2             DEBUG  Collected objects:
+Stream2             DEBUG  Object/count: AthenaAttributeList_SimpleTag, 20
 Stream2             DEBUG  Object/count: EventInfo_McEventInfo, 20
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #19, run #1 20 events processed so far  <<<===
 Stream1             DEBUG AthenaOutputStream Stream1 ::stop()
@@ -1037,11 +1197,11 @@ ToolSvc              INFO Removing all tools created by ToolSvc
 *****Chrono*****     INFO ****************************************************************************************************
 *****Chrono*****     INFO  The Final CPU consumption ( Chrono ) Table (ordered)
 *****Chrono*****     INFO ****************************************************************************************************
-commitOutput         INFO Time User   : Tot=    0 [us] Ave/Min/Max=    0(+-    0)/    0/    0 [us] #= 43
-cRepR_ALL            INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.0324(+-0.568)/    0/   10 [ms] #=309
-fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.283(+- 1.66)/    0/   10 [ms] #=106
-cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.283(+- 2.15)/    0/   20 [ms] #=106
-ChronoStatSvc        INFO Time User   : Tot=  0.7  [s]                                             #=  1
+commitOutput         INFO Time User   : Tot=   10 [ms] Ave/Min/Max=0.233(+- 1.51)/    0/   10 [ms] #= 43
+cRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.205(+- 1.84)/    0/   20 [ms] #=146
+cRepR_ALL            INFO Time User   : Tot=   20 [ms] Ave/Min/Max=0.0647(+-0.802)/    0/   10 [ms] #=309
+fRep_ALL             INFO Time User   : Tot=   30 [ms] Ave/Min/Max=0.205(+- 1.42)/    0/   10 [ms] #=146
+ChronoStatSvc        INFO Time User   : Tot= 0.62  [s]                                             #=  1
 *****Chrono*****     INFO ****************************************************************************************************
 ChronoStatSvc.f...   INFO  Service finalized successfully 
 ApplicationMgr       INFO Application Manager Finalized successfully
-- 
GitLab


From 322618e62ac6e10bf1ec51de88badb2a5de6f5db Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:47:16 +0100
Subject: [PATCH 333/404] MuonSimEventAthenaPool: Update test reference file.

Update reference file for changes in HepMcParticleLink implementation.
---
 MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/CMakeLists.txt
index b79622617bc..697abfeef10 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()
-- 
GitLab


From fa78691c20328f12eca2973eba4fd52fc3695bff Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:28:43 +0100
Subject: [PATCH 334/404] InDetSimEventAthenaPool: Update reference file.

Update test reference file for changes in HepMcParticleLink implementation.
---
 .../InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/CMakeLists.txt
index a66d9c330e5..1f012ea1101 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()
-- 
GitLab


From 3b5afdc8fe775ed322ace3c50ccb3f886194b817 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:43:48 +0100
Subject: [PATCH 335/404] MuonEventAthenaPool: Update reference file.

Update test reference file for changes in HepMcParticleLink implementation.
---
 MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/CMakeLists.txt
index 8e9abc47c0e..99fb34c2e1a 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
-- 
GitLab


From bb72c6c21f505ba48925904ab8c3b9780884b25d Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:23:14 +0100
Subject: [PATCH 336/404] GeneratorObjects: Don't trip assertion in eventIndex
 for a null link.

If we have a null link, we can't do the normal eventIndex() processing.
Just return 0 in that case, rather than tripping an assertion.
---
 Generators/GeneratorObjects/src/HepMcParticleLink.cxx | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
index bdf672d83ed..8bbcfddf441 100644
--- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
+++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
@@ -222,6 +222,8 @@ HepMcParticleLink::index_type HepMcParticleLink::eventIndex() const
   index_type index, position;
   m_extBarcode.eventIndex (index, position);
   if (index == ExtendedBarCode::UNDEFINED) {
+    // Don't trip the assertion for a null link.
+    if (barcode() == 0) return 0;
     cptr();
     m_extBarcode.eventIndex (index, position);
     assert (index != ExtendedBarCode::UNDEFINED);
-- 
GitLab


From 31cf579d4660dee9f7c899864dadf5a361177c34 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 05:16:31 +0100
Subject: [PATCH 337/404] TrkPrepRawData: Fix alignment of eigen objects for
 cling.

cling erroneously aligns eigen objects to 8 bytes rather than 16 bytes.
This causes failures when accessing EDM objects via python/ROOT.
Add a couple alignment attributes to force cling to do the right thing.
---
 .../TrkEvent/TrkPrepRawData/TrkPrepRawData/PrepRawData.h     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkEvent/TrkPrepRawData/TrkPrepRawData/PrepRawData.h b/Tracking/TrkEvent/TrkPrepRawData/TrkPrepRawData/PrepRawData.h
index a728e21fb50..883a0c016ed 100755
--- a/Tracking/TrkEvent/TrkPrepRawData/TrkPrepRawData/PrepRawData.h
+++ b/Tracking/TrkEvent/TrkPrepRawData/TrkPrepRawData/PrepRawData.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -119,7 +119,8 @@ namespace Trk{
     /**PrepRawData ID, not const because of DataPool*/
         Identifier m_clusId; 
     /**see derived classes for definition of meaning of LocalPosition*/
-        Amg::Vector2D m_localPos;
+        // Need to force proper alignment; otherwise cling gets it wrong.
+        alignas(16) Amg::Vector2D m_localPos;
     /**Stores the identifiers of the RDOs.*/
         std::vector<Identifier> m_rdoList; 
     /**See derived classes for definition of ErrorMatrix */
-- 
GitLab


From 383ba9ede27afd86993475a0f372a1b956ff9dfb Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:33:41 +0100
Subject: [PATCH 338/404] InDetPrepRawData: Fix alignment of eigen objects for
 cling,

cling erroneously aligns eigen objects to 8 bytes rather than 16 bytes.
This causes failures when accessing EDM objects via python/ROOT.
Add a couple alignment attributes to force cling to do the right thing.
---
 .../InDetPrepRawData/InDetPrepRawData/SiWidth.h            | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiWidth.h b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiWidth.h
index 601f8196cd2..563e23dfab3 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiWidth.h
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiWidth.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -96,8 +96,9 @@ namespace InDet {
    // Private data:
    ///////////////////////////////////////////////////////////////////
  private:
-   Amg::Vector2D m_colrow;//<col, row>
-   Amg::Vector2D m_phirzWidth;
+   // Need to force proper alignment; otherwise cling gets it wrong.
+   alignas(16) Amg::Vector2D m_colrow;//<col, row>
+   alignas(16) Amg::Vector2D m_phirzWidth;
  };
 
  MsgStream&    operator << (MsgStream& stream,    const SiWidth& prd);
-- 
GitLab


From 7f0bf5d033ff965598a0b7e04544865d0a2599a9 Mon Sep 17 00:00:00 2001
From: Tim Martin <tim.martin@cern.ch>
Date: Fri, 8 Mar 2019 09:01:11 +0000
Subject: [PATCH 339/404] Revert "Merge branch 'master-jetchainconfig2' into
 'master'"

This reverts merge request !21470
---
 .../TrigHLTJetHypoUtils/DijetMTCondition.h    |  61 ---
 .../TrigHLTJetHypoUtils/conditionsFactory2.h  |   8 -
 .../TrigHLTJetHypo/python/ChainLabelParser.py | 390 -----------------
 .../TrigHLTJetHypo/python/ToolSetter.py       | 134 ------
 .../python/TrigJetHypoToolConfig.py           | 102 +++--
 .../python/chainDict2jetLabel.py              | 106 -----
 .../TrigHLTJetHypo/python/chainDictDumper.py  |  22 -
 .../TrigHLTJetHypo/python/constants.py        |   6 -
 .../TrigHLTJetHypo/python/node.py             |  69 ---
 .../TrigHLTJetHypo/python/test_cases.py       |  70 ----
 .../TrigHLTJetHypo/python/treeVisitors.py     | 392 ------------------
 .../TrigHLTJetHypoUtils/DijetMTCondition.cxx  | 101 -----
 .../conditionsFactory2.cxx                    |  25 --
 .../TrigHLTJetHypo/src/TrigJetAndToolMT.cxx   |  62 ---
 .../TrigHLTJetHypo/src/TrigJetAndToolMT.h     |  68 ---
 .../src/TrigJetHypoToolConfig_dijet.cxx       |  94 -----
 .../src/TrigJetHypoToolConfig_dijet.h         |  76 ----
 .../src/TrigJetHypoToolConfig_simple.cxx      |  92 ----
 .../src/TrigJetHypoToolConfig_simple.h        |  71 ----
 .../TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx  |  10 +-
 .../TrigHLTJetHypo/src/TrigJetHypoToolMT.h    |   5 +-
 .../TrigHLTJetHypo/src/TrigJetNotToolMT.cxx   |  63 ---
 .../TrigHLTJetHypo/src/TrigJetNotToolMT.h     |  66 ---
 .../TrigHLTJetHypo/src/TrigJetOrToolMT.cxx    |  60 ---
 .../TrigHLTJetHypo/src/TrigJetOrToolMT.h      |  68 ---
 .../src/components/TrigHLTJetHypo_entries.cxx |  12 +-
 .../TrigUpgradeTest/python/jetDefs.py         |   2 +
 .../TrigUpgradeTest/share/fullMenu.py         |   2 +-
 .../TrigUpgradeTest/share/fullMenu.ref        |  23 +-
 .../TrigUpgradeTest/share/jet.menu.py         |   2 +-
 .../TrigUpgradeTest/share/jetMenu.ref         |  23 +-
 .../TrigUpgradeTest/share/simpleJetJob.py     |  16 +-
 .../HLTMenuConfig/Menu/SignatureDicts.py      |   6 +-
 33 files changed, 98 insertions(+), 2209 deletions(-)
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
 delete mode 100644 Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
deleted file mode 100644
index 84aef0dc56a..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGHLTJETHYPO_DIJETMTCONDITION_H
-#define TRIGHLTJETHYPO_DIJETMTCONDITION_H
-
-/********************************************************************
- *
- * NAME:     DijetMTCondition.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- * Cuts on paris of jets makling up a dijet
- *
- * AUTHOR:   P. Sherwood
- * CREATED:  February 21, 2019
- *           
- *********************************************************************/
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICondition.h"
-
-
-class DijetMTCondition: public ICondition{
- public:
-  DijetMTCondition(
-                   double massMin,
-                   double massMax,
-                   double detaMin,
-                   double detaMax,
-                   double dphiMin,
-                   double dphiMax
-                 );
-
-  ~DijetMTCondition() override {}
-
-  bool isSatisfied(const HypoJetVector&) const override;
-  
-  double orderingParameter() const noexcept override;
-  
-  std::string toString() const noexcept override;
-
- private:
-
-  bool passJetCuts(pHypoJet, pHypoJet) const;
-  bool passDijetCuts(pHypoJet, pHypoJet) const;
-
-  // cuts on sum of jets
-  double m_massMin;
-  double m_massMax;
-
-  // cuts on the two jets
-  double m_detaMin;
-  double m_detaMax;
-  
-  double m_dphiMin;
-  double m_dphiMax;
-
-};
-
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
index 03492681722..92078f82269 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h
@@ -44,14 +44,6 @@ Conditions conditionsFactoryDijet(const std::vector<double>& etThresholds1,
                                   const std::vector<double>& dphiMins,
                                   const std::vector<double>& dphiMaxs);
 
-Conditions conditionsFactoryDijetMT(const std::vector<double>& massMins,
-                                    const std::vector<double>& massMaxs,
-                                    const std::vector<double>& detaMins,
-                                    const std::vector<double>& detaMaxs,
-                                    const std::vector<double>& dphiMins,
-                                    const std::vector<double>& dphiMaxs);
-
-
 
 // for conditionsFactory2
 Conditions conditionsFactoryDijetEtaMass(const std::vector<double>& etasMin,
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
deleted file mode 100644
index 46230e0139d..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ChainLabelParser.py
+++ /dev/null
@@ -1,390 +0,0 @@
-from node import Node
-from constants import (lchars,
-                       digits,
-                       delims)
-
-
-
-def get_char(s):
-    """character generator"""
-
-    while s:
-        c = s[0]
-        s = s[1:]
-        yield c
-
-def _check_parens(s, pars):
-    pl = pars[0]
-    pr = pars[1]
-    np = 0
-    for c in s:
-        if c == pl: np += 1
-        if c == pr: np -= 1
-        if np < 0:
-            raise RuntimeError('Paren mismatch for parens %s, %s' % (pars, s))
-
-def check_parens(s):
-    _check_parens(s, '()')
-    _check_parens(s, '[]')
-    
-            
-
-def preprocess(s):
-    llines  = s.split('\n')
-
-    lines  = [l.split('#')[0].strip() for l in llines]
-    s = ''.join(lines)
-    ss = ''
-    reject = ' \n'
-    for c in s:
-        # keep white space whn within square brackets, reject otherwise
-        if c not in reject:
-            ss += c
-    s = ss      
-
-    check_parens(s)
-    print s
-    from constants import alphabet
-    for c in s:
-        if not c in alphabet:
-            raise RuntimeError('bad character %s in string %s' % (c, s))
-    print 'end of preprocess: ', s
-    return s
-
-
-class ChainLabelParser(object):
-    def __init__(self, label, debug=False):
-        self.label = label
-        self.state = 'start'
-        pp = preprocess(label)
-        print 'preprocessd string', pp, 'length', len(pp)
-        self.gc = get_char(pp)
-        self.state_history = []
-        self.states = {
-            'start': self.start,
-            'scenario': self.scen,
-            'start_params_0': self.start_params_0,
-            'start_params_1': self.start_params_1,
-            'params': self.params,
-            'end_params_0': self.end_params_0,
-            'end_params': self.end_params,
-            'end_scenario': self.end_scenario,
-            'error': self.error,
-        }
-        self.debug = debug
-
-    def paramAppend(self, c):
-        self.parameters += c
-        if self.debug:
-            print 'parameters', self.parameters
-
-    def scenAppend(self, c):
-        self.scenario += c
-        if self.debug:
-            print 'scenario', self.scenario
-            
-    def start(self):
-        "initialise"
-
-        self.state = 'scenario'
-        self.scenario = ''
-        self.parameters = ''
-        self.tree = [Node('dummy')]
-        self.msg = ''
-        
-
-    def scen(self):
-        """accumulate scenario name string into self.scenario"""
-        
-        c = self.gc.next()
-    
-        if c in lchars: 
-            self.scenAppend(c)
-            return
-    
-        if c == '(':
-            self.state = 'start_params_0'
-
-            return
-    
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-
-    def start_params_0(self):
-        """accumulate parameter string into self.parameter"""
-
-        self.tree.append(Node(self.scenario))
-        self.scenario = ''
-
-        c = self.gc.next()
-    
-        if c == '[':
-            self.state = 'start_params_1'
-            return
-
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-
-    def start_params_1(self):
-        """accumulate parameter string into self.parameter"""
-        
-        c = self.gc.next()
-    
-        if c == '(':
-            self.paramAppend(c)
-            self.state = 'params'
-            return
-
-        if c == ']':
-            self.state = 'end_params'
-            return
-
-
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-
-    def params(self):
-        """accumulate parameter string into self.parameter"""
-        
-        c = self.gc.next()
-    
-        if c in lchars or c in digits or c ==',':
-            self.paramAppend(c)
-            return
-
-        if c == ')':
-            self.paramAppend(c)
-            self.state = 'end_params_0'
-            return
-
-
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-    
-
-    def end_params_0(self):
-        """Check whether there are more prameters to accumulate"""
-
-        c = self.gc.next()
-
-        # more parameters
-        if c == '(':
-            self.paramAppend(c)
-            self.state = 'params'
-            return
-
-        # end of paramter lists
-        if c == ']':
-            self.tree[-1].parameters = self.parameters.strip()
-            self.parameters = ''
-            self.state = 'end_params'
-            return
-
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-    
-
-    def end_params(self):
-        """after accumulating params, drop white space, then add node to tree
-        or process next scenario"""
-        
-        c = self.gc.next()
-        
-        if c == ')':
-            self.state = 'end_scenario'
-            return
-        
-        if c in lchars:
-            self.scenAppend(c)
-            self.state = 'scenario'
-            return
-        
-        self.msg = 'state %s, bad character %s in string %s' % (self.state,
-                                                                c,
-                                                                self.label)
-        self.state = 'error'
-        
-    def end_scenario(self):
-        """Add current node to its parent"""
-        
-        n = self.tree.pop()
-        self.tree[-1].add_child(n)
-
-        while True:
-            c = self.gc.next()
-            if c == ')':
-                n = self.tree.pop()
-                self.tree[-1].add_child(n)
-            else:
-
-                # more input means a new scenario is starting
-                self.scenario = c
-                self.parameters = ''
-                self.msg = ''
-                self.state = 'scenario'
-        
-                return    
-
-        
-    def error(self):
-        """From error state, dump error report and raise exception"""
-        
-        print '---error state report ---'
-        print ' state', self.state
-        print ' scenario', self.scenario
-        print ' parameters', self.parameters
-        print ' msg', self.msg
-        print 'state history', self.state_history
-        print ' tree dump:'
-        print self.tree[0].dump()
-        print '--end error state report---'
-        raise RuntimeError('error state')
-    
-    def get_state(self):
-        self.state_history.append(self.state)
-        return self.states[self.state]
-    
-
-    
-    def parse(self):
-        "parse a chain label"
-        
-        error = False
-        terminated = False
-
-        self.start()  # re-initialise
-        
-        try:   # parsing ends with an exception
-            while True:   # continue until exception
-
-                # print 'current state', self.state
-                # print 'current scenario', self.scenario
-                # print 'current parameters', self.parameters
-                
-                # self.states[self.state]()  # process the current state
-                self.get_state()()
-                
-        except StopIteration:  # generator has reached the end of the string
-            print 'parse terminated'
-            terminated = True
-        except AssertionError, e:
-            print 'assertion err'
-            print e
-            error = True
-        except RuntimeError, e:
-            print e
-            error = True
-            
-    
-        if not terminated:
-            s = ''
-            try:
-                while True:
-                    s += self.gc.next()
-            except StopIteration:
-                if s:
-                    print 'error: remaining characters:', s
-     
-        if len(self.tree) != 1:
-            error = True
-            print 'error, stack size', len(self.tree), 'expected 2'
-            print self.state_history
-            
-        if len(self.tree[0].children) != 1:
-            error = True
-            print 'error, top node has %d cdildren, expected 1' % (
-                len(self.tree[0].children))
-
-        final_state = 'end_scenario'
-        if self.state != final_state:
-            error = True
-            print 'error: final state is %s, expected %s' % (self.state,
-                                                             final_state)
-        # print 'tree dump:'
-        # print self.tree[0].dump()
-        print 'parse',
-        if not error:
-            print 'succeeded'
-        else:
-            print 'state: %s scenario: %s parameters: %s stack len %d' % (
-                self.state, self.scenario, self.parameters, len(self.tree))
-            print 'failed'
-
-        # Kludge: mark the tops of the trees. The visitor which
-        # creates Tool instances with give the Tool for this node
-        # the name of the chain
-    
-        for c in self.tree[0].children:
-            c.tree_top = True
-
-        # for now (02/01/2019), no reco. First tree is only tree is hypo
-        return self.tree[0].children[0]
-
-def _test(s):
-    from ChainLabelParser import ChainLabelParser
-    parser = ChainLabelParser(s, debug=True)
-    tree = parser.parse()
-    print tree.dump()
-
-
-def test(index):
-    from test_cases import test_strings
-    c = sys.argv[1]
-    index = -1
-    try:
-        index = int(c)
-    except:
-        print 'expected int in [1,%d] ]on comand line, got %s' % (
-            len(test_strins), c)
-        sys.exit()
-
-    print 'index', index
-    print '========== Test %d ==============' % index
-    s = test_strings[index]
-    print s
-    _test(s)
-
-
-def usage(options):
-    print 'usage: ChainLabelPaers -[%s]' % options
-
-  
-if __name__ == '__main__':
-
-    import getopt, sys
-    from test_cases import test_strings
-    ncases = len(test_strings)
-    try:
-        options = "1234567"
-        opts, args = getopt.getopt(sys.argv[1:], options, [])
-    except getopt.GetoptError as err:
-        # print help information and exit:
-        print str(err) # will print something like "option -a not recognized"
-        usage(options)
-        sys.exit(2)
-
-    assert len(args) == 1
-    o = args[0]
-    try:
-        index = int(o)
-    except:
-        print 'Supply an test case integer index  on the command line '
-        sys.exit(0)
-    
-    if index < 0 or index >= ncases:
-        print 'no such test case ind %d, expect val in [0, %d]'  %(index,
-                                                                   ncases-1)
-        sys.exit(0)
-
-    test(int(o))
-    
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
deleted file mode 100644
index 87c1114df9c..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py
+++ /dev/null
@@ -1,134 +0,0 @@
-from TrigHLTJetHypo.TrigHLTJetHypoConf import (TrigJetHypoToolConfig_simple,
-                                               TrigJetHypoToolConfig_dijet,
-                                               TrigJetNotToolMT,
-                                               TrigJetAndToolMT,
-                                               TrigJetOrToolMT,
-                                               TrigJetHypoToolMT)
-
-
-class ToolSetter(object):
-    """Visitor to set instantiated AlgTools to a jet hypo tree"""
-    
-    def __init__(self, name, dump_jets=True):
-
-        self.chain_name = name
-        self.dump_jets = dump_jets
-        
-        self.tool_factories = {
-            'simple': [TrigJetHypoToolConfig_simple, 0],
-            'not': [TrigJetNotToolMT, 0],
-            'and': [TrigJetAndToolMT, 0],
-            'or': [TrigJetOrToolMT, 0],
-            'dijet': [TrigJetHypoToolConfig_dijet, 0],
-            }
-
-        self.mod_router = {
-            'not': self.mod_logical_unary,
-            'and': self.mod_logical_binary,
-            'or': self.mod_logical_binary,
-            # 'not': self.mod_logical_unary,
-        }
-
-    def mod_logical_binary(self, node):
-        """Set the HypoConfigTool instance the 'and' and 'or' scenarios
-        these take two predicates"""
-        
-        scen = node.scenario
-        klass = self.tool_factories[scen][0]
-        sn = self.tool_factories[scen][1]
-        name = '%s_%d' % (scen, sn)
-        self.tool_factories[scen][1] += 1
-
-        # kludgy. The name of the tool seen by the trigger must be
-        # the trigger name, so have to figure  out if this is the top
-        # level node (actually first daughter, as the start node is the top)
-        # note that the name can only be set once so have to know
-        # if we are the top of the tree while traversing it. kludgy...
-        # also - will break when using a forest...
-
-        print 'Toolsetter, node.tree_top', node.tree_top
-        if node.tree_top:
-            tool = klass(name=self.chain_name)
-        else:
-            tool = klass(name=name)
-
-        print 'ToolSetter, setting lhs ', node.children[0].tool
-        tool.lhs = node.children[0].tool
-        tool.rhs = node.children[1].tool
-        node.tool = tool
-
-
-    def mod_logical_unary(self, node):
-        """Set the HypoConfigTool instance for the 'not' scenario
-        this takes a single predicate"""
-        
-        scen = node.scenario
-        klass = self.tool_factories[scen][0]
-        sn = self.tool_factories[scen][1]
-        name = '%s_%d' % (scen, sn)
-        self.tool_factories[scen][1] += 1
-
-        # kludgy. The name of the tool seen by the trigger must be
-        # the trigger name, so have to figure  out if this is the top
-        # level node (actually first daughter, as the start node is the top)
-        # note that the name can only be set once so have to know
-        # if we are the top of the tree while traversing it. kludgy...
-        # also - will break when using a forest...
-
-        print 'Toolsetter, node.tree_top', node.tree_top
-        if node.tree_top:
-            tool = klass(name=self.chain_name)
-        else:
-            tool = klass(name=name)
-
-        print 'ToolSetter, setting lhs ', node.children[0].tool
-        tool.hypoTool = node.children[0].tool
-        node.tool = tool
-                               
-
-                               
-    def mod_simple(self, node):
-        """Set the HypoConfigTool instance in a hypo tree node"""
-
-        scen = node.scenario
-        klass = self.tool_factories[scen][0]
-        sn = self.tool_factories[scen][1]
-        name = '%s_%d' % (scen, sn)
-        
-        self.tool_factories[scen][1] += 1
-
-        config_tool = klass(name=name+'_config')
-        [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()]
-        
-        # kludgy. The name of the tool seen by the trigger must be
-        # the trigger name, so have to figure  out if this is the top
-        # level node (actually first daughter, as the start node is the top)
-        # note that the name can only be set once so have to know
-        # if we are the top of the tree while traversing it. kludgy...
-        # also - will break when using a forest...
-        print 'Toolsetter, node.tree_top', node.tree_top
-        if node.tree_top:
-            tool = TrigJetHypoToolMT(name=self.chain_name)
-        else:
-            tool = TrigJetHypoToolMT(name=name)
-            
-        tool.HypoConfigurer = config_tool
-        tool.dumpJets  = self.dump_jets
-        node.tool = tool
-                               
-    def mod(self, node):
-        """Set the HypoConfigTool instance according to the scenario.
-        Note: node.accept must perform depth first navigation to ensure
-        child tools are set."""
-        
-        self.mod_router.get(node.scenario, self.mod_simple)(node)
-
-    def report(self):
-        wid = max(len(k) for k in self.tool_factories.keys())
-        rep = '\n%s: ' % self.__class__.__name__
-
-        rep += '\n'.join(
-            ['%s: %d' % (k.ljust(wid), v[1])
-             for k, v in self.tool_factories.items()])
-
-        return rep
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
index 908fcb0454a..538ed52e796 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py
@@ -1,73 +1,67 @@
-from TrigHLTJetHypo.TrigHLTJetHypoConf import (TrigJetHypoToolMT,
-                                               TrigJetHypoToolConfig_EtaEt)
+from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoToolMT, TrigJetHypoToolConfig_EtaEt
+import re
 
-from  TrigHLTJetHypo.ToolSetter import ToolSetter
-from  TrigHLTJetHypo.treeVisitors import TreeParameterExpander
-from  TrigHLTJetHypo.chainDict2jetLabel import (make_simple_label,
-                                                make_vbenf_label)
-from  TrigHLTJetHypo.ChainLabelParser import ChainLabelParser
+re_EtEta0 = re.compile(
+    r'^HLT_j(?P<thresh>\d+)(_(?P<etalo>\d{3})eta(?P<etahi>\d{3}))?$')
+# re_EtEta1 = re.compile(r'^HLT_j\d+(_\d{1-3}eta\d{3})?_L1')
+# re_EtEta2 = re.compile(r'^HLT_j\d+(_\d{3}eta\d{3})?_(jes|nojcalib|lcw)*$')
 
-from GaudiKernel.Constants import (VERBOSE,
-                                   DEBUG,
-                                   INFO,
-                                   WARNING,
-                                   ERROR,
-                                   FATAL,)
 
+def decodeEtEta(match, chain):
+    """Create a hypo tool for the Et - Eta scenario"""
+    default = {'etalo': '0', 'etahi': '320'}
+    conf_dict = match.groupdict()
+    for k, v in default.items():
+        if k not in conf_dict: conf_dict[k] = v
+        if conf_dict[k] is None: conf_dict[k] = v
 
-def  trigJetHypoToolFromDict(chain_dict):
-    """Produce  a jet trigger hypo tool from a chainDict"""
+    conf_tool = TrigJetHypoToolConfig_EtaEt(name=chain+"config")
+    conf_tool.EtThresholds = [float(conf_dict['thresh'])]
+    conf_tool.eta_mins = [float(conf_dict['etalo'])]
+    conf_tool.eta_maxs = [float(conf_dict['etahi'])]
+    conf_tool.asymmetricEtas = [0]
+    conf_tool.OutputLevel = 0
+    return conf_tool
 
-    print 'trigJetHypoToolFromDict starts'
-    chain_label = ''    
-    if 'vbenf' in chain_dict['chainParts'][0]['hypoScenario']:
-        assert len(chain_dict['chainParts']) == 1
-        chain_label = make_vbenf_label(chain_dict)
-    else:
-        chain_label = make_simple_label(chain_dict)
-    parser = ChainLabelParser(chain_label)
-    tree = parser.parse()
 
-    #expand strings of cuts to a cut dictionary
-    visitor = TreeParameterExpander()
-    tree.accept(visitor)
-    visitor.report()
+def  trigJetHypoToolFromDict(chainDict):
+    return trigJetHypoToolFromName( chainDict['chainName'], chainDict['chainName'])
 
-    # create - possibly nested - tools
+def  trigJetHypoToolFromName(name, jetconfig):
+    """Configure a jet hypo tool from chain name.
 
-    # chain name in run 2 dicts were missing the 'HLT_' prefix
-    # but it seems it is necessary to run the hypos in AthenaMT ?...?
-    
-    chain_name = chain_dict['chainName']
-    if not chain_name.startswith('HLT_'):
-        chain_name = 'HLT_' + chain_name
+    Delegate to functions according to the hypo scenartio."""
+    scenario_dict = {re_EtEta0: decodeEtEta}
 
-    print 'trigJetHypoToolFromDict chain_name', chain_name
-    visitor = ToolSetter(chain_name)
-    tree.accept(visitor)
-    visitor.report()
+    chain = jetconfig
+    for k, v in scenario_dict.items():
+        match = k.match(chain)
+        if match:
+            hypo_tool = TrigJetHypoToolMT(chain)
+            hypo_tool.HypoConfigurer = v(match, chain)
+            return hypo_tool
 
-    print 'Dumping jet config for', chain_name
-    print tree.dump()
-    tool = tree.tool
-    tool.OutputLevel = DEBUG
-    return tool
+    msg = 'trigJetHypoToolFromName(%s) - decode error' % chain
+    raise NotImplementedError(msg)
 
 
 import unittest
 class TestStringMethods(unittest.TestCase):
     def testValidConfigs(self):
-        from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
+        # EtaEt hypos
+        # from MC_pp_v7 import  TriggerFlags.JetSlice.signatures
+        # exception or any other issue will make the ctest for this package fail
+        chains = ('HLT_j85', 'HLT_j35_320eta490')
+        wid = max(len(c) for c in chains)
+        for c in chains:
+            tool = trigJetHypoToolFromName(c, c)
+            self.assertIsNotNone( tool ) 
+            print '%s' % c.rjust(wid), tool
+
+    def testInvalidConfig(self):
+        with self.assertRaises(NotImplementedError):
+            tool = trigJetHypoToolFromName('HLT_nonsense', 'HLT_nonsense')
 
-        chainNameDecoder = DictFromChainName.DictFromChainName()
-        # chain_names = ('HLT_j85', 'HLT_j35_0eta320')
-        chain_names = ('HLT_j0hs_vbenf',)
-        wid = max(len(c) for c in chain_names)
-        for chain_name in chain_names:
-            chain_dict = chainNameDecoder.getChainDict(chain_name)
-            tool = trigJetHypoToolFromDict(chain_dict)
-            self.assertIsNotNone(tool) 
-            print '%s' % chain_name.rjust(wid), tool
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
deleted file mode 100644
index 89047bbe9e7..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDict2jetLabel.py
+++ /dev/null
@@ -1,106 +0,0 @@
-import re
-
-# substrings that cannot occur in any chainPartName for simple chains.
-reject_substr = (
-    'gsc',
-    'ion',
-    'dphi',
-    'deta',
-    'invm',
-    '0i1',
-    '1i2',
-    'dphi',
-    'ht\d',)
-
-reject_substr_res = re.compile(r'%s' % '|'.join(reject_substr))
-
-
-def select_simple_chains(cd):
-    """Select chains for which to make an simple chain label.
-
-    Chains selected by reuiring that the signature os 'Jet'. Chains are
-    vetoed if specific substrings occur in any of the chainPartNames"""
-
-
-    # print cd
-    # assert False
-    chain_parts = [c for c in cd['chainParts'] if c['signature'] == 'Jet']
-    chain_name = cd['chainName']
-                       
-    for cp in chain_parts:
-        if  reject_substr_res.search(cp['chainPartName']):
-            return []
-
-    return chain_parts
-
-
-def make_simple_label(chain_dict):
-    """Marshal information deom the selected chainParts to create a
-    'simple' label.
-    """
-    
-    cps = select_simple_chains(chain_dict)
-    if not cps:
-        raise NotImplementedError(
-            'chain fails substring selection: not "simple": %s' % (
-                chain_dict['chainName']))
-    
-    label = 'simple(['
-    for cp in cps:
-        smcstr =  str(cp['smc'])
-        if smcstr == 'nosmc':
-            smcstr = ''
-        for i in range(int(cp['multiplicity'])):
-            # condition_str = '(%set,%s,%s)' % (str(cp['threshold']),
-            #                                  str(cp['etaRange']),
-            #                                  smcstr,)
-            condition_str = '(%set,%s' % (str(cp['threshold']),
-                                              str(cp['etaRange']),)
-            if smcstr:
-                condition_str += ',%s)'
-            else:
-                condition_str += ')'
-            label += condition_str
-    label += '])'
-    return label
-
-
-def select_vbenf_chains(cd):
-    """Select chains for which to make a vbenf chain label.
-    Chains selected by reuiring that the signature os 'Jet'. Chains are
-    vetoed if specific substrings occur in any of the chainPartNames"""
-
-
-    # print cd
-    # assert False
-    chain_parts = [c for c in cd['chainParts'] if c['signature'] == 'Jet']
-    return any(['vbenf' in cp['chainPartName'] for cp in chain_parts])
-
-def make_vbenf_label(chain_dict):
-    """Marshal information from the selected chainParts to create a
-    vbenf label.
-    """
-
-    # toy label for developement: run simple and dijet independently.
-    # simple makes Et cuts on two jets. Independently (sharing possible)
-    # of jets choosean by simple,  the dijet
-    # scenario requires a dijet of mass > 900, and opening angle in phi > 2.6
-               
-    return 'and([] simple([(50et)(70et)])dijet([(900mass, 26dphi)]))'
-
-if __name__ == '__main__':
-    """Read chainDicts from files, cread simple label if possible"""
-    from chainDictSource import chainDictSource
-
-    for cd in chainDictSource():
-        f = cd['chainName']
-        print '\n---------'
-        print f
-        try:
-            label = make_simple_label(cd)
-        except Exception, e:
-            print e
-            continue
-        
-        print 'chain label', label
-        print '-----------\n'
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
deleted file mode 100644
index 608d8b49228..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/chainDictDumper.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
-from TriggerMenuMT.HLTMenuConfig.Menu.SignatureDicts import JetChainParts
-import sys
-
-from pprint import PrettyPrinter
-
-pp = PrettyPrinter(indent=4)
-pp.pprint(JetChainParts)
-
-decodeChainName = DictFromChainName.DictFromChainName()
-
-def do_it():
-    print '\n------------------\n'
-    chain_dict = decodeChainName.getChainDict(chain_name)
-    pp.pprint(chain_dict)
-
-if __name__ == '__main__':
-    chain_name = sys.argv[1]
-    do_it()
-    # chain_names = ('HLT_j85', 'j85', 'HLT_j55_0eta320_2j20_0eta320',)
-    # for chain_name in chain_names:
-    #      do_it()
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
deleted file mode 100644
index 33afe422d31..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/constants.py
+++ /dev/null
@@ -1,6 +0,0 @@
-lchars = 'abcdefghijklmnopqrstuvwxyz'
-digits = '0123456789'
-delims = '()[],'
-logicals = ('and', 'or', 'not')
-alphabet = lchars + digits + delims
-
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
deleted file mode 100644
index 7ce56d947df..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py
+++ /dev/null
@@ -1,69 +0,0 @@
-from constants import logicals
-    
-class Node(object):
-    
-    def __init__(self, scenario):
-        self.scenario = scenario
-        self.parameters = ''
-        self.children = []
-        self.conf_attrs = {}
-        self.tool = None
-
-        # self.tree_top kludge carensure top level tools get chain name
-        # as Tool name
-        self.tree_top = False
-
-    def add_child(self, c):
-        self.children.append(c)
-        
-    def accept(self, modifier):
-        "call self before children"
-
-        modifier.mod(self)
-        for c in self.children:
-            c.accept(modifier)
-
-    def accept_cf(self, modifier):
-        "call children before self"
-        
-        for c in self.children:
-            c.accept_cf(modifier)
-        modifier.mod(self)
-
-    def makeTool(self):
-        if self.scenario not in logicals:
-            self.tool = DummyTool(self.toolName)
-            
-    def buildTree(self, treeVisitor):
-        if self.children:
-            if self.scenario in logicals:
-                treeVisitor.add(self.scenario + '(')
-            else: 
-                treeVisitor.add(self.tool.name() + '(')
-                
-            for c in self.children:
-                c.buildTree(treeVisitor)
-            treeVisitor.add(') ')
-
-        else:
-            treeVisitor.add(self.tool.name() + ' ')
-            
-
-    
-        return s
-        
-    def dump(self, n_in=0):
-        indent = ' '*n_in
-        s = '\n'
-        s =  indent + 'Node. scenario: %s \n' % self.scenario
-        s +=  indent + 'is tree top? %s \n' % self.tree_top
-        s += indent + 'parameters: %s\n' % str(self.parameters)
-        s += indent + 'conf_attrs: %s\n' % str(self.conf_attrs)
-        s += indent + 'AlgTool: %s\n' % str(self.tool)
-        # s += indent + 'AlgTool dict: %s\n' % str(self.tool.__dict__)
-        s += indent + 'No of children: %d\n\n' % len(self.children)
-        for c in self.children:
-            s += c.dump(n_in+5)
-
-        return s
-        
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
deleted file mode 100644
index 549dc54109a..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/test_cases.py
+++ /dev/null
@@ -1,70 +0,0 @@
-test_strings = [
-    'ijet([(10et, 0eta320)])',
-     'ijet([(10et, 0eta320)(20et, 0eta320)])',
-    # 'or([] ijet([10et]) and([] ijet([20et]) ijet([30et])))',
-    'or([] ijet([(10et)]) ijet([(20et)(40et)]))',
-    'and([] ijet([(10et)]) ijet([(20et)]))',
-    'not([] ijet([(10et)]) )',
-    'not([] and([] ijet([(40et, 0eta320)]) ijet([(100et, 0eta320)])))',
-    'or([] not([] ijet([(40et, 0eta320)])) not([] ijet([(100et, 0eta320)])))',
-    'or([] and([] ijet([(40et, 0eta320)]) ijet([(40et, 0eta320)])) not([] ijet([(100et, 0eta320)])))',
-
-
-
-"""
-partition     
-(
-  [(4,2)]   # partition 6 input jets to 4, 2 
-  splitter  # send the 4s to first 2 children, 2 to third.
-    assert len(o) == 1
-  (
-    [(1,1)(2)]
-    sum # mass cut on sum of input jets (ord.=4)
-    (
-      [(800m900)]
-    )
-    partition        #  partition 4 jets into non-overlapping
-                     #  sets ord 2, 2
-    (
-      [(2,2)]
-      pair           # sum inputs, apply deta cut to the 2 sums
-      (
-        [(40deta)]
-        sum          # child gets two lists, applys mass cuts
-        ( 
-          [(75m85)(80m90)]
-          partition  # passes on 2 sum to regroup to single jets
-          (
-            [() (1)]
-            ijet     # apply aoverlapping mod, et cuts
-            (
-              [(30width50, 30et) (35width45, 40et)]
-            )
-          )
-        )
-      )
-    )
-  )
-               
-  ijet([(p320etap500, 100et) (n500etan320)]),
-)""",
-
-
-#     """cascade(
-#    [800m900]             # conditions for cascade (only one here)
-#      dijet(              # first daughter scenario
-#        [ 80m90]          # condition(s) for first daughter scenario
-#         ijet([10et])     # grandaughter scenario 1 for first daugh scen.
-#         ijet([20et])     # grandaughter scenario 2 for first daugh scen.
-#           )              # end of first dijet scenario 
-#      dijet(              # second daughter scenario
-#        [85m95]
-#          ijet([30et]) 
-#          ijet([40et])
-#            )             # end of second dijet scenario
-#    )                     # end of cascade scenario
-#    """
-
-    'and([] ijet([(50et)(70et)]) dijet([(900mass, 26dphi)]))',
-    'and([]simple([(50et)(70et)])dijet([(900m,26dphi)]))',
-]
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
deleted file mode 100644
index 5dcc580ce23..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py
+++ /dev/null
@@ -1,392 +0,0 @@
-from constants import lchars
-
-import re
-import math
-
-from ToolSetter import ToolSetter
-class Checker(object):
-    def __init__(self):
-        self.known = {
-            'simple': ('Et'),
-            'cascade': ('m')
-        }
-
-        self.msgs = []
-        self.nchecked = 0
-
-    def mod(self, node):
-        self.nchecked += 1
-        if node.scenario not in self.known:
-            self.msgs.append('unknown scenario %s' % node.scenario)
-    
-    def report(self):
-        s = ['Checker: %d nodes checked' % self.nchecked]
-        s.extend(self.msgs)
-        return '\n'.join(s)
-
-
-class TreeBuilder(object):
-    def __init__(self):
-        self.tree = '('
-        
-    def add(self, s):
-        self.tree += s
-
-    def report(self):
-        return self.tree
-
-
-class TreeToBooleanExpression(object):
-    """visit a hypo tree. If boolean scenarios are present, build a
-    boolean expression string."""
-    
-    def __init__(self):
-        self.stack = []
-
-    def mod(self, node):
-        if node.scenario == 'not':
-            self.stack.append(' ! ')
-            return
-
-        if node.scenario == 'and':
-            self.stack.append(' x ')
-            return
-
-        if node.scenario == 'or':
-            self.stack.append(' + ')
-            return
-
-        self.stack.append(' %s ' %node.tool.name())
-
-    def report(self):
-        s = '%s: ' % self.__class__.__name__
-        while self.stack: s += self.stack.pop()
-        return s.strip()
-
-
-class TreeParameterExpander_simple(object):
-    """Convert parameter string into duction holding low, high window
-    cut vals. Specialistaion for the 'simple' scenario
-
-    parameter strings look like '40et, 0eta320, nosmc'
-    """
-    
-    window_re = re.compile(
-        r'^(?P<lo>\d*)(?P<attr>[%s]+)(?P<hi>\d*)' % lchars)
-
-    defaults = {'etalo': 0.0,
-                'etahi': 3.2,
-    }
-
-    scale_factors = {'eta': 0.01,
-                     'et': 1000.,
-                     'smc': 1000.,
-    }
-
-    def __init__(self):
-        self.msgs = []
-
-    def mod(self, node):
-
-        def get_conditions(params):
-            """Split conditions string into list of condition strings
-            Condition string looks like
-            '(10et,0eta320)(20et,0eta320)(40et,0eta320)'
-            returned is ['10et,0eta320', '20et,0eta320', '40et,0eta320']
-            """
-
-            alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789,'
-            pat = re.compile(r'(^\([%s]+\))'% alphabet )
-            s = params
-            m = True
-            conditions = []
-            while m:
-                m = pat.match(s)
-                if m is not None:
-                    conditions.append(m.group(0))
-                    s = s[len(conditions[-1]):]
-            assert params == ''.join(conditions)
-            conditions = [c[1:-1] for c in conditions]  # strip parens
-            return conditions
-
-
-        conditions = get_conditions(node.parameters)
-
-        
-        node.conf_attrs['EtThresholds'] = []
-        node.conf_attrs['eta_mins'] = []
-        node.conf_attrs['eta_maxs'] = []
-        node.conf_attrs['asymmetricEtas'] = []
-
-        for c in conditions:
-            toks = c.split(',')
-            toks = [t.strip() for t in toks]
-
-
-            for t in toks:
-                m = self.window_re.match(t)
-                if m is None:
-                    self.msgs.append('match failed for parameter %s' % t)
-                    return
-                group_dict = m.groupdict()
-                attr = group_dict['attr']
-                lo = group_dict['lo']
-                hi = group_dict['hi']
-                if lo == '':
-                    lo = self.defaults.get(attr+'lo', '')
-                if hi == '':
-                    hi = self.defaults.get(attr+'hi', '')
-
-                sf = self.scale_factors[attr]
-                if lo:
-                    if attr == 'eta':
-                        node.conf_attrs['eta_mins'].append(sf * float(lo))
-                    elif attr == 'et':
-                        node.conf_attrs['EtThresholds'].append(sf * float(lo))
-                if hi:
-                    if attr == 'eta':
-                        node.conf_attrs['eta_maxs'].append(sf * float(hi))
-                
-        #01/01/2019 PS  KLUDGE !! FIX ME!!!  asymmetric eta hardwired to 0.
-
-        [node.conf_attrs['asymmetricEtas'].append(0) for i in range(
-                len(conditions))]
-        self.msgs = ['All OK']
-
-        
-    def report(self):
-        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
-
-    
-
-
-class TreeParameterExpander_dijet(object):
-    """Convert parameter string into duction holding low, high window
-    cut vals. Specialistaion for the dijet scenario
-
-    parameter strings look like '40m,100deta200, 50dphi300'
-    """
-    
-    window_re = re.compile(
-        r'^(?P<lo>\d*)(?P<attr>[%s]+)(?P<hi>\d*)' % lchars)
-
-    defaults = {'mass_mins': 0.0,
-                'mass_maxs': 100000.,
-                'deta_mins': 0.,
-                'deta_maxs': 20.,
-                'dphi_mins': 0.,
-                'dphi_maxs': math.pi,
-    }
-
-    scale_factors = {'deta': 0.01,
-                     'mass': 1000.,
-                     'dphi': 0.01,
-    }
-
-    def __init__(self):
-        self.msgs = []
-
-    def mod(self, node):
-
-        def get_conditions(params):
-            """Split conditions string into list of condition strings
-            Condition string looks like
-            '(75m85,100dEta200, 50dphi200)(80m90, 110dEta210)'
-            returned is ['10et,0eta320', '20et,0eta320', '40et,0eta320']
-            """
-
-            alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789,'
-            pat = re.compile(r'(^\([%s]+\))'% alphabet )
-            s = params
-            m = True
-            conditions = []
-            while m:
-                m = pat.match(s)
-                if m is not None:
-                    conditions.append(m.group(0))
-                    s = s[len(conditions[-1]):]
-            assert params == ''.join(conditions)
-            conditions = [c[1:-1] for c in conditions]  # strip parens
-            return conditions
-
-        ok = True # status flag
-        conditions = get_conditions(node.parameters)
-
-        bare_attrs = ['mass', 'deta', 'dphi']
-        all_attrs = []
-        for attr in bare_attrs:
-            all_attrs.extend([attr+'_mins', attr+'_maxs'])
-
-        for attr in all_attrs:
-            node.conf_attrs[attr] = []
-
-        for c in conditions:
-            toks = c.split(',')
-            toks = [t.strip() for t in toks]
-
-
-            processed_attrs = []
-            for t in toks:
-                m = self.window_re.match(t)
-                if m is None:
-                    self.msgs.append('match failed for parameter %s' % t)
-                    return
-                group_dict = m.groupdict()
-                attr = group_dict['attr']
-                lo = group_dict['lo']
-                hi = group_dict['hi']
-                if lo == '':
-                    lo = self.defaults.get(attr+'_min', '')
-                if hi == '':
-                    hi = self.defaults.get(attr+'_max', '')
-
-                sf = self.scale_factors[attr]
-                if lo:
-                    if attr == 'mass':
-                        node.conf_attrs['mass_mins'].append(sf * float(lo))
-                    elif attr == 'deta':
-                        node.conf_attrs['deta_mins'].append(sf * float(lo))
-                    elif attr == 'dphi':
-                        node.conf_attrs['dphi_mins'].append(sf * float(lo))
-
-                    processed_attrs.append(attr+'_mins')
-                if hi:
-                    if attr == 'mass':
-                        node.conf_attrs['mass_maxs'].append(sf * float(lo))
-                    elif attr == 'deta':
-                        node.conf_attrs['deta_maxs'].append(sf * float(lo))
-                    elif attr == 'dphi':
-                        node.conf_attrs['dphi_maxs'].append(sf * float(lo))
-
-                    processed_attrs.append(attr+'_maxs')
-
-
-
-            for a in all_attrs:
-                if a not in processed_attrs:
-                    node.conf_attrs[a].append(self.defaults[a])
-
-            for a in processed_attrs:
-                if a not in all_attrs:
-                    self.msgs.append('Unknown attribute: %s' % a)
-                    ok = False
-
-        if ok:
-            self.msgs = ['All OK']
-        else:
-            self.msgs.append('Error')
-
-        
-    def report(self):
-        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
-
-    
-class TreeParameterExpander_null(object):
-    """Does nothing except check the parameter string is empty"""
-
-    def __init__(self):
-        self.msgs = ['Do nothing paramter expander']
-
-    def mod(self, node):
-        assert node.parameters == ''
-        
-    def report(self):
-        return '%s: ' % self.__class__.__name__ + '\n'.join(self.msgs) 
-    
-
-
-class TreeParameterExpander(object):
-    """Class to exapnder node.paramters string. Delegates to
-    specialised exanders."""
-    
-    router = {
-        'simple': TreeParameterExpander_simple,
-        'dijet': TreeParameterExpander_dijet,
-        'not': TreeParameterExpander_null,
-        'and': TreeParameterExpander_null,
-        'or': TreeParameterExpander_null,
-    }
-
-    def __init__(self):
-        self.expander = None
-
-    def mod(self, node):
-        self.expander = self.router[node.scenario]()
-        self.expander.mod(node)
-        print self.expander.report()
-    def report(self):
-        return self.expander.report()
-        
-
-
-class TreeToCascade(object):
-    def __init__(self):
-        self.stack = []
-
-    def mod(self, node):
-        
-        self.stack.append(
-            '(%s < (%s))' %(node.tool.name(), 
-                            ' '.join([c.tool.name  for c in node.children])))
-
-    def report(self):
-        s = ''
-        while self.stack:
-            s += self.stack.pop()
-        return s.strip()
-
-
-def _test(s):
-
-    from ChainLabelParser import ChainLabelParser
-    parser = ChainLabelParser(s)
-    tree = parser.parse()
-    print tree.dump()
-    # exapnd the window cuts (strings) obtained from the chain label
-    # to attributes and floating point numbers, set defaults
-    # for unspecified vallues
-    visitor = TreeParameterExpander()
-    tree.accept(visitor)
-    print visitor.report()
-    print tree.dump()
-
-
-    # set the node attribute node.tool to be the hypo  Al\gTool.
-    print 'sending in the ToolSetter visitor'
-    ts_visitor = ToolSetter(s)
-    tree.accept_cf(ts_visitor)
-    print ts_visitor.report()
-
-
-    print tree.dump()
-
-
-def test(index):
-    from test_cases import test_strings
-    import sys
-    c = sys.argv[1]
-    index = -1
-    try:
-        index = int(c)
-    except:
-        print 'expected int in [1,%d] ]on comand line, got %s' % (
-            len(test_strings), c)
-        sys.exit()
-
-    print 'index', index
-    print '========== Test %d ==============' % index
-    s = test_strings[index]
-    print s
-    _test(s)
-
-
-if __name__ == '__main__':
-    import sys
-    c = sys.argv[1]
-    ic = -1
-    try:
-        ic = int(c)
-    except:
-        print 'expected int on command line, got ',c
-        sys.exit()
-    test(ic)
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
deleted file mode 100644
index 8e1c5d29314..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/DijetMTCondition.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h"
-#include <sstream>
-#include <stdexcept>
-#include <TLorentzVector.h>
-#include <limits>
-// #include <iostream>
-DijetMTCondition::DijetMTCondition(double massMin,
-                                   double massMax,
-                                   double detaMin,
-                                   double detaMax,
-                                   double dphiMin,
-                                   double dphiMax
-                                   ){
-  m_massMin = massMin;
-  m_massMax = massMax;
-  m_detaMin = detaMin;
-  m_detaMax = detaMax;
-  m_dphiMin = dphiMin;
-  m_dphiMax = dphiMax;
-}
-
-
-bool DijetMTCondition::isSatisfied(const HypoJetVector& ips) const{
-  if(ips.size() != 2){
-    std::stringstream ss;
-    ss << "DijetMT::isSatisfied must see exactly 2 particles, but received "
-       << ips.size()
-       << '\n';
-    
-    throw std::runtime_error(ss.str());
-  }
-
-  auto j0 = ips[0];
-  auto j1 = ips[1];
-
-  auto rj0 = 0.001 * (j0 -> p4());
-  auto rj1 = 0.001 * (j1 -> p4());
-
-  auto mass = (rj0 + rj1).M();
-  if (m_massMin > mass or mass >= m_massMax){return false;}
-
-  
-  auto eta0 =  j0->eta();
-  auto eta1 =  j1->eta();
-  auto adeta = std::abs(eta0 -eta1);
-  if (m_detaMin > adeta or adeta >= m_detaMax){return false;}
-
-
-  auto dphi = std::abs(rj0.DeltaPhi(rj1));
-  if (m_dphiMin > dphi or dphi >= m_dphiMax){return false;}
-
-  return true;
-
-  /*
-  auto result =  test(et0, et1, absEta0, absEta1, dEta, mass);
-  std::cout << "DijetMTCondition : " << std::boolalpha << result << '\n'
-            << std::setprecision(3) << std::scientific 
-            << "jet 0 et " << m_etThreshold0 << " " << et0 << '\n'
-            << "jet 1 et " << m_etThreshold1 << " " << et1 << '\n'
-            << "jet 0 eta " << m_etaMin0 << " " << eta0 << " " << m_etaMax0 << '\n'
-            << "jet 1 eta " << m_etaMin1 << " " << eta1 << " " << m_etaMax1 << '\n'
-            << "dEta " << m_dEtaMin << " " << dEta << " " << m_dEtaMax << '\n'
-            << "mass " << m_massMin << " " << mass << " " <<m_massMax << '\n';
-
-  return result;
-  */
-
-}
-
-std::string DijetMTCondition::toString() const noexcept {
-  std::stringstream ss;
-  ss << "DijetMTCondition: "
-
-     << " mass min: " 
-     << m_massMin
-     << " mass max: " 
-     << m_massMax
-
-     << " dEta min: " 
-     << m_detaMin
-     << " dEta max: " 
-     << m_detaMax
-
-     << " dPhi min: " 
-     << m_dphiMin
-     << " dPhi max: " 
-     << m_dphiMax
-
-     <<'\n';
-
-  return ss.str();
-}
-
-
-double DijetMTCondition::orderingParameter() const noexcept {
-  return m_massMin;
-}
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
index ce9babaa9a7..20299f147ee 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/conditionsFactory2.cxx
@@ -19,7 +19,6 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetDEtaMassCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetDPhiCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetCondition.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/DijetMTCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HTCondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TLACondition.h"
 #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
@@ -105,30 +104,6 @@ Conditions conditionsFactoryDijet(const std::vector<double>& etThresholds1,
   return conditions;
 }
 
-
-Conditions conditionsFactoryDijetMT(const std::vector<double>& massMins,
-                                    const std::vector<double>& massMaxs,
-                                    const std::vector<double>& detaMins,
-                                    const std::vector<double>& detaMaxs,
-                                    const std::vector<double>& dphiMins,
-                                    const std::vector<double>& dphiMaxs){  
-  Conditions conditions;
-  
-  for(std::size_t i = 0; i < massMins.size(); ++i){
-    std::shared_ptr<ICondition>
-      pCondition(new DijetMTCondition(massMins[i],
-                                      massMaxs[i],
-                                      detaMins[i],
-                                      detaMaxs[i],
-                                      dphiMins[i],
-                                      dphiMaxs[i]));
-    
-    conditions.push_back(ConditionBridge(pCondition));
-  }
-  return conditions;
-}
-
-
 Conditions conditionsFactoryDijetEtaMass(const std::vector<double>& etaMins,
                                          const std::vector<double>& etaMaxs,
                                          const std::vector<double>& etMins,
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
deleted file mode 100644
index 4b169a56a5f..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.cxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ********************************************************************
-//
-// NAME:     TrigJetAndToolMT.cxx
-// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
-//
-//
-// ********************************************************************
-
-#include "TrigJetAndToolMT.h"
-
-#include "GaudiKernel/StatusCode.h"
-
-#include "DecisionHandling/HLTIdentifier.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-
-using TrigCompositeUtils::DecisionID;
-using TrigCompositeUtils::Decision;
-using TrigCompositeUtils::DecisionContainer;
-
-TrigJetAndToolMT::TrigJetAndToolMT(const std::string& type,
-                                 const std::string& name,
-                                 const IInterface* parent) :
-  base_class(type, name, parent),
-  m_decisionId(HLT::Identifier::fromToolName(name)) {
-}
-
-
-TrigJetAndToolMT::~TrigJetAndToolMT(){
-}
-
-StatusCode TrigJetAndToolMT::initialize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetAndToolMT::finalize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetAndToolMT::decide(const xAOD::JetContainer* jets,
-                                           bool& pass) const {
-
-  m_lhs->decide(jets, pass);
-  if (pass){
-    ATH_MSG_DEBUG("LHS passed");
-    m_rhs->decide(jets, pass);
-    ATH_MSG_DEBUG("RHS " <<std::boolalpha << pass);
-  } else {
-    ATH_MSG_DEBUG("LHS failed");
-  }    
-
-
-  return StatusCode::SUCCESS;
-}
-
-
-const HLT::Identifier& TrigJetAndToolMT::getId() const{
-  return m_decisionId;
-} 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
deleted file mode 100644
index f2140fc2a75..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetAndToolMT.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGJETANDTOOLMT_H
-#define TRIGJETANDTOOLMT_H
-/********************************************************************
- *
- * NAME:     TrigJetAndToolMT.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- *
- *********************************************************************/
-
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "DecisionHandling/HLTIdentifier.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-#include "AthenaMonitoring/GenericMonitoringTool.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-
-#include "ITrigJetHypoToolMT.h"
-#include "ITrigJetHypoToolConfig.h"
-
-class TrigJetAndToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
-
- public:
-  
-  TrigJetAndToolMT(const std::string& type,
-                    const std::string& name,
-                    const IInterface* parent);
-  virtual ~TrigJetAndToolMT();
-  virtual StatusCode initialize() override;
-  virtual StatusCode finalize() override;
-
-  // ITrigJetHypoToolMT interface
-  virtual StatusCode
-    decide(const xAOD::JetContainer*, bool& pass) const override;
-  virtual const HLT::Identifier& getId() const override; 
- private:
-
-  // Identifier is used to keep track of which tool made which decision.
-  // The information is stored in the event store.
-  HLT::Identifier m_decisionId;  
-  
-  ToolHandle<ITrigJetHypoToolMT> m_lhs {
-    this, "lhs", {}, "LHS boolean binary expression"}; 
-  ToolHandle<ITrigJetHypoToolMT> m_rhs {
-    this, "rhs", {}, "RHS boolean binary expression"}; 
-
- 
- // Monitored variables...
- /*
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-*/
-
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
deleted file mode 100644
index c079a5328ca..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/*
-  Instatniation of JetHypo components for  the DiMass scenario
- */
-#include "TrigJetHypoToolConfig_dijet.h"
-
-#include "GaudiKernel/StatusCode.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsSorter.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CombinationsGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/groupsMatcherFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
-
-#include "DecisionHandling/TrigCompositeUtils.h"
-
-using TrigCompositeUtils::DecisionID;
-using TrigCompositeUtils::Decision;
-using TrigCompositeUtils::DecisionContainer;
-
-TrigJetHypoToolConfig_dijet::TrigJetHypoToolConfig_dijet(const std::string& type,
-                                                 const std::string& name,
-                                                 const IInterface* parent) :
-  base_class(type, name, parent){
-
-}
-
-
-TrigJetHypoToolConfig_dijet::~TrigJetHypoToolConfig_dijet(){
-}
-
-StatusCode TrigJetHypoToolConfig_dijet::initialize() {
-  CHECK(checkVals());
-  return StatusCode::SUCCESS;
-}
-
-
-
-
-Conditions TrigJetHypoToolConfig_dijet::getConditions() const {
-  auto conditions = conditionsFactoryDijetMT(m_massMins,
-                                             m_massMaxs,
-                                             m_dEtaMins,
-                                             m_dEtaMaxs,
-                                             m_dPhiMins,
-                                             m_dPhiMaxs);
- 
-  std::sort(conditions.begin(), conditions.end(), ConditionsSorter());
-  
-  return conditions;
-}
-
- 
-std::unique_ptr<IJetGrouper> TrigJetHypoToolConfig_dijet::getJetGrouper() const {
-  return std::make_unique<CombinationsGrouper>(2);
-}
-
-StatusCode TrigJetHypoToolConfig_dijet::checkVals() const {
-  // check cionsistent sizes
-
-  auto sz = m_massMins.size();
-  if (sz != m_massMaxs.size() or
-      sz != m_dEtaMins.size() or
-      sz != m_dEtaMaxs.size() or
-      sz != m_dPhiMins.size() or
-      sz != m_dPhiMaxs.size()){
-    ATH_MSG_ERROR(name()
-                  << ": mismatch between number of thresholds "
-                  << "and min, max fro mass, dEta, dPhi "
-                  << m_massMins.size() << " "
-                  << m_massMaxs.size() << " "
-                  << m_dEtaMins.size() << " "
-                  << m_dEtaMaxs.size() << " "
-                  << m_dPhiMins.size() << " "
-                  << m_dPhiMaxs.size() << " ");
-    
-    return StatusCode::FAILURE;
-  }
-  return StatusCode::SUCCESS;
-}
-
-std::vector<std::shared_ptr<ICleaner>> 
-TrigJetHypoToolConfig_dijet::getCleaners() const {
-  std::vector<std::shared_ptr<ICleaner>> v;
-  return v;
-}
-
-
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
deleted file mode 100644
index 0f47ee6b7ca..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_dijet.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGJETHYPOTOOLConfig_DIJET_H
-#define TRIGJETHYPOTOOLConfig_DIJET_H
-/********************************************************************
- *
- * NAME:     TrigJetHypoToolConfig_dijetTool.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- *
- *********************************************************************/
-
-
-#include "ITrigJetHypoToolConfig.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "DecisionHandling/HLTIdentifier.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-#include "AthenaMonitoring/GenericMonitoringTool.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-
-class TrigJetHypoToolConfig_dijet:
-public extends<AthAlgTool, ITrigJetHypoToolConfig> {
-
- public:
-  
-  TrigJetHypoToolConfig_dijet(const std::string& type,
-                          const std::string& name,
-                          const IInterface* parent);
-  virtual ~TrigJetHypoToolConfig_dijet();
-
-  virtual StatusCode initialize() override;
-  virtual std::vector<std::shared_ptr<ICleaner>> getCleaners() const override;
-  virtual std::unique_ptr<IJetGrouper> getJetGrouper() const override;
-  virtual Conditions getConditions() const override;
-
- private:
-
-  Gaudi::Property<std::vector<double>>
-    m_massMins{this, "mass_mins", {}, "min mass for each dijet"};
-
-  Gaudi::Property<std::vector<double>>
-    m_massMaxs{this, "mass_maxs", {}, "max mass for each dijet"};
-
-  Gaudi::Property<std::vector<double>>
-    m_dEtaMins{this, "deta_mins", {}, "min dEta for jets in each dijet"};
-
-  Gaudi::Property<std::vector<double>>
-    m_dEtaMaxs{this, "deta_maxs", {}, "max dEta for jets in each dijet"};
-
-  Gaudi::Property<std::vector<double>>
-    m_dPhiMins{this, "dphi_mins", {}, "min dPhi for jets in each dijet"};
-
-  Gaudi::Property<std::vector<double>>
-    m_dPhiMaxs{this, "dphi_maxs", {}, "max dPhi for jets in each dijet"};
-
-  virtual StatusCode checkVals()  const override;
- 
- // Monitored variables...
- /*
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-*/
-
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
deleted file mode 100644
index 9eaa545f00f..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ********************************************************************
-//
-// NAME:     TrigJetHypoToolMT_simple.cxx
-// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
-//
-//
-// ********************************************************************
-
-#include "TrigJetHypoToolConfig_simple.h"
-
-#include "GaudiKernel/StatusCode.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/conditionsFactory2.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsSorter.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/SingleJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/groupsMatcherFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerFactory.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/TrigHLTJetHypoHelper2.h"
-
-#include "DecisionHandling/TrigCompositeUtils.h"
-
-using TrigCompositeUtils::DecisionID;
-using TrigCompositeUtils::Decision;
-using TrigCompositeUtils::DecisionContainer;
-
-TrigJetHypoToolConfig_simple::TrigJetHypoToolConfig_simple(const std::string& type,
-                                                 const std::string& name,
-                                                 const IInterface* parent) :
-  base_class(type, name, parent){
-
-}
-
-
-TrigJetHypoToolConfig_simple::~TrigJetHypoToolConfig_simple(){
-}
-
-StatusCode TrigJetHypoToolConfig_simple::initialize() {
-  CHECK(checkVals());
-  return StatusCode::SUCCESS;
-}
-
-
-
-
-Conditions TrigJetHypoToolConfig_simple::getConditions() const {
-  auto conditions = conditionsFactoryEtaEt(m_etaMins,
-                                           m_etaMaxs,
-                                           m_EtThresholds,
-                                           m_asymmetricEtas);
-  std::sort(conditions.begin(), conditions.end(), ConditionsSorter());
-  
-  return conditions;
-}
-
- 
-std::unique_ptr<IJetGrouper>
-TrigJetHypoToolConfig_simple::getJetGrouper() const {
-  return std::make_unique<SingleJetGrouper>();
-}
-
-StatusCode TrigJetHypoToolConfig_simple::checkVals() const {
-  if (m_EtThresholds.size() != m_etaMins.size() or
-      m_EtThresholds.size() != m_etaMaxs.size() or
-      m_asymmetricEtas.size() != m_etaMaxs.size()){
-    
-    ATH_MSG_ERROR(name()
-                  << ": mismatch between number of thresholds "
-                  << "and eta min, max boundaries or asymmetric eta flags: "
-                  << m_EtThresholds.size() << " "
-                  << m_etaMins.size() << " "
-                  << m_etaMaxs.size() << " "
-                  << m_asymmetricEtas.size() << " "
-                  );
-    
-    return StatusCode::FAILURE;
-  }
-  return StatusCode::SUCCESS;
-}
-
-std::vector<std::shared_ptr<ICleaner>> 
-TrigJetHypoToolConfig_simple::getCleaners() const {
-  std::vector<std::shared_ptr<ICleaner>> v;
-  return v;
-}
-
-
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
deleted file mode 100644
index 6f8b04e489d..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_simple.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGJETHYPOTOOLConfig_SIMPLE_H
-#define TRIGJETHYPOTOOLConfig_SIMPLE_H
-/********************************************************************
- *
- * NAME:     TrigJetHypoToolConfig_simple.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- *
- *********************************************************************/
-
-
-#include "ITrigJetHypoToolConfig.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "DecisionHandling/HLTIdentifier.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-#include "AthenaMonitoring/GenericMonitoringTool.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-
-class TrigJetHypoToolConfig_simple:
-public extends<AthAlgTool, ITrigJetHypoToolConfig> {
-
- public:
-  
-  TrigJetHypoToolConfig_simple(const std::string& type,
-                          const std::string& name,
-                          const IInterface* parent);
-  virtual ~TrigJetHypoToolConfig_simple();
-
-  virtual StatusCode initialize() override;
-  virtual std::vector<std::shared_ptr<ICleaner>> getCleaners() const override;
-  virtual std::unique_ptr<IJetGrouper> getJetGrouper() const override;
-  virtual Conditions getConditions() const override;
-
- private:
-  
-  Gaudi::Property<std::vector<double>>
-    m_EtThresholds{this, "EtThresholds", {}, "Etthresholds by eta region"};
-  
-  Gaudi::Property<std::vector<double>>
-    m_etaMins{this, "eta_mins", {}, "Eta min for eta regions"};
-  
-  Gaudi::Property<std::vector<double>>
-    m_etaMaxs{this, "eta_maxs", {}, "Eta max for eta regions"};
-
-  Gaudi::Property<std::vector<int>>
-    m_asymmetricEtas{this, "asymmetricEtas", {}, "Apply asym. eta cuts"};
-
-
-  virtual StatusCode checkVals()  const override;
- 
- // Monitored variables...
- /*
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-*/
-
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
index 90fcef39694..4faa51b87fb 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.cxx
@@ -71,7 +71,7 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
                                       std::move(matcher));
 
   /* apply cleaning and hypothesis alg */
-  ATH_MSG_DEBUG("hypo helper start... "
+  ATH_MSG_DEBUG("hypo helper start... " << m_chainName
                 << " no of jets ... " 
                 << jets->size() 
                 << "...");
@@ -88,7 +88,7 @@ StatusCode TrigJetHypoToolMT::decide(const xAOD::JetContainer* jets,
 
   // accumulateTime(steady_clock::now() - t);
   
-  ATH_MSG_DEBUG("hypo testing done chain  "
+  ATH_MSG_DEBUG("hypo testing done chain  " << m_chainName
                 << " no of input jets " << jets->size()
                 << " pass " << pass );
   
@@ -144,12 +144,12 @@ void TrigJetHypoToolMT::writeDebug(bool pass,
                                        const HypoJetVector& passedJets,
                                        const HypoJetVector& failedJets
                                        ) const{
-  ATH_MSG_INFO("Writing debug start...");
+  ATH_MSG_INFO("Writing debug start" << m_chainName << "...");
   
   if(pass){
-    ATH_MSG_DEBUG(" event passed");
+    ATH_MSG_DEBUG(m_chainName<< " event passed");
   } else {
-    ATH_MSG_DEBUG(" event failed");
+    ATH_MSG_DEBUG(m_chainName<< " event failed");
   }
 
   for (auto j :  passedJets) {
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
index 0e3744f582b..0b9fac33e1e 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolMT.h
@@ -53,7 +53,7 @@ class TrigJetHypoToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
   // Paraphanalia needed for the Jet Hypo Helper class:
   Conditions m_conditions;
 
-  Gaudi::Property<bool> m_dumpJets{this, "dumpJets", {}, "verbose jet dump flag"};
+  bool m_dumpJets{false};
   
   void setCleaners();
  
@@ -152,6 +152,9 @@ class TrigJetHypoToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
  Gaudi::Property<float>
    m_avLarQFLlpThreshold{this, "AverageLArQFLlpThreshold", 0.8*65535, ""};
 
+ Gaudi::Property<std::string>
+   m_chainName{this, "chain_name", {}, "chain name (dbg)"};
+  
  Gaudi::Property<bool>
    m_acceptAll{this, "AcceptAll", false, "flag to turn of hypo"};
  
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
deleted file mode 100644
index 2ec75ba2f8c..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ********************************************************************
-//
-// NAME:     TrigJetNotToolMT.cxx
-// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
-//
-//
-// ********************************************************************
-
-#include "TrigJetNotToolMT.h"
-
-#include "GaudiKernel/StatusCode.h"
-
-#include "DecisionHandling/HLTIdentifier.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-
-using TrigCompositeUtils::DecisionID;
-using TrigCompositeUtils::Decision;
-using TrigCompositeUtils::DecisionContainer;
-
-TrigJetNotToolMT::TrigJetNotToolMT(const std::string& type,
-                                 const std::string& name,
-                                 const IInterface* parent) :
-  base_class(type, name, parent),
-  m_decisionId(HLT::Identifier::fromToolName(name)) {
-}
-
-
-TrigJetNotToolMT::~TrigJetNotToolMT(){
-}
-
-StatusCode TrigJetNotToolMT::initialize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetNotToolMT::finalize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetNotToolMT::decide(const xAOD::JetContainer* jets,
-                                           bool& pass) const {
-
-  m_hypoTool->decide(jets, pass);
-
-  if(pass){
-    ATH_MSG_DEBUG("hypoTool passed");
-  } else {
-    ATH_MSG_DEBUG("hypoTool failed");
-  }
-
-  pass = !pass;
-
-  return StatusCode::SUCCESS;
-}
-
-
-const HLT::Identifier& TrigJetNotToolMT::getId() const{
-  return m_decisionId;
-} 
- 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
deleted file mode 100644
index 05504bb5184..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetNotToolMT.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collabnotation
-*/
-
-#ifndef TRIGJETNOTTOOLMT_H
-#define TRIGJETNOTTOOLMT_H
-/********************************************************************
- *
- * NAME:     TrigJetNotToolMT.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- *
- *********************************************************************/
-
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "DecisionHandling/HLTIdentifier.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-#include "AthenaMonitoring/GenericMonitoringTool.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-
-#include "ITrigJetHypoToolMT.h"
-#include "ITrigJetHypoToolConfig.h"
-
-class TrigJetNotToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
-
- public:
-  
-  TrigJetNotToolMT(const std::string& type,
-                    const std::string& name,
-                    const IInterface* parent);
-  virtual ~TrigJetNotToolMT();
-  virtual StatusCode initialize() override;
-  virtual StatusCode finalize() override;
-
-  // ITrigJetHypoToolMT interface
-  virtual StatusCode
-    decide(const xAOD::JetContainer*, bool& pass) const override;
-  virtual const HLT::Identifier& getId() const override; 
- private:
-
-  // Identifier is used to keep track of which tool made which decision.
-  // The information is stored in the event store.
-  HLT::Identifier m_decisionId;  
-  
-  ToolHandle<ITrigJetHypoToolMT> m_hypoTool {
-    this, "hypoTool", {}, "predicate to be inverted"};
-
- 
- // Monitored variables...
- /*
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-*/
-
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
deleted file mode 100644
index 80846e55aea..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ********************************************************************
-//
-// NAME:     TrigJetOrToolMT.cxx
-// PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
-//
-//
-// ********************************************************************
-
-#include "TrigJetOrToolMT.h"
-
-#include "GaudiKernel/StatusCode.h"
-
-#include "DecisionHandling/HLTIdentifier.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-
-using TrigCompositeUtils::DecisionID;
-using TrigCompositeUtils::Decision;
-using TrigCompositeUtils::DecisionContainer;
-
-TrigJetOrToolMT::TrigJetOrToolMT(const std::string& type,
-                                 const std::string& name,
-                                 const IInterface* parent) :
-  base_class(type, name, parent),
-  m_decisionId(HLT::Identifier::fromToolName(name)) {
-}
-
-
-TrigJetOrToolMT::~TrigJetOrToolMT(){
-}
-
-StatusCode TrigJetOrToolMT::initialize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetOrToolMT::finalize(){
-  return StatusCode::SUCCESS;
-}
-
-StatusCode TrigJetOrToolMT::decide(const xAOD::JetContainer* jets,
-                                           bool& pass) const {
-
-  m_lhs->decide(jets, pass);
-  if (not pass){
-    m_rhs->decide(jets, pass);
-    ATH_MSG_DEBUG("LHS failed " << " RHS " <<std::boolalpha << pass);
-  } else {
-    ATH_MSG_DEBUG("LHS passed");
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-
-const HLT::Identifier& TrigJetOrToolMT::getId() const{
-  return m_decisionId;
-} 
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h
deleted file mode 100644
index 3af3941dc69..00000000000
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetOrToolMT.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGJETORTOOLMT_H
-#define TRIGJETORTOOLMT_H
-/********************************************************************
- *
- * NAME:     TrigJetOrToolMT.h
- * PACKAGE:  Trigger/TrigHypothesis/TrigHLTJetHypo
- *
- *
- *********************************************************************/
-
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "DecisionHandling/HLTIdentifier.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "DecisionHandling/TrigCompositeUtils.h"
-#include "AthenaMonitoring/GenericMonitoringTool.h"
-
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h"
-#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h"
-
-#include "ITrigJetHypoToolMT.h"
-#include "ITrigJetHypoToolConfig.h"
-
-class TrigJetOrToolMT: public extends<AthAlgTool, ITrigJetHypoToolMT> {
-
- public:
-  
-  TrigJetOrToolMT(const std::string& type,
-                    const std::string& name,
-                    const IInterface* parent);
-  virtual ~TrigJetOrToolMT();
-  virtual StatusCode initialize() override;
-  virtual StatusCode finalize() override;
-
-  // ITrigJetOrToolMT interface
-  virtual StatusCode
-    decide(const xAOD::JetContainer*, bool& pass) const override;
-  virtual const HLT::Identifier& getId() const override; 
- private:
-
-  // Identifier is used to keep track of which tool made which decision.
-  // The information is stored in the event store.
-  HLT::Identifier m_decisionId;  
-  
-  ToolHandle<ITrigJetHypoToolMT> m_lhs {
-    this, "lhs", {}, "LHS boolean binary expression"}; 
-  ToolHandle<ITrigJetHypoToolMT> m_rhs {
-    this, "rhs", {}, "RHS boolean binary expression"}; 
-
- 
- // Monitored variables...
- /*
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-*/
-
-
-};
-#endif
diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
index 014d7bb1b88..6b4ad114a9a 100644
--- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
+++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
@@ -10,11 +10,6 @@
 #include "TrigHLTJetHypo/TrigHLTJetHypo_SMC.h"
 #include "../TrigJetHypoAlgMT.h"
 #include "../TrigJetHypoToolConfig_EtaEt.h"
-#include "../TrigJetHypoToolConfig_simple.h"
-#include "../TrigJetHypoToolConfig_dijet.h"
-#include "../TrigJetNotToolMT.h"
-#include "../TrigJetAndToolMT.h"
-#include "../TrigJetOrToolMT.h"
 #include "../TrigJetHypoToolMT.h"
 
 DECLARE_COMPONENT( TrigHLTJetHypo2 )
@@ -24,12 +19,7 @@ DECLARE_COMPONENT( TrigEFDPhiMetJetAllTE )
 DECLARE_COMPONENT( TrigHLTJetHypo_Dijet )
 DECLARE_COMPONENT( TrigHLTJetHypo_DijetMassDEta )
 DECLARE_COMPONENT( TrigHLTJetHypo_DijetMassDEtaDPhi )
-DECLARE_COMPONENT( TrigJetHypoToolConfig_EtaEt )
-DECLARE_COMPONENT( TrigJetHypoToolConfig_simple )
-DECLARE_COMPONENT( TrigJetHypoToolConfig_dijet )
-DECLARE_COMPONENT( TrigJetNotToolMT)
-DECLARE_COMPONENT( TrigJetAndToolMT)
-DECLARE_COMPONENT( TrigJetOrToolMT)
+DECLARE_COMPONENT( TrigHLTJetHypo_EtaEt )
 DECLARE_COMPONENT( TrigHLTJetHypo_SMC )
 DECLARE_COMPONENT( TrigHLTJetHypo_HT )
 DECLARE_COMPONENT( TrigHLTJetHypo_TLA )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
index 934c2ca704f..9393ed844a8 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/jetDefs.py
@@ -7,6 +7,8 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 from AthenaCommon.Constants import VERBOSE,DEBUG,INFO
 from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq
 
+
+
 ## def jetFSInputMaker( ):
 ##   """ Creates the jet inputMaker for FS"""
 ##   RoIs = jetCollections.L1RoIs
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
index 00344d62048..9e36ab4f49b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
@@ -119,7 +119,7 @@ if (doJet):
     
     jetChains  = [
         Chain(name='HLT_j85',  Seed="L1_J20",  ChainSteps=[jetstep1]  ),
-        Chain(name='HLT_j45', Seed="L1_J20",  ChainSteps=[jetstep1] )  
+        Chain(name='HLT_j100', Seed="L1_J20",  ChainSteps=[jetstep1]  )
         ]
     testChains += jetChains
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
index c3ef3fd3315..f235b86abb8 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
@@ -1,20 +1,23 @@
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     0   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j45 ID#3664574289
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     1   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -30,10 +33,12 @@ TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e7_etcut ID#243
 TriggerSummaryStep2                     2   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     3   0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -95,11 +100,12 @@ TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e7_etcut ID#243
 TriggerSummaryStep2                     8   0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     9   0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j45 ID#3664574289
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     10  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -123,10 +129,12 @@ TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_g5_etcut ID#140
 TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep2                     12  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
+TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     13  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -165,11 +173,12 @@ TriggerSummaryStep1                     18  0     DEBUG  +++ HLT_e3_etcut ID#271
 TriggerSummaryStep2                     18  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_xe30_L1XE10 ID#347649004
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e3_etcut1step ID#1509456583
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
 TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_e3_etcut ID#2711808158
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j45 ID#3664574289
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j85 ID#3478728990
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e5_etcut ID#607406625
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_g5_etcut ID#1407390618
 TriggerSummaryStep2                     19  0     DEBUG  +++ HLT_e7_etcut ID#2430733989
@@ -190,10 +199,10 @@ TrigSignatureMoniMT                                INFO HLT_e7_etcut
 TrigSignatureMoniMT                                INFO HLT_e7_etcut decisions                            36        205       
 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         
-TrigSignatureMoniMT                                INFO HLT_j45 decisions                                 3         0         
-TrigSignatureMoniMT                                INFO HLT_j85                       20        20        0         0         0         
-TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 0         0         
+TrigSignatureMoniMT                                INFO HLT_j100                      20        20        6         0         6         
+TrigSignatureMoniMT                                INFO HLT_j100 decisions                                6         0         
+TrigSignatureMoniMT                                INFO HLT_j85                       20        20        6         0         6         
+TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 6         0         
 TrigSignatureMoniMT                                INFO HLT_mu6                       20        20        3         0         3         
 TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         0         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb                   20        20        3         2         2         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
index 668f87183b7..936f01378a6 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jet.menu.py
@@ -16,7 +16,7 @@ step1=ChainStep("Step1_jet", [jetSeq1])
 
 testChains  = [
     Chain(name='HLT_j85',  Seed="L1_J20",  ChainSteps=[step1]  ),
-    Chain(name='HLT_j45', Seed="L1_J20",  ChainSteps=[step1]  )
+    Chain(name='HLT_j100', Seed="L1_J20",  ChainSteps=[step1]  )
     ]
     
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
index f9072a28f11..ce932a38433 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/jetMenu.ref
@@ -1,7 +1,16 @@
-TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j45 ID#3664574289
-TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j45 ID#3664574289
-TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j45 ID#3664574289
-TrigSignatureMoniMT                                INFO HLT_j45                       20        20        3         3         
-TrigSignatureMoniMT                                INFO HLT_j45 decisions                                 3         
-TrigSignatureMoniMT                                INFO HLT_j85                       20        20        0         0         
-TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 0         
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     0   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     1   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     3   0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     10  0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     13  0     DEBUG  +++ HLT_j85 ID#3478728990
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j100 ID#625306965
+TriggerSummaryStep1                     19  0     DEBUG  +++ HLT_j85 ID#3478728990
+TrigSignatureMoniMT                                INFO HLT_j100                      20        20        6         6         
+TrigSignatureMoniMT                                INFO HLT_j100 decisions                                6         
+TrigSignatureMoniMT                                INFO HLT_j85                       20        20        6         6         
+TrigSignatureMoniMT                                INFO HLT_j85 decisions                                 6         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
index b4702163378..e5fb55effd1 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py
@@ -27,10 +27,7 @@ if TriggerFlags.doCalo:
 
 
     # menu items
-     CTPToChainMapping = {
-       "HLT_j85":       "L1_J20"  ,
-       "HLT_j45" : "L1_J20"
-     }
+     CTPToChainMapping = {"HLT_j85":       "L1_J20"  , "HLT_j100" : "L1_J20" }
      testChains =[x for x, y in CTPToChainMapping.items()]
      topSequence.L1DecoderTest.ChainToCTPMapping = CTPToChainMapping
      print testChains
@@ -70,20 +67,13 @@ if TriggerFlags.doCalo:
      (recoSequence, sequenceOut) = jetRecoSequence(inputRoIs)
 
      from TrigHLTJetHypo.TrigHLTJetHypoConf import TrigJetHypoAlgMT
-     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromDict
+     from TrigHLTJetHypo.TrigJetHypoToolConfig import trigJetHypoToolFromName
      hypo = TrigJetHypoAlgMT("jethypo")
      hypo.OutputLevel = DEBUG
      hypo.Jets = sequenceOut
      hypo.HypoInputDecisions = hypoDecisions
      hypo.HypoOutputDecisions = "jetDecisions"
-     
-     def make_dict(chain_name):
-       from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
-       chainNameDecoder = DictFromChainName.DictFromChainName()
-       return chainNameDecoder.getChainDict(chain_name)
-       
-     hypo.HypoTools = [trigJetHypoToolFromDict(make_dict(c))
-                       for c in testChains] 
+     hypo.HypoTools = [ trigJetHypoToolFromName( c, c ) for c in testChains ] 
      print hypo
      for tool in hypo.HypoTools:
          print tool
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 249691380e5..1637d01b074 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -126,9 +126,7 @@ JetChainParts = {
     'bTracking'    : [],
     'bConfig'      : ['split',],
     'bMatching'    : ['antimatchdr05mu'],
-    'trkopt'       : [],
-    'hypoScenario' : ['simple', 'vbenf'],
-    'smc'          : ['30smcINF', '35smcINF', '40smcINF', '50smcINF', '60smcINF', 'nosmc'],
+    'trkopt'       : []
 }
 
 # ---- Jet Dictinary of default Values ----
@@ -155,8 +153,6 @@ JetChainParts_Default = {
     'bMatching'    : [],
     'dataScouting' : '',
     'trkopt'       : 'notrk',
-    'hypoScenario' : 'simple',
-    'smc'          : 'nosmc',
     }
 
 #==========================================================
-- 
GitLab


From 021bb0139a211dd23e52f333cfb592849279e153 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 8 Mar 2019 10:48:04 +0000
Subject: [PATCH 340/404] Add ATLAS_CHECK_THREAD_SAFETY to SCT_CalibAlgs
 package

---
 .../SCT_CalibAlgs/ATLAS_CHECK_THREAD_SAFETY   |  1 +
 .../SCT_CalibAlgs/ISCT_CalibHistoTool.h       | 14 +++++------
 .../SCT_CalibAlgs/SCTCalibWriteTool.h         | 20 ++++++++--------
 .../SCT_CalibAlgs/src/IElementStreamer.cxx    |  5 +---
 .../SCT_CalibAlgs/src/IElementStreamer.h      |  4 ++--
 .../SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx |  8 +++----
 .../SCT_CalibAlgs/src/SCTCalib.cxx            |  9 ++++---
 .../SCT_CalibAlgs/src/SCTCalibWriteTool.cxx   | 24 +++++++++----------
 .../src/SCT_CalibBsErrorTool.cxx              | 10 ++++----
 .../SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h  |  1 +
 10 files changed, 48 insertions(+), 48 deletions(-)
 create mode 100644 InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3b2aa4f2c9c
--- /dev/null
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetCalibAlgs/SCT_CalibAlgs
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
index 1b58fe492ec..eaa5fd3122c 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.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,13 +50,13 @@ class ISCT_CalibHistoTool: virtual public IAlgTool {
       int size(const int histogramIndex) const;
       void binHistograms(const int nLbMerged);
       /// set number of lumiblocks
-      static void setNumberOfLb(const int nLb);
+      void setNumberOfLb(const int nLb);
       /// get number of lumiblocks
-      static int numberOfLb();
+      int numberOfLb();
       /// set number of lumiblocks
-      static void setLbToMerge(const int nLbMerge);
+      void setLbToMerge(const int nLbMerge);
       /// get number of lumiblocks
-      static int LbToMerge();
+      int LbToMerge();
    protected:
       std::vector<TH1F *> m_phistoVector;
       std::vector<TH2F *> m_phistoVector2D;
@@ -66,8 +66,8 @@ class ISCT_CalibHistoTool: virtual public IAlgTool {
       //ServiceHandle<StoreGateSvc> m_detStore;
       //ServiceHandle<StoreGateSvc> m_evtStore;
       const SCT_ID* m_pSCTHelper;
-      static int m_nLb;
-      static int m_nLbMerge;
+      int m_nLb;
+      int m_nLbMerge;
       //
       bool init();
       template<class T>
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
index a8fc81f48c3..e1bf6cbb1c4 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
@@ -167,19 +167,19 @@ class SCTCalibWriteTool : public AthAlgTool {
 
       // would it make sense to change the strings to properties?
       // that would be a fairly simple fix
-      static std::string s_separator;
-      static std::string s_defectFolderName;
-      static std::string s_deadStripFolderName;
-      static std::string s_deadChipFolderName;
-      static std::string s_effFolderName;
-      static std::string s_noFolderName;
-      static std::string s_RawOccuFolderName;
-      static std::string s_BSErrFolderName;
-      static std::string s_LAFolderName;
+      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;
+      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;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
index c449b1c6146..8531a1de422 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.cxx
@@ -12,11 +12,8 @@
 
 namespace SCT_CalibAlgs {
 
-unsigned int IElementStreamer::m_depth=0;
-unsigned int IElementStreamer::m_nodeIndex=0;
-
 IElementStreamer::IElementStreamer(const std::string & name, const std::map<std::string, std::string> & attributeMap, std::ostream & os):
-   m_name(name), m_os(os),m_nodeId(m_nodeIndex) {
+  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) {
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
index dfeb16ccf1c..a1708e2aa28 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/IElementStreamer.h
@@ -23,8 +23,8 @@ class IElementStreamer {
       std::vector<std::string> m_attributeNames;
       std::vector<std::string> m_attributeValues;
       std::ostream & m_os;
-      static unsigned int m_depth;
-      static unsigned int m_nodeIndex;
+      unsigned int m_depth;
+      unsigned int m_nodeIndex;
       unsigned int m_nodeId;
 
    public:
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
index 3ab782315eb..dcf0375ba0c 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.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
 */
 
 
@@ -15,10 +15,8 @@
 #include "TMath.h"
 #include <stdexcept> // out_of_range exception
 
-int ISCT_CalibHistoTool::m_nLb=0;
-int ISCT_CalibHistoTool::m_nLbMerge=0;
-
-ISCT_CalibHistoTool::ISCT_CalibHistoTool():m_numberOfEventsHisto(0),m_thistSvc(0),m_pSCTHelper(0) {
+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
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
index a1b99d0424b..a9537e5ab47 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -202,14 +202,17 @@ StatusCode SCTCalib::initialize() {
    //--- LB range
    try {
       m_LBRange = std::stoi( m_LBMax );
-      ISCT_CalibHistoTool::setNumberOfLb(m_LBRange);
+      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;
    }
 
-   ISCT_CalibHistoTool::setLbToMerge(m_nLbsMerged);
-
+   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;
 
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
index 3748c82e541..b98c334f7e5 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
@@ -42,18 +42,18 @@
 
 using std::string;
 /////////////////////////////////////////////////////////////////////////////
-string SCTCalibWriteTool::s_separator = string("-");
-string SCTCalibWriteTool::s_defectFolderName = string("/SCT/Derived/Monitoring");
-string SCTCalibWriteTool::s_deadStripFolderName = string("/SCT/Derived/DeadStrips");
-string SCTCalibWriteTool::s_deadChipFolderName = string("/SCT/Derived/DeadChips");
-string SCTCalibWriteTool::s_effFolderName = string("/SCT/Derived/Efficiency");
-string SCTCalibWriteTool::s_noFolderName = string("/SCT/Derived/NoiseOccupancy");
-string SCTCalibWriteTool::s_RawOccuFolderName = string("/SCT/Derived/RawOccupancy");
-string SCTCalibWriteTool::s_BSErrFolderName = string("/SCT/Derived/BSErrorsRun2");
-string SCTCalibWriteTool::s_LAFolderName = string("/SCT/Derived/LorentzAngleRun2_v2");
-
-static bool becCapsFormat(true);
-static bool becUnderscoreFormat(false);
+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);
 
 SCTCalibWriteTool::SCTCalibWriteTool(const std::string& type, const std::string& name, const IInterface* parent) :
    AthAlgTool(type, name, parent),
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
index 3f97044896a..3fe1ffba284 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.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
 */
 
 /**
@@ -34,7 +34,6 @@ const static string detectorNames[] = { "negativeEndcap", "barrel", "positiveEnd
 const static int  n_BSErrorType = 15;
 const static int firstBSErrorType = 0;
 const static int lastBSErrorType = 14;
-static int MAXHASH(0);
 
 SCT_CalibBsErrorTool::SCT_CalibBsErrorTool(const std::string& type, const std::string& name, const IInterface* parent) :
    base_class(type, name, parent),
@@ -46,7 +45,8 @@ SCT_CalibBsErrorTool::SCT_CalibBsErrorTool(const std::string& type, const std::s
    m_scterr_eta(0),
    m_scterr_phi(0),
    m_scterr_side(0),
-   m_scterr_type(0)
+   m_scterr_type(0),
+   m_maxHash(0)
 {
 }
 
@@ -56,7 +56,7 @@ SCT_CalibBsErrorTool::initialize() {
    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;
    //
-   MAXHASH=m_pSCTHelper->wafer_hash_max();
+   m_maxHash=m_pSCTHelper->wafer_hash_max();
    m_waferItrBegin  = m_pSCTHelper->wafer_begin();
    m_waferItrEnd  = m_pSCTHelper->wafer_end();
 
@@ -161,7 +161,7 @@ SCT_CalibBsErrorTool::fillBsErrorsForWafer(const Identifier & waferId, const int
    int iWaferHash = (int) m_pSCTHelper->wafer_hash( waferId );
    const string osWafer=formatPosition(waferId, m_pSCTHelper,".");
    //--- Protection for wrong waferID
-   if ( iWaferHash < 0 || iWaferHash >= MAXHASH ) {
+   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;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
index 9eafa8854b8..b21ef94a797 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
@@ -68,6 +68,7 @@ class SCT_CalibBsErrorTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
       VecInt *m_scterr_phi;
       VecInt *m_scterr_side;
       VecInt *m_scterr_type;
+      int m_maxHash;
 
       void
       fillBsErrorsForWafer(const Identifier & waferId, const int type);
-- 
GitLab


From 86f8ef5319b6d3eacc3e40a5f3f630b4334d5cce Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Fri, 8 Mar 2019 10:49:55 +0000
Subject: [PATCH 341/404] Add ATLAS_CHECK_THREAD_SAFETY to LArG4FCAL and
 LArG4HEC packages

---
 LArCalorimeter/LArG4/LArG4FCAL/ATLAS_CHECK_THREAD_SAFETY      | 1 +
 LArCalorimeter/LArG4/LArG4HEC/ATLAS_CHECK_THREAD_SAFETY       | 1 +
 LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc              | 4 ++--
 .../LArG4/LArG4HEC/src/LocalCalibrationCalculator.cc          | 2 +-
 LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc            | 4 ++--
 5 files changed, 7 insertions(+), 5 deletions(-)
 create mode 100644 LArCalorimeter/LArG4/LArG4FCAL/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 LArCalorimeter/LArG4/LArG4HEC/ATLAS_CHECK_THREAD_SAFETY

diff --git a/LArCalorimeter/LArG4/LArG4FCAL/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArG4/LArG4FCAL/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..a12b3f4ada3
--- /dev/null
+++ b/LArCalorimeter/LArG4/LArG4FCAL/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArG4/LArG4FCAL
diff --git a/LArCalorimeter/LArG4/LArG4HEC/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArG4/LArG4HEC/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..0be6fbada7b
--- /dev/null
+++ b/LArCalorimeter/LArG4/LArG4HEC/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArG4/LArG4HEC
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc b/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
index 8c05dccac2b..e0e38363bb5 100644
--- a/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/HECGeometry.cc
@@ -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
 */
 
 // LArG4::HEC::HECGeometry
@@ -215,7 +215,7 @@ namespace LArG4 {
       G4StepPoint* pre_step_point = a_step->GetPreStepPoint();
       Point3D<double>  globalPosition = pre_step_point->GetPosition();
 
-      G4TouchableHistory* theTouchable = (G4TouchableHistory*) (pre_step_point->GetTouchable());
+      const G4TouchableHistory* theTouchable = static_cast<const G4TouchableHistory*>(pre_step_point->GetTouchable());
       G4String volumeName = theTouchable->GetVolume()->GetName() ;
 
       // Do the following only once - to determine the G4 history-depth of the wheel coordinates
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LocalCalibrationCalculator.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LocalCalibrationCalculator.cc
index 960b2dddb6f..914abae8272 100644
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LocalCalibrationCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LocalCalibrationCalculator.cc
@@ -92,7 +92,7 @@ namespace LArG4 {
 	{
 	   // Calculate the identifier.
            G4StepPoint* pre_step_point = step->GetPreStepPoint();
-           G4TouchableHistory* theTouchable = (G4TouchableHistory*) (pre_step_point->GetTouchable());
+           const G4TouchableHistory* theTouchable = static_cast<const G4TouchableHistory*>(pre_step_point->GetTouchable());
            // Volume name 
            G4String hitVolume = theTouchable->GetVolume(0)->GetName();
 #ifdef DEBUG_HITS
diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
index 2d00aa44423..69c7d732701 100644
--- a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
+++ b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc
@@ -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
 */
 
 // LArG4::HEC::LocalGeometry
@@ -192,7 +192,7 @@ namespace LArG4 {
 
 
       // We can extract our position from the copy number of depth and module
-      G4TouchableHistory* theTouchable = (G4TouchableHistory*) (pre_step_point->GetTouchable());
+      const G4TouchableHistory* theTouchable = static_cast<const G4TouchableHistory*>(pre_step_point->GetTouchable());
 
       //  Get local coordinates of the step, independently of how it was positioned  in World
       G4AffineTransform transformation;
-- 
GitLab


From 9ad336ba95813346a240da5705db5b06a91a713e Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 8 Mar 2019 10:58:14 +0000
Subject: [PATCH 342/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetPrepRawData
 package and fix thread-safe issue.

---
 .../InDetPrepRawData/ATLAS_CHECK_THREAD_SAFETY |  1 +
 .../InDetPrepRawData/SiCluster.h               | 18 ++++++++++++++----
 .../InDetPrepRawData/src/SiCluster.cxx         |  6 +++---
 3 files changed, 18 insertions(+), 7 deletions(-)
 create mode 100644 InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..cde14507bc4
--- /dev/null
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecEvent/InDetPrepRawData
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h
index a30eda6ba40..fc668b7f792 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -24,6 +24,8 @@
 #include "InDetReadoutGeometry/SiDetectorElement.h" // cant be forward declared
 #include "TrkSurfaces/Surface.h"
 
+#include <atomic>
+
 class PixelClusterContainerCnv;
 class SCT_ClusterContainerCnv;
 
@@ -111,7 +113,7 @@ class SiCluster :   public Trk::PrepRawData {
 
 	private:
 	InDet::SiWidth m_width; //col, row, and width in mm
-	mutable const Amg::Vector3D* m_globalPosition;
+	mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
 	bool m_gangedPixel;
 	const InDetDD::SiDetectorElement* m_detEl;
 
@@ -132,8 +134,16 @@ inline const InDet::SiWidth&  SiCluster::width() const
 // return globalPosition:
 inline const Amg::Vector3D& SiCluster::globalPosition() const
 {
-        if (m_globalPosition==0) m_globalPosition = m_detEl->surface(identify()).localToGlobal(localPosition());
-	return *m_globalPosition;
+  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;
+    }
+  }
+  return *m_globalPosition;
 }
 // set gangedPixel:
 inline void SiCluster::setGangedPixel(bool ganged){
diff --git a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
index 574d66c7167..004125d0d9b 100755
--- a/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.cxx
+++ b/InnerDetector/InDetRecEvent/InDetPrepRawData/src/SiCluster.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -80,7 +80,7 @@ SiCluster::SiCluster(const SiCluster& RIO):
 SiCluster::SiCluster(SiCluster&& RIO):
         PrepRawData( std::move(RIO) ),
 	m_width( std::move(RIO.m_width) ),
-	m_globalPosition( RIO.m_globalPosition ),
+	m_globalPosition( RIO.m_globalPosition.load() ),
 	m_gangedPixel( RIO.m_gangedPixel ),
 	m_detEl( RIO.m_detEl )
 
@@ -107,7 +107,7 @@ SiCluster& SiCluster::operator=(SiCluster&& RIO){
                 Trk::PrepRawData::operator= (std::move(RIO));
 		delete m_globalPosition;
 		m_width = RIO.m_width;
-		m_globalPosition = RIO.m_globalPosition;
+		m_globalPosition = RIO.m_globalPosition.load();
                 RIO.m_globalPosition = nullptr;
 		m_gangedPixel = RIO.m_gangedPixel;
 		m_detEl =  RIO.m_detEl ;
-- 
GitLab


From 8a47d7ec585088ebb2e84ba9d655fc6fe72efcf2 Mon Sep 17 00:00:00 2001
From: Tigran Mkrtchyan <tigran.mkrtchyan@cern.ch>
Date: Fri, 8 Mar 2019 11:11:44 +0000
Subject: [PATCH 343/404] TileCalibAlgs: Migration of package to use private
 tools

---
 .../TileCalibAlgs/TileCisDefaultCalibTool.h   |  7 +--
 .../TileCalibAlgs/TileDigiNoiseCalibAlg.h     |  5 +-
 .../TileCalibAlgs/TileExpertDump.h            |  5 +-
 .../TileCalibAlgs/TileInfoDump.h              | 52 +++++++++++--------
 .../TileCalibAlgs/TileLaserCalibAlg.h         | 12 +++--
 .../TileCalibAlgs/TileLaserDefaultCalibTool.h | 18 ++++---
 .../TileLaserLinearityCalibTool.h             |  3 +-
 .../TileCalibAlgs/TileLaserTimingTool.h       |  3 +-
 .../TileCalibAlgs/TileMuId2DBAlg.h            |  3 +-
 .../TileCalibAlgs/TileOFC2DBAlg.h             |  9 ++--
 .../TileCalibAlgs/TileRawChNoiseCalibAlg.h    |  9 ++--
 .../TileCalibAlgs/TileTopCalibAlg.h           |  3 +-
 .../TileTriggerDefaultCalibTool.h             |  8 +--
 .../src/TileCisDefaultCalibTool.cxx           |  3 --
 .../src/TileDigiNoiseCalibAlg.cxx             |  3 --
 .../TileCalibAlgs/src/TileExpertDump.cxx      |  3 --
 .../TileCalibAlgs/src/TileInfoDump.cxx        | 30 -----------
 .../TileCalibAlgs/src/TileLaserCalibAlg.cxx   |  3 +-
 .../src/TileLaserDefaultCalibTool.cxx         |  6 ---
 .../src/TileLaserLinearityCalibTool.cxx       |  1 -
 .../TileCalibAlgs/src/TileLaserTimingTool.cxx |  2 -
 .../TileCalibAlgs/src/TileMuId2DBAlg.cxx      |  2 -
 .../TileCalibAlgs/src/TileOFC2DBAlg.cxx       |  4 --
 .../src/TileRawChNoiseCalibAlg.cxx            |  5 --
 .../TileCalibAlgs/src/TileTopCalibAlg.cxx     |  2 -
 .../src/TileTriggerDefaultCalibTool.cxx       |  4 --
 .../share/jobOptions_TileCalibRec.py          |  3 --
 27 files changed, 83 insertions(+), 125 deletions(-)

diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileCisDefaultCalibTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileCisDefaultCalibTool.h
index d6552cf73d9..11052fd715b 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileCisDefaultCalibTool.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileCisDefaultCalibTool.h
@@ -21,6 +21,7 @@
 #include "TileEvent/TileRawChannelContainer.h"
 #include "TileEvent/TileDigitsContainer.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
+#include "TileMonitoring/ITileStuckBitsProbsTool.h"
 
 
 #include "TString.h"
@@ -37,7 +38,6 @@ class TileCablingSvc;
 class TFile;
 class TileRawChannelContainer;
 class TMap;
-class ITileStuckBitsProbsTool;
 
 class TileCisDefaultCalibTool: public AthAlgTool
                              , virtual public ITileCalibTool {
@@ -92,9 +92,10 @@ class TileCisDefaultCalibTool: public AthAlgTool
     const TileHWID* m_tileHWID;
     const TileCablingService* m_cabling;
     ServiceHandle<TileCablingSvc> m_cablingSvc;
-    ToolHandle<ITileStuckBitsProbsTool> m_stuckBitsProbs;
-    SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
+    ToolHandle<ITileStuckBitsProbsTool> m_stuckBitsProbs{this,
+      "StuckBitsProbsTool","","Tile stuck bits probabilities tool"};
 
+    SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
     SG::ReadHandleKey<TileDigitsContainer> m_digitsContainerKey{this,
       "TileDigitsContainer", "TileDigitsCnt", "Tile digits container"};
     SG::ReadHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this,
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileDigiNoiseCalibAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileDigiNoiseCalibAlg.h
index 578c8e39092..abd64064d1f 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileDigiNoiseCalibAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileDigiNoiseCalibAlg.h
@@ -28,6 +28,7 @@
 #include "TileEvent/TileDQstatus.h"
 #include "TileEvent/TileDigitsContainer.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
+#include "TileRecUtils/TileRawChannelBuilderFlatFilter.h"
 
 #include <cmath>
 #include <vector>
@@ -40,7 +41,6 @@
 // Forward declaration
 class TileHWID;
 class TileBeamElemContByteStreamCnv;
-class TileRawChannelBuilderFlatFilter;
 class TileOFCorrelation;
 
 class TileDigiNoiseCalibAlg: public AthAlgorithm {
@@ -94,7 +94,8 @@ class TileDigiNoiseCalibAlg: public AthAlgorithm {
       "EventInfo", "EventInfo", "EventInfo key"};
 
   // Tools / storegate info
-    ToolHandle<TileRawChannelBuilderFlatFilter> m_adderFilterAlgTool;
+    ToolHandle<TileRawChannelBuilderFlatFilter> m_adderFilterAlgTool{this,
+      "TileAdderFlatFilter","TileRawChannelBuilderFlatFilter/TileAdderFlatFilter","Tile adder flat filter"};
     TileBeamElemContByteStreamCnv* m_beamCnv;
     const TileCablingService* m_cabling;
     TileOFCorrelation* m_tileOFCorrelation;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileExpertDump.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileExpertDump.h
index 97362699bf6..8f0a9f65da3 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileExpertDump.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileExpertDump.h
@@ -24,8 +24,8 @@
 #include "StoreGate/ReadHandleKey.h"
 
 #include "TileIdentifier/TileEmscaleCalibOptions.h"
+#include "TileConditions/TileExpertToolEmscale.h"
 
-class TileExpertToolEmscale;
 class TileHWID;
 
 /**
@@ -69,7 +69,8 @@ class TileExpertDump: public AthAlgorithm {
       "EventInfo", "EventInfo", "EventInfo key"};
 
     //=== non-property members
-    ToolHandle<TileExpertToolEmscale> m_tileExpertToolEmscale;
+    ToolHandle<TileExpertToolEmscale> m_tileExpertToolEmscale{this,
+      "TileExpertToolEmscale","TileExpertToolEmscale", "Tile expert tool em scale"};
 
     const TileHWID* m_tileHWID;
 };
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileInfoDump.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileInfoDump.h
index cf9c19f4601..9fa334b64d4 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileInfoDump.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileInfoDump.h
@@ -22,18 +22,18 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "xAODEventInfo/EventInfo.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "TileConditions/ITileBadChanTool.h"
+#include "TileConditions/TileCondToolEmscale.h"
+#include "TileConditions/TileCondToolIntegrator.h"
+#include "TileConditions/TileCondToolTiming.h"
+#include "TileConditions/TileCondToolPulseShape.h"
+#include "TileConditions/TileCondToolNoiseSample.h"
+#include "TileConditions/TileCondToolNoiseRawChn.h"
+#include "TileConditions/TileCondToolOfcCool.h"
+#include "TileConditions/TileCondToolMuID.h"
+#include "TileConditions/TileCondToolAutoCr.h"
+
 
-class ITileBadChanTool;
-class TileCondToolEmscale;
-class TileCondToolIntegrator;
-class TileCondToolTiming;
-class TileCondToolPulseShape;
-class TileCondToolNoiseSample;
-class TileCondToolNoiseRawChn;
-class TileCondToolOfcCool;
-class TileCondToolMuID;
-
-class TileCondToolAutoCr;
 class ITHistSvc;
 class TileHWID;
 class TileID;
@@ -97,16 +97,26 @@ class TileInfoDump: public AthAlgorithm {
       "EventInfo", "EventInfo", "EventInfo key"};
 
     //=== Non-property members
-    ToolHandle<ITileBadChanTool> m_tileBadChanTool;
-    ToolHandle<TileCondToolEmscale> m_tileToolEmscale;
-    ToolHandle<TileCondToolIntegrator> m_tileToolIntegrator;
-    ToolHandle<TileCondToolTiming> m_tileToolTiming;
-    ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape;
-    ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample;
-    ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr;
-    ToolHandle<TileCondToolNoiseRawChn> m_tileToolNoiseRawChn;
-    ToolHandle<TileCondToolOfcCool> m_tileToolOfcCool;
-    ToolHandle<TileCondToolMuID> m_tileToolMuID;
+    ToolHandle<ITileBadChanTool> m_tileBadChanTool{this,
+      "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
+    ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
+      "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};
+    ToolHandle<TileCondToolIntegrator> m_tileToolIntegrator{this,
+      "TileCondToolIntegrator", "TileCondToolIntegrator", "Tile integrator tool"};
+    ToolHandle<TileCondToolTiming> m_tileToolTiming{this,
+      "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};
+    ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape{this,
+      "TileCondToolPulseShape", "TileCondToolPulseShape", "Tile pulse shape tool"};
+    ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample{this,
+      "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile noise sample tool"};
+    ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr{this,
+      "TileCondToolAutoCr", "TileCondToolAutoCr", "Tile auto cr tool"};
+    ToolHandle<TileCondToolNoiseRawChn> m_tileToolNoiseRawChn{this,
+      "TileCondToolNoiseRawChn", "TileCondToolNoiseRawChn", "Tile raw channel noise tool"};
+    ToolHandle<TileCondToolOfcCool> m_tileToolOfcCool{this,
+      "TileCondToolOfcCool", "TileCondToolOfcCool", "Tile OfcCool tool"};
+    ToolHandle<TileCondToolMuID> m_tileToolMuID{this,
+      "TileCondToolMuID", "TileCondToolMuID", "Tile MuID tool"};
 
     //=== a handle on the Hist/TTree registration service 
     ITHistSvc* m_thistSvc;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserCalibAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserCalibAlg.h
index 343dbe32d2a..5185e3e7705 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserCalibAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserCalibAlg.h
@@ -12,10 +12,11 @@
 // Athena includes
 #include "AthenaBaseComps/AthAlgorithm.h"
 
+#include "TileCalibAlgs/ITileCalibTool.h"
+
 #include <string>
 
 class TFile;
-class ITileCalibTool;
 class IROBDataProviderSvc;
 
 class TileLaserCalibAlg: public AthAlgorithm {
@@ -23,17 +24,18 @@ class TileLaserCalibAlg: public AthAlgorithm {
     TileLaserCalibAlg(const std::string& name, ISvcLocator* pSvcLocator);
     virtual ~TileLaserCalibAlg();
 
-    typedef ToolHandleArray<ITileCalibTool> lastools_t;
-
     // Functions
     StatusCode initialize();
     StatusCode execute();
     StatusCode finalize();
 
-    lastools_t m_lasTools;
-
   private:
 
+    typedef ToolHandleArray<ITileCalibTool> lastools_t;
+
+    lastools_t m_lasTools{this,
+      "Tools",{},"Tile laser calibration tools"};
+
     ServiceHandle<IROBDataProviderSvc> m_RobSvc;
 
     // jobOptions
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h
index ef156d3aa8e..a005d5f418c 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h
@@ -3,8 +3,7 @@
 */
 
 #ifndef TILECALIBALG_TILELASERDEFAULTCALIBTOOL_H
-#define TILECALIBALG_TILELASERDEFAULTCALIBTOOL_H
-
+#define TILECALIBALG_TILELASERDEFAULTCALIBTOOL_H 
 
 // Tile includes
 #include "TileCalibAlgs/ITileCalibTool.h"
@@ -15,6 +14,9 @@
 #include "TileConditions/ITileDCSTool.h"
 #include "TileEvent/TileRawChannelContainer.h"
 #include "TileEvent/TileLaserObject.h"
+#include "TileConditions/ITileBadChanTool.h"
+#include "TileMonitoring/ITileStuckBitsProbsTool.h"
+
 
 // Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
@@ -44,7 +46,6 @@ class TileLaserObject;
 class TileHWID;
 class TFile;
 class RunningStat;
-class ITileStuckBitsProbsTool;
 
 class TileLaserDefaultCalibTool : public AthAlgTool, virtual public ITileCalibTool
 {
@@ -73,11 +74,14 @@ class TileLaserDefaultCalibTool : public AthAlgTool, virtual public ITileCalibTo
   
   const TileHWID* m_tileHWID;    
   const TileCablingService* m_cabling;
-  ToolHandle<TileCondToolEmscale>  m_tileToolEmscale;
-  ToolHandle<ITileBadChanTool>     m_tileBadChanTool;
-  ToolHandle<ITileStuckBitsProbsTool> m_stuckBitsProbs;
-  SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
+  ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
+    "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};
+  ToolHandle<ITileBadChanTool> m_tileBadChanTool{this,
+    "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
+  ToolHandle<ITileStuckBitsProbsTool> m_stuckBitsProbs{this,
+    "StuckBitsProbsTool", "", "Tile stuck bits probabilities tool"};
 
+  SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
   SG::ReadHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this,
       "TileRawChannelContainer", "TileRawChannelOpt2", "Tile raw channel container"};
   SG::ReadHandleKey<TileLaserObject> m_laserContainerKey{this,
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserLinearityCalibTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserLinearityCalibTool.h
index 90407429da3..d4838546ae1 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserLinearityCalibTool.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserLinearityCalibTool.h
@@ -68,7 +68,8 @@ class TileLaserLinearityCalibTool : public AthAlgTool, virtual public ITileCalib
 
   const TileHWID* m_tileHWID;    
   const TileCablingService* m_cabling;
-  ToolHandle<TileCondToolEmscale>  m_tileToolEmscale;
+  ToolHandle<TileCondToolEmscale>  m_tileToolEmscale{this,
+    "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};
 
   // Parameter which will end up in the ROOTuple
   //
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserTimingTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserTimingTool.h
index f5dfff9eeb4..8504c2253ab 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserTimingTool.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserTimingTool.h
@@ -256,7 +256,8 @@ class TileLaserTimingTool: public AthAlgTool, virtual public ITileCalibTool {
     // Tools info
     const TileHWID* m_tileHWID;
     const TileCablingService* m_cabling;
-    ToolHandle<TileCondToolTiming> m_tileToolTiming;
+    ToolHandle<TileCondToolTiming> m_tileToolTiming{this,
+      "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};
 
     // jobOptions
     std::string m_rawChannelContainerName;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileMuId2DBAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileMuId2DBAlg.h
index e5db1ef4eb1..c93412d8159 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileMuId2DBAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileMuId2DBAlg.h
@@ -46,7 +46,8 @@ class TileMuId2DBAlg: public AthAlgorithm {
   const DataHandle<CaloIdManager> m_caloIdMgr;
   const DataHandle<CaloDetDescrManager> m_calodetdescrmgr;
 
-  ToolHandle<ICaloNoiseTool> m_noiseTool;
+  PublicToolHandle<ICaloNoiseTool> m_noiseTool{this,
+    "noiseTool", "CaloNoiseToolDB/calonoisetooldb", "Calo noise tool"};
 
   //float m_eta;
   //float m_phi;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileOFC2DBAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileOFC2DBAlg.h
index d778bc647fe..321f04437dd 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileOFC2DBAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileOFC2DBAlg.h
@@ -28,9 +28,6 @@
 #include "TileConditions/ITileCondToolOfc.h"
 #include "TileConditions/TileCondToolTiming.h"
 
-#define N_FIXED_PHASES 100
-#define PHASE_STEP 0.5
-
 class IIOVRegistrationSvc;
 
 class TileOFC2DBAlg: public AthAlgorithm {
@@ -63,8 +60,10 @@ class TileOFC2DBAlg: public AthAlgorithm {
 
     //=== non-property members
     IIOVRegistrationSvc* m_regSvc;
-    ToolHandle<TileCondToolTiming> m_tileToolTiming;
-    ToolHandle<ITileCondToolOfc> m_tileCondToolOfc;
+    ToolHandle<TileCondToolTiming> m_tileToolTiming{this,
+      "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};
+    ToolHandle<ITileCondToolOfc> m_tileCondToolOfc{this,
+      "TileCondToolOfc", "TileCondToolOfc", "Tile OFC tool"};
 
     //=== store all folders to be registered
     std::set<std::string> m_folders;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileRawChNoiseCalibAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileRawChNoiseCalibAlg.h
index 963fbea9e4d..fd5e292e95b 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileRawChNoiseCalibAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileRawChNoiseCalibAlg.h
@@ -117,10 +117,13 @@ class TileRawChNoiseCalibAlg: public AthAlgorithm {
     // Identifiers
     const TileID* m_tileID;
     const TileHWID* m_tileHWID;
-    ToolHandle<TileCondToolEmscale> m_tileToolEmscale;
-    ToolHandle<ITileBadChanTool> m_tileBadChanTool;
+    ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
+      "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};
+    ToolHandle<ITileBadChanTool> m_tileBadChanTool{this,
+      "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
     SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
-    ToolHandle<TileCondIdTransforms> m_tileIdTrans;
+    ToolHandle<TileCondIdTransforms> m_tileIdTrans{this,
+      "TileCondIdTransforms", "TileCondIdTransforms", "Tile Id transforms tool"};
     const uint32_t* m_cispar;
 
     SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this,
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTopCalibAlg.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTopCalibAlg.h
index 639c7580b2a..002805b92df 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTopCalibAlg.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTopCalibAlg.h
@@ -53,7 +53,8 @@ class TileTopCalibAlg : public AthAlgorithm
   /**
    * Vector of algtools to call
    */
-  ToolHandleArray<ITileCalibTool> m_tileCalibToolList;
+  ToolHandleArray<ITileCalibTool> m_tileCalibToolList{this,
+    "TileCalibTools", {}, "Tile calib tools"};
  
   /**
    * Pointer to the ROOT file
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTriggerDefaultCalibTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTriggerDefaultCalibTool.h
index 47533663514..a1d881a47fd 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTriggerDefaultCalibTool.h
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileTriggerDefaultCalibTool.h
@@ -15,12 +15,12 @@
 #include "TileEvent/TileDQstatus.h"
 #include "TileEvent/TileRawChannelContainer.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
+#include "TileConditions/TileCondToolEmscale.h"
 #include "StoreGate/ReadHandleKey.h"
 
 #include <string> 
 
 class TileCablingService;
-class TileCondToolEmscale;
 class CaloLVL1_ID;
 class TileHWID;
 class TileID;
@@ -59,7 +59,8 @@ class TileTriggerDefaultCalibTool : public AthAlgTool, virtual public ITileCalib
   const TileHWID* m_tileHWID;
   const TileID*   m_tileID;
   const TileCablingService* m_tileCablingService;
-  ToolHandle<TileCondToolEmscale> m_tileToolEmscale; //!< main Tile Calibration tool
+  ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,  //!< main Tile Calibration tool
+    "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};
   SG::ReadHandleKey<TileDQstatus> m_dqStatusKey;
   SG::ReadHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this,
       "TileRawChannelContainer", "TileRawChannelFit", "Tile raw channel container"};
@@ -107,7 +108,8 @@ class TileTriggerDefaultCalibTool : public AthAlgTool, virtual public ITileCalib
 
   std::string m_TileBeamContainerID;    //!< Name of the TileBeamElemContainer
   std::string m_TileTriggerContainerID; //!< Name of the TileTriggerContainer
-  ToolHandle<LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools;
+  ToolHandle<LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools{this,
+    "L1CaloTTIdTools", "LVL1::L1CaloTTIdTools/L1CaloTTIdTools", "L1Calo TTId tools"};
   //  ToolHandle<LVL1::IL1TriggerTowerTool> m_ttTool; 
 
   uint32_t m_BCID;         //!< BCID in LASTROD
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx
index 79e5888c4c2..57094e5cf19 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileCisDefaultCalibTool.cxx
@@ -21,7 +21,6 @@
 #include "TileIdentifier/TileHWID.h"
 #include "TileConditions/TileCablingSvc.h"
 
-#include "TileMonitoring/ITileStuckBitsProbsTool.h"
 
 #include "TFile.h"
 #include "TTree.h"
@@ -43,7 +42,6 @@ TileCisDefaultCalibTool::TileCisDefaultCalibTool(const std::string& type, const
   , m_tileHWID(0)
   , m_cabling(0)
   , m_cablingSvc("TileCablingSvc", name)
-  , m_stuckBitsProbs("")
   , m_scanMap(0)
   , m_scanMapRMS(0)
 {
@@ -64,7 +62,6 @@ TileCisDefaultCalibTool::TileCisDefaultCalibTool(const std::string& type, const
   declareProperty("linfitMinLo", m_linfitMinLo = 300.0);
 
   declareProperty("doSampleChecking", m_doSampleChecking = true); // do sample checking by default
-  declareProperty("StuckBitsProbsTool", m_stuckBitsProbs);
   declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
 
   // Initialize arrays for results
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileDigiNoiseCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileDigiNoiseCalibAlg.cxx
index 1a0b4574163..62b9a502598 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileDigiNoiseCalibAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileDigiNoiseCalibAlg.cxx
@@ -29,7 +29,6 @@
 #include "TileEvent/TileDigitsContainer.h"
 #include "TileEvent/TileBeamElemContainer.h"
 #include "TileEvent/TileRawChannelContainer.h"
-#include "TileRecUtils/TileRawChannelBuilderFlatFilter.h"
 #include "TileByteStream/TileBeamElemContByteStreamCnv.h"
 #include "TileCalibAlgs/TileOFCorrelation.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
@@ -44,7 +43,6 @@
 
 TileDigiNoiseCalibAlg::TileDigiNoiseCalibAlg(const std::string& name, ISvcLocator* pSvcLocator)
     : AthAlgorithm(name, pSvcLocator)
-  , m_adderFilterAlgTool("TileRawChannelBuilderFlatFilter/TileAdderFlatFilter", this)
   , m_beamCnv(0)
   , m_cabling(0)
   , m_tileOFCorrelation(0)
@@ -61,7 +59,6 @@ TileDigiNoiseCalibAlg::TileDigiNoiseCalibAlg(const std::string& name, ISvcLocato
   , m_min(0)
   , m_trigType(0)
 {
-  declareProperty("TileAdderFlatFilter", m_adderFilterAlgTool);
   declareProperty("TileBeamElemContainer", m_beamElemContainer = "TileBeamElemCnt");
   /*  declareProperty("TileRawChannelContainerFlat", m_flatRawChannelContainer = "TileRawChannelFlat");
    declareProperty("TileRawChannelContainerFit", m_fitRawChannelContainer = ""); // don't create
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileExpertDump.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileExpertDump.cxx
index 89d97592396..25582991634 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileExpertDump.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileExpertDump.cxx
@@ -11,7 +11,6 @@
 #include "TileCalibAlgs/TileExpertDump.h"
 #include "TileConditions/TileInfoLoader.h"
 #include "TileConditions/TileInfo.h"
-#include "TileConditions/TileExpertToolEmscale.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
 #include "TileIdentifier/TileHWID.h"
 #include "TileIdentifier/TileTrigType.h"
@@ -27,10 +26,8 @@
 TileExpertDump::TileExpertDump(const std::string& name, ISvcLocator* pSvcLocator)
   : AthAlgorithm(name, pSvcLocator)
   , m_emExpertOptions(0)
-  , m_tileExpertToolEmscale("TileExpertToolEmscale")
   , m_tileHWID(0)
 {
-  declareProperty("TileExpertToolEmscale"  , m_tileExpertToolEmscale);
   declareProperty("PrintExpertEmscale"     , m_printExpertEmscale=false      ,"Switch on expert calibration chain printout");
   declareProperty("PrintExpertEmscaleOnl"  , m_printExpertEmscaleOnl=false   ,"Switch on expert onl calibration chain printout");
 
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileInfoDump.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileInfoDump.cxx
index 9e8e3600eab..d4df7e21687 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileInfoDump.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileInfoDump.cxx
@@ -23,17 +23,6 @@
 #include "TileIdentifier/TileFragHash.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
 #include "TileConditions/TileCablingService.h"
-#include "TileConditions/ITileBadChanTool.h"
-#include "TileConditions/TileCondToolEmscale.h"
-#include "TileConditions/TileCondToolIntegrator.h"
-#include "TileConditions/TileCondToolTiming.h"
-#include "TileConditions/TileCondToolPulseShape.h"
-#include "TileConditions/TileCondToolNoiseSample.h"
-#include "TileConditions/TileCondToolNoiseRawChn.h"
-#include "TileConditions/TileCondToolOfcCool.h"
-#include "TileConditions/TileCondToolMuID.h"
-#include "TileConditions/TileCondToolAutoCr.h"
-
 #include "TH2.h"
 
 #include <iomanip>
@@ -44,16 +33,6 @@
 
 TileInfoDump::TileInfoDump(const std::string& name, ISvcLocator* pSvcLocator)
     : AthAlgorithm(name, pSvcLocator)
-    , m_tileBadChanTool("TileBadChanTool")
-    , m_tileToolEmscale("TileCondToolEmscale")
-    , m_tileToolIntegrator("TileCondToolIntegrator")
-    , m_tileToolTiming("TileCondToolTiming")
-    , m_tileToolPulseShape("TileCondToolPulseShape")
-    , m_tileToolNoiseSample("TileCondToolNoiseSample")
-    , m_tileToolAutoCr("TileCondToolAutoCr")
-    , m_tileToolNoiseRawChn("TileCondToolNoiseRawChn", this)
-    , m_tileToolOfcCool("TileCondToolOfcCool")
-    , m_tileToolMuID("TileCondToolMuID")
     , m_thistSvc(0)
     , m_tileHWID(0)
     , m_tileID(0)
@@ -65,15 +44,6 @@ TileInfoDump::TileInfoDump(const std::string& name, ISvcLocator* pSvcLocator)
     , m_h_badCell(0)
 
 {
-  declareProperty("TileBadChanTool", m_tileBadChanTool);
-  declareProperty("TileCondToolEmscale", m_tileToolEmscale);
-  declareProperty("TileCondToolIntegrator", m_tileToolIntegrator);
-  declareProperty("TileCondToolTiming", m_tileToolTiming);
-  declareProperty("TileCondToolPulseShape", m_tileToolPulseShape);
-  declareProperty("TileCondToolOfcCool", m_tileToolOfcCool);
-  declareProperty("TileCondToolNoiseSample", m_tileToolNoiseSample);
-  declareProperty("TileCondToolAutoCr", m_tileToolAutoCr);
-  declareProperty("TileCondToolNoiseRawChn", m_tileToolNoiseRawChn);
   declareProperty("AthenaIsOnline", m_isOnline = false, "Availability of COOL folders depends on Athena mode");
   declareProperty("PrintEmscale", m_printEmscale = false, "Switch on calibration chain printout");
   declareProperty("PrintEmscaleOnl", m_printEmscaleOnl = false, "Switch on online calibration chain printout");
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserCalibAlg.cxx
index e16deaabe86..8e6db04dc41 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserCalibAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserCalibAlg.cxx
@@ -12,7 +12,6 @@
 
 // Tile includes
 #include "TileCalibAlgs/TileLaserCalibAlg.h"
-#include "TileCalibAlgs/ITileCalibTool.h"
 
 #include "TFile.h"
 #include <iostream>
@@ -37,8 +36,8 @@ TileLaserCalibAlg::TileLaserCalibAlg(const std::string& name, ISvcLocator* pSvcL
   , m_runNo(0)
   , m_runType(0)
 {
+
   declareProperty("FileName", m_fileName);
-  declareProperty("Tools", m_lasTools);
 }
 
 TileLaserCalibAlg::~TileLaserCalibAlg() {
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
index 57c9288fd35..2bc770a4dfe 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx
@@ -8,8 +8,6 @@
 #include "TileEvent/TileLaserObject.h"
 #include "TileConditions/TileCablingService.h"
 #include "TileCalibBlobObjs/TileCalibUtils.h"
-#include "TileConditions/ITileBadChanTool.h"
-#include "TileMonitoring/ITileStuckBitsProbsTool.h"
 
 
 #include "GaudiKernel/MsgStream.h"
@@ -43,9 +41,6 @@ TileLaserDefaultCalibTool::TileLaserDefaultCalibTool(const std::string& type, co
   m_isLaserCalib(false),
   m_tileHWID(nullptr),
   m_cabling(nullptr),
-  m_tileToolEmscale("TileCondToolEmscale"),
-  m_tileBadChanTool("TileBadChanTool"),
-  m_stuckBitsProbs(""),
   m_toolRunNo(0),
   m_ADC_problem(0),
   m_las_filter(0),
@@ -72,7 +67,6 @@ TileLaserDefaultCalibTool::TileLaserDefaultCalibTool(const std::string& type, co
   declareInterface<ITileCalibTool>( this );
   declareProperty("toolNtuple", m_toolNtuple="h3000");
   declareProperty("pisaMethod2", m_pisaMethod2=true);
-  declareProperty("StuckBitsProbsTool", m_stuckBitsProbs);
   declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
   
   //creating multi-dim arrays on the heap and initialize all elements to zeros
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserLinearityCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserLinearityCalibTool.cxx
index c0967227e1a..8387dc9bec4 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserLinearityCalibTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserLinearityCalibTool.cxx
@@ -35,7 +35,6 @@ TileLaserLinearityCalibTool::TileLaserLinearityCalibTool(const std::string& type
   AthAlgTool(type, name, pParent),
   m_tileHWID (nullptr),
   m_cabling (nullptr),
-  m_tileToolEmscale("TileCondToolEmscale"),
   m_toolRunNo(0),
   m_ADC_problem(0),
   m_las_filter(0),
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserTimingTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserTimingTool.cxx
index 56619532dd2..763a4b38430 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserTimingTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserTimingTool.cxx
@@ -123,14 +123,12 @@ TileLaserTimingTool::TileLaserTimingTool(const std::string& type, const std::str
   : AthAlgTool(type, name, pParent)
   , m_tileHWID(0)
   , m_cabling(0)
-  , m_tileToolTiming("TileCondToolTiming")
   , m_nevts(0)
   , m_gaussf(0)
 {
 
   declareInterface<ITileCalibTool>( this );
 
-  declareProperty("TileCondToolTiming", m_tileToolTiming);
   declareProperty("NtupleID", m_ntupleID = "h3000");
   declareProperty("FiberLightSpeed", m_fiberLightSpeed);
   declareProperty("NSamples", m_nSamples = 9);
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileMuId2DBAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileMuId2DBAlg.cxx
index 282504b3789..07c3b06f144 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileMuId2DBAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileMuId2DBAlg.cxx
@@ -34,11 +34,9 @@ using namespace std;
 TileMuId2DBAlg::TileMuId2DBAlg(const std::string& name, ISvcLocator* pSvcLocator) : 
   AthAlgorithm(name,pSvcLocator), 
   m_calo_id(0),
-  m_noiseTool("CaloNoiseToolDB/calonoisetooldb"),
   m_noise(0.0),
   m_module(0)
 {
-  declareProperty("noiseTool",   m_noiseTool,"noise tool");
 }
 
 
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileOFC2DBAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileOFC2DBAlg.cxx
index 7d58ada9abf..d875848de56 100755
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileOFC2DBAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileOFC2DBAlg.cxx
@@ -26,12 +26,8 @@
 TileOFC2DBAlg::TileOFC2DBAlg(const std::string& name, ISvcLocator* pSvcLocator)
     : AthAlgorithm(name, pSvcLocator)
   , m_regSvc(0)
-  , m_tileToolTiming("TileCondToolTiming")
-  , m_tileCondToolOfc("TileCondToolOfc")
 
 {
-  declareProperty("TileCondToolTiming", m_tileToolTiming);
-  declareProperty("TileCondToolOfc",    m_tileCondToolOfc, "TileCondToolOfc");
   declareProperty("OF2",                m_of2            = true,"true => OF2, false => OF1");
   declareProperty("RunIOVSince",        m_runIOVSince    = IOVTime::MINRUN );
   declareProperty("RunIOVUntil",        m_runIOVUntil    = IOVTime::MAXRUN );
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
index 6fd10bdffec..37c72be5a3e 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx
@@ -61,9 +61,6 @@ TileRawChNoiseCalibAlg::TileRawChNoiseCalibAlg(const std::string& name, ISvcLoca
   , m_cabling(0)
   , m_tileID(0)
   , m_tileHWID(0)
-  , m_tileToolEmscale("TileCondToolEmscale")
-  , m_tileBadChanTool("TileBadChanTool")
-  , m_tileIdTrans("TileCondIdTransforms")
   , m_cispar(0)
   //, m_nDrawers(0)
   , m_time(0)
@@ -95,8 +92,6 @@ TileRawChNoiseCalibAlg::TileRawChNoiseCalibAlg(const std::string& name, ISvcLoca
   declareProperty("FileNamePrefix", m_file="RawCh_NoiseCalib");
   declareProperty("NtupleID", m_ntupleID="RawCh_NoiseCalib");
   declareProperty("TreeSize", m_treeSize = 16000000000LL);
-  declareProperty("TileCondToolEmscale", m_tileToolEmscale);
-  declareProperty("TileBadChanTool", m_tileBadChanTool);
   declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
 
   m_evtNr=-1;
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTopCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTopCalibAlg.cxx
index 1be6391ade1..4403aae4173 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTopCalibAlg.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTopCalibAlg.cxx
@@ -18,12 +18,10 @@ TileTopCalibAlg::TileTopCalibAlg(const std::string& name, ISvcLocator* pSvcLocat
   , m_runNumber(0)
   , m_runType(0)
   , m_fileName("TileCalibNtuple.root")
-  , m_tileCalibToolList()
   , m_rootFile(0)
 {
   declareProperty("RunNumber", m_runNumber=0);
   declareProperty("RunType", m_runType=0);
-  declareProperty("TileCalibTools",m_tileCalibToolList,"List Of Tools");
   declareProperty("FileName",m_fileName="TileCalibNtuple.root");
 }
 
diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTriggerDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTriggerDefaultCalibTool.cxx
index 7ae6fc6565c..40bf274b415 100644
--- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTriggerDefaultCalibTool.cxx
+++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileTriggerDefaultCalibTool.cxx
@@ -26,7 +26,6 @@
 #include "TileEvent/TileRawChannelContainer.h"
 #include "TileEvent/TileBeamElemContainer.h"
 #include "TileConditions/TileCablingService.h"
-#include "TileConditions/TileCondToolEmscale.h"
 //for the extended CISpar
 #include "TileIdentifier/TileTBFrag.h"
 
@@ -55,7 +54,6 @@ TileTriggerDefaultCalibTool::TileTriggerDefaultCalibTool(const std::string& type
   , m_tileHWID(nullptr)
   , m_tileID(nullptr)
   , m_tileCablingService(nullptr)
-  , m_tileToolEmscale("TileCondToolEmscale")
   , m_DACvalue(0)
   , m_charge(0)
   , m_ipmt(0)
@@ -63,7 +61,6 @@ TileTriggerDefaultCalibTool::TileTriggerDefaultCalibTool(const std::string& type
   , m_ipmtOld(0)
   , m_nEvtGlobal()
   , m_TileTriggerContainerID("")
-  , m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools")
   //, m_ttTool("LVL1::L1TriggerTowerTool/LVL1::L1TriggerTowerTool")
   , m_BCID(0)
   , m_trigType(0)
@@ -74,7 +71,6 @@ TileTriggerDefaultCalibTool::TileTriggerDefaultCalibTool(const std::string& type
   declareProperty("NtupleID", m_ntupleID="h3000");
   declareProperty("NumEventPerPMT", m_nevpmt=195); // changed from 200 to 195
   declareProperty("TileBeamElemContainer",m_TileBeamContainerID);
-  declareProperty("TileCondToolEmscale", m_tileToolEmscale);
   declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus");
   //  declareProperty("L1TriggerTowerTool", m_ttTool);
   
diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
index 63168433bc3..577d3fec673 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
@@ -1586,7 +1586,6 @@ if doTileCalib:
 
         TileCisTool.removePed = True
         #from AthenaCommon.AppMgr import ToolSvc
-        ToolSvc += TileCisTool
         TileCalibAlg.TileCalibTools += [ TileCisTool ]
 
         topSequence += TileCalibAlg
@@ -1608,7 +1607,6 @@ if doTileCalib:
         dqStatus.TileRawChannelContainer = 'TileRawChannelCnt'
 
         #from AthenaCommon.AppMgr import ToolSvc
-        ToolSvc += TileTriggerTool
         TileCalibAlg.TileCalibTools += [ TileTriggerTool ]
 
         topSequence += TileCalibAlg              
@@ -1629,7 +1627,6 @@ if doTileCalib:
             TileLaserTool.StuckBitsProbsTool = ToolSvc.TileDigitsMon
 
         #from AthenaCommon.AppMgr import ToolSvc
-        ToolSvc += TileLaserTool
         TileCalibAlg.Tools = [ TileLaserTool ]
 
         topSequence += TileCalibAlg
-- 
GitLab


From f5813b635e5d0de5f74970026c94cd95d5ac3083 Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Wed, 6 Mar 2019 15:26:08 +0000
Subject: [PATCH 344/404] Clean up some atomic usage, fixing thread safety and
 performance tradeoffs

---
 .../CompetingPixelClustersOnTrack.h           |   6 -
 .../CompetingSCT_ClustersOnTrack.h            |  10 +-
 .../CompetingTRT_DriftCirclesOnTrack.h        |   2 +-
 .../src/CompetingPixelClustersOnTrack.cxx     |  15 +-
 .../src/CompetingTRT_DriftCirclesOnTrack.cxx  |  28 +-
 .../CompetingTRT_DriftCirclesOnTrackTool.cxx  |   4 +-
 .../TruthClusterizationFactory.h              |  10 +-
 .../src/TruthClusterizationFactory.cxx        | 279 ++++++++----------
 .../CompetingRIOsOnTrack.h                    |   4 +-
 .../src/CompetingRIOsOnTrack.cxx              |  12 +-
 .../CompetingRIOsOnTrackCnv_p1.cxx            |  15 +-
 .../test/CompetingRIOsOnTrackCnv_p1_test.cxx  |   2 +-
 12 files changed, 185 insertions(+), 202 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
index e6f25e1470c..1d3aa42df21 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingPixelClustersOnTrack.h
@@ -137,12 +137,6 @@ inline const InDet::PixelClusterOnTrack& CompetingPixelClustersOnTrack::rioOnTra
         return * m_containedChildRots->operator[](indx);
 }
 
- inline const Amg::Vector3D& CompetingPixelClustersOnTrack::globalPosition() const {
-    if (m_globalPosition)
-        return (*m_globalPosition.load());
-    m_globalPosition = associatedSurface().localToGlobal(localParameters());
-    return (*m_globalPosition.load());
-}
 
 inline unsigned int CompetingPixelClustersOnTrack::numberOfContainedROTs() const {
     return m_containedChildRots->size();
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
index 45b1434dfa7..4d535d49296 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingSCT_ClustersOnTrack.h
@@ -138,10 +138,14 @@ inline const InDet::SCT_ClusterOnTrack& CompetingSCT_ClustersOnTrack::rioOnTrack
 }
 
 inline const Amg::Vector3D& CompetingSCT_ClustersOnTrack::globalPosition() const {
-    if (m_globalPosition==nullptr) {
-        m_globalPosition = associatedSurface().localToGlobal(localParameters());
+    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
     }
-    return (*m_globalPosition);
+    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.
 }
 
 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 8ff11116217..22fe614c83a 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/InDetCompetingRIOsOnTrack/CompetingTRT_DriftCirclesOnTrack.h
@@ -106,7 +106,7 @@ namespace InDet {
     //! private method to clear the Trk::RIO_OnTrack vector
     void                               clearChildRotVector();
     //! The surface to which the competingROTs parameters are expressed to
-    mutable std::atomic<const Trk::Surface*> m_associatedSurface;
+    const Trk::Surface* m_associatedSurface;
 
     //! The global Position
     mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
index ac6808c43ca..b3b8234e1d2 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingPixelClustersOnTrack.cxx
@@ -72,9 +72,7 @@ InDet::CompetingPixelClustersOnTrack& InDet::CompetingPixelClustersOnTrack::oper
         delete m_globalPosition;
         m_containedChildRots = compROT.m_containedChildRots;
         compROT.m_containedChildRots = nullptr;
-
-        m_globalPosition = compROT.m_globalPosition.load();
-        compROT.m_globalPosition = nullptr;
+        m_globalPosition = compROT.m_globalPosition.exchange(nullptr, std::memory_order_relaxed);
     }
     return (*this);
 }
@@ -118,3 +116,14 @@ bool InDet::CompetingPixelClustersOnTrack::ROTsHaveCommonSurface(const bool) con
     return true;
 }
 
+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
+    }
+    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.
+}
+
diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
index 9a85e67f61c..d56f06d795e 100755
--- a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/src/CompetingTRT_DriftCirclesOnTrack.cxx
@@ -32,7 +32,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack::CompetingTRT_DriftCirclesOnTrack(const
   m_ROTsHaveCommonSurface(compROT.m_ROTsHaveCommonSurface.load()) {
   if (compROT.m_associatedSurface) {
     // copy only if surface is not one owned by a detector Element
-    m_associatedSurface = (!compROT.m_associatedSurface.load()->associatedDetectorElement()) ? compROT.m_associatedSurface.load()->clone() : compROT.m_associatedSurface.load();
+    m_associatedSurface = (!compROT.m_associatedSurface->associatedDetectorElement()) ? compROT.m_associatedSurface->clone() : compROT.m_associatedSurface;
   } else {
     m_associatedSurface = 0;
   }
@@ -77,12 +77,12 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
     delete m_containedChildRots;
     delete m_globalPosition;
     // delete surface if not owned by detElement
-    if (m_associatedSurface && !m_associatedSurface.load()->associatedDetectorElement())
+    if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement())
       delete m_associatedSurface;
     m_containedChildRots = new std::vector<const InDet::TRT_DriftCircleOnTrack*>;
     if (compROT.m_associatedSurface) {
       // copy only if surface is not one owned by a detector Element
-      m_associatedSurface = (!compROT.m_associatedSurface.load()->associatedDetectorElement()) ? compROT.m_associatedSurface.load()->clone() : compROT.m_associatedSurface.load();
+      m_associatedSurface = (!compROT.m_associatedSurface->associatedDetectorElement()) ? compROT.m_associatedSurface->clone() : compROT.m_associatedSurface;
     } else {
       m_associatedSurface = 0;
     }
@@ -97,7 +97,7 @@ InDet::CompetingTRT_DriftCirclesOnTrack& InDet::CompetingTRT_DriftCirclesOnTrack
 
 InDet::CompetingTRT_DriftCirclesOnTrack::~CompetingTRT_DriftCirclesOnTrack() {
   // delete surface if not owned by detElement
-  if (m_associatedSurface && !m_associatedSurface.load()->associatedDetectorElement())
+  if (m_associatedSurface && !m_associatedSurface->associatedDetectorElement())
     delete m_associatedSurface;
   delete m_globalPosition;
   clearChildRotVector();
@@ -155,22 +155,23 @@ bool InDet::CompetingTRT_DriftCirclesOnTrack::ROTsHaveCommonSurface(const bool w
 
 
 const Amg::Vector3D& InDet::CompetingTRT_DriftCirclesOnTrack::globalPosition() const {
-  if (m_globalPosition) return (*m_globalPosition);
+  auto ptr = m_globalPosition.load();
+  if (ptr) return (*ptr);
   // 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
     
   // FIXME: introduce a special function in base class, which returns the sum of assignment probabilities
   double assgnProbSum = 0.;
-  std::vector<AssignmentProb>::const_iterator assgnProbIter = m_assignProb.load()->begin();
-  for (; assgnProbIter != m_assignProb.load()->end(); ++assgnProbIter) {
+  std::vector<AssignmentProb>::const_iterator assgnProbIter = m_assignProb->begin();
+  for (; assgnProbIter != m_assignProb->end(); ++assgnProbIter) {
     assgnProbSum += (*assgnProbIter);
   }
 
   Amg::Vector3D globalPos(0.,0.,0.);
   if (assgnProbSum > 0.) {
     std::vector< const InDet::TRT_DriftCircleOnTrack* >::const_iterator rotIter = m_containedChildRots->begin();
-    assgnProbIter = m_assignProb.load()->begin();
+    assgnProbIter = m_assignProb->begin();
     for (; rotIter != m_containedChildRots->end(); ++rotIter, ++assgnProbIter) {
       globalPos += ( ((*assgnProbIter)/assgnProbSum) * ((*rotIter)->globalPosition()) );
     }
@@ -178,9 +179,14 @@ const Amg::Vector3D& InDet::CompetingTRT_DriftCirclesOnTrack::globalPosition() c
   } else {
     globalPos = (*m_containedChildRots->begin())->globalPosition();
   }
-    
-  m_globalPosition = new Amg::Vector3D(globalPos);
-  return *m_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.
+  
 }
 
 void InDet::CompetingTRT_DriftCirclesOnTrack::setLocalParametersAndErrorMatrix() {
diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
index a66a6c5452b..8be554aff34 100755
--- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx
@@ -479,7 +479,7 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT(
     
     // cast baseCompROT to CompTRT_DConTrack:
 
-    const InDet::CompetingTRT_DriftCirclesOnTrack* compROT = dynamic_cast< const InDet::CompetingTRT_DriftCirclesOnTrack* >(&baseCompROT);
+    InDet::CompetingTRT_DriftCirclesOnTrack* compROT = dynamic_cast< InDet::CompetingTRT_DriftCirclesOnTrack* >(&baseCompROT);
     if (!compROT) {
         ATH_MSG_ERROR("Given CompetingRIOsOnTrack is not a CompetingTRT_DriftCirclesOnTrack!");
         ATH_MSG_ERROR("Update of assignment probabilities aborted!!!");
@@ -714,7 +714,7 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT(
     // update maximum assign prob index:
     compROT->m_indexMaxAssignProb = maximumAssignProbIndex;
     // update surface
-    if (!compROT->m_associatedSurface.load()->associatedDetectorElement())
+    if (!compROT->m_associatedSurface->associatedDetectorElement())
         delete compROT->m_associatedSurface;
     compROT->m_associatedSurface=assocSurface;
     // delete global position (will be recreated in competingROT itself
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
index 9422c4103cd..56339bdd7dd 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/TruthClusterizationFactory.h
@@ -16,9 +16,7 @@
 
  #include "AthenaBaseComps/AthAlgTool.h"
  #include "GaudiKernel/ToolHandle.h"
- #include "GaudiKernel/IIncidentSvc.h"
 
- #include <atomic>
  #include <vector>
  #include <string>
  #include <map>
@@ -48,8 +46,7 @@ namespace InDet {
 
   static const InterfaceID IID_TruthClusterizationFactory("InDet::NnClusterizationFactory", 1, 0);
   
-  class TruthClusterizationFactory : 	virtual public IIncidentListener,
-									public AthAlgTool  {
+  class TruthClusterizationFactory : public AthAlgTool  {
      
    public:
      
@@ -63,18 +60,13 @@ namespace InDet {
     virtual StatusCode initialize();
     virtual StatusCode finalize() { return StatusCode::SUCCESS; };
 	
-	/** handle for incident service */
-    virtual void handle(const Incident& inc); 
-     
     std::vector<double> estimateNumberOfParticles(const InDet::PixelCluster& pCluster) const;
 
     std::vector<Amg::Vector2D> estimatePositions(const InDet::PixelCluster&) const;
                                                       
    private:
 	/** IncidentSvc to catch begining of event and end of event */   
-    ServiceHandle<IIncidentSvc>           m_incidentSvc;   	
     SG::ReadHandleKey<InDetSimDataCollection> m_simDataCollectionName {this, "InputSDOMap", "PixelSDO_Map", "sim data collection name"};
-    mutable std::atomic<const InDetSimDataCollection*> m_simDataCollection; //!< sim data collection - refreshed at BeginEvent incident
 
   protected:
     ServiceHandle<IAtRndmGenSvc> m_rndmSvc;
diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
index 6067167563d..930ad357f19 100644
--- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/TruthClusterizationFactory.cxx
@@ -2,65 +2,56 @@
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-/////////////////////////////////////////////////////////////////////////////////////////////////////
-/// Name    : TruthClusterizationFactory.cxx
-/// Package : SiClusterizationTool 
-/// Author  : Roland Jansky & Felix Cormier
-/// Created : April 2016
-///
-/// DESCRIPTION: Emulates NN evaluation from truth (for ITK studies)
-///////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-#include <TMath.h>
-#include "SiClusterizationTool/TruthClusterizationFactory.h"
-
-//for position estimate and clustering
-#include "InDetIdentifier/PixelID.h"
-#include "InDetPrepRawData/PixelCluster.h"
-
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/Incident.h"
-#include "InDetSimData/InDetSimData.h"
-#include "HepMC/GenParticle.h"
-
-#include "TrkEventPrimitives/ParamDefs.h"
-
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+/// Name    : TruthClusterizationFactory.cxx
+/// Package : SiClusterizationTool 
+/// Author  : Roland Jansky & Felix Cormier
+/// Created : April 2016
+///
+/// DESCRIPTION: Emulates NN evaluation from truth (for ITK studies)
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+#include <TMath.h>
+#include "SiClusterizationTool/TruthClusterizationFactory.h"
+
+//for position estimate and clustering
+#include "InDetIdentifier/PixelID.h"
+#include "InDetPrepRawData/PixelCluster.h"
+
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/Incident.h"
+#include "InDetSimData/InDetSimData.h"
+#include "HepMC/GenParticle.h"
+
+#include "TrkEventPrimitives/ParamDefs.h"
+
 #include "CLHEP/Random/RandFlat.h"
-
-namespace InDet {
-
-  TruthClusterizationFactory::TruthClusterizationFactory(const std::string& name,
-                                                   const std::string& n, const IInterface* p):
-          AthAlgTool(name, n,p),
-	  m_incidentSvc("IncidentSvc", n),
-	  m_simDataCollection(0),
+
+namespace InDet {
+
+  TruthClusterizationFactory::TruthClusterizationFactory(const std::string& name,
+                                                   const std::string& n, const IInterface* p):
+          AthAlgTool(name, n,p),
 	  m_rndmSvc("AtDSFMTGenSvc",name),
 	  m_rndmEngine(0)
 {
-  // further properties
-  declareProperty("IncidentService", m_incidentSvc );
+  // further properties
   declareProperty("RndmSvc", m_rndmSvc, "Random Number Service used in TruthClusterizationFactory");
   
-  declareInterface<TruthClusterizationFactory>(this);
-      } 
-  
-/////////////////////////////////////////////////////////////////////////////////////
-/// Destructor - check up memory allocation
-/// delete any memory allocation on the heap
-  
-  TruthClusterizationFactory::~TruthClusterizationFactory() {}
-  
-  StatusCode TruthClusterizationFactory::initialize() {
-    if (m_incidentSvc.retrieve().isFailure()){
-		ATH_MSG_WARNING("Can not retrieve " << m_incidentSvc << ". Exiting.");
-		return StatusCode::FAILURE;
-	}
-  
-	// register to the incident service
-	m_incidentSvc->addListener( this, "BeginEvent");
-
+  declareInterface<TruthClusterizationFactory>(this);
+      } 
+  
+/////////////////////////////////////////////////////////////////////////////////////
+/// Destructor - check up memory allocation
+/// delete any memory allocation on the heap
+  
+  TruthClusterizationFactory::~TruthClusterizationFactory() {}
+  
+  StatusCode TruthClusterizationFactory::initialize() {
+  
+
 	msg(MSG::INFO) << "initialize() successful in " << name() << endmsg;
 
 	 // random svc
@@ -80,103 +71,89 @@ namespace InDet {
 	ATH_CHECK( m_simDataCollectionName.initialize() );
 
 
-    return StatusCode::SUCCESS;
-  }
-  
-  void TruthClusterizationFactory::handle(const Incident& inc) 
-  { 
-   if ( inc.type() == IncidentType::BeginEvent ){
-   	// record the SDO collection
-     
-     SG::ReadHandle<InDetSimDataCollection> pixSdoColl(m_simDataCollectionName);
-
-     if (!pixSdoColl.isValid()){
-       ATH_MSG_WARNING("Could not retrieve the  InDetSimDataCollection with name "   << m_simDataCollectionName);
-       m_simDataCollection = 0;
-     } else {
-       ATH_MSG_VERBOSE("Successfully retrieved the InDetSimDataCollection with name " << m_simDataCollectionName);
-       m_simDataCollection = &(*pixSdoColl);  
-     }
-   }  
-  }
-
+    return StatusCode::SUCCESS;
+  }
+  
+
+
   std::vector<double> TruthClusterizationFactory::estimateNumberOfParticles(const InDet::PixelCluster& pCluster) const
-  {
-	std::vector<double> probabilities(3,0.);
-	auto rdos = pCluster.rdoList();
-    	bool crazycluster(true);
-	unsigned int nPartContributing = 0;
-	//Initialize vector for a list of UNIQUE barcodes for the cluster
-	std::vector<int> barcodes;
-	//Loop over all elements (pixels/strips) in the cluster
-	for (auto rdoIter :  rdos){
-		if (m_simDataCollection){
-                       auto simDataIter = m_simDataCollection.load()->find(rdoIter);
-                       if (simDataIter != m_simDataCollection.load()->end()){
-                		crazycluster = false;
-				// get the SimData and count the individual contributions
-				auto simData = (simDataIter->second);
-				//auto simDataDeposits = simData.getdeposits();
-				for( auto deposit : simData.getdeposits() ){
-					//If deposit exists
-					if (deposit.first){
-						//Now iterate over all barcodes
-						std::vector<int>::iterator barcodeIterator;
-						//Look for the barcode of the specific particle depositing energy in the barcodes vector
-						barcodeIterator  = find(barcodes.begin(), barcodes.end(), deposit.first->barcode());
-						//If this barcode is not found
-						if (!(barcodeIterator != barcodes.end())){
-							//Add the barcode to the barcodes vector
-							barcodes.push_back(deposit.first->barcode());
-						}
-					}
-					else ATH_MSG_WARNING("No deposits found");
-				}
-				//nPartContributing = simDataDeposits.size() > nPartContributing ? simDataDeposits.size() : nPartContributing;
-			}
-		}
-	}
-	//Barcodes vector is then a list of the total number of UNIQUE
-	//barcodes in the cluster, each corresponding to a truth particle
-	nPartContributing = barcodes.size();
-	ATH_MSG_VERBOSE("n Part Contributing: " << nPartContributing);
-	ATH_MSG_VERBOSE("Smearing TruthClusterizationFactory probability output for TIDE studies");
-	//If only 1 truth particles found
-	if (nPartContributing==1) {
-		//NN will always return 100% chance of there being only 1 particle
-		probabilities[0] = 1.0;
-	}
-	//If two unique truth particles found in cluster
-	else if (nPartContributing==2) {
-		//90% chance NN returns high probability of there being 2 particles
-		if (CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1 ) < 0.9) probabilities[1] = 1.0;
-		//Other 10% NN returns high probability of there being 1 particle
-		else probabilities[0] = 1.0;
-	}
-	//If greater than 2 unique truth particles in cluster
-	else if (nPartContributing>2) {
-		//90% chance NN returns high probability of there being >2 particles
-		if (CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1 ) < 0.9) probabilities[2] = 1.0;
-		//Other 10% NN returns high probability of there being 1 particle
-		else probabilities[0] = 1.0;
-	}
-    
-    //if truth collection not found
-    if(crazycluster) {
-        std::vector<double> noprobabilities;
-        return noprobabilities;
-    }
-	//Else return probabilities calculated above
-    
-	return probabilities;
-	
-  }
-
+  {
+	std::vector<double> probabilities(3,0.);
+	auto rdos = pCluster.rdoList();
+    	bool crazycluster(true);
+	unsigned int nPartContributing = 0;
+	//Initialize vector for a list of UNIQUE barcodes for the cluster
+	std::vector<int> barcodes;
+        SG::ReadHandle<InDetSimDataCollection> pixSdoColl(m_simDataCollectionName);
+	//Loop over all elements (pixels/strips) in the cluster
+        if(pixSdoColl.isValid()){
+            for (auto rdoIter :  rdos){
+                       auto simDataIter = pixSdoColl->find(rdoIter);
+                       if (simDataIter != pixSdoColl->end()){
+                		crazycluster = false;
+				// get the SimData and count the individual contributions
+				auto simData = (simDataIter->second);
+				//auto simDataDeposits = simData.getdeposits();
+				for( auto deposit : simData.getdeposits() ){
+					//If deposit exists
+					if (deposit.first){
+						//Now iterate over all barcodes
+						std::vector<int>::iterator barcodeIterator;
+						//Look for the barcode of the specific particle depositing energy in the barcodes vector
+						barcodeIterator  = find(barcodes.begin(), barcodes.end(), deposit.first->barcode());
+						//If this barcode is not found
+						if (!(barcodeIterator != barcodes.end())){
+							//Add the barcode to the barcodes vector
+							barcodes.push_back(deposit.first->barcode());
+						}
+					}
+					else ATH_MSG_WARNING("No deposits found");
+				}
+				//nPartContributing = simDataDeposits.size() > nPartContributing ? simDataDeposits.size() : nPartContributing;
+			}
+	   }
+        }
+	//Barcodes vector is then a list of the total number of UNIQUE
+	//barcodes in the cluster, each corresponding to a truth particle
+	nPartContributing = barcodes.size();
+	ATH_MSG_VERBOSE("n Part Contributing: " << nPartContributing);
+	ATH_MSG_VERBOSE("Smearing TruthClusterizationFactory probability output for TIDE studies");
+	//If only 1 truth particles found
+	if (nPartContributing==1) {
+		//NN will always return 100% chance of there being only 1 particle
+		probabilities[0] = 1.0;
+	}
+	//If two unique truth particles found in cluster
+	else if (nPartContributing==2) {
+		//90% chance NN returns high probability of there being 2 particles
+		if (CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1 ) < 0.9) probabilities[1] = 1.0;
+		//Other 10% NN returns high probability of there being 1 particle
+		else probabilities[0] = 1.0;
+	}
+	//If greater than 2 unique truth particles in cluster
+	else if (nPartContributing>2) {
+		//90% chance NN returns high probability of there being >2 particles
+		if (CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1 ) < 0.9) probabilities[2] = 1.0;
+		//Other 10% NN returns high probability of there being 1 particle
+		else probabilities[0] = 1.0;
+	}
+    
+    //if truth collection not found
+    if(crazycluster) {
+        std::vector<double> noprobabilities;
+        return noprobabilities;
+    }
+	//Else return probabilities calculated above
+    
+	return probabilities;
+	
+  }
+
   std::vector<Amg::Vector2D> TruthClusterizationFactory::estimatePositions(const InDet::PixelCluster& ) const
-  { 
-	ATH_MSG_ERROR("TruthClusterizationFactory::estimatePositions called for ITk ambiguity setup, should never happen! Digital clustering should be run for positions & errors.");
-    return std::vector<Amg::Vector2D>(2,Amg::Vector2D (2,0.));
-  }
-  
-}//end InDet namespace
- 
+  { 
+	ATH_MSG_ERROR("TruthClusterizationFactory::estimatePositions called for ITk ambiguity setup, should never happen! Digital clustering should be run for positions & errors.");
+    return std::vector<Amg::Vector2D>(2,Amg::Vector2D (2,0.));
+  }
+  
+}//end InDet namespace
+ 
diff --git a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
index 35c0d678906..e9b22fd268d 100755
--- a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
+++ b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h
@@ -113,7 +113,7 @@ protected:
     mutable std::atomic_uint m_indexMaxAssignProb;
 
     //! assignment probabilities of the ROTs
-    mutable std::atomic<const std::vector<AssignmentProb>*> m_assignProb;
+    const std::vector<AssignmentProb>* m_assignProb;
 
     //! used to flag that the m_indexMaxAssignProb hasn't been calculated yet
     bool                            m_maxProbCalculated;
@@ -134,7 +134,7 @@ protected:
 inline CompetingRIOsOnTrack::AssignmentProb CompetingRIOsOnTrack::assignmentProbability(unsigned int indx) const {
     assert ( indx < numberOfContainedROTs() );
     if (indx < numberOfContainedROTs() )
-        return m_assignProb.load()->operator[](indx);
+        return m_assignProb->operator[](indx);
     return 0; // could consider throwing an exception here - EJWM
 }
 
diff --git a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
index 0fa42ac31eb..e1189805e96 100755
--- a/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
+++ b/Tracking/TrkEvent/TrkCompetingRIOsOnTrack/src/CompetingRIOsOnTrack.cxx
@@ -29,7 +29,7 @@ Trk::CompetingRIOsOnTrack::CompetingRIOsOnTrack(const Trk::CompetingRIOsOnTrack&
     Trk::MeasurementBase(compROT)
 {
   m_indexMaxAssignProb = compROT.m_indexMaxAssignProb.load();
-  m_assignProb = compROT.m_assignProb ? new std::vector<AssignmentProb>(*compROT.m_assignProb.load()) : 0;
+  m_assignProb = compROT.m_assignProb ? new std::vector<AssignmentProb>(*compROT.m_assignProb) : 0;
   m_maxProbCalculated = compROT.m_maxProbCalculated;
 }
 
@@ -61,7 +61,7 @@ Trk::CompetingRIOsOnTrack& Trk::CompetingRIOsOnTrack::operator=(Trk::CompetingRI
       Trk::MeasurementBase::operator=(std::move(compROT));
 
       delete m_assignProb;
-      m_assignProb = compROT.m_assignProb.load();
+      m_assignProb = compROT.m_assignProb;
       compROT.m_assignProb = nullptr;
 
       m_indexMaxAssignProb = compROT.m_indexMaxAssignProb.load();
@@ -141,9 +141,9 @@ Trk::CompetingRIOsOnTrack::indexOfMaxAssignProb() const {
         // No, so work it out.
         double maxAssgnProb = 0;
         for (unsigned int i=0; i<numberOfContainedROTs(); i++) {
-            if (m_assignProb.load()->operator[](i) >= maxAssgnProb) {
+            if (m_assignProb->operator[](i) >= maxAssgnProb) {
                 m_indexMaxAssignProb=i;
-                maxAssgnProb = m_assignProb.load()->operator[](i);
+                maxAssgnProb = m_assignProb->operator[](i);
             }
         }
         //m_maxProbCalculated = true;
@@ -178,7 +178,7 @@ MsgStream& Trk::CompetingRIOsOnTrack::dump( MsgStream& out ) const
       out <<"  "<<std::setw(10)<< this->rioOnTrack(i).localParameters()[Trk::locY]
           <<"  "<< 1/this->rioOnTrack(i).localCovariance()(Trk::locY,Trk::locY)<<"  ";
     else out << "                         ";
-    out <<"  "<< m_assignProb.load()->at(i)
+    out <<"  "<< m_assignProb->at(i)
         << (m_indexMaxAssignProb == i ? " **|":"   |");
   }
 /*  out << std::resetiosflags(std::ios::right)<<std::resetiosflags(std::ios::adjustfield)
@@ -213,7 +213,7 @@ std::ostream& Trk::CompetingRIOsOnTrack::dump( std::ostream& out ) const
       out << "  "<<std::setw(10)<< this->rioOnTrack(i).localParameters()[Trk::locY]
           <<"  "<< 1/this->rioOnTrack(i).localCovariance()(Trk::locY,Trk::locY)<<"  ";
     else out << "                         ";
-    out << "  " << m_assignProb.load()->at(i)
+    out << "  " << m_assignProb->at(i)
         << (m_indexMaxAssignProb == i ? " **|":"   |");
   }
 //   out << std::resetiosflags(std::ios::right)<<std::resetiosflags(std::ios::adjustfield)
diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx b/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
index 4ae4616e636..02b361bc069 100644
--- a/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
+++ b/Tracking/TrkEventCnv/TrkEventTPCnv/src/TrkCompetingRIOsOnTrack/CompetingRIOsOnTrackCnv_p1.cxx
@@ -19,22 +19,23 @@ void CompetingRIOsOnTrackCnv_p1::persToTrans( const Trk::CompetingRIOsOnTrack_p1
   EigenHelpers::vectorToEigenMatrix(dummy.values, transObj->m_localCovariance, "CompetingRIOsOnTrackCnv_p1");
 
   #ifdef UseFloatsIn_CompetingRIOsOnTrack
-  std::vector<double> tmpVector;
+  std::vector<double> *tmpVector = new std::vector<double>();
+  tmpVector->reserve(persObj->m_assignProb.size());
   for (std::vector<float>::const_iterator itr  = persObj->m_assignProb.begin() ; 
   itr != persObj->m_assignProb.end()   ; ++itr)
   {
-    tmpVector.push_back((double)(*itr));
+    tmpVector->push_back((double)(*itr));
   }
-  transObj->m_assignProb = new std::vector<double>(tmpVector);
+  transObj->m_assignProb = tmpVector;
   #else
   transObj->m_assignProb = new std::vector<double>(persObj->m_assignProb);
   #endif
 
     // find max assignment index again
   double maxAssgnProb = 0;
-  unsigned int max = transObj->m_assignProb.load()->size();
+  unsigned int max = transObj->m_assignProb->size();
   typedef std::vector< Trk::CompetingRIOsOnTrack::AssignmentProb > t_probVec;
-  t_probVec& tProbVec = *(const_cast<t_probVec*>(transObj->m_assignProb.load()));
+  const t_probVec& tProbVec = *(transObj->m_assignProb);
   for (unsigned int i=0; i<max; i++) {
     if ( tProbVec[i] >= maxAssgnProb) {
       transObj->m_indexMaxAssignProb=i;
@@ -51,6 +52,6 @@ void CompetingRIOsOnTrackCnv_p1::transToPers( const Trk::CompetingRIOsOnTrack *
     EigenHelpers::eigenMatrixToVector(pMat.values, transObj->m_localCovariance, "CompetingRIOsOnTrackCnv_p1");
     persObj->m_localErrorMatrix = toPersistent( &m_errorMxCnv, &pMat, log ); 
 
-    persObj->m_assignProb.assign (transObj->m_assignProb.load()->begin(),
-                                  transObj->m_assignProb.load()->end());
+    persObj->m_assignProb.assign (transObj->m_assignProb->begin(),
+                                  transObj->m_assignProb->end());
 }
diff --git a/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
index 054c88e5d29..1d18904707d 100644
--- a/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
+++ b/Tracking/TrkEventCnv/TrkEventTPCnv/test/CompetingRIOsOnTrackCnv_p1_test.cxx
@@ -30,7 +30,7 @@ public:
                             const std::vector<double>& probs);
   
   virtual unsigned int numberOfContainedROTs() const override
-  { return m_assignProb.load()->size(); }
+  { return m_assignProb->size(); }
 
   virtual const Trk::Surface& associatedSurface() const override
   { std::abort(); }
-- 
GitLab


From 41c338e4c806d285f9e4a8cf516899cd9d44565c Mon Sep 17 00:00:00 2001
From: Xiaohu Sun <xiaohu.sun@cern.ch>
Date: Fri, 8 Mar 2019 15:00:02 +0100
Subject: [PATCH 345/404] update trigger menu ATR-19499

---
 Tools/Tier0ChainTests/test/test_reco_mc16e.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/Tier0ChainTests/test/test_reco_mc16e.sh b/Tools/Tier0ChainTests/test/test_reco_mc16e.sh
index f6ae0bf55b4..df1771ccc85 100755
--- a/Tools/Tier0ChainTests/test/test_reco_mc16e.sh
+++ b/Tools/Tier0ChainTests/test/test_reco_mc16e.sh
@@ -8,7 +8,7 @@
 # art-include: 21.3/Athena
 # art-include: 21.9/Athena
 
-Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC16-SDR-25' --valid 'True' --pileupFinalBunch '6' --numberOfHighPtMinBias '0.2595392' --autoConfiguration 'everything' --numberOfLowPtMinBias '99.2404608' --steering 'doRDO_TRIG' --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000.py' --postInclude 'default:PyJobTransforms/UseFrontier.py' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' "ESDtoAOD:fixedAttrib=[s if \"CONTAINER_SPLITLEVEL = '99'\" not in s else \"\" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib" "RDOtoRDOTrigger:conddb.addOverride(\"/CALO/Ofl/Noise/PileUpNoiseLumi\",\"CALOOflNoisePileUpNoiseLumi-mc15-mu30-dt25ns\")" 'ESDtoAOD:CILMergeAOD.removeItem("xAOD::CaloClusterAuxContainer#CaloCalTopoClustersAux.LATERAL.LONGITUDINAL.SECOND_R.SECOND_LAMBDA.CENTER_MAG.CENTER_LAMBDA.FIRST_ENG_DENS.ENG_FRAC_MAX.ISOLATION.ENG_BAD_CELLS.N_BAD_CELLS.BADLARQ_FRAC.ENG_BAD_HV_CELLS.N_BAD_HV_CELLS.ENG_POS.SIGNIFICANCE.CELL_SIGNIFICANCE.CELL_SIG_SAMPLING.AVG_LAR_Q.AVG_TILE_Q.EM_PROBABILITY.PTD.BadChannelList");CILMergeAOD.add("xAOD::CaloClusterAuxContainer#CaloCalTopoClustersAux.N_BAD_CELLS.ENG_BAD_CELLS.BADLARQ_FRAC.AVG_TILE_Q.AVG_LAR_Q.CENTER_MAG.ENG_POS.CENTER_LAMBDA.SECOND_LAMBDA.SECOND_R.ISOLATION.EM_PROBABILITY");StreamAOD.ItemList=CILMergeAOD()' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)' 'ESDtoAOD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet.set_Value_and_Lock("AODSLIM");' --triggerConfig 'RDOtoRDOTrigger=MCRECO:DBF:TRIGGERDBMC:2232,86,278' --geometryVersion 'default:ATLAS-R2-2016-01-00-01' --numberOfCavernBkg '0' --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/\* --maxEvents=100 --outputAODFile=myAOD.pool.root --outputRDOFile=myRDO.pool.root --outputESDFile=myESD.pool.root --outputTAGFile=myTAG.root --runNumber=410000 --jobNumber=1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/\* --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/\*
+Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC16-SDR-25' --valid 'True' --pileupFinalBunch '6' --numberOfHighPtMinBias '0.2595392' --autoConfiguration 'everything' --numberOfLowPtMinBias '99.2404608' --steering 'doRDO_TRIG' --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000.py' --postInclude 'default:PyJobTransforms/UseFrontier.py' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' "ESDtoAOD:fixedAttrib=[s if \"CONTAINER_SPLITLEVEL = '99'\" not in s else \"\" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib" "RDOtoRDOTrigger:conddb.addOverride(\"/CALO/Ofl/Noise/PileUpNoiseLumi\",\"CALOOflNoisePileUpNoiseLumi-mc15-mu30-dt25ns\")" 'ESDtoAOD:CILMergeAOD.removeItem("xAOD::CaloClusterAuxContainer#CaloCalTopoClustersAux.LATERAL.LONGITUDINAL.SECOND_R.SECOND_LAMBDA.CENTER_MAG.CENTER_LAMBDA.FIRST_ENG_DENS.ENG_FRAC_MAX.ISOLATION.ENG_BAD_CELLS.N_BAD_CELLS.BADLARQ_FRAC.ENG_BAD_HV_CELLS.N_BAD_HV_CELLS.ENG_POS.SIGNIFICANCE.CELL_SIGNIFICANCE.CELL_SIG_SAMPLING.AVG_LAR_Q.AVG_TILE_Q.EM_PROBABILITY.PTD.BadChannelList");CILMergeAOD.add("xAOD::CaloClusterAuxContainer#CaloCalTopoClustersAux.N_BAD_CELLS.ENG_BAD_CELLS.BADLARQ_FRAC.AVG_TILE_Q.AVG_LAR_Q.CENTER_MAG.ENG_POS.CENTER_LAMBDA.SECOND_LAMBDA.SECOND_R.ISOLATION.EM_PROBABILITY");StreamAOD.ItemList=CILMergeAOD()' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True); from LArDigitization.LArDigitizationFlags import jobproperties;jobproperties.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(False)' 'ESDtoAOD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet.set_Value_and_Lock("AODSLIM");' --triggerConfig 'RDOtoRDOTrigger=MCRECO:Physics_pp_v7_primaries' --geometryVersion 'default:ATLAS-R2-2016-01-00-01' --numberOfCavernBkg '0' --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/\* --maxEvents=100 --outputAODFile=myAOD.pool.root --outputRDOFile=myRDO.pool.root --outputESDFile=myESD.pool.root --outputTAGFile=myTAG.root --runNumber=410000 --jobNumber=1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/\* --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/\*
 
 echo "art-result: $? Reco"
 
-- 
GitLab


From 26ee054d584a43f97b9ab01fb272b91b8ac088b4 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 8 Mar 2019 14:02:09 +0000
Subject: [PATCH 346/404] Add ATLAS_CHECK_THREAD_SAFETY to SCT_GeoModel package

---
 .../InDetDetDescr/SCT_GeoModel/README         |   0
 .../SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY    |   1 +
 .../SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h    |  15 +--
 .../SCT_GeoModel/SCT_BarrelModuleParameters.h |   4 +-
 .../SCT_GeoModel/SCT_BarrelParameters.h       |   4 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h   |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h     |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h  |   7 +-
 .../SCT_GeoModel/SCT_ComponentFactory.h       |  46 ++++----
 .../SCT_GeoModel/SCT_CoolingBlock.h           |   7 +-
 .../SCT_GeoModel/SCT_CoolingEnd.h             |   9 +-
 .../SCT_GeoModel/SCT_CoolingPipe.h            |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h  |  20 +---
 .../SCT_GeoModel/SCT_DetectorFactory.h        |   8 +-
 .../SCT_GeoModel/SCT_DetectorFactoryCosmic.h  |   0
 .../SCT_GeoModel/SCT_DetectorTool.h           |   0
 .../SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h    |   7 +-
 .../SCT_GeoModel/SCT_FSIEndJewel.h            |   7 +-
 .../SCT_GeoModel/SCT_FSIFibreMask.h           |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h |   0
 .../SCT_GeoModel/SCT_FSIScorpion.h            |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Flange.h    |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Forward.h   |  13 ++-
 .../SCT_ForwardModuleParameters.h             |   4 +-
 .../SCT_GeoModel/SCT_ForwardParameters.h      |   7 +-
 .../SCT_GeoModel/SCT_FwdCoolingBlock.h        |   7 +-
 .../SCT_GeoModel/SCT_FwdCoolingPipe.h         |   8 +-
 .../SCT_GeoModel/SCT_FwdCylinderServices.h    |   7 +-
 .../SCT_GeoModel/SCT_FwdDiscFixation.h        |   7 +-
 .../SCT_GeoModel/SCT_FwdDiscPowerTape.h       |   7 +-
 .../SCT_GeoModel/SCT_FwdDiscSupport.h         |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h    |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h |  19 ++--
 .../SCT_GeoModel/SCT_FwdModuleConnector.h     |   7 +-
 .../SCT_GeoModel/SCT_FwdOptoHarness.h         |   7 +-
 .../SCT_GeoModel/SCT_FwdPPConnector.h         |   7 +-
 .../SCT_GeoModel/SCT_FwdPPCooling.h           |   7 +-
 .../SCT_GeoModel/SCT_FwdPatchPanel.h          |   7 +-
 .../SCT_GeoModel/SCT_FwdPowerTape.h           |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h   |  13 ++-
 .../SCT_GeoModel/SCT_FwdRingCooling.h         |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h |  11 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h  |   7 +-
 .../SCT_GeoModel/SCT_FwdSubSpine.h            |   7 +-
 .../SCT_GeoModel/SCT_FwdSupportFrame.h        |   7 +-
 .../SCT_FwdThermalShieldElement.h             |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h  |  29 ++---
 .../SCT_GeoModel/SCT_GeneralParameters.h      |   4 +-
 .../SCT_GeoModel/SCT_GeometryManager.h        |  26 +++--
 .../SCT_GeoModel/SCT_GeoModel/SCT_Harness.h   |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h    |   7 +-
 .../SCT_GeoModel/SCT_Identifier.h             |  20 ++--
 .../SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h |  13 ++-
 .../SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Layer.h     |  35 +++---
 .../SCT_GeoModel/SCT_MaterialManager.h        |  24 ++--
 .../SCT_GeoModel/SCT_GeoModel/SCT_Module.h    |  19 ++--
 .../SCT_GeoModel/SCT_GeoModel/SCT_Options.h   |   0
 .../SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h |  13 ++-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h   |   7 +-
 .../SCT_GeoModel/SCT_PixelAttachment.h        |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h    |  11 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Ski.h       |  29 ++---
 .../SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h    |  34 +++---
 .../SCT_GeoModel/SCT_SkiPowerTape.h           |   7 +-
 .../SCT_GeoModel/SCT_GeoModel/SCT_Spider.h    |   7 +-
 .../SCT_GeoModel/SCT_SupportCyl.h             |   7 +-
 .../SCT_GeoModel/src/SCT_Barrel.cxx           |  57 +++++-----
 .../src/SCT_BarrelModuleParameters.cxx        |   6 +-
 .../SCT_GeoModel/src/SCT_BarrelParameters.cxx |   6 +-
 .../SCT_GeoModel/src/SCT_BaseBoard.cxx        |  17 +--
 .../SCT_GeoModel/src/SCT_Bracket.cxx          |  17 +--
 .../SCT_GeoModel/src/SCT_Clamp.cxx            |  18 +--
 .../SCT_GeoModel/src/SCT_CloseOut.cxx         |  15 ++-
 .../SCT_GeoModel/src/SCT_ComponentFactory.cxx |  34 ++----
 .../SCT_GeoModel/src/SCT_CoolingBlock.cxx     |  15 +--
 .../SCT_GeoModel/src/SCT_CoolingEnd.cxx       |  18 +--
 .../SCT_GeoModel/src/SCT_CoolingPipe.cxx      |  18 +--
 .../SCT_GeoModel/src/SCT_DataBase.cxx         |  43 ++-----
 .../SCT_GeoModel/src/SCT_DetectorFactory.cxx  |  49 +++-----
 .../SCT_GeoModel/src/SCT_DetectorTool.cxx     |  10 +-
 .../SCT_GeoModel/src/SCT_Dogleg.cxx           |  16 +--
 .../SCT_GeoModel/src/SCT_FSIEndJewel.cxx      |  19 ++--
 .../SCT_GeoModel/src/SCT_FSIFibreMask.cxx     |  20 ++--
 .../SCT_GeoModel/src/SCT_FSIHelper.cxx        |   0
 .../SCT_GeoModel/src/SCT_FSIScorpion.cxx      |  22 ++--
 .../SCT_GeoModel/src/SCT_Flange.cxx           |  18 +--
 .../SCT_GeoModel/src/SCT_Forward.cxx          |  46 ++++----
 .../src/SCT_ForwardModuleParameters.cxx       |   6 +-
 .../src/SCT_ForwardParameters.cxx             |  20 +---
 .../SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx  |  19 ++--
 .../SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx   |  19 ++--
 .../src/SCT_FwdCylinderServices.cxx           |  52 ++++-----
 .../SCT_GeoModel/src/SCT_FwdDiscFixation.cxx  |  16 +--
 .../SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx |  17 +--
 .../SCT_GeoModel/src/SCT_FwdDiscSupport.cxx   |  18 +--
 .../SCT_GeoModel/src/SCT_FwdFSI.cxx           |  16 +--
 .../SCT_GeoModel/src/SCT_FwdHybrid.cxx        |  18 +--
 .../SCT_GeoModel/src/SCT_FwdModule.cxx        |  43 ++++---
 .../src/SCT_FwdModuleConnector.cxx            |  17 +--
 .../SCT_GeoModel/src/SCT_FwdOptoHarness.cxx   |  16 +--
 .../SCT_GeoModel/src/SCT_FwdPPConnector.cxx   |  16 +--
 .../SCT_GeoModel/src/SCT_FwdPPCooling.cxx     |  16 +--
 .../SCT_GeoModel/src/SCT_FwdPatchPanel.cxx    |  17 +--
 .../SCT_GeoModel/src/SCT_FwdPowerTape.cxx     |  18 +--
 .../SCT_GeoModel/src/SCT_FwdRing.cxx          |  41 ++++---
 .../SCT_GeoModel/src/SCT_FwdRingCooling.cxx   |  16 +--
 .../SCT_GeoModel/src/SCT_FwdSensor.cxx        |  33 +++---
 .../SCT_GeoModel/src/SCT_FwdSpine.cxx         |  18 +--
 .../SCT_GeoModel/src/SCT_FwdSubSpine.cxx      |  17 +--
 .../SCT_GeoModel/src/SCT_FwdSupportFrame.cxx  |  17 +--
 .../src/SCT_FwdThermalShieldElement.cxx       |  18 +--
 .../SCT_GeoModel/src/SCT_FwdWheel.cxx         |  65 ++++++-----
 .../src/SCT_GeneralParameters.cxx             |   6 +-
 .../SCT_GeoModel/src/SCT_GeometryManager.cxx  | 106 +++++++-----------
 .../SCT_GeoModel/src/SCT_Harness.cxx          |  23 ++--
 .../SCT_GeoModel/src/SCT_Hybrid.cxx           |  15 +--
 .../SCT_GeoModel/src/SCT_Identifier.cxx       |   8 +-
 .../SCT_GeoModel/src/SCT_InnerSide.cxx        |  23 ++--
 .../SCT_GeoModel/src/SCT_InterLink.cxx        |  26 ++---
 .../SCT_GeoModel/src/SCT_Layer.cxx            |  81 +++++++------
 .../SCT_GeoModel/src/SCT_MaterialManager.cxx  |  74 ++++--------
 .../SCT_GeoModel/src/SCT_Module.cxx           |  36 +++---
 .../SCT_GeoModel/src/SCT_OuterSide.cxx        |  25 +++--
 .../SCT_GeoModel/src/SCT_Pigtail.cxx          |  15 +--
 .../SCT_GeoModel/src/SCT_PixelAttachment.cxx  |  15 +--
 .../SCT_GeoModel/src/SCT_PowerTape.cxx        |  18 +--
 .../SCT_GeoModel/src/SCT_Sensor.cxx           |  34 +++---
 .../SCT_GeoModel/src/SCT_Ski.cxx              |  35 +++---
 .../SCT_GeoModel/src/SCT_SkiAux.cxx           |  23 ++--
 .../SCT_GeoModel/src/SCT_SkiPowerTape.cxx     |  22 ++--
 .../SCT_GeoModel/src/SCT_Spider.cxx           |  17 +--
 .../SCT_GeoModel/src/SCT_SupportCyl.cxx       |  20 ++--
 136 files changed, 1228 insertions(+), 1132 deletions(-)
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/README
 create mode 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx
 mode change 100755 => 100644 InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx

diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/README b/InnerDetector/InDetDetDescr/SCT_GeoModel/README
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..1b1dbc1b881
--- /dev/null
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDetDescr/SCT_GeoModel
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h
old mode 100755
new mode 100644
index 496da203672..8a58255181f
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Barrel.h
@@ -1,12 +1,11 @@
 /*
-  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_GEOMODEL_SCT_BARREL_H
 #define SCT_GEOMODEL_SCT_BARREL_H
 
 #include "SCT_GeoModel/SCT_ComponentFactory.h"
-#include "AthenaKernel/MsgStreamMember.h"
 
 class GeoVPhysVol;
 class GeoFullPhysVol;
@@ -17,8 +16,11 @@ class SCT_Barrel : public SCT_UniqueComponentFactory
 {
 
 public:
-  SCT_Barrel(const std::string & name);
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  SCT_Barrel(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
 public:
   int    numLayers()   const {return m_numLayers;}
@@ -26,9 +28,6 @@ public:
   double outerRadius() const {return m_outerRadius;}
   double length()      const {return m_length;}
  
-  MsgStream& msg( MSG::Level lvl ) const { return m_msg << lvl; }
-  bool msgLvl( MSG::Level lvl ) { return m_msg.get().level() <= lvl; }
-
 private:
   void getParameters();
   virtual const GeoLogVol * preBuild();
@@ -49,8 +48,6 @@ private:
 
   bool   m_isOldGeometry;
 
-  mutable Athena::MsgStreamMember m_msg;
-
 };
 
 #endif // SCT_GEOMODEL_SCT_BARREL_H
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h
old mode 100755
new mode 100644
index 7b40a6ffa3c..09b6190c4a1
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelModuleParameters.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 SCT_GeoModel_SCT_BarrelModuleParameters_H
@@ -14,7 +14,7 @@ class SCT_BarrelModuleParameters {
 public:
 
   // Constructor 
-  SCT_BarrelModuleParameters();
+  SCT_BarrelModuleParameters(SCT_DataBase* rdb);
 
   // Sensors
   double sensorThickness() const;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h
old mode 100755
new mode 100644
index 111dbe08b81..8ffb7388380
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BarrelParameters.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 SCT_GeoModel_SCT_BarrelParameters_H
@@ -14,7 +14,7 @@ class SCT_BarrelParameters {
 public:
 
   // Constructor 
-  SCT_BarrelParameters();
+  SCT_BarrelParameters(SCT_DataBase* rdb);
 
   // Ski
   int    skiFirstStagger() const;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h
old mode 100755
new mode 100644
index 42b689d5be7..ddd2d08c060
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_BaseBoard.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 SCT_GEOMODEL_SCT_BaseBoard_H
@@ -15,7 +15,10 @@ class GeoVPhysVol;
 class SCT_BaseBoard: public SCT_SharedComponentFactory
 {
 public:
-  SCT_BaseBoard(const std::string & name);
+  SCT_BaseBoard(const std::string & name,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h
old mode 100755
new mode 100644
index 73057d438ab..2ccd94be4c7
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Bracket.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 SCT_GEOMODEL_SCT_BRACKET_H
@@ -18,7 +18,10 @@ class SCT_Bracket: public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_Bracket(const std::string & name);
+  SCT_Bracket(const std::string & name,
+              InDetDD::SCT_DetectorManager* detectorManager,
+              const SCT_GeometryManager* geometryManager,
+              SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h
old mode 100755
new mode 100644
index 78cb9c51599..2421ff0a773
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Clamp.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 SCT_GEOMODEL_SCT_CLAMP_H
@@ -16,7 +16,10 @@ class SCT_Clamp : public SCT_SharedComponentFactory
 
 public:
   SCT_Clamp(const std::string & name, int iLayer,
-                  double innerRadius);
+            double innerRadius,
+            InDetDD::SCT_DetectorManager* detectorManager,
+            const SCT_GeometryManager* geometryManager,
+            SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h
old mode 100755
new mode 100644
index 4586a5856ba..289d27f1891
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CloseOut.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 SCT_GEOMODEL_SCT_CLOSEOUT_H
@@ -14,7 +14,10 @@ class SCT_CloseOut : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_CloseOut(const std::string & name, int iLayer);
+  SCT_CloseOut(const std::string & name, int iLayer,
+               InDetDD::SCT_DetectorManager* detectorManager,
+               const SCT_GeometryManager* geometryManager,
+               SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h
old mode 100755
new mode 100644
index a87f6f9f5c1..cb3a123995b
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ComponentFactory.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 SCT_GEOMODEL_SCT_COMPONENTFACTORY_H
@@ -10,6 +10,7 @@
 
 namespace InDetDD{class SCT_DetectorManager;}
 class SCT_GeometryManager;
+class SCT_MaterialManager;
 
 class GeoLogVol;
 class GeoVPhysVol;
@@ -19,30 +20,27 @@ class SCT_ComponentFactory
 {
 
 public:
-  SCT_ComponentFactory(const std::string & name);
+  SCT_ComponentFactory(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials);
 
   const std::string & getName() const {return m_name;}
 
-  static void setDetectorManager(InDetDD::SCT_DetectorManager * manager);
-  static void setGeometryManager(SCT_GeometryManager * manager);
- 
   // utility function to covert int to string
-  static std::string intToString(int i);
+  std::string intToString(int i) const;
 
 protected: 
-  InDetDD::SCT_DetectorManager * detectorManager() const {return s_detectorManager;}
-  const SCT_GeometryManager * geometryManager() const {return s_geometryManager;}
+  InDetDD::SCT_DetectorManager* m_detectorManager;
+  const SCT_GeometryManager* m_geometryManager;
+  SCT_MaterialManager* m_materials;
 
   double epsilon() const;
-
   virtual ~SCT_ComponentFactory();
 
 private:
   std::string m_name;
-  static double s_epsilon;
-
-  static InDetDD::SCT_DetectorManager* s_detectorManager;
-  static const SCT_GeometryManager* s_geometryManager;
+  const static double s_epsilon;
 
 };
 
@@ -51,12 +49,15 @@ class SCT_SharedComponentFactory : public SCT_ComponentFactory
 {
 
 public:
-  SCT_SharedComponentFactory(const std::string & name) : 
-    SCT_ComponentFactory(name), 
-    m_physVolume(0) 
+  SCT_SharedComponentFactory(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials=nullptr) :
+    SCT_ComponentFactory(name, detectorManager, geometryManager, materials),
+    m_physVolume(nullptr)
   {};
   
-  GeoVPhysVol * getVolume() const {return  m_physVolume;}
+  GeoVPhysVol * getVolume() {return  m_physVolume;}
 
 protected:
   GeoVPhysVol * m_physVolume;
@@ -68,12 +69,15 @@ class SCT_UniqueComponentFactory : public SCT_ComponentFactory
 {
 
 public:
-  SCT_UniqueComponentFactory(const std::string & name) : 
-    SCT_ComponentFactory(name),
-    m_logVolume(0)
+  SCT_UniqueComponentFactory(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials=nullptr) :
+    SCT_ComponentFactory(name, detectorManager, geometryManager, materials),
+    m_logVolume{nullptr}
   {};
 
-  virtual GeoVPhysVol * build(SCT_Identifier id) const = 0;
+  virtual GeoVPhysVol * build(SCT_Identifier id) = 0;
 
 protected:
   const GeoLogVol * m_logVolume;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h
old mode 100755
new mode 100644
index 65612b0e06f..6ddfa222eb6
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingBlock.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 SCT_GEOMODEL_SCT_COOLINGBLOCK_H
@@ -18,7 +18,10 @@ class SCT_CoolingBlock: public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_CoolingBlock(const std::string & name);
+  SCT_CoolingBlock(const std::string & name,
+                   InDetDD::SCT_DetectorManager* detectorManager,
+                   const SCT_GeometryManager* geometryManager,
+                   SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h
old mode 100755
new mode 100644
index c089f8564d3..8de3939bedf
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingEnd.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 SCT_GEOMODEL_SCT_COOLINGEND_H
@@ -16,8 +16,11 @@ class SCT_CoolingEnd : public SCT_SharedComponentFactory
 
 public:
   SCT_CoolingEnd(const std::string & name, int iLayer,
-		   double innerRadius,
-		   double length);
+                 double innerRadius,
+                 double length,
+                 InDetDD::SCT_DetectorManager* detectorManager,
+                 const SCT_GeometryManager* geometryManager,
+                 SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h
old mode 100755
new mode 100644
index f538c271cd6..58194f645c8
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_CoolingPipe.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 SCT_GEOMODEL_SCT_COOLINGPIPE_H
@@ -18,7 +18,10 @@ class SCT_CoolingPipe: public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_CoolingPipe(const std::string & name, double length);
+  SCT_CoolingPipe(const std::string & name, double length,
+                  InDetDD::SCT_DetectorManager* detectorManager,
+                  const SCT_GeometryManager* geometryManager,
+                  SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
old mode 100755
new mode 100644
index 933087e161a..c1c561ef67e
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DataBase.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 SCT_GeoModel_SCT_DataBase_H
@@ -18,18 +18,9 @@ class SCT_DataBase
   
 public:
 
-  // Get pointer to singleton instance.
-  static SCT_DataBase * instance();
+  SCT_DataBase(const SCT_GeoModelAthenaComps* athenaComps);
 
-  // Delete instance
-  static void reinit();
-  
-  // Access to athena components
-  static void setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps);
-  const SCT_GeoModelAthenaComps * athenaComps() const;
-
-
-  //const IRDBRecord* atls() const;  
+  const SCT_GeoModelAthenaComps* athenaComps() const;
 
   IRDBRecordset_ptr weightTable() const;
   IRDBRecordset_ptr scalingTable() const;
@@ -103,15 +94,12 @@ public:
 
 private:
   
-  // Singleton - Constructor is private
-  SCT_DataBase();
   SCT_DataBase(const SCT_DataBase &);
   SCT_DataBase& operator= (const SCT_DataBase &);
 
 private:
 
-  static SCT_DataBase * s_instance;
-  static const SCT_GeoModelAthenaComps * s_athenaComps;
+  const SCT_GeoModelAthenaComps* m_athenaComps;
 
   std::string m_sctVersionTag;
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
old mode 100755
new mode 100644
index 822cea24a08..b6aac2cc9fc
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactory.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 SCT_GEOMODEL_SCT_DETECTORFACTORY_H 
@@ -10,9 +10,11 @@
 #include "InDetReadoutGeometry/InDetDD_Defs.h"
 
 class GeoPhysVol;
+class SCT_DataBase;
 class SCT_GeometryManager;
-class SCT_Options;
 class SCT_GeoModelAthenaComps;
+class SCT_MaterialManager;
+class SCT_Options;
 
 class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase  
 { 
@@ -38,6 +40,8 @@ class SCT_DetectorFactory : public InDetDD::DetectorFactoryBase
 
   InDetDD::SCT_DetectorManager *m_detectorManager;
   SCT_GeometryManager *m_geometryManager;
+  SCT_DataBase* m_db;
+  SCT_MaterialManager* m_materials;
   bool m_useDynamicAlignFolders;
 
 }; 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorFactoryCosmic.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_DetectorTool.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h
old mode 100755
new mode 100644
index 567c8d1c28d..1a29840ec84
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Dogleg.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,7 +21,10 @@ class SCT_Dogleg: public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_Dogleg(const std::string & name);
+  SCT_Dogleg(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h
old mode 100755
new mode 100644
index 7c437e90042..5a447e11670
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIEndJewel.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 SCT_GEOMODEL_SCT_FSIENDJEWEL_H
@@ -15,7 +15,10 @@ class SCT_FSIEndJewel : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FSIEndJewel(const std::string & name);
+  SCT_FSIEndJewel(const std::string & name,
+                  InDetDD::SCT_DetectorManager* detectorManager,
+                  const SCT_GeometryManager* geometryManager,
+                  SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h
old mode 100755
new mode 100644
index 63da137bdd6..56e5a945d8d
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIFibreMask.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 SCT_GEOMODEL_SCT_FSIFIBREMASK_H
@@ -15,7 +15,10 @@ class SCT_FSIFibreMask : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FSIFibreMask(const std::string & name, int iLayer, double length);
+  SCT_FSIFibreMask(const std::string & name, int iLayer, double length,
+                   InDetDD::SCT_DetectorManager* detectorManager,
+                   const SCT_GeometryManager* geometryManager,
+                   SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIHelper.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h
old mode 100755
new mode 100644
index ea18db3ca22..34fcf7a5426
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FSIScorpion.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 SCT_GEOMODEL_SCT_FSISCORPION_H
@@ -15,7 +15,10 @@ class SCT_FSIScorpion : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FSIScorpion(const std::string & name);
+  SCT_FSIScorpion(const std::string & name,
+                  InDetDD::SCT_DetectorManager* detectorManager,
+                  const SCT_GeometryManager* geometryManager,
+                  SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h
old mode 100755
new mode 100644
index 26b55e5a561..5d231a3e326
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Flange.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 SCT_GEOMODEL_SCT_FLANGE_H
@@ -15,7 +15,10 @@ class SCT_Flange : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_Flange(const std::string & name, int iLayer);
+  SCT_Flange(const std::string & name, int iLayer,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h
old mode 100755
new mode 100644
index 4c2934a7785..b515a77cbd5
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Forward.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 SCT_GEOMODEL_SCT_FORWARD_H
@@ -17,7 +17,10 @@ class SCT_Forward : public SCT_UniqueComponentFactory
 
 public:
   
-  SCT_Forward(const std::string & name, int ec);
+  SCT_Forward(const std::string & name, int ec,
+              InDetDD::SCT_DetectorManager* detectorManager,
+              const SCT_GeometryManager* geometryManager,
+              SCT_MaterialManager* materials);
   ~SCT_Forward();
 
   //
@@ -40,7 +43,7 @@ public:
   double length() const {return m_length;}
   double zCenter() const {return 0.5*(m_zMin+m_zMax);}
 
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
 
  
@@ -66,9 +69,9 @@ private:
   double m_outerRadiusCylinderServices;
 
   // Child detector elements
-  std::vector <const SCT_FwdWheel *> m_wheels;
+  std::vector <SCT_FwdWheel *> m_wheels;
 
-  std::vector <const SCT_FwdModule *> m_modules;
+  std::vector <SCT_FwdModule *> m_modules;
   
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h
old mode 100755
new mode 100644
index 6f90aa29f50..c442145313a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardModuleParameters.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 SCT_GeoModel_SCT_ForwardModuleParameters_H
@@ -14,7 +14,7 @@ class SCT_ForwardModuleParameters {
 public:
 
   // Constructor 
-  SCT_ForwardModuleParameters();
+  SCT_ForwardModuleParameters(SCT_DataBase* rdb);
 
   // Sensor
   // For Inner module there is only one sensor,
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h
old mode 100755
new mode 100644
index a438c565917..130c7146b4a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_ForwardParameters.h
@@ -1,10 +1,11 @@
 /*
-  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_GeoModel_SCT_ForwardParameters_H
 #define SCT_GeoModel_SCT_ForwardParameters_H
 
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -17,7 +18,7 @@ class SCT_ForwardParameters {
 public:
 
   // Constructor and destructor 
-  SCT_ForwardParameters();
+  SCT_ForwardParameters(SCT_DataBase* rdb);
   ~SCT_ForwardParameters();
 
   //////////////////////////////////////////////////////////////////////////////
@@ -181,7 +182,7 @@ private:
 
   SCT_DataBase * m_rdb;
 
-  mutable FSIHelper * m_fsiHelper;
+  std::unique_ptr<FSIHelper> m_fsiHelper;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h
old mode 100755
new mode 100644
index 14b7c5608c7..bac694eab7e
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingBlock.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 SCT_GEOMODEL_SCT_FWDCOOLINGBLOCK_H
@@ -19,7 +19,10 @@ class SCT_FwdCoolingBlock: public SCT_SharedComponentFactory
 
 
 public:
-  SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary);
+  SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary,
+                      InDetDD::SCT_DetectorManager* detectorManager,
+                      const SCT_GeometryManager* geometryManager,
+                      SCT_MaterialManager* materials);
 
   enum types {UPPER = 1,
 	      LOWER = -1,
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h
old mode 100755
new mode 100644
index 311bcf19091..cef91098760
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCoolingPipe.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 SCT_GEOMODEL_SCT_FWDCOOLINGPIPE_H
@@ -19,8 +19,10 @@ public:
 		     int numPipes, 
 		     double innerRadius, 
 		     double startPos, 
-		     double endPos);
-
+		     double endPos,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials);
 
   const GeoMaterial * material() const {return m_material;}
   double pipeRadius()  const {return m_pipeRadius;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h
old mode 100755
new mode 100644
index 7e655f575cb..0766a478aa8
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdCylinderServices.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 SCT_GEOMODEL_SCT_FWDCYLINDERSERVICES_H
@@ -14,7 +14,10 @@ class SCT_FwdCylinderServices : public SCT_SharedComponentFactory
 
 public:
   
-  SCT_FwdCylinderServices(const std::string & name, double rmin, double rmax, double length);
+  SCT_FwdCylinderServices(const std::string & name, double rmin, double rmax, double length,
+                          InDetDD::SCT_DetectorManager* detectorManager,
+                          const SCT_GeometryManager* geometryManager,
+                          SCT_MaterialManager* materials);
   ~SCT_FwdCylinderServices();
 
   //
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h
old mode 100755
new mode 100644
index 8df7a7246f7..d760b498291
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscFixation.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 SCT_GEOMODEL_SCT_FWDDISCFIXATION_H
@@ -13,7 +13,10 @@ class SCT_FwdDiscFixation : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdDiscFixation(const std::string & name);
+  SCT_FwdDiscFixation(const std::string & name,
+                      InDetDD::SCT_DetectorManager* detectorManager,
+                      const SCT_GeometryManager* geometryManager,
+                      SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h
old mode 100755
new mode 100644
index 94bdedc770c..15d6461cd3a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscPowerTape.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 SCT_GEOMODEL_SCT_FWDDISCPOWERTAPE_H
@@ -13,7 +13,10 @@ class SCT_FwdDiscPowerTape : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdDiscPowerTape(const std::string & name, int iRing);
+  SCT_FwdDiscPowerTape(const std::string & name, int iRing,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h
old mode 100755
new mode 100644
index 97b6c4b80a1..7867f6acea9
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdDiscSupport.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 SCT_GEOMODEL_SCT_FWDDISCSUPPORT_H
@@ -13,7 +13,10 @@ class SCT_FwdDiscSupport : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdDiscSupport(const std::string & name, int iWheel);
+  SCT_FwdDiscSupport(const std::string & name, int iWheel,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h
old mode 100755
new mode 100644
index 4f4b933ed71..c2c6a72f9ae
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdFSI.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 SCT_GEOMODEL_SCT_FWDFSI_H
@@ -13,7 +13,10 @@ class SCT_FwdFSI : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdFSI(const std::string & name, int type);
+  SCT_FwdFSI(const std::string & name, int type,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h
old mode 100755
new mode 100644
index db0069b7b6c..f9fe308161a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdHybrid.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 SCT_GEOMODEL_SCT_FWDHYBRID_H
@@ -15,7 +15,10 @@ class GeoVPhysVol;
 class SCT_FwdHybrid : public SCT_SharedComponentFactory
 {
 public:
-  SCT_FwdHybrid(const std::string & name, int ringType);
+  SCT_FwdHybrid(const std::string & name, int ringType,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
 
 public:
   //int hybridPart() const {return m_hybridPart;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h
old mode 100755
new mode 100644
index 26c974a01e1..5b2db9aa7df
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModule.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 SCT_GEOMODEL_SCT_FWDMODULE_H
@@ -26,7 +26,10 @@ class SCT_FwdModule : public SCT_UniqueComponentFactory
 {
 public:
 
-  SCT_FwdModule(const std::string & name, int ringType);
+  SCT_FwdModule(const std::string & name, int ringType,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
   ~SCT_FwdModule();
   //explicitly disallow copy, assignment to appease coverity
   SCT_FwdModule(const SCT_FwdModule &) = delete;
@@ -35,7 +38,7 @@ public:
   // Ring type
   int ringType() const {return m_ringType;}
 
-  virtual GeoVPhysVol* build(SCT_Identifier id) const;
+  virtual GeoVPhysVol* build(SCT_Identifier id);
 
   double stereoAngle() const {return m_stereoAngle;}
 
@@ -89,11 +92,11 @@ private:
 public:	  
   // Child detector elements
   SCT_FwdSensor    * m_sensor;
-  const SCT_FwdModuleConnector    * m_connector;
-  const SCT_FwdHybrid    * m_hybrid;
-  const SCT_FwdSpine     * m_spine;
-  const SCT_FwdSubSpine  * m_subspineL;
-  const SCT_FwdSubSpine  * m_subspineR;
+  SCT_FwdModuleConnector    * m_connector;
+  SCT_FwdHybrid    * m_hybrid;
+  SCT_FwdSpine     * m_spine;
+  SCT_FwdSubSpine  * m_subspineL;
+  SCT_FwdSubSpine  * m_subspineR;
 };
     
 #endif //  SCT_GEOMODEL_SCT_FWDMODULE_H
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h
old mode 100755
new mode 100644
index b0645070fb9..728f492541c
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdModuleConnector.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 SCT_GEOMODEL_SCT_FWDMODULECONNECTOR_H
@@ -13,7 +13,10 @@ class SCT_FwdModuleConnector : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdModuleConnector(const std::string & name, int ringType);
+  SCT_FwdModuleConnector(const std::string & name, int ringType,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h
old mode 100755
new mode 100644
index 17b33116b62..39274fc8525
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdOptoHarness.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 SCT_GEOMODEL_SCT_FWDOPTOHARNESS_H
@@ -13,7 +13,10 @@ class SCT_FwdOptoHarness : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdOptoHarness(const std::string & name, int iType);
+  SCT_FwdOptoHarness(const std::string & name, int iType,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h
old mode 100755
new mode 100644
index b1032bb2231..a3ca5e72366
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPConnector.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 SCT_GEOMODEL_SCT_FWDPPCONNECTOR_H
@@ -13,7 +13,10 @@ class SCT_FwdPPConnector : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdPPConnector(const std::string & name);
+  SCT_FwdPPConnector(const std::string & name,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h
old mode 100755
new mode 100644
index 2b931c3a0b5..a9566aea2f0
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPPCooling.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 SCT_GEOMODEL_SCT_FWDPPCOOLING_H
@@ -13,7 +13,10 @@ class SCT_FwdPPCooling : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdPPCooling(const std::string & name);
+  SCT_FwdPPCooling(const std::string & name,
+                   InDetDD::SCT_DetectorManager* detectorManager,
+                   const SCT_GeometryManager* geometryManager,
+                   SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h
old mode 100755
new mode 100644
index 410e6063958..f38de2d5df3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPatchPanel.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 SCT_GEOMODEL_SCT_FWDPATCHPANEL_H
@@ -13,7 +13,10 @@ class SCT_FwdPatchPanel : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdPatchPanel(const std::string & name, int type);
+  SCT_FwdPatchPanel(const std::string & name, int type,
+                    InDetDD::SCT_DetectorManager* detectorManager,
+                    const SCT_GeometryManager* geometryManager,
+                    SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h
old mode 100755
new mode 100644
index aface8df71d..3b8ee4765dd
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdPowerTape.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 SCT_GEOMODEL_SCT_FWDPOWERTAPE_H
@@ -17,7 +17,10 @@ public:
 		  int numModules, 
 		  double innerRadius, 
 		  double startPos, 
-		  double endPos);
+		  double endPos,
+                  InDetDD::SCT_DetectorManager* detectorManager,
+                  const SCT_GeometryManager* geometryManager,
+                  SCT_MaterialManager* materials);
 
 
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h
old mode 100755
new mode 100644
index b5926772fa0..f23a67ff9f3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRing.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 SCT_GEOMODEL_SCT_FWDRING_H
@@ -22,10 +22,13 @@ class SCT_FwdRing : public SCT_UniqueComponentFactory
 
 public:
   SCT_FwdRing(const std::string & name, 
-	      const SCT_FwdModule * module, 
+	      SCT_FwdModule * module, 
 	      int iWheel,
 	      int iRing,
-	      int ec);
+	      int ec,
+              InDetDD::SCT_DetectorManager* detectorManager,
+              const SCT_GeometryManager* geometryManager,
+              SCT_MaterialManager* materials);
 
   ~SCT_FwdRing();
   
@@ -56,7 +59,7 @@ public:
 
   bool discRotated() const {return m_discRotated;}
  
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
   // Child elements
   const SCT_FwdModule* module() const {return m_module;}
@@ -106,7 +109,7 @@ private:
   double m_maxModuleServicesBaseToRingCenter;
 
   // Child detector elements
-  const SCT_FwdModule* m_module;
+  SCT_FwdModule* m_module;
   SCT_FwdCoolingBlock * m_coolingBlockHiMain;
   SCT_FwdCoolingBlock * m_coolingBlockHiSec;
   SCT_FwdCoolingBlock * m_coolingBlockLoMain;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h
old mode 100755
new mode 100644
index 2bce180c6b5..b7398967444
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdRingCooling.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 SCT_GEOMODEL_SCT_FWDRINGCOOLING_H
@@ -13,7 +13,10 @@ class SCT_FwdRingCooling : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdRingCooling(const std::string & name, int ringType);
+  SCT_FwdRingCooling(const std::string & name, int ringType,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h
old mode 100755
new mode 100644
index dfb518719b1..e201263a3d2
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSensor.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 SCT_GEOMODEL_SCT_FWDSENSOR_H
@@ -8,6 +8,7 @@
 
 #include "SCT_GeoModel/SCT_ComponentFactory.h"
 
+#include <atomic>
 #include <string>
 
 // sensor types
@@ -31,7 +32,10 @@ namespace InDetDD{class SiDetectorDesign;}
 class SCT_FwdSensor : public SCT_UniqueComponentFactory
 {
 public:
-  SCT_FwdSensor(const std::string & name, int ringType);
+  SCT_FwdSensor(const std::string & name, int ringType,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
   ~SCT_FwdSensor();
 
   // Ring type
@@ -72,7 +76,7 @@ public:
   double thicknessF()  const {return m_thicknessF;}
 
   
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
   GeoPhysVol * getInactive() {return m_inactive;}
 
@@ -116,6 +120,7 @@ private:
   
   InDetDD::SiDetectorDesign * m_design;
 
+  mutable std::atomic_bool m_noElementWarning;
 };
 
 #endif // SCT_GEOMODEL_SCT_FWDSENSOR_H
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h
old mode 100755
new mode 100644
index 4b53f2e35cc..bfc92c50cb5
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSpine.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 SCT_GEOMODEL_SCT_FWDSPINE_H
@@ -16,7 +16,10 @@ class SCT_FwdSpine : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdSpine(const std::string & name, int ringType);
+  SCT_FwdSpine(const std::string & name, int ringType,
+               InDetDD::SCT_DetectorManager* detectorManager,
+               const SCT_GeometryManager* geometryManager,
+               SCT_MaterialManager* materials);
 
 public:
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h
old mode 100755
new mode 100644
index 504d2047d97..38a01d88278
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSubSpine.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 SCT_GEOMODEL_SCT_FWDSUBSPINE_H 
@@ -20,7 +20,10 @@ class SCT_FwdSubSpine : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdSubSpine(const std::string & name, int ringType, int spineSide);
+  SCT_FwdSubSpine(const std::string & name, int ringType, int spineSide,
+                  InDetDD::SCT_DetectorManager* detectorManager,
+                  const SCT_GeometryManager* geometryManager,
+                  SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h
old mode 100755
new mode 100644
index f7eb1915e2a..b94dfadac58
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdSupportFrame.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 SCT_GEOMODEL_SCT_FWDSUPPORTFRAME_H
@@ -15,7 +15,10 @@ class SCT_FwdSupportFrame : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdSupportFrame(const std::string & name);
+  SCT_FwdSupportFrame(const std::string & name,
+                      InDetDD::SCT_DetectorManager* detectorManager,
+                      const SCT_GeometryManager* geometryManager,
+                      SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h
old mode 100755
new mode 100644
index e71ceb1664a..302539bfbea
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdThermalShieldElement.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 SCT_GEOMODEL_SCT_FWDTHERMALSHIELDELEMENT_H
@@ -15,7 +15,10 @@ class SCT_FwdThermalShieldElement : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_FwdThermalShieldElement(const std::string & name, int iElement);
+  SCT_FwdThermalShieldElement(const std::string & name, int iElement,
+                              InDetDD::SCT_DetectorManager* detectorManager,
+                              const SCT_GeometryManager* geometryManager,
+                              SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h
old mode 100755
new mode 100644
index 706cefb30d2..b1d32198202
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_FwdWheel.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 SCT_GEOMODEL_SCT_FWDWHEEL_H
@@ -27,8 +27,11 @@ class SCT_FwdWheel : public SCT_UniqueComponentFactory
 public:
   SCT_FwdWheel(const std::string & name,
 	       int iWheel,
-	       const std::vector<const SCT_FwdModule *> & modules,
-	       int ec);
+	       const std::vector<SCT_FwdModule *> & modules,
+	       int ec,
+               InDetDD::SCT_DetectorManager* detectorManager,
+               const SCT_GeometryManager* geometryManager,
+               SCT_MaterialManager* materials);
   ~SCT_FwdWheel();
   //Explicitly disallow copy and assignment to appease coverity
   SCT_FwdWheel(const SCT_FwdWheel &) = delete;
@@ -52,7 +55,7 @@ public:
   double outerRadius() const {return m_outerRadius;} 
   int    totalModules() const {return m_totalModules;}
 
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
   
  
 private:
@@ -92,15 +95,15 @@ private:
   double m_safety;
 
   // Child detector elements
-  std::vector<const SCT_FwdRing *>      m_rings;
-  const SCT_FwdDiscSupport *            m_discSupport;
-  std::vector<const SCT_FwdPatchPanel*> m_patchPanel;
-  const SCT_FwdPPConnector*             m_pPConnector;
-  const SCT_FwdPPCooling*               m_pPCooling;
-  std::vector<const SCT_FwdFSI*>        m_fsiType;
-  const SCT_FwdDiscFixation*            m_discFixation;
-
-  const std::vector<const SCT_FwdModule*> & m_modules;
+  std::vector<SCT_FwdRing *>      m_rings;
+  SCT_FwdDiscSupport *            m_discSupport;
+  std::vector<SCT_FwdPatchPanel*> m_patchPanel;
+  SCT_FwdPPConnector*             m_pPConnector;
+  SCT_FwdPPCooling*               m_pPCooling;
+  std::vector<SCT_FwdFSI*>        m_fsiType;
+  SCT_FwdDiscFixation*            m_discFixation;
+
+  const std::vector<SCT_FwdModule*> & m_modules;
 
 
   const std::vector<const FSIDetails *> * m_fsiVector;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h
old mode 100755
new mode 100644
index 922a69f6fce..5a104c6723c
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeneralParameters.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 SCT_GeoModel_SCT_GeneralParameters_H
@@ -17,7 +17,7 @@ class SCT_GeneralParameters {
 
 public:
 
-  SCT_GeneralParameters();
+  SCT_GeneralParameters(SCT_DataBase* rdb);
   ~SCT_GeneralParameters();
   //Explicitly disallow copy, assignment to appease coverity
   SCT_GeneralParameters(const SCT_GeneralParameters &) = delete;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h
old mode 100755
new mode 100644
index 5073f9e6fab..00f34f8ee4a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_GeometryManager.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 SCT_GeoModel_SCT_GeometryManager_H
@@ -7,13 +7,16 @@
 
 #include "SCT_GeoModel/SCT_Options.h"
 
-namespace InDetDD{
+#include <memory>
+
+namespace InDetDD {
   class SiCommonItems;
   class DistortedMaterialManager;
 }
 
 class SCT_BarrelParameters;
 class SCT_BarrelModuleParameters;
+class SCT_DataBase;
 class SCT_ForwardParameters;
 class SCT_ForwardModuleParameters; 
 class SCT_GeneralParameters;
@@ -24,7 +27,7 @@ class SCT_GeometryManager {
 public:
 
   // Constructor 
-  SCT_GeometryManager();
+  SCT_GeometryManager(SCT_DataBase* rdb);
 
   // Destructor 
   ~SCT_GeometryManager();
@@ -35,11 +38,9 @@ public:
 
   // Access to athena components
   const SCT_GeoModelAthenaComps * athenaComps() const;
-  void setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps);
 
   // To be passed to detector element.
-  InDetDD::SiCommonItems * commonItems() const;
-  void setCommonItems(InDetDD::SiCommonItems * commonItems); 
+  const InDetDD::SiCommonItems * commonItems() const;
 
   const SCT_BarrelParameters          * barrelParameters() const;
   const SCT_BarrelModuleParameters    * barrelModuleParameters() const;
@@ -56,13 +57,14 @@ private:
   SCT_Options m_options;
   const SCT_GeoModelAthenaComps * m_athenaComps;
   InDetDD::SiCommonItems * m_commonItems;
+  SCT_DataBase* m_rdb;
  
-  mutable const SCT_BarrelParameters          * m_barrelParameters;
-  mutable const SCT_BarrelModuleParameters    * m_barrelModuleParameters;
-  mutable const SCT_ForwardParameters         * m_forwardParameters;
-  mutable const SCT_ForwardModuleParameters   * m_forwardModuleParameters;
-  mutable const SCT_GeneralParameters         * m_generalParameters;
-  mutable const InDetDD::DistortedMaterialManager  * m_distortedMatManager;
+  std::unique_ptr<SCT_BarrelParameters> m_barrelParameters;
+  std::unique_ptr<SCT_BarrelModuleParameters> m_barrelModuleParameters;
+  std::unique_ptr<SCT_ForwardParameters> m_forwardParameters;
+  std::unique_ptr<SCT_ForwardModuleParameters> m_forwardModuleParameters;
+  std::unique_ptr<SCT_GeneralParameters> m_generalParameters;
+  std::unique_ptr<InDetDD::DistortedMaterialManager> m_distortedMatManager;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h
old mode 100755
new mode 100644
index 06a9b5f2c29..79243c1aae9
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Harness.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 SCT_GEOMODEL_SCT_HARNESS_H
@@ -15,7 +15,10 @@ class SCT_Harness : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_Harness(const std::string & name, double length);
+  SCT_Harness(const std::string & name, double length,
+              InDetDD::SCT_DetectorManager* detectorManager,
+              const SCT_GeometryManager* geometryManager,
+              SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h
old mode 100755
new mode 100644
index 032fdc70867..7046e978bb4
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Hybrid.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 SCT_GEOMODEL_SCT_Hybrid_H
@@ -16,7 +16,10 @@ class SCT_Hybrid: public SCT_SharedComponentFactory
 
 {
 public:
-  SCT_Hybrid(const std::string & name);
+  SCT_Hybrid(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h
old mode 100755
new mode 100644
index c74fad15348..67506281225
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Identifier.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 SCT_GEOMODEL_SCT_IDENTIFIER_H
@@ -12,16 +12,18 @@ class SCT_Identifier
 {
 public:
 
-  SCT_Identifier(int barrelEC = 0,
+  SCT_Identifier(const SCT_ID* idHelper,
+                 int barrelEC = 0,
 		 int layerDisk = 0, 
 		 int phiModule = 0,
 		 int etaModule = 0,
 		 int side = 0)
-    : m_barrelEC(barrelEC), 
-      m_layerDisk(layerDisk), 
-      m_phiModule(phiModule), 
-      m_etaModule(etaModule), 
-      m_side(side)
+    : m_idHelper{idHelper},
+      m_barrelEC{barrelEC},
+      m_layerDisk{layerDisk},
+      m_phiModule{phiModule},
+      m_etaModule{etaModule},
+      m_side{side}
   {};
 
 
@@ -40,20 +42,18 @@ public:
   void setSide(int i) {m_side = i;}
   int  getSide() const {return m_side;}
 
-  static void setIdHelper(const SCT_ID * idHelper) {s_idHelper = idHelper;}
-
   Identifier getWaferId();
 
   // For debugging purposes.
   void print();
 
 private:
+  const SCT_ID* m_idHelper;
   int m_barrelEC;
   int m_layerDisk;
   int m_phiModule;
   int m_etaModule;
   int m_side;
-  static const SCT_ID * s_idHelper;
 };
 
 #endif // SCT_GEOMODEL_SCT_IDENTIFIER_H
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h
old mode 100755
new mode 100644
index fd91a3788d0..72f7065edf6
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InnerSide.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
 */
 
 //
@@ -29,22 +29,25 @@ class SCT_InnerSide: public SCT_UniqueComponentFactory
 {
 public:
 
-  SCT_InnerSide(const std::string & name);
+  SCT_InnerSide(const std::string & name,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
   
   //explicitly disallow copy, assign, to appease coverity
   SCT_InnerSide(const SCT_InnerSide &) = delete;
   SCT_InnerSide & operator=(const SCT_InnerSide &) = delete;
 
   ~SCT_InnerSide();  
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
   
 public:
   double thickness() const {return m_thickness;}
   double width()     const {return m_width;}
   double length()    const {return m_length;}
 
-  GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
-  GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
+  const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
+  const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
   // *** End of modified lines. ------------------ (00)*********************************
 
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h
old mode 100755
new mode 100644
index 620f029b15a..518e168a23b
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_InterLink.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 SCT_GEOMODEL_SCT_INTERLINK_H
@@ -21,7 +21,10 @@ class SCT_InterLink : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_InterLink(const std::string & name);
+  SCT_InterLink(const std::string & name,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
   ~SCT_InterLink();
 
 public:
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h
old mode 100755
new mode 100644
index 8309e864873..e29c3db7980
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Layer.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
 */
 
 //
@@ -37,14 +37,17 @@ class SCT_Layer: public SCT_UniqueComponentFactory
 public:
   SCT_Layer(const std::string & name,
 	    int iLayer,
-	    const SCT_Module * module);
+            SCT_Module * module,
+            InDetDD::SCT_DetectorManager* detectorManager,
+            const SCT_GeometryManager* geometryManager,
+            SCT_MaterialManager* materials);
 
   ~SCT_Layer();
   //Explicitly disallow copy, assign to appease coverity
   SCT_Layer(const SCT_Layer &) = delete;
   SCT_Layer & operator=(const SCT_Layer &) = delete;
 
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
 
 public:
@@ -100,19 +103,19 @@ private:
   double m_phiScorpion;
   double m_zScorpion;
 
-  const SCT_Module       * m_module;
-  const SCT_Ski          * m_ski;
-  const SCT_Clamp        * m_clamp;
-  const SCT_CoolingEnd   * m_coolingEnd;
-  const SCT_Bracket      * m_bracket;
-  const SCT_Harness      * m_harness;
-  const SCT_SkiPowerTape * m_skiPowerTape;
-  const SCT_SkiAux       * m_skiAux;
-  const SCT_Flange       * m_flange;
-  const SCT_SupportCyl   * m_supportCyl;
-  const SCT_FSIEndJewel  * m_endJewel;
-  const SCT_FSIScorpion  * m_scorpion;
-  const SCT_FSIFibreMask * m_fibreMask;
+  SCT_Module       * m_module;
+  SCT_Ski          * m_ski;
+  SCT_Clamp        * m_clamp;
+  SCT_CoolingEnd   * m_coolingEnd;
+  SCT_Bracket      * m_bracket;
+  SCT_Harness      * m_harness;
+  SCT_SkiPowerTape * m_skiPowerTape;
+  SCT_SkiAux       * m_skiAux;
+  SCT_Flange       * m_flange;
+  SCT_SupportCyl   * m_supportCyl;
+  SCT_FSIEndJewel  * m_endJewel;
+  SCT_FSIScorpion  * m_scorpion;
+  SCT_FSIFibreMask * m_fibreMask;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h
old mode 100755
new mode 100644
index 9cdb4ec633d..0bbd85ac9ef
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_MaterialManager.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 SCT_MATERIALMANAGER_H
@@ -7,21 +7,22 @@
 
 // SCT_MaterialManager. This provides an interface to the InDetMaterialManager which in turn
 // is an interface to GeoModel Material Manager with some additional functionality.
+#include "InDetGeoModelUtils/InDetMaterialManager.h"
+
+#include <memory>
+#include <string>
 
 class GeoMaterial;
 class GeoElement;
 class InDetMaterialManager;
-
-#include <string>
+class SCT_DataBase;
 
 class SCT_MaterialManager
 {
 
 public:
 
-  SCT_MaterialManager();
-  
-  static void reinit();
+  SCT_MaterialManager(SCT_DataBase* db);
 
   const GeoMaterial* getMaterial(const std::string & materialName) const;
   const GeoElement* getElement(const std::string & elementName) const;
@@ -31,22 +32,15 @@ public:
 				 const std::string & newName = "");
   const GeoMaterial *getMaterialForVolume(const std::string & materialName, double volume);
 
-
   // Default gas material
   const GeoMaterial* gasMaterial() const;
 
-  // Allow changing gas material. (Will be air if never called)
-  // Will affect all instances. 
-  static void setGasMaterial(const GeoMaterial* material);
-  static void setGasMaterial(const std::string & materialName);
-
-
 private:
   void loadMaterials();
   void addMaterial(GeoMaterial* material);
 
-  static InDetMaterialManager *s_materialManager;
-  static const GeoMaterial* s_gasMaterial;
+  std::unique_ptr<InDetMaterialManager> m_materialManager;
+  const GeoMaterial* m_gasMaterial;
 
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h
old mode 100755
new mode 100644
index cd739b6b249..f34e82b520b
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Module.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 SCT_GEOMODEL_SCT_MODULE_H
@@ -24,14 +24,17 @@ class SCT_Module: public SCT_UniqueComponentFactory
 {
 public:
 
-  SCT_Module(const std::string & name);
+  SCT_Module(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
   ~SCT_Module(); 
   //Explicitly disallow copy, assign to appease coverity
   SCT_Module(const SCT_Module &) = delete;
   SCT_Module & operator=(const SCT_Module &) = delete;
   
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
   
 public:
   double thickness() const {return m_thickness;}
@@ -45,8 +48,8 @@ public:
   double env2Width()     const {return m_env2Width;}
   double env2Length()    const {return m_env2Length;}
 
-  GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
-  GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
+  const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
+  const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
 
   double sensorGap()    const {return m_sensorGap;}
   double stereoInner()  const {return m_stereoInner;}
@@ -91,9 +94,9 @@ private:
   int    m_upperSide;
   double m_safety;
 
-  const SCT_InnerSide * m_innerSide;
-  const SCT_OuterSide * m_outerSide;
-  const SCT_BaseBoard * m_baseBoard;
+  SCT_InnerSide * m_innerSide;
+  SCT_OuterSide * m_outerSide;
+  SCT_BaseBoard * m_baseBoard;
   //const SCT_Sensor          * m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed.
 
   GeoTrf::Transform3D * m_innerSidePos;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Options.h
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h
old mode 100755
new mode 100644
index d3fd0dab877..e8c8840bbdc
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_OuterSide.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 SCT_GEOMODEL_SCT_OUTERSIDE_H
@@ -25,21 +25,24 @@ class SCT_OuterSide: public SCT_UniqueComponentFactory
 {
 public:
 
-  SCT_OuterSide(const std::string & name);
+  SCT_OuterSide(const std::string & name,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
 
   ~SCT_OuterSide(); 
   //Explicitly disallow copy, assign to appease coverity
   SCT_OuterSide(const SCT_OuterSide &) = delete;
   SCT_OuterSide & operator=(const SCT_OuterSide &) = delete;
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
   
 public:
   double thickness() const {return m_thickness;}
   double width()     const {return m_width;}
   double length()    const {return m_length;}
 
-  GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
-  GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
+  const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
+  const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
 
   const SCT_Hybrid       * hybrid() const {return m_hybrid;}
   const SCT_Pigtail      * pigtail()      const {return m_pigtail;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h
old mode 100755
new mode 100644
index a7f8c685f00..7ad7ef872c8
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Pigtail.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 SCT_GEOMODEL_SCT_Pigtail_H
@@ -16,7 +16,10 @@ class SCT_Pigtail: public SCT_SharedComponentFactory
 
 {
 public:
-  SCT_Pigtail(const std::string & name);
+  SCT_Pigtail(const std::string & name,
+              InDetDD::SCT_DetectorManager* detectorManager,
+              const SCT_GeometryManager* geometryManager,
+              SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h
old mode 100755
new mode 100644
index 5a8b6355486..f8470545495
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PixelAttachment.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 SCT_GEOMODEL_SCT_PIXELATTACHMENT_H
@@ -15,7 +15,10 @@ class SCT_PixelAttachment : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_PixelAttachment(const std::string & name);
+  SCT_PixelAttachment(const std::string & name,
+                      InDetDD::SCT_DetectorManager* detectorManager,
+                      const SCT_GeometryManager* geometryManager,
+                      SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h
old mode 100755
new mode 100644
index ce77d46dfe5..6440152146a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_PowerTape.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 SCT_GEOMODEL_SCT_POWERTAPE_H
@@ -18,7 +18,10 @@ class SCT_PowerTape: public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_PowerTape(const std::string & name, double length);
+  SCT_PowerTape(const std::string & name, double length,
+                InDetDD::SCT_DetectorManager* detectorManager,
+                const SCT_GeometryManager* geometryManager,
+                SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h
old mode 100755
new mode 100644
index 735437710d9..d77710e9d46
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Sensor.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 SCT_GEOMODEL_SCT_SENSOR_H
@@ -7,6 +7,7 @@
 
 #include "SCT_GeoModel/SCT_ComponentFactory.h"
 
+#include <atomic>
 #include <string>
 
 class GeoMaterial;
@@ -16,7 +17,10 @@ namespace InDetDD{class SiDetectorDesign;}
 class SCT_Sensor: public SCT_UniqueComponentFactory
 {
 public:
-  SCT_Sensor(const std::string & name);
+  SCT_Sensor(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;} 
@@ -24,7 +28,7 @@ public:
   double width()     const {return m_width;}
   double length()    const {return m_length;}
 
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
   
 private:
   void getParameters();
@@ -38,6 +42,7 @@ private:
   
   InDetDD::SiDetectorDesign * m_design;
 
+  mutable std::atomic_bool m_noElementWarning;
 };
 
 #endif // SCT_GEOMODEL_SCT_SENSOR_H
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h
old mode 100755
new mode 100644
index 63b03561170..01dd72fa0fe
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Ski.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 SCT_GEOMODEL_SCT_SKI_H
@@ -30,13 +30,16 @@ class SCT_Ski: public SCT_UniqueComponentFactory
 {
 public:
   SCT_Ski(const std::string & name,
-		const SCT_Module * module,
-		int stereoSign,
-		double tilt,
- 	        double length);
+          SCT_Module * module,
+          int stereoSign,
+          double tilt,
+          double length,
+          InDetDD::SCT_DetectorManager* detectorManager,
+          const SCT_GeometryManager* geometryManager,
+          SCT_MaterialManager* materials);
 
   ~SCT_Ski();
-  virtual GeoVPhysVol * build(SCT_Identifier id) const;
+  virtual GeoVPhysVol * build(SCT_Identifier id);
 
 public:
   double thickness() const {return m_thickness;}
@@ -57,9 +60,9 @@ public:
   const SCT_CoolingBlock * coolingBlock() const {return m_coolingBlock;}   
   const SCT_CoolingPipe * coolingPipe() const {return m_coolingPipe;}   
 
-  GeoTransform * getRefPointTransform() const {return m_refPointTransform;}
-  GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
-  GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
+  const GeoTransform * getRefPointTransform() const {return m_refPointTransform;}
+  const GeoTrf::Vector3D * env1RefPointVector() const {return m_env1RefPointVector;}
+  const GeoTrf::Vector3D * env2RefPointVector() const {return m_env2RefPointVector;}
   double env1Thickness() const {return m_env1Thickness;}
   double env1Width()     const {return m_env1Width;}
   double env2Thickness() const {return m_env2Thickness;}
@@ -115,10 +118,10 @@ private:
   double m_doglegOffsetX;
   double m_doglegOffsetY;
 
-  const SCT_Module* m_module;
-  const SCT_Dogleg* m_dogleg;
-  const SCT_CoolingBlock* m_coolingBlock;
-  const SCT_CoolingPipe* m_coolingPipe;
+  SCT_Module* m_module;
+  SCT_Dogleg* m_dogleg;
+  SCT_CoolingBlock* m_coolingBlock;
+  SCT_CoolingPipe* m_coolingPipe;
 
   GeoTransform * m_refPointTransform;
   GeoTransform * m_coolingPipePos;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h
old mode 100755
new mode 100644
index 8445a0ccf7a..3985d43a1e1
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiAux.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 SCT_GEOMODEL_SCT_SKIAUX_H
@@ -11,7 +11,6 @@
 
 class SCT_Ski;
 // 14th Aug 2005 S.Mima modified.
-//class SCT_Bracket;
 class SCT_Bracket;
 class SCT_Harness;
 class SCT_SkiPowerTape;
@@ -24,16 +23,17 @@ public:
 
 
   SCT_SkiAux(const std::string & name,
-		   const SCT_Ski * ski,
-		   // 14th Aug 2005 S.Mima modified.
-		   //const SCT_Bracket * bracket,
-		   const SCT_Bracket * bracket,
-		   const SCT_Harness * harness,
-		   const SCT_SkiPowerTape * skiPowerTape,
-		   double innerRadius,
-		   double bracketPhiOffset, 
-		   double powerTapePhiOffset,
-		   double divisionAngle);
+             SCT_Ski * ski,
+             SCT_Bracket * bracket,
+             SCT_Harness * harness,
+             SCT_SkiPowerTape * skiPowerTape,
+             double innerRadius,
+             double bracketPhiOffset, 
+             double powerTapePhiOffset,
+             double divisionAngle,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
   
   //
   // Retrieve basic/derived parameters
@@ -71,12 +71,10 @@ private:
   double m_sectorAngle;
  
   // Child detector elements
-  const SCT_Ski * m_ski;
-  // 14th Aug 2005 S.Mima modified.
-  //  const SCT_Bracket * m_bracket;
-  const SCT_Bracket * m_bracket;
-  const SCT_Harness * m_harness;
-  const SCT_SkiPowerTape * m_skiPowerTape;
+  SCT_Ski * m_ski;
+  SCT_Bracket * m_bracket;
+  SCT_Harness * m_harness;
+  SCT_SkiPowerTape * m_skiPowerTape;
  
 };
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h
old mode 100755
new mode 100644
index c536ca0de7d..1542267f6e0
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SkiPowerTape.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 SCT_GEOMODEL_SCT_SKIPOWERTAPE_H
@@ -18,7 +18,10 @@ public:
 
   SCT_SkiPowerTape(const std::string & name,
 		   const SCT_Ski * ski,
-		   double length);
+		   double length,
+                   InDetDD::SCT_DetectorManager* detectorManager,
+                   const SCT_GeometryManager* geometryManager,
+                   SCT_MaterialManager* materials);
 
   //
   // Methods to return basic and derived parameters. 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h
old mode 100755
new mode 100644
index d8ed217cbed..35bfe08ba79
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_Spider.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 SCT_GEOMODEL_SCT_SPIDER_H
@@ -15,7 +15,10 @@ class SCT_Spider : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_Spider(const std::string & name);
+  SCT_Spider(const std::string & name,
+             InDetDD::SCT_DetectorManager* detectorManager,
+             const SCT_GeometryManager* geometryManager,
+             SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h
old mode 100755
new mode 100644
index 3e8778c558d..2f671952e1a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.h
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/SCT_GeoModel/SCT_SupportCyl.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 SCT_GEOMODEL_SCT_SUPPORTCYL_H
@@ -15,7 +15,10 @@ class SCT_SupportCyl : public SCT_SharedComponentFactory
 {
 
 public:
-  SCT_SupportCyl(const std::string & name, int iLayer, double length);
+  SCT_SupportCyl(const std::string & name, int iLayer, double length,
+                 InDetDD::SCT_DetectorManager* detectorManager,
+                 const SCT_GeometryManager* geometryManager,
+                 SCT_MaterialManager* materials);
 
 public:
   const GeoMaterial * material() const {return m_material;}
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx
old mode 100755
new mode 100644
index f9daf218931..a1177453e4f
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Barrel.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 "SCT_GeoModel/SCT_Barrel.h"
@@ -37,8 +37,11 @@
 
 #include <iostream>
 
-SCT_Barrel::SCT_Barrel(const std::string & name)
-  : SCT_UniqueComponentFactory(name)
+SCT_Barrel::SCT_Barrel(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_logVolume = preBuild();
@@ -48,8 +51,8 @@ SCT_Barrel::SCT_Barrel(const std::string & name)
 void
 SCT_Barrel::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-    
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+  
   m_innerRadius = parameters->barrelInnerRadius();
   m_outerRadius = parameters->barrelOuterRadius();
   m_length =      parameters->barrelLength();
@@ -59,13 +62,13 @@ SCT_Barrel::getParameters()
   m_thermalShieldEndWallThickness = parameters->thermalShieldEndCapThickness();
 
   // Clearannce in z between layer and interlink.
-  m_zClearance = 1*Gaudi::Units::mm;
+  m_zClearance = 1.*Gaudi::Units::mm;
 
   // Layer internal structure and services depend on geometry version
   m_isOldGeometry = parameters->isOldGeometry();
 
   // Set numerology
-  detectorManager()->numerology().setNumLayers(m_numLayers);
+  m_detectorManager->numerology().setNumLayers(m_numLayers);
 
 }
 
@@ -74,30 +77,28 @@ SCT_Barrel::preBuild()
 {
   // Create the barrel volume
   // Tube envelope containing the barrel.
-  SCT_MaterialManager materials;
   const GeoTube * barrelEnvelopeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  GeoLogVol * barrelLog = 
-    new GeoLogVol(getName(), barrelEnvelopeShape, materials.gasMaterial());
+  GeoLogVol * barrelLog = new GeoLogVol(getName(), barrelEnvelopeShape, m_materials->gasMaterial());
   return barrelLog;
 }
 
 GeoVPhysVol * 
-SCT_Barrel::build(SCT_Identifier id) const
+SCT_Barrel::build(SCT_Identifier id)
 {
 
   GeoFullPhysVol * barrel = new GeoFullPhysVol(m_logVolume);
     
   // Old geometries are no longer supported - give up now if one is requested
   if(m_isOldGeometry) {
-    msg(MSG::FATAL) << "Old barrel geometry versions are not supported" << endmsg;
+    std::cout << "SCT_Barrel Old barrel geometry versions are not supported" << std::endl;
     return barrel;
   }
 
   // There is only one type of module. So we create it just the once and pass it to the layers.
-  SCT_Module module("Module");
+  SCT_Module module("Module", m_detectorManager, m_geometryManager, m_materials);
 
   // Create the interlinks
-  SCT_InterLink interLink("InterLink");
+  SCT_InterLink interLink("InterLink", m_detectorManager, m_geometryManager, m_materials);
 
   // Calculte the length of the layer cylinder. This is the barrel length less the thermal 
   // shield and interlink width.
@@ -113,7 +114,7 @@ SCT_Barrel::build(SCT_Identifier id) const
     // Create the layers
 
     layerLength = 0.;
-    SCT_Layer layer("Layer"+intToString(iLayer), iLayer, &module);
+    SCT_Layer layer("Layer"+intToString(iLayer), iLayer, &module, m_detectorManager, m_geometryManager, m_materials);
     barrel->add(new GeoNameTag("Layer#"+intToString(iLayer)));
     barrel->add(new GeoIdentifierTag(iLayer)); // Identifier layer= iLayer
     id.setLayerDisk(iLayer); 
@@ -122,7 +123,7 @@ SCT_Barrel::build(SCT_Identifier id) const
     GeoVPhysVol * layerPV = layer.build(id);
     barrel->add(layerPV);
     // Store alignable transform
-    detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, layerPV);
+    m_detectorManager->addAlignableTransform(2, id.getWaferId(), transform, layerPV);
     layerLength = std::max(layerLength,layer.length());
   }
 
@@ -136,7 +137,7 @@ SCT_Barrel::build(SCT_Identifier id) const
 
   // Build and place the cooling spiders
   double spiderZPos = 0.;
-  SCT_Spider spider("Spider");
+  SCT_Spider spider("Spider", m_detectorManager, m_geometryManager, m_materials);
   spiderZPos =  interLinkZPos + 0.5*interLink.length() + 0.5*spider.length();
   barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(+spiderZPos)));
   barrel->add(spider.getVolume());
@@ -150,14 +151,14 @@ SCT_Barrel::build(SCT_Identifier id) const
   buildEMIShield(barrel);
 
   // Build and place SCT to Pixel attachment
-  SCT_PixelAttachment pixelAttachment("AttachmentPixelToSCT");
+  SCT_PixelAttachment pixelAttachment("AttachmentPixelToSCT", m_detectorManager, m_geometryManager, m_materials);
   barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(+pixelAttachment.zPosition()))); // +ve z
   barrel->add(pixelAttachment.getVolume());
   barrel->add(new GeoTransform(GeoTrf::TranslateZ3D(-pixelAttachment.zPosition()))); // -ve z
   barrel->add(pixelAttachment.getVolume());
 
   // Extra Material
-  InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager());
+  InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager());
   xMat.add(barrel, "SCTBarrel");
   
   return barrel;
@@ -173,8 +174,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const
   // (c) end panels
   // The inner cylinder is called 'EMI shield' for backwards compatibility
 
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
 
   double cylinderOuterRadius   = parameters->thermalShieldOuterRadius();
   double cylinderInnerRadius   = parameters->thermalShieldInnerRadius();
@@ -194,14 +194,14 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const
 
   // The outer cylinder part of thermal shield.
   const GeoTube * cylinderShape  = new GeoTube(cylinderInnerRadius, cylinderOuterRadius, 0.5*cylinderLength);
-  const GeoMaterial* cylinderMaterial = materials.getMaterialForVolume(cylinderMaterialName,cylinderShape->volume());
+  const GeoMaterial* cylinderMaterial = m_materials->getMaterialForVolume(cylinderMaterialName,cylinderShape->volume());
   const GeoLogVol  * cylinderLog = new GeoLogVol("ThShieldOuterCyl", cylinderShape, cylinderMaterial);
   GeoPhysVol * cylinder = new GeoPhysVol(cylinderLog);
   parent->add(cylinder);
 
   // The bulkheads
   const GeoTube * bulkheadShape  = new GeoTube(bulkheadInnerRadius, bulkheadOuterRadius, 0.5*bulkheadThickness);
-  const GeoMaterial* bulkheadMaterial = materials.getMaterialForVolume(bulkheadMaterialName,bulkheadShape->volume());
+  const GeoMaterial* bulkheadMaterial = m_materials->getMaterialForVolume(bulkheadMaterialName,bulkheadShape->volume());
   const GeoLogVol  * bulkheadLog = new GeoLogVol("ThShieldBulkhead", bulkheadShape, bulkheadMaterial);
   GeoPhysVol * bulkhead = new GeoPhysVol(bulkheadLog);
   GeoTransform * bulkheadPosPlus  =  new GeoTransform(GeoTrf::TranslateZ3D(+(endPanelZMax-endPanelThickness-0.5*bulkheadThickness)));
@@ -213,7 +213,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const
 
   // The end panels
   const GeoTube * endPanelShape  = new GeoTube(endPanelInnerRadius, endPanelOuterRadius,  0.5*endPanelThickness);
-  const GeoMaterial* endPanelMaterial = materials.getMaterialForVolume(endPanelMaterialName,endPanelShape->volume());
+  const GeoMaterial* endPanelMaterial = m_materials->getMaterialForVolume(endPanelMaterialName,endPanelShape->volume());
   const GeoLogVol  * endPanelLog = new GeoLogVol("ThShieldEndPanel", endPanelShape, endPanelMaterial);
   GeoPhysVol * endPanel = new GeoPhysVol(endPanelLog);
   GeoTransform * endPanelPosPlus  =  new GeoTransform(GeoTrf::TranslateZ3D(+(endPanelZMax-0.5*endPanelThickness)));
@@ -228,8 +228,7 @@ void SCT_Barrel::buildThermalShield(GeoFullPhysVol * parent) const
 void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const
 {
   
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
 
   // Parameters of cylinder 
   double innerRadius       = parameters->emiShieldInnerRadius();
@@ -258,13 +257,13 @@ void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const
   const GeoTube * emiShieldTube  = new GeoTube(innerRadius, outerRadius,  0.5*length);
   if (m_isOldGeometry) {
     emiShieldShape = emiShieldTube;
-    material = materials.getMaterial(materialName);
+    material = m_materials->getMaterial(materialName);
   } else {
     const GeoTube* cutOut = new GeoTube(innerRadius, outerRadius, 0.5*pixelAttachmentLength);
     const GeoShape* emiTemp = (GeoShape*)&(emiShieldTube->subtract(*cutOut << GeoTrf::TranslateZ3D(pixelAttachmentZpos)));
     emiShieldShape = (GeoShape*)&emiTemp->subtract(*cutOut << GeoTrf::TranslateZ3D(-pixelAttachmentZpos));
     double emiVolume = emiShieldTube->volume() - 2. * cutOut->volume();
-    material = materials.getMaterialForVolume(materialName, emiVolume);
+    material = m_materials->getMaterialForVolume(materialName, emiVolume);
   }
   const GeoLogVol  * emiShieldLog = new GeoLogVol("EMIShield", emiShieldShape, material);
   GeoPhysVol * emiShield = new GeoPhysVol(emiShieldLog);
@@ -280,7 +279,7 @@ void SCT_Barrel::buildEMIShield(GeoFullPhysVol * parent) const
     const GeoShape* jointTemp = (GeoShape*)&(emiJointTubs->subtract(*jointCutOut << GeoTrf::TranslateZ3D(pixelAttachmentZpos)));
     const GeoShape* emiJointShape = (GeoShape*)&jointTemp->subtract(*jointCutOut << GeoTrf::TranslateZ3D(-pixelAttachmentZpos));
     double jointVolume = emiJointTubs->volume() - 2. * jointCutOut->volume();
-    const GeoMaterial * jointMaterial = materials.getMaterialForVolume(jointMaterialName, jointVolume);
+    const GeoMaterial * jointMaterial = m_materials->getMaterialForVolume(jointMaterialName, jointVolume);
     const GeoLogVol  * emiJointLog = new GeoLogVol("EMIShieldJoint", emiJointShape, jointMaterial);
     GeoPhysVol * emiJoint = new GeoPhysVol(emiJointLog);
     // Place 3 copies
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx
old mode 100755
new mode 100644
index 96f390bc501..5fd468fef61
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelModuleParameters.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 "SCT_GeoModel/SCT_BarrelModuleParameters.h"
@@ -15,9 +15,9 @@
 
 using std::abs;
 
-SCT_BarrelModuleParameters::SCT_BarrelModuleParameters()
+SCT_BarrelModuleParameters::SCT_BarrelModuleParameters(SCT_DataBase* rdb)
 {
-  m_rdb = SCT_DataBase::instance();
+  m_rdb = rdb;
 }
 
 //
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx
old mode 100755
new mode 100644
index c9cdeb4c5dd..468c88ea015
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BarrelParameters.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 "SCT_GeoModel/SCT_BarrelParameters.h"
@@ -13,9 +13,9 @@
 #include <cmath>
 
 
-SCT_BarrelParameters::SCT_BarrelParameters()
+SCT_BarrelParameters::SCT_BarrelParameters(SCT_DataBase* rdb)
 {
-  m_rdb = SCT_DataBase::instance();
+  m_rdb = rdb;
 }
 
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx
old mode 100755
new mode 100644
index 08b804b7dcb..1866d3583a2
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_BaseBoard.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 "SCT_GeoModel/SCT_BaseBoard.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoPhysVol.h"
 #include "GeoModelKernel/GeoMaterial.h"
 
-SCT_BaseBoard::SCT_BaseBoard(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_BaseBoard::SCT_BaseBoard(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -25,12 +28,10 @@ SCT_BaseBoard::SCT_BaseBoard(const std::string & name)
 void
 SCT_BaseBoard::getParameters() 
 {
-  const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters();
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
+  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
 
-  SCT_MaterialManager materials;
- 
-  m_material  = materials.getMaterial(parameters->baseBoardMaterial());
+  m_material  = m_materials->getMaterial(parameters->baseBoardMaterial());
   m_safety    = generalParameters->safety();
   m_thickness = parameters->baseBoardThickness();
   m_width     = parameters->baseBoardWidth();
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx
old mode 100755
new mode 100644
index 599d5081a5c..43323a0eee5
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Bracket.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
 */
 
 //
@@ -18,8 +18,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_Bracket::SCT_Bracket(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_Bracket::SCT_Bracket(const std::string & name,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -29,10 +32,9 @@ SCT_Bracket::SCT_Bracket(const std::string & name)
 void
 SCT_Bracket::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;   
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
  
-  m_material  = materials.getMaterial(parameters->bracketMaterial());
+  m_material  = m_materials->getMaterial(parameters->bracketMaterial());
   m_thickness = parameters->bracketThickness();
   m_length    = parameters->bracketLength();
   m_width     = parameters->bracketWidth();
@@ -47,8 +49,7 @@ SCT_Bracket::build()
   // Length is in z-direction. 
 
   const GeoBox * bracketShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
-  const GeoLogVol *bracketLog = 
-    new GeoLogVol(getName(), bracketShape, m_material);
+  const GeoLogVol *bracketLog = new GeoLogVol(getName(), bracketShape, m_material);
   GeoPhysVol * bracket = new GeoPhysVol(bracketLog);
 
   return bracket;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx
old mode 100755
new mode 100644
index a85fb7efcdf..e61cea9e49b
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Clamp.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 "SCT_GeoModel/SCT_Clamp.h"
@@ -16,9 +16,12 @@
 
 
 SCT_Clamp::SCT_Clamp(const std::string & name, int iLayer,
-                           double innerRadius)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer),
-    m_innerRadius(innerRadius)
+                     double innerRadius,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer), m_innerRadius(innerRadius)
 {
   getParameters();
   m_physVolume = build();
@@ -28,7 +31,7 @@ SCT_Clamp::SCT_Clamp(const std::string & name, int iLayer,
 void 
 SCT_Clamp::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
       
   m_materialName    = parameters->clampMaterial(m_iLayer);
   m_length      = parameters->clampDeltaZ(m_iLayer);
@@ -41,11 +44,10 @@ GeoVPhysVol *
 SCT_Clamp::build() 
 {
   // Make the clamp. A simple tube.
-  SCT_MaterialManager materials;
 
   const GeoTube * clampShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, clampShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, clampShape->volume());
+  if(!m_material) {m_material = m_materials->getMaterial(m_materialName);}
   const GeoLogVol * clampLog = new GeoLogVol(getName(), clampShape, m_material);
 
   GeoPhysVol * clamp = new GeoPhysVol(clampLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx
old mode 100755
new mode 100644
index b4b6db173cf..4c229c9abc7
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CloseOut.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 "SCT_GeoModel/SCT_CloseOut.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer)
+SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer,
+                           InDetDD::SCT_DetectorManager* detectorManager,
+                           const SCT_GeometryManager* geometryManager,
+                           SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer)
 {
   getParameters();
   m_physVolume = build();
@@ -26,10 +30,9 @@ SCT_CloseOut::SCT_CloseOut(const std::string & name, int iLayer)
 void 
 SCT_CloseOut::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
     
-  m_material    = materials.getMaterial(parameters->closeOutMaterial(m_iLayer));
+  m_material    = m_materials->getMaterial(parameters->closeOutMaterial(m_iLayer));
   m_length      = parameters->closeOutDeltaZ(m_iLayer);
 
   // Same inner and outer radius of support cylinder.
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx
old mode 100755
new mode 100644
index cee35aa92f6..614c31349ff
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ComponentFactory.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 "SCT_GeoModel/SCT_ComponentFactory.h"
@@ -10,41 +10,29 @@
 
 using InDetDD::SCT_DetectorManager;
 
-SCT_DetectorManager * SCT_ComponentFactory::s_detectorManager = 0;
-const SCT_GeometryManager * SCT_ComponentFactory::s_geometryManager = 0;
+const double SCT_ComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm;
 
-double SCT_ComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm;
-
-SCT_ComponentFactory::SCT_ComponentFactory(const std::string & name) 
-  : m_name(name)
+SCT_ComponentFactory::SCT_ComponentFactory(const std::string & name,
+                                           InDetDD::SCT_DetectorManager* detectorManager,
+                                           const SCT_GeometryManager* geometryManager,
+                                           SCT_MaterialManager* materials)
+  : m_detectorManager(detectorManager), 
+    m_geometryManager(geometryManager),
+    m_materials(materials),
+    m_name(name)
 {}
 
 SCT_ComponentFactory::~SCT_ComponentFactory() 
 {}
 
-
-void 
-SCT_ComponentFactory::setDetectorManager(SCT_DetectorManager * manager)
-{
-  s_detectorManager = manager;
-}
-
-void 
-SCT_ComponentFactory::setGeometryManager(SCT_GeometryManager * manager)
-{
-  s_geometryManager = manager;
-}
-
 std::string 
-SCT_ComponentFactory::intToString(int i)
+SCT_ComponentFactory::intToString(int i) const
 {
   std::ostringstream str;
   str << i;
   return str.str();
 }
 
- 
-
 double
 SCT_ComponentFactory::epsilon() const
 {
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx
old mode 100755
new mode 100644
index 5db571788fa..991a4e10a7a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingBlock.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 "SCT_GeoModel/SCT_CoolingBlock.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name,
+                                   InDetDD::SCT_DetectorManager* detectorManager,
+                                   const SCT_GeometryManager* geometryManager,
+                                   SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_CoolingBlock::SCT_CoolingBlock(const std::string & name)
 void
 SCT_CoolingBlock::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
 
   m_materialName  = parameters->coolingBlockMaterial();
   m_thickness = parameters->coolingBlockThickness();
@@ -42,10 +45,8 @@ SCT_CoolingBlock::build()
   // Width is in phi-direction.
   // Length is in z-direction. 
 
-  SCT_MaterialManager materials;
-
   const GeoBox * coolingBlockShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, coolingBlockShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, coolingBlockShape->volume());
   const GeoLogVol *coolingBlockLog = 
     new GeoLogVol(getName(), coolingBlockShape, m_material);
   GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx
old mode 100755
new mode 100644
index 969f719c3eb..cbaaeeab225
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingEnd.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 "SCT_GeoModel/SCT_CoolingEnd.h"
@@ -17,8 +17,12 @@
 
 SCT_CoolingEnd::SCT_CoolingEnd(const std::string & name, int iLayer,
                                double innerRadius,
-                               double length)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer),
+                               double length,
+                               InDetDD::SCT_DetectorManager* detectorManager,
+                               const SCT_GeometryManager* geometryManager,
+                               SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer),
     m_innerRadius(innerRadius),
     m_length(length)
 {
@@ -30,7 +34,7 @@ SCT_CoolingEnd::SCT_CoolingEnd(const std::string & name, int iLayer,
 void 
 SCT_CoolingEnd::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
     
   m_materialName    = parameters->coolingEndMaterial(m_iLayer);
   m_radialWidth = parameters->clampDeltaR(m_iLayer);
@@ -42,11 +46,9 @@ GeoVPhysVol *
 SCT_CoolingEnd::build() 
 {
   // Make volume representing cooling inlets, outlets and U-bends. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * coolShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, coolShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, coolShape->volume());
+  if(!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * coolLog = new GeoLogVol(getName(), coolShape, m_material);
 
   GeoPhysVol * cool = new GeoPhysVol(coolLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx
old mode 100755
new mode 100644
index cf1d88eaa64..17f7b184ed3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_CoolingPipe.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 "SCT_GeoModel/SCT_CoolingPipe.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length)
-  : SCT_SharedComponentFactory(name), m_length(length)
+SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length,
+                                 InDetDD::SCT_DetectorManager* detectorManager,
+                                 const SCT_GeometryManager* geometryManager,
+                                 SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_length(length)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_CoolingPipe::SCT_CoolingPipe(const std::string & name, double length)
 void
 SCT_CoolingPipe::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
     
   m_materialName  = parameters->coolingPipeMaterial();
   m_pipeRadius = parameters->coolingPipeRadius();
@@ -37,11 +41,9 @@ SCT_CoolingPipe::build()
 {
 
   // Build the CoolingPipe.
-  SCT_MaterialManager materials;
-
   const GeoTube * coolingPipeShape = new GeoTube(0., m_pipeRadius, 0.5*m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, coolingPipeShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, coolingPipeShape->volume());
+  if(!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol *coolingPipeLog = 
     new GeoLogVol(getName(), coolingPipeShape, m_material);
   GeoPhysVol * coolingPipe = new GeoPhysVol(coolingPipeLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
old mode 100755
new mode 100644
index 35264aee4d2..ef69ebbaa5a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DataBase.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 "SCT_GeoModel/SCT_DataBase.h"
@@ -15,41 +15,11 @@
 
 #include <iostream>
 
-SCT_DataBase * SCT_DataBase::s_instance = 0;
-const SCT_GeoModelAthenaComps * SCT_DataBase::s_athenaComps = 0;
-
-SCT_DataBase * SCT_DataBase::instance() 
-{
-  if (s_athenaComps) {
-    if (!s_instance) s_instance = new SCT_DataBase;
-  } else {
-    std::cout << "SCT_Data ERROR. Cannot create instance without SCT_GeoModelAthenaComps object!" << std::endl;
-  }
-  return s_instance;
-}
-
-void SCT_DataBase::reinit()
-{
-  delete s_instance;
-  s_instance = 0;
-}
-
-const SCT_GeoModelAthenaComps *
-SCT_DataBase::athenaComps() const 
-{
-  return  s_athenaComps;
-}
-  
-void 
-SCT_DataBase::setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps)
+SCT_DataBase::SCT_DataBase(const SCT_GeoModelAthenaComps * athenaComps)
 {
-  s_athenaComps = athenaComps;
-}
-
-SCT_DataBase::SCT_DataBase()
+  m_athenaComps = athenaComps;
 
-{
-  IGeoDbTagSvc * geoDbTag = s_athenaComps->geoDbTagSvc();
+  IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc();
 
   // Get version tag and node for SCT
   DecodeVersionKey versionKey(geoDbTag,"SCT");
@@ -60,7 +30,7 @@ SCT_DataBase::SCT_DataBase()
   DecodeVersionKey indetVersionKey(geoDbTag,"InnerDetector");
 
   // Access the RDB
-  IRDBAccessSvc* rdbSvc = s_athenaComps->rdbAccessSvc();
+  IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc();
 
   // SCT version tag
   m_sctVersionTag = rdbSvc->getChildTag("SCT", versionKey.tag(), versionKey.node());
@@ -218,6 +188,7 @@ SCT_DataBase::SCT_DataBase()
 
 }
 
+const SCT_GeoModelAthenaComps* SCT_DataBase::athenaComps() const { return m_athenaComps; }
 
 IRDBRecordset_ptr SCT_DataBase::weightTable() const {return m_weightTable;}
 
@@ -293,5 +264,5 @@ const std::string & SCT_DataBase::versionTag() const {
 
 MsgStream&  SCT_DataBase::msg (MSG::Level lvl) const 
 { 
-  return s_athenaComps->msg(lvl); 
+  return m_athenaComps->msg(lvl); 
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
old mode 100755
new mode 100644
index 94b2350d3ac..8d0f1d555fd
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorFactory.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
 */
 
 //
@@ -8,6 +8,8 @@
 
 
 #include "SCT_GeoModel/SCT_DetectorFactory.h" 
+
+#include "SCT_GeoModel/SCT_DataBase.h"
 #include "SCT_GeoModel/SCT_Identifier.h"
 #include "SCT_GeoModel/SCT_GeometryManager.h" 
 #include "SCT_GeoModel/SCT_MaterialManager.h"
@@ -70,24 +72,18 @@ SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaC
   // Create the detector manager
   m_detectorManager = new SCT_DetectorManager(detStore());
 
-  //
+  // Create the database
+  m_db = new SCT_DataBase{athenaComps};
+
+  // Create the material manager
+  m_materials = new SCT_MaterialManager{m_db};
+
   // Create the geometry manager.
-  //
-  
-  m_geometryManager = new SCT_GeometryManager();
+  m_geometryManager = new SCT_GeometryManager{m_db};
   m_geometryManager->setOptions(options);
-  m_geometryManager->setAthenaComps(athenaComps);
 
   m_useDynamicAlignFolders = options.dynamicAlignFolders();
  
-  // Pass the Athena components the data base access class
-  SCT_DataBase::setAthenaComps(athenaComps);
- 
-  // Create SiCommonItems. These are items that are shared by all elements
-  SiCommonItems * commonItems = new SiCommonItems(athenaComps->getIdHelper());
-  m_geometryManager->setCommonItems(commonItems);
-  
-
   // Set Version information
   // Get the geometry tag
   DecodeVersionKey versionKey(geoDbTagSvc(),"SCT");
@@ -118,12 +114,6 @@ SCT_DetectorFactory::SCT_DetectorFactory(const SCT_GeoModelAthenaComps * athenaC
                            versionPatchNumber);
   m_detectorManager->setVersion(version);
 
-  // Initailize some static variables in various classes/
-  SCT_ComponentFactory::setDetectorManager(m_detectorManager);
-  SCT_ComponentFactory::setGeometryManager(m_geometryManager);
-
-  SCT_Identifier::setIdHelper(athenaComps->getIdHelper());
- 
 } 
  
  
@@ -131,8 +121,9 @@ SCT_DetectorFactory::~SCT_DetectorFactory()
 { 
   // NB the detector manager (m_detectorManager)is stored in the detector store by the
   // Tool and so we don't delete it.
+  delete m_db;
+  delete m_materials;
   delete m_geometryManager;
-
 } 
 
 void SCT_DetectorFactory::create(GeoPhysVol *world) 
@@ -147,10 +138,6 @@ void SCT_DetectorFactory::create(GeoPhysVol *world)
   // The tree tops get added to world. We name it "indet" though.
   GeoPhysVol *indet = world;
 
-  // Set default gas throughout detector.
-  // Air is the default if this is not set.
-  // SCT_MaterialManager::setGasMaterial("std::Air"); 
-
   const SCT_GeneralParameters * sctGeneral = m_geometryManager->generalParameters();
 
   GeoTrf::Transform3D sctTransform = sctGeneral->partTransform("SCT");
@@ -175,9 +162,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world)
     m_detectorManager->numerology().addBarrel(0);
 
     // Create the SCT Barrel
-    SCT_Barrel sctBarrel("SCT_Barrel");
+    SCT_Barrel sctBarrel("SCT_Barrel", m_detectorManager, m_geometryManager, m_materials);
   
-    SCT_Identifier id;
+    SCT_Identifier id{m_geometryManager->athenaComps()->getIdHelper()};
     id.setBarrelEC(0);
     GeoVPhysVol * barrelPV = sctBarrel.build(id);
     GeoAlignableTransform * barrelTransform = new GeoAlignableTransform(sctTransform * sctGeneral->partTransform(barrelLabel));
@@ -206,9 +193,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world)
     m_detectorManager->numerology().addEndcap(2);
 
     // Create the Forward
-    SCT_Forward sctForwardPlus("SCT_ForwardA", +2);
+    SCT_Forward sctForwardPlus("SCT_ForwardA", +2, m_detectorManager, m_geometryManager, m_materials);
     
-    SCT_Identifier idFwdPlus;
+    SCT_Identifier idFwdPlus{m_geometryManager->athenaComps()->getIdHelper()};
     idFwdPlus.setBarrelEC(2);
     GeoVPhysVol * forwardPlusPV = sctForwardPlus.build(idFwdPlus);
     GeoTrf::Transform3D fwdTransformPlus(sctTransform 
@@ -239,9 +226,9 @@ void SCT_DetectorFactory::create(GeoPhysVol *world)
 
     m_detectorManager->numerology().addEndcap(-2);
     
-    SCT_Forward sctForwardMinus("SCT_ForwardC",-2);
+    SCT_Forward sctForwardMinus("SCT_ForwardC", -2, m_detectorManager, m_geometryManager, m_materials);
 
-    SCT_Identifier idFwdMinus;
+    SCT_Identifier idFwdMinus{m_geometryManager->athenaComps()->getIdHelper()};
     idFwdMinus.setBarrelEC(-2);
     GeoVPhysVol * forwardMinusPV = sctForwardMinus.build(idFwdMinus);
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
old mode 100755
new mode 100644
index c3c00a5bd7a..93b7e54b5c7
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_DetectorTool.cxx
@@ -50,10 +50,6 @@ SCT_DetectorTool::SCT_DetectorTool(const std::string& type,
 StatusCode
 SCT_DetectorTool::create()
 { 
-  // Reinit various singleton type objects.
-  SCT_DataBase::reinit();
-  SCT_MaterialManager::reinit();
-
   // Get the detector configuration.
   ATH_CHECK(m_geoDbTagSvc.retrieve());
   
@@ -156,10 +152,6 @@ SCT_DetectorTool::create()
     ATH_CHECK(detStore()->symLink(m_manager, siDetManager));
   }
 
-  // Delete unneeded singleton objects
-  SCT_DataBase::reinit();
-  SCT_MaterialManager::reinit();
-
   return StatusCode::SUCCESS;
 }
 
@@ -175,7 +167,7 @@ SCT_DetectorTool::clear()
 }
 
 StatusCode 
-SCT_DetectorTool::registerCallback()
+SCT_DetectorTool::registerCallback ATLAS_NOT_THREAD_SAFE ()
 {
   StatusCode sc{StatusCode::FAILURE, true};
   if (m_alignable.value()) {
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx
old mode 100755
new mode 100644
index e79d3211d0a..b5c0345cec5
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Dogleg.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
 */
 
 //
@@ -18,8 +18,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_Dogleg::SCT_Dogleg(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_Dogleg::SCT_Dogleg(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -29,10 +32,9 @@ SCT_Dogleg::SCT_Dogleg(const std::string & name)
 void
 SCT_Dogleg::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
-    
-  m_material  = materials.getMaterial(parameters->doglegMaterial());
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+
+  m_material  = m_materials->getMaterial(parameters->doglegMaterial());
   m_thickness = parameters->doglegThickness();
   m_length    = parameters->doglegLength();
   m_width     = parameters->doglegWidth();
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx
old mode 100755
new mode 100644
index f0517558891..21c6277b383
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIEndJewel.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 "SCT_GeoModel/SCT_FSIEndJewel.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name,
+                                 InDetDD::SCT_DetectorManager* detectorManager,
+                                 const SCT_GeometryManager* geometryManager,
+                                 SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,8 +29,7 @@ SCT_FSIEndJewel::SCT_FSIEndJewel(const std::string & name)
 void
 SCT_FSIEndJewel::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;   
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
  
   m_materialName  = parameters->fsiEndJewelMaterial();
   m_radialWidth = parameters->fsiEndJewelRadialWidth();
@@ -41,12 +43,9 @@ SCT_FSIEndJewel::build()
 
   // Build the barrel FSI end jewel. Just a simple box.
   // Length is in z-direction. 
-  SCT_MaterialManager materials;
-
   const GeoBox * jewelShape = new GeoBox(0.5*m_radialWidth, 0.5*m_rPhiWidth, 0.5*m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, jewelShape->volume());
-  const GeoLogVol *jewelLog = 
-    new GeoLogVol(getName(), jewelShape, m_material);
+  m_material = m_materials->getMaterialForVolume(m_materialName, jewelShape->volume());
+  const GeoLogVol *jewelLog = new GeoLogVol(getName(), jewelShape, m_material);
   GeoPhysVol * jewel = new GeoPhysVol(jewelLog);
 
   return jewel;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx
old mode 100755
new mode 100644
index 96c53597a00..b16d678153d
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIFibreMask.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 "SCT_GeoModel/SCT_FSIFibreMask.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double length)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length)
+SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double length,
+                                   InDetDD::SCT_DetectorManager* detectorManager,
+                                   const SCT_GeometryManager* geometryManager,
+                                   SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer), m_length(length)
 {
   getParameters();
   m_physVolume = build();
@@ -26,8 +30,8 @@ SCT_FSIFibreMask::SCT_FSIFibreMask(const std::string & name, int iLayer, double
 void 
 SCT_FSIFibreMask::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-       
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+
   m_materialName = parameters->fsiFibreMaskMaterial();
   m_outerRadius = parameters->supportCylInnerRadius(m_iLayer);
   m_innerRadius = m_outerRadius - parameters->fsiFibreMaskDeltaR();
@@ -38,15 +42,11 @@ GeoVPhysVol *
 SCT_FSIFibreMask::build() 
 {
   // Make the support cyliner. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * fibreMaskShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName+intToString(m_iLayer), fibreMaskShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName+intToString(m_iLayer), fibreMaskShape->volume());
   const GeoLogVol * fibreMaskLog = new GeoLogVol(getName(), fibreMaskShape, m_material);
 
   GeoPhysVol * fibreMask = new GeoPhysVol(fibreMaskLog);
 
   return fibreMask;
 }
-
-
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIHelper.cxx
old mode 100755
new mode 100644
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx
old mode 100755
new mode 100644
index 57a8a419a60..a94a913277d
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FSIScorpion.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 "SCT_GeoModel/SCT_FSIScorpion.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name,
+                                 InDetDD::SCT_DetectorManager* detectorManager,
+                                 const SCT_GeometryManager* geometryManager,
+                                 SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,9 +29,7 @@ SCT_FSIScorpion::SCT_FSIScorpion(const std::string & name)
 void
 SCT_FSIScorpion::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;   
- 
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
   m_materialName  = parameters->fsiScorpionMaterial();
   m_radialWidth = parameters->fsiScorpionRadialWidth();
   m_rPhiWidth = parameters->fsiScorpionRPhiWidth();
@@ -40,13 +41,10 @@ SCT_FSIScorpion::build()
 {
 
   // Build the barrel FSI scorpion. Just a simple box.
-  // Length is in z-direction. 
-  SCT_MaterialManager materials;
-
+  // Length is in z-direction.
   const GeoBox * scorpionShape = new GeoBox(0.5*m_radialWidth, 0.5*m_rPhiWidth, 0.5*m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, scorpionShape->volume());
-  const GeoLogVol *scorpionLog = 
-    new GeoLogVol(getName(), scorpionShape, m_material);
+  m_material = m_materials->getMaterialForVolume(m_materialName, scorpionShape->volume());
+  const GeoLogVol *scorpionLog = new GeoLogVol(getName(), scorpionShape, m_material);
   GeoPhysVol * scorpion = new GeoPhysVol(scorpionLog);
 
   return scorpion;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx
old mode 100755
new mode 100644
index 4422b3f751c..14e0cb9e722
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Flange.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 "SCT_GeoModel/SCT_Flange.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_Flange::SCT_Flange(const std::string & name, int iLayer)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer)
+SCT_Flange::SCT_Flange(const std::string & name, int iLayer,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_Flange::SCT_Flange(const std::string & name, int iLayer)
 void 
 SCT_Flange::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
     
   m_materialName    = parameters->flangeMaterial(m_iLayer);
   m_length      = parameters->flangeDeltaZ(m_iLayer);
@@ -47,11 +51,9 @@ GeoVPhysVol *
 SCT_Flange::build() 
 {
   // Make the flange. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * flangeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, flangeShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, flangeShape->volume());
+  if(!m_material) {m_material = m_materials->getMaterial(m_materialName);}
   const GeoLogVol * flangeLog = new GeoLogVol(getName(), flangeShape, m_material);
 
   GeoPhysVol * flange = new GeoPhysVol(flangeLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx
old mode 100755
new mode 100644
index 405c90423da..a9700ebd9dc
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Forward.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 "SCT_GeoModel/SCT_Forward.h"
@@ -13,7 +13,6 @@
 #include "SCT_GeoModel/SCT_FwdWheel.h"
 #include "SCT_GeoModel/SCT_FwdModule.h"
 #include "SCT_GeoModel/SCT_FwdRing.h"
-#include "SCT_GeoModel/SCT_FwdRingCooling.h"
 #include "SCT_GeoModel/SCT_FwdSupportFrame.h"
 #include "SCT_GeoModel/SCT_FwdCoolingPipe.h"
 #include "SCT_GeoModel/SCT_FwdPowerTape.h"
@@ -37,8 +36,11 @@
 #include <sstream>
 #include <cmath>
 
-SCT_Forward::SCT_Forward(const std::string & name, int ec)
-  : SCT_UniqueComponentFactory(name), 
+SCT_Forward::SCT_Forward(const std::string & name, int ec,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_endcap(ec)
 {
   getParameters();
@@ -55,8 +57,8 @@ void
 SCT_Forward::getParameters()
 {
 
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
-  const SCT_ForwardModuleParameters * moduleParameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
+  const SCT_ForwardModuleParameters * moduleParameters = m_geometryManager->forwardModuleParameters();
     
   //m_numRingTypes = parameters->fwdNumRingTypes();
   m_numModuleTypes = moduleParameters->fwdModuleNumTypes();
@@ -84,7 +86,7 @@ SCT_Forward::getParameters()
 
 
   // Set numerology
-  detectorManager()->numerology().setNumDisks(m_numWheels);
+  m_detectorManager->numerology().setNumDisks(m_numWheels);
 
 
 }
@@ -98,35 +100,36 @@ SCT_Forward::preBuild()
 
   // We make all the module types here. There is a outer, middle, truncated middle and inner type module.
   for (int iModuleType = 0; iModuleType < m_numModuleTypes; iModuleType++){
-    m_modules.push_back(new SCT_FwdModule("FwdModule"+intToString(iModuleType), iModuleType));
+    m_modules.push_back(new SCT_FwdModule("FwdModule"+intToString(iModuleType), iModuleType,
+                                          m_detectorManager, m_geometryManager, m_materials));
   }
 
   for (int iWheel = 0; iWheel < m_numWheels; iWheel++){
     // Build Wheels
     std::ostringstream name; name << "Wheel" << iWheel << ((m_endcap > 0) ? "A" : "C");
-    const SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap);
+    SCT_FwdWheel * wheel = new SCT_FwdWheel(name.str(), iWheel, m_modules, m_endcap,
+                                            m_detectorManager, m_geometryManager, m_materials);
     m_wheels.push_back(wheel);
   }
 
 
   // Make one end of the Forward tracker
   //  Tube envelope containing the forward
-  SCT_MaterialManager materials;
   const GeoTube * forwardEnvelopeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
   const GeoLogVol * forwardLog = 
-    new GeoLogVol(getName(), forwardEnvelopeShape, materials.gasMaterial());
+    new GeoLogVol(getName(), forwardEnvelopeShape, m_materials->gasMaterial());
   
   return forwardLog;
 }
 
 GeoVPhysVol * 
-SCT_Forward::build(SCT_Identifier id) const
+SCT_Forward::build(SCT_Identifier id)
 {
   GeoFullPhysVol * forward = new GeoFullPhysVol(m_logVolume);
 
   for (int iWheel = 0; iWheel < m_numWheels; iWheel++){
 
-    const SCT_FwdWheel * wheel = m_wheels[iWheel];
+    SCT_FwdWheel * wheel = m_wheels[iWheel];
     std::ostringstream wheelName; wheelName << "Wheel#" << iWheel;
     double zpos = wheel->zPosition() - zCenter();
     forward->add(new GeoNameTag(wheelName.str()));
@@ -138,13 +141,13 @@ SCT_Forward::build(SCT_Identifier id) const
     forward->add(wheelPV);
 
     // Store the alignable transform
-    detectorManager()->addAlignableTransform(2, id.getWaferId(), transform, wheelPV);
+    m_detectorManager->addAlignableTransform(2, id.getWaferId(), transform, wheelPV);
   }
 
   //
   // Place SupportFrame
   //
-  SCT_FwdSupportFrame supportFrame("SupportFrame");
+  SCT_FwdSupportFrame supportFrame("SupportFrame", m_detectorManager, m_geometryManager, m_materials);
   double supportFrameZPos = supportFrame.zPosition() - zCenter();
   forward->add(new GeoTransform(GeoTrf::TranslateZ3D(supportFrameZPos)));
   forward->add(supportFrame.getVolume());
@@ -157,7 +160,8 @@ SCT_Forward::build(SCT_Identifier id) const
     SCT_FwdCylinderServices cylinderServices("CylinderServices",
                                              supportFrame.outerRadius(),
                                              m_outerRadiusCylinderServices,
-                                             supportFrame.length());
+                                             supportFrame.length(),
+                                             m_detectorManager, m_geometryManager, m_materials);
     forward->add(new GeoTransform(GeoTrf::TranslateZ3D(supportFrameZPos)));
     forward->add(cylinderServices.getVolume());
 
@@ -188,7 +192,8 @@ SCT_Forward::build(SCT_Identifier id) const
     
         // Label Cooling pipe with W# at end of string  
         SCT_FwdCoolingPipe coolingPipe("OffDiskCoolingPipeW"+intToString(iWheel),
-                                       numPipes, rStart, startPos, endPos);  
+                                       numPipes, rStart, startPos, endPos,
+                                       m_detectorManager, m_geometryManager, m_materials);
       
         // Place the cooling pipes
         double coolingPipeZPos = coolingPipe.zPosition() - zCenter();
@@ -227,7 +232,8 @@ SCT_Forward::build(SCT_Identifier id) const
 
         // Label power tape with W# at end of string  
         SCT_FwdPowerTape powerTape("OffDiskPowerTapeW"+intToString(iWheel),
-                                   numModules, rStart, startPos, endPos);
+                                   numModules, rStart, startPos, endPos,
+                                   m_detectorManager, m_geometryManager, m_materials);
 
         // Place Power Tapes
         double powerTapeZPos = powerTape.zPosition() - zCenter();
@@ -245,14 +251,14 @@ SCT_Forward::build(SCT_Identifier id) const
   //
   for (int iElement = 0; iElement < m_numThermalShieldElements; iElement++){
     SCT_FwdThermalShieldElement thermalShieldElement("FwdThermalShieldElement"+intToString(iElement),
-                                                     iElement);
+                                                     iElement, m_detectorManager, m_geometryManager, m_materials);
     double elementZPos = thermalShieldElement.zPosition() - zCenter();
     forward->add(new GeoTransform(GeoTrf::TranslateZ3D(elementZPos)));
     forward->add(thermalShieldElement.getVolume());
   }
 
   // Extra Material
-  InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager());
+  InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager());
   xMat.add(forward, "SCTEndcap", zCenter());
   if (m_endcap > 0) {
     xMat.add(forward, "SCTEndcapA", zCenter());
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx
old mode 100755
new mode 100644
index fb09c3900ad..ef6af4c275d
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardModuleParameters.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 "SCT_GeoModel/SCT_ForwardModuleParameters.h"
@@ -14,9 +14,9 @@
 #include <cmath>
 
 
-SCT_ForwardModuleParameters::SCT_ForwardModuleParameters()
+SCT_ForwardModuleParameters::SCT_ForwardModuleParameters(SCT_DataBase* rdb)
 {
-  m_rdb = SCT_DataBase::instance();
+  m_rdb = rdb;
 }
 
 //
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx
old mode 100755
new mode 100644
index 80fc94334cb..f72533b1ed7
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_ForwardParameters.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 "SCT_GeoModel/SCT_ForwardParameters.h"
@@ -15,15 +15,14 @@
 #include <iostream>
 #include <cmath>
 
-SCT_ForwardParameters::SCT_ForwardParameters()
-  : m_fsiHelper(0)
+SCT_ForwardParameters::SCT_ForwardParameters(SCT_DataBase* rdb)
 {
-  m_rdb = SCT_DataBase::instance();
+  m_rdb = rdb;
+  m_fsiHelper = std::make_unique<FSIHelper>(m_rdb);
 }
 
 SCT_ForwardParameters::~SCT_ForwardParameters()
 {
-  delete m_fsiHelper;
 }
 
 //
@@ -574,7 +573,6 @@ SCT_ForwardParameters::fwdFSIGeomZOffset(int iType) const
 const FSIHelper & 
 SCT_ForwardParameters::fsiHelper() const
 {
-  if (!m_fsiHelper) m_fsiHelper = new FSIHelper(m_rdb);
   return *m_fsiHelper;
 }
 
@@ -776,18 +774,12 @@ SCT_ForwardParameters&
 SCT_ForwardParameters::operator=(const SCT_ForwardParameters& right) {
   if (this != &right) {
     m_rdb = right.m_rdb;
-    m_fsiHelper = nullptr;
-    if (right.m_fsiHelper!=nullptr) {
-      m_fsiHelper = new FSIHelper(m_rdb);
-    }
+    m_fsiHelper.reset(new FSIHelper(m_rdb));
   }
   return *this;
 }
 
 SCT_ForwardParameters::SCT_ForwardParameters(const SCT_ForwardParameters& right) {
   m_rdb = right.m_rdb;
-  m_fsiHelper = nullptr;
-  if (right.m_fsiHelper!=nullptr) {
-    m_fsiHelper = new FSIHelper(m_rdb);
-  }
+  m_fsiHelper.reset(new FSIHelper(m_rdb));
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx
old mode 100755
new mode 100644
index b3420cf1379..2ec1b74a90d
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingBlock.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 "SCT_GeoModel/SCT_FwdCoolingBlock.h"
@@ -17,8 +17,12 @@
 
 #include <iostream>
 
-SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary)
-  : SCT_SharedComponentFactory(name), m_hiLo(hiLo), m_mainSec(mainOrSecondary)
+SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary,
+                                         InDetDD::SCT_DetectorManager* detectorManager,
+                                         const SCT_GeometryManager* geometryManager,
+                                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_hiLo(hiLo), m_mainSec(mainOrSecondary)
 {
   getParameters();
   m_physVolume = build();
@@ -28,7 +32,7 @@ SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int
 void
 SCT_FwdCoolingBlock::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
     
   m_coolingBlockIndex = -1;
   for (int i = 0; i < 4; i++){
@@ -38,7 +42,7 @@ SCT_FwdCoolingBlock::getParameters()
   }
 
   if (m_coolingBlockIndex < 0){
-    std::cout << "SCT_FwdRing: ERROR. Cooling block type is missing. HiLo = " << m_hiLo 
+    std::cout << "SCT_FwdCoolingBlock: ERROR. Cooling block type is missing. HiLo = " << m_hiLo 
               << ", MainSecondary = " << m_mainSec << std::endl;
     // Will crash or give unpredictable results
   } 
@@ -57,11 +61,8 @@ SCT_FwdCoolingBlock::build()
 {
 
   // Build the CoolingBlock. Just a simple box.
-
-  SCT_MaterialManager materials;
-  
   const GeoBox * coolingBlockShape = new GeoBox(0.5*m_deltaR, 0.5*m_rphi, 0.5*m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, coolingBlockShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, coolingBlockShape->volume());
   const GeoLogVol *coolingBlockLog = 
     new GeoLogVol(getName(), coolingBlockShape, m_material);
   GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx
old mode 100755
new mode 100644
index bd06f571ebd..0ac7f63c0b6
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCoolingPipe.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 "SCT_GeoModel/SCT_FwdCoolingPipe.h"
@@ -22,8 +22,12 @@ SCT_FwdCoolingPipe::SCT_FwdCoolingPipe(const std::string & name,
                                        int numPipes, 
                                        double innerRadius, 
                                        double startPos, 
-                                       double endPos)
-  : SCT_SharedComponentFactory(name), m_numPipes(numPipes), m_innerRadius(innerRadius)
+                                       double endPos,
+                                       InDetDD::SCT_DetectorManager* detectorManager,
+                                       const SCT_GeometryManager* geometryManager,
+                                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_numPipes(numPipes), m_innerRadius(innerRadius)
 {
   m_length = std::abs(endPos - startPos);
   m_zPosition = 0.5 * (startPos + endPos);
@@ -35,11 +39,9 @@ SCT_FwdCoolingPipe::SCT_FwdCoolingPipe(const std::string & name,
 
 void 
 SCT_FwdCoolingPipe::getParameters()
-{ 
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
-  SCT_MaterialManager materials;
-    
-  m_material    = materials.getMaterial(parameters->fwdCoolingPipeMaterial());
+{
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
+  m_material    = m_materials->getMaterial(parameters->fwdCoolingPipeMaterial());
   m_pipeRadius  = parameters->fwdCoolingPipeRadius();
 }
 
@@ -65,4 +67,3 @@ SCT_FwdCoolingPipe::build()
 
   return pipe;
 }
-
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx
old mode 100755
new mode 100644
index e8bf3e68b7c..586ca2294c0
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdCylinderServices.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 "SCT_GeoModel/SCT_FwdCylinderServices.h"
@@ -26,8 +26,12 @@
 SCT_FwdCylinderServices::SCT_FwdCylinderServices(const std::string & name,
                                                  double rmin,
                                                  double rmax,
-                                                 double length)
-  : SCT_SharedComponentFactory(name), m_innerRadius(rmin), m_outerRadius(rmax), m_length(length)
+                                                 double length,
+                                                 InDetDD::SCT_DetectorManager* detectorManager,
+                                                 const SCT_GeometryManager* geometryManager,
+                                                 SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_innerRadius(rmin), m_outerRadius(rmax), m_length(length)
 {
   getParameters();
   m_physVolume = build(); 
@@ -41,36 +45,36 @@ SCT_FwdCylinderServices::~SCT_FwdCylinderServices()
 void
 SCT_FwdCylinderServices::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
 
   // Retrieve parameters for each service    
   for (int iType = 0; iType < parameters->fwdNumCylinderServiceTypes(); iType++) {
-    if(parameters->fwdCylinderServiceName(iType) == "CoolingPipe") {
+    if (parameters->fwdCylinderServiceName(iType) == "CoolingPipe") {
       m_coolingDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_coolingRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_coolingMaterialName = parameters->fwdCylinderServiceMaterial(iType);
     }
-    if(parameters->fwdCylinderServiceName(iType) == "LMT") {
+    if (parameters->fwdCylinderServiceName(iType) == "LMT") {
       m_lmtDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_lmtRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_lmtMaterialName = parameters->fwdCylinderServiceMaterial(iType);
     }
-    if(parameters->fwdCylinderServiceName(iType) == "LMTCooling") {
+    if (parameters->fwdCylinderServiceName(iType) == "LMTCooling") {
       m_lmtCoolingDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_lmtCoolingRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_lmtCoolingMaterialName = parameters->fwdCylinderServiceMaterial(iType);
     }
-    if(parameters->fwdCylinderServiceName(iType) == "Fibres") {
+    if (parameters->fwdCylinderServiceName(iType) == "Fibres") {
       m_fibreDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_fibreRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_fibreMaterialName = parameters->fwdCylinderServiceMaterial(iType);
     }
-    if(parameters->fwdCylinderServiceName(iType) == "NPipe") {
+    if (parameters->fwdCylinderServiceName(iType) == "NPipe") {
       m_nPipeDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_nPipeRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_nPipeMaterialName = parameters->fwdCylinderServiceMaterial(iType);
     }
-    if(parameters->fwdCylinderServiceName(iType) == "Rail") {
+    if (parameters->fwdCylinderServiceName(iType) == "Rail") {
       m_railDeltaR = parameters->fwdCylinderServiceDeltaR(iType);
       m_railRPhi = parameters->fwdCylinderServiceRPhi(iType);
       m_railMaterialName = parameters->fwdCylinderServiceMaterial(iType);
@@ -79,22 +83,22 @@ SCT_FwdCylinderServices::getParameters()
 
   // Retrieve angles for each service
   for (int iLoc = 0; iLoc < parameters->fwdNumCylinderServiceLocs(); iLoc++) {
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "CoolingPipe") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "CoolingPipe") {
       m_coolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "LMT") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "LMT") {
       m_lmtLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "LMTCooling") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "LMTCooling") {
       m_lmtCoolingLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "Fibres") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "Fibres") {
       m_fibreLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "NPipe") {
       m_nPipeLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
-    if(parameters->fwdCylinderServiceLocName(iLoc) == "Rail") {
+    if (parameters->fwdCylinderServiceLocName(iLoc) == "Rail") {
       m_railLocAngle.push_back(parameters->fwdCylinderServiceLocAngle(iLoc));
     }
   }
@@ -110,9 +114,8 @@ SCT_FwdCylinderServices::build()
 {
 
   // Make envelope for the services
-  SCT_MaterialManager materials;
   const GeoTube * cylinderShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  const GeoLogVol * cylinderLog = new GeoLogVol(getName(), cylinderShape, materials.gasMaterial());
+  const GeoLogVol * cylinderLog = new GeoLogVol(getName(), cylinderShape, m_materials->gasMaterial());
   GeoPhysVol * cylinder = new GeoPhysVol(cylinderLog);
 
   // Create All Services
@@ -132,7 +135,7 @@ SCT_FwdCylinderServices::build()
   const GeoCons* coolingShape = new GeoCons(coolingRmin, coolingRmin, coolingRmax1, coolingRmax2, 
                                             0.5 * m_length, 
                                             -0.5 * coolingDPhi * Gaudi::Units::radian, coolingDPhi * Gaudi::Units::radian);
-  const GeoLogVol * coolingLog = new GeoLogVol("CoolingPipe", coolingShape, materials.getMaterialForVolume(m_coolingMaterialName, coolingShape->volume()));
+  const GeoLogVol * coolingLog = new GeoLogVol("CoolingPipe", coolingShape, m_materials->getMaterialForVolume(m_coolingMaterialName, coolingShape->volume()));
   GeoPhysVol * coolingPipe = new GeoPhysVol(coolingLog);
 
   // Low Mass Tapes
@@ -142,7 +145,7 @@ SCT_FwdCylinderServices::build()
   double lmtDPhi = m_lmtRPhi / lmtRmin;
   const GeoCons* lmtShape = new GeoCons(lmtRmin, lmtRmin, lmtRmax1, lmtRmax2, 0.5 * m_length, 
                                         -0.5 * lmtDPhi * Gaudi::Units::radian, lmtDPhi * Gaudi::Units::radian);
-  const GeoLogVol * lmtLog = new GeoLogVol("LMT", lmtShape, materials.getMaterialForVolume(m_lmtMaterialName,lmtShape->volume()));
+  const GeoLogVol * lmtLog = new GeoLogVol("LMT", lmtShape, m_materials->getMaterialForVolume(m_lmtMaterialName,lmtShape->volume()));
   GeoPhysVol * lmt = new GeoPhysVol(lmtLog);
 
   // LMT Cooling: must be outside LMTs
@@ -152,7 +155,7 @@ SCT_FwdCylinderServices::build()
   double lmtLength = m_length - 2. * m_lmtCoolingZOffset;
   const GeoTubs* lmtCoolingShape = new GeoTubs(lmtCoolingRmin, lmtCoolingRmax, 0.5 * lmtLength, 
                                                -0.5 * lmtCoolingDPhi * Gaudi::Units::radian, lmtCoolingDPhi * Gaudi::Units::radian);
-  const GeoLogVol * lmtCoolingLog = new GeoLogVol("LMTCooling", lmtCoolingShape, materials.getMaterialForVolume(m_lmtCoolingMaterialName,lmtCoolingShape->volume()));
+  const GeoLogVol * lmtCoolingLog = new GeoLogVol("LMTCooling", lmtCoolingShape, m_materials->getMaterialForVolume(m_lmtCoolingMaterialName,lmtCoolingShape->volume()));
   GeoPhysVol * lmtCooling = new GeoPhysVol(lmtCoolingLog);
 
   // Fibres
@@ -162,7 +165,7 @@ SCT_FwdCylinderServices::build()
   double fibreDPhi = m_fibreRPhi / fibreRmin;
   const GeoCons* fibreShape = new GeoCons(fibreRmin, fibreRmin, fibreRmax1, fibreRmax2, 0.5 * m_length,
                                           -0.5 * fibreDPhi * Gaudi::Units::radian, fibreDPhi * Gaudi::Units::radian);
-  const GeoLogVol * fibreLog = new GeoLogVol("Fibres", fibreShape, materials.getMaterialForVolume(m_fibreMaterialName,fibreShape->volume()));
+  const GeoLogVol * fibreLog = new GeoLogVol("Fibres", fibreShape, m_materials->getMaterialForVolume(m_fibreMaterialName,fibreShape->volume()));
   GeoPhysVol * fibres = new GeoPhysVol(fibreLog);
 
   // N2 Pipe
@@ -171,7 +174,7 @@ SCT_FwdCylinderServices::build()
   double nPipeDPhi = m_nPipeRPhi / nPipeRmin;
   const GeoTubs* nPipeShape = new GeoTubs(nPipeRmin, nPipeRmax, 0.5 * m_length, 
                                           -0.5 * nPipeDPhi * Gaudi::Units::radian, nPipeDPhi * Gaudi::Units::radian);
-  const GeoLogVol * nPipeLog = new GeoLogVol("NPipe", nPipeShape, materials.getMaterialForVolume(m_nPipeMaterialName,nPipeShape->volume()));
+  const GeoLogVol * nPipeLog = new GeoLogVol("NPipe", nPipeShape, m_materials->getMaterialForVolume(m_nPipeMaterialName,nPipeShape->volume()));
   GeoPhysVol * nPipe = new GeoPhysVol(nPipeLog);
 
   // Rails: must be outside Cooling and N2 Pipes
@@ -180,7 +183,7 @@ SCT_FwdCylinderServices::build()
   double railDPhi = m_railRPhi / railRmin;
   const GeoTubs* railShape = new GeoTubs(railRmin, railRmax,
                                          0.5 * m_length, -0.5 * railDPhi * Gaudi::Units::radian, railDPhi * Gaudi::Units::radian);
-  const GeoLogVol * railLog = new GeoLogVol("Rail", railShape, materials.getMaterialForVolume(m_railMaterialName,railShape->volume()));
+  const GeoLogVol * railLog = new GeoLogVol("Rail", railShape, m_materials->getMaterialForVolume(m_railMaterialName,railShape->volume()));
   GeoPhysVol * rail = new GeoPhysVol(railLog);
 
   // Services are repeated for each quadrant
@@ -228,4 +231,3 @@ SCT_FwdCylinderServices::build()
   return cylinder;
   
 }
-
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx
old mode 100755
new mode 100644
index 0bd1309dc16..8ff57e6d8bb
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscFixation.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 "SCT_GeoModel/SCT_FwdDiscFixation.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name,
+                                         InDetDD::SCT_DetectorManager* detectorManager,
+                                         const SCT_GeometryManager* geometryManager,
+                                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_FwdDiscFixation::SCT_FwdDiscFixation(const std::string & name)
 void 
 SCT_FwdDiscFixation::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
         
   m_materialName= parameters->fwdDiscFixationMaterial();
   m_thickness   = parameters->fwdDiscFixationThickness();
@@ -36,11 +39,8 @@ SCT_FwdDiscFixation::getParameters()
 GeoVPhysVol * 
 SCT_FwdDiscFixation::build() 
 {
-
-  SCT_MaterialManager materials;
-
   const GeoTube * discFixationShape = new GeoTube(0., m_radius, 0.5*m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, discFixationShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, discFixationShape->volume());
   const GeoLogVol * discFixationLog = new GeoLogVol(getName(), discFixationShape, m_material);
 
   GeoPhysVol * discFixation = new GeoPhysVol(discFixationLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx
old mode 100755
new mode 100644
index bb71f56acd3..47473f65ca0
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscPowerTape.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 "SCT_GeoModel/SCT_FwdDiscPowerTape.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing)
-  : SCT_SharedComponentFactory(name), m_ringNumber(iRing) 
+SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing,
+                                           InDetDD::SCT_DetectorManager* detectorManager,
+                                           const SCT_GeometryManager* geometryManager,
+                                           SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringNumber(iRing) 
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_FwdDiscPowerTape::SCT_FwdDiscPowerTape(const std::string & name, int iRing)
 void 
 SCT_FwdDiscPowerTape::getParameters()
 {    
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
       
   m_materialName = parameters->fwdDiscPowerTapeMaterial(m_ringNumber);
   m_innerRadius  = parameters->fwdDiscPowerTapeInnerRadius(m_ringNumber);
@@ -38,12 +42,9 @@ SCT_FwdDiscPowerTape::getParameters()
 GeoVPhysVol * 
 SCT_FwdDiscPowerTape::build() 
 {
-  
-   SCT_MaterialManager materials;
- 
   // Make the support disk. A simple tube.
   const GeoTube * powerTapeShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, powerTapeShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, powerTapeShape->volume());
   const GeoLogVol * powerTapeLog = new GeoLogVol(getName(), powerTapeShape, m_material);
 
   GeoPhysVol * powerTape = new GeoPhysVol(powerTapeLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx
old mode 100755
new mode 100644
index 9e66dc2944b..9952f315e45
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdDiscSupport.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 "SCT_GeoModel/SCT_FwdDiscSupport.h"
@@ -14,8 +14,12 @@
 #include "GeoModelKernel/GeoPhysVol.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel)
-  : SCT_SharedComponentFactory(name), m_iWheel(iWheel)
+SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel,
+                                       InDetDD::SCT_DetectorManager* detectorManager,
+                                       const SCT_GeometryManager* geometryManager,
+                                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iWheel(iWheel)
 {
   getParameters();
   m_physVolume = build();
@@ -25,7 +29,7 @@ SCT_FwdDiscSupport::SCT_FwdDiscSupport(const std::string & name, int iWheel)
 void 
 SCT_FwdDiscSupport::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
 
   m_materialName = parameters->fwdDiscSupportMaterial();
   m_thickness   = parameters->fwdDiscSupportThickness();
@@ -37,11 +41,9 @@ GeoVPhysVol *
 SCT_FwdDiscSupport::build() 
 {
   // Make the support disk. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * discSupportShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName+intToString(m_iWheel), discSupportShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName+intToString(m_iWheel), discSupportShape->volume());
+  if(!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * discSupportLog = new GeoLogVol(getName(), discSupportShape, m_material);
 
   GeoPhysVol * discSupport = new GeoPhysVol(discSupportLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx
old mode 100755
new mode 100644
index 98c77903a3f..5597aaf4555
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdFSI.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 "SCT_GeoModel/SCT_FwdFSI.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type)
-  : SCT_SharedComponentFactory(name), m_type(type)
+SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_type(type)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_FwdFSI::SCT_FwdFSI(const std::string & name, int type)
 void 
 SCT_FwdFSI::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
         
   m_materialName= parameters->fwdFSIGeomMaterial(m_type);
   m_thickness   = parameters->fwdFSIGeomThickness(m_type);
@@ -38,10 +42,8 @@ SCT_FwdFSI::getParameters()
 GeoVPhysVol * 
 SCT_FwdFSI::build() 
 {
-  SCT_MaterialManager materials;
-
   const GeoBox * fsiShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, fsiShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, fsiShape->volume());
   const GeoLogVol * fsiLog = new GeoLogVol(getName(), fsiShape, m_material);
 
   GeoPhysVol * fsi = new GeoPhysVol(fsiLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx
old mode 100755
new mode 100644
index 99b73df0b4d..6944ff4bbb3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdHybrid.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
 */
 
 ///////////////////////////////////////////////
@@ -35,8 +35,12 @@
 #include <cmath>
 
 
-SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType)
-  : SCT_SharedComponentFactory(name), m_ringType(ringType) 
+SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType) 
 {
   getParameters();
   m_physVolume = build();
@@ -48,7 +52,7 @@ void
 SCT_FwdHybrid::getParameters()
 {
 
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
   m_materialName  = parameters->fwdHybridMaterial();
 
@@ -80,7 +84,7 @@ SCT_FwdHybrid::getParameters()
 GeoVPhysVol * SCT_FwdHybrid::build() 
 {
 
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
   // Make a hybrid. This is a TRD + BOX 
   const GeoTrd * hybridShape1 = new GeoTrd(0.5 * m_thickness, 0.5 * m_thickness, 
@@ -108,11 +112,9 @@ GeoVPhysVol * SCT_FwdHybrid::build()
   const GeoShape & hybridPos2 = (*hybridShape1 << GeoTrf::RotateX3D(rotation)
                       << GeoTrf::TranslateZ3D(position) );
   
-
-  SCT_MaterialManager materials;
   const GeoShapeUnion & hybridShape = hybridPos1.add(hybridPos2);
   // error getting volume directly.
-  m_material = materials.getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume());
   const GeoLogVol * hybridLog = new GeoLogVol(getName(), &hybridShape, m_material);
   GeoPhysVol * hybrid = new GeoPhysVol(hybridLog);
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx
old mode 100755
new mode 100644
index c1170044dc7..09bb0a3d8d7
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModule.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
 */
 
 ///////////////////////////////////////////////
@@ -45,22 +45,30 @@
 
 inline double sqr(double x) {return x*x;}
 
-SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType)
-  : SCT_UniqueComponentFactory(name), m_ringType(ringType)
+SCT_FwdModule::SCT_FwdModule(const std::string & name, int ringType,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType)
 {
 
   getParameters();
 
-  m_hybrid = new SCT_FwdHybrid("SCT_FwdHybrid"+intToString(ringType), m_ringType );
-  m_spine  = new SCT_FwdSpine("SCT_FwdSpine"+intToString(ringType), m_ringType);
-  m_subspineL  = new SCT_FwdSubSpine("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT);
-  m_subspineR  = new SCT_FwdSubSpine("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT);
-  m_sensor = new SCT_FwdSensor("ECSensor"+intToString(ringType), m_ringType);
+  m_hybrid = new SCT_FwdHybrid("SCT_FwdHybrid"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials);
+  m_spine  = new SCT_FwdSpine("SCT_FwdSpine"+intToString(ringType), m_ringType, m_detectorManager, m_geometryManager, materials);
+  m_subspineL  = new SCT_FwdSubSpine("SCT_FwdSubSpineL"+intToString(ringType), m_ringType, SUBSPINE_LEFT,
+                                     m_detectorManager, m_geometryManager, materials);
+  m_subspineR  = new SCT_FwdSubSpine("SCT_FwdSubSpineR"+intToString(ringType), m_ringType, SUBSPINE_RIGHT,
+                                     m_detectorManager, m_geometryManager, materials);
+  m_sensor = new SCT_FwdSensor("ECSensor"+intToString(ringType), m_ringType,
+                               m_detectorManager, m_geometryManager, materials);
   if (m_connectorPresent) {
-    m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType);
+    m_connector = new SCT_FwdModuleConnector("SCT_FwdModuleConnector"+intToString(ringType), m_ringType,
+                                             m_detectorManager, m_geometryManager, materials);
   }
   else {
-    m_connector = NULL;
+    m_connector = nullptr;
   }
 
   m_logVolume = preBuild();
@@ -81,7 +89,7 @@ SCT_FwdModule::~SCT_FwdModule()
 void 
 SCT_FwdModule::getParameters()
 {
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
   m_glueThickness = parameters->fwdModuleGlueThickness(m_ringType);
   m_distBtwMountPoints = parameters->fwdModuleDistBtwMountPoints(m_ringType);
   m_mountPointToCenter = parameters->fwdModuleMountPoint(m_ringType);
@@ -97,7 +105,7 @@ const GeoLogVol * SCT_FwdModule::preBuild()
 {  
   // module volume preparing 
 
-  const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters();
+  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
   
   double safety = generalParameters->safety();
   double safetyTmp = safety * Gaudi::Units::cm; // For compatibility with minor bug in older version - safety already in CLHEP units;
@@ -159,14 +167,13 @@ const GeoLogVol * SCT_FwdModule::preBuild()
                                                   0.5 * m_length);
   const GeoShapeShift & moduleEnvelope = (*moduleEnvelopeShape << GeoTrf::TranslateZ3D(m_moduleShift) );
   
-  SCT_MaterialManager materials;
-  GeoLogVol * moduleLog =  new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial());
+  GeoLogVol * moduleLog =  new GeoLogVol(getName(), &moduleEnvelope, m_materials->gasMaterial());
      
   return moduleLog;
 
 }
 
-GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const
+GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id)
 {
 
   // build method for creating module parent physical volume 
@@ -174,7 +181,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const
   // - relative position of component is part of its shape 
   GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume);
 
-  if(m_connector != NULL) module->add(m_connector->getVolume());
+  if (m_connector != NULL) module->add(m_connector->getVolume());
   module->add(m_hybrid->getVolume());
   module->add(m_spine->getVolume());
   module->add(m_subspineL->getVolume());
@@ -207,7 +214,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const
   module->add(bottomSensorPV);
   
   // Store transform
-  detectorManager()->addAlignableTransform(0, id.getWaferId(), bottomTransform, bottomSensorPV); 
+  m_detectorManager->addAlignableTransform(0, id.getWaferId(), bottomTransform, bottomSensorPV); 
 
   
   if (m_ringType == 2) { // Place glass pieces in place of sensor
@@ -235,7 +242,7 @@ GeoVPhysVol * SCT_FwdModule::build(SCT_Identifier id) const
   module->add(topSensorPV);
 
   // Store transform
-  detectorManager()->addAlignableTransform(0, id.getWaferId(), topTransform, topSensorPV); 
+  m_detectorManager->addAlignableTransform(0, id.getWaferId(), topTransform, topSensorPV); 
 
   if (m_ringType == 2) { // Place glass pieces in place of sensor
     module->add(new GeoTransform(GeoTrf::Transform3D(vecT*rotT)));
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx
old mode 100755
new mode 100644
index 5ba0a82cba9..5d1174cd24b
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdModuleConnector.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 "SCT_GeoModel/SCT_FwdModuleConnector.h"
@@ -18,8 +18,12 @@
 
 #include <cmath>
 
-SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType)
-  : SCT_SharedComponentFactory(name), m_ringType(ringType)
+SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int ringType,
+                                               InDetDD::SCT_DetectorManager* detectorManager,
+                                               const SCT_GeometryManager* geometryManager,
+                                               SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType)
 {
   getParameters();
   m_physVolume = build();
@@ -29,7 +33,7 @@ SCT_FwdModuleConnector::SCT_FwdModuleConnector(const std::string & name, int rin
 void 
 SCT_FwdModuleConnector::getParameters()
 {
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
   m_materialName= parameters->fwdModuleConnectorMaterial();
   m_deltaR = parameters->fwdModuleConnectorDeltaR();
@@ -40,12 +44,11 @@ SCT_FwdModuleConnector::getParameters()
 GeoVPhysVol * 
 SCT_FwdModuleConnector::build() 
 {
-  SCT_MaterialManager materials;
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
   // Construct box
   const GeoBox * moduleConnShape = new GeoBox(0.5 * m_thickness, 0.5 * m_rphi, 0.5 * m_deltaR);
-  m_material = materials.getMaterialForVolume(m_materialName, moduleConnShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, moduleConnShape->volume());
 
   // Shift to correct position within module
   double xposition = 0.5 * (parameters->fwdHybridThickness() + m_thickness);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx
old mode 100755
new mode 100644
index 0a25774b197..222377aa76e
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdOptoHarness.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 "SCT_GeoModel/SCT_FwdOptoHarness.h"
@@ -19,8 +19,12 @@
 
 inline double sqr(double x) {return x*x;}
 
-SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype)
-  : SCT_SharedComponentFactory(name), m_type(itype)
+SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype,
+                                       InDetDD::SCT_DetectorManager* detectorManager,
+                                       const SCT_GeometryManager* geometryManager,
+                                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_type(itype)
 {
   getParameters();
   m_physVolume = build();
@@ -30,7 +34,7 @@ SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype)
 void 
 SCT_FwdOptoHarness::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
 
   m_index = -1;
   for(int i=0; i<3; ++i) {
@@ -52,10 +56,8 @@ SCT_FwdOptoHarness::getParameters()
 GeoVPhysVol * 
 SCT_FwdOptoHarness::build() 
 {
-  SCT_MaterialManager materials;
-
   const GeoTube * optoHarnessShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, optoHarnessShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, optoHarnessShape->volume());
   const GeoLogVol * optoHarnessLog = new GeoLogVol(getName(), optoHarnessShape, m_material);
 
   GeoPhysVol * optoHarness = new GeoPhysVol(optoHarnessLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx
old mode 100755
new mode 100644
index 29b530629e4..55325f9c75f
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPConnector.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 "SCT_GeoModel/SCT_FwdPPConnector.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name,
+                                       InDetDD::SCT_DetectorManager* detectorManager,
+                                       const SCT_GeometryManager* geometryManager,
+                                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_FwdPPConnector::SCT_FwdPPConnector(const std::string & name)
 void 
 SCT_FwdPPConnector::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
         
   m_materialName= parameters->fwdPPConnectorMaterial();
   m_thickness   = parameters->fwdPPConnectorThickness();
@@ -37,11 +40,8 @@ SCT_FwdPPConnector::getParameters()
 GeoVPhysVol * 
 SCT_FwdPPConnector::build() 
 {
-
-  SCT_MaterialManager materials;
-
   const GeoBox * pPConnectorShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, pPConnectorShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, pPConnectorShape->volume());
   const GeoLogVol * pPConnectorLog = new GeoLogVol(getName(), pPConnectorShape, m_material);
 
   GeoPhysVol * pPConnector = new GeoPhysVol(pPConnectorLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx
old mode 100755
new mode 100644
index ef6c3b76ee7..37a100c3fba
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPPCooling.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 "SCT_GeoModel/SCT_FwdPPCooling.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name,
+                                   InDetDD::SCT_DetectorManager* detectorManager,
+                                   const SCT_GeometryManager* geometryManager,
+                                   SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_FwdPPCooling::SCT_FwdPPCooling(const std::string & name)
 void 
 SCT_FwdPPCooling::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
         
   m_materialName= parameters->fwdPPCoolingMaterial();
   m_thickness   = parameters->fwdPPCoolingThickness();
@@ -37,11 +40,8 @@ SCT_FwdPPCooling::getParameters()
 GeoVPhysVol * 
 SCT_FwdPPCooling::build() 
 {
-
-  SCT_MaterialManager materials;
-
   const GeoBox * pPCoolingShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, pPCoolingShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, pPCoolingShape->volume());
   const GeoLogVol * pPCoolingLog = new GeoLogVol(getName(), pPCoolingShape, m_material);
 
   GeoPhysVol * pPCooling = new GeoPhysVol(pPCoolingLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx
old mode 100755
new mode 100644
index 514a6bf0270..b3e3ff84cc4
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPatchPanel.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 "SCT_GeoModel/SCT_FwdPatchPanel.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type)
-  : SCT_SharedComponentFactory(name), m_type(type)
+SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type,
+                                     InDetDD::SCT_DetectorManager* detectorManager,
+                                     const SCT_GeometryManager* geometryManager,
+                                     SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_type(type)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_FwdPatchPanel::SCT_FwdPatchPanel(const std::string & name, int type)
 void 
 SCT_FwdPatchPanel::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
         
   m_materialName= parameters->fwdPatchPanelMaterial(m_type);
   m_thickness   = parameters->fwdPatchPanelThickness(m_type);
@@ -38,11 +42,8 @@ SCT_FwdPatchPanel::getParameters()
 GeoVPhysVol * 
 SCT_FwdPatchPanel::build() 
 {
-
-  SCT_MaterialManager materials;
-
   const GeoBox * patchPanelShape = new GeoBox(0.5 * m_deltaR, 0.5 * m_rphi, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, patchPanelShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, patchPanelShape->volume());
   const GeoLogVol * patchPanelLog = new GeoLogVol(getName(), patchPanelShape, m_material);
 
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx
old mode 100755
new mode 100644
index 26eb8488217..39a7dbced84
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdPowerTape.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 "SCT_GeoModel/SCT_FwdPowerTape.h"
@@ -20,8 +20,12 @@ SCT_FwdPowerTape::SCT_FwdPowerTape(const std::string & name,
                                    int numModules,
                                    double innerRadius, 
                                    double startPos, 
-                                   double endPos)
-  : SCT_SharedComponentFactory(name), m_numModules(numModules), m_innerRadius(innerRadius)
+                                   double endPos,
+                                   InDetDD::SCT_DetectorManager* detectorManager,
+                                   const SCT_GeometryManager* geometryManager,
+                                   SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_numModules(numModules), m_innerRadius(innerRadius)
 {
   m_length = std::abs(endPos - startPos);
   m_zPosition = 0.5 * (startPos + endPos);
@@ -33,11 +37,9 @@ SCT_FwdPowerTape::SCT_FwdPowerTape(const std::string & name,
 
 void 
 SCT_FwdPowerTape::getParameters()
-{ 
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
-  SCT_MaterialManager materials;
-    
-  m_material  = materials.getMaterial(parameters->fwdPowerTapeMaterial());
+{
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
+  m_material  = m_materials->getMaterial(parameters->fwdPowerTapeMaterial());
   m_crossSectArea = parameters->fwdPowerTapeCrossSectArea();
 }
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx
old mode 100755
new mode 100644
index 4ba75ed8c4e..7546002b12c
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRing.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 "SCT_GeoModel/SCT_FwdRing.h"
@@ -34,11 +34,14 @@
 inline double sqr(double x) {return x*x;}
 
 SCT_FwdRing::SCT_FwdRing(const std::string & name, 
-                         const SCT_FwdModule * module, 
+                         SCT_FwdModule * module, 
                          int iWheel,
                          int iRing,
-                         int ec)
-  : SCT_UniqueComponentFactory(name), 
+                         int ec,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_iWheel(iWheel),
     m_iRing(iRing),
     m_endcap(ec),
@@ -52,8 +55,8 @@ void
 SCT_FwdRing::getParameters()
 {
   
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
-  const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
+  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
     
   m_safety       = generalParameters->safety();
   
@@ -71,7 +74,7 @@ SCT_FwdRing::getParameters()
   m_identifier = m_iRing;
   
   // Set numerology
-  detectorManager()->numerology().setNumPhiModulesForDiskRing(m_iWheel,m_iRing,m_numModules);
+  m_detectorManager->numerology().setNumPhiModulesForDiskRing(m_iWheel,m_iRing,m_numModules);
 
 }
 
@@ -152,10 +155,9 @@ SCT_FwdRing::preBuild()
   // We want the center in z to be at the module mid plane. So we shift the volume.
   double envelopeShift = -m_ringSide * (0.5 * m_thickness - m_thicknessOuter);
 
-  SCT_MaterialManager materials;
   const GeoTube * tmpShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
   const GeoShape & ringEnvelopeShape = (*tmpShape <<  GeoTrf::Translate3D(0, 0, envelopeShift));
-  GeoLogVol * ringLog = new GeoLogVol(getName(), &ringEnvelopeShape, materials.gasMaterial());
+  GeoLogVol * ringLog = new GeoLogVol(getName(), &ringEnvelopeShape, m_materials->gasMaterial());
 
   return ringLog;
 }
@@ -163,7 +165,7 @@ SCT_FwdRing::preBuild()
 
 
 GeoVPhysVol * 
-SCT_FwdRing::build(SCT_Identifier id) const
+SCT_FwdRing::build(SCT_Identifier id)
 {
 
   // Physical volume for the half ring
@@ -235,7 +237,7 @@ SCT_FwdRing::build(SCT_Identifier id) const
     ring->add(modulePV);
 
     // Store alignable transform
-    detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV);  
+    m_detectorManager->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV);  
 
     // Add the moduleServices (contains the cooling block)
     // In principle this should also be rotated by the stereo angle (although one
@@ -280,11 +282,15 @@ SCT_FwdRing::makeModuleServices()
   // to add more things to it later. We call it module services.
   
   // Cooling blocks for the upper Modules
-  m_coolingBlockHiMain = new SCT_FwdCoolingBlock("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN);
-  m_coolingBlockHiSec  = new SCT_FwdCoolingBlock("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY);
+  m_coolingBlockHiMain = new SCT_FwdCoolingBlock("CoolingBlkHiMain",SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::MAIN,
+                                                 m_detectorManager, m_geometryManager, m_materials);
+  m_coolingBlockHiSec  = new SCT_FwdCoolingBlock("CoolingBlkHiSec", SCT_FwdCoolingBlock::UPPER, SCT_FwdCoolingBlock::SECONDARY,
+                                                 m_detectorManager, m_geometryManager, m_materials);
   // Cooling blocks for the lower Modules
-  m_coolingBlockLoMain = new SCT_FwdCoolingBlock("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN);
-  m_coolingBlockLoSec  = new SCT_FwdCoolingBlock("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY);
+  m_coolingBlockLoMain = new SCT_FwdCoolingBlock("CoolingBlkLoMain",SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::MAIN,
+                                                 m_detectorManager, m_geometryManager, m_materials);
+  m_coolingBlockLoSec  = new SCT_FwdCoolingBlock("CoolingBlkLoSec", SCT_FwdCoolingBlock::LOWER, SCT_FwdCoolingBlock::SECONDARY,
+                                                 m_detectorManager, m_geometryManager, m_materials);
   
   double coolingBlkMainR = m_module->mainMountPointRadius();
   double coolingBlkSecR  = m_module->endModuleRadius(); // This is the end of the module. Align block with the end.
@@ -320,15 +326,14 @@ SCT_FwdRing::makeModuleServices()
   m_moduleServicesHiOuterZPos =  -(moduleServicesBaseToRingCenterHi - moduleServicesHiThickness);
   m_moduleServicesLoOuterZPos =  -(moduleServicesBaseToRingCenterLo - moduleServicesLoThickness);
   
-  SCT_MaterialManager materials;
   const GeoBox * moduleServicesHiShape = new GeoBox(0.5*moduleServicesHiLength    + m_safety,  
                                                     0.5*moduleServicesHiWidth     + m_safety, 
                                                     0.5*moduleServicesHiThickness + m_safety);
   const GeoBox * moduleServicesLoShape = new GeoBox(0.5*moduleServicesLoLength    + m_safety,
                                                     0.5*moduleServicesLoWidth     + m_safety, 
                                                     0.5*moduleServicesLoThickness + m_safety);
-  const GeoLogVol *  moduleServicesHiLog = new GeoLogVol("ModuleServicesHi", moduleServicesHiShape,  materials.gasMaterial());
-  const GeoLogVol *  moduleServicesLoLog = new GeoLogVol("ModuleServicesLo", moduleServicesLoShape,  materials.gasMaterial());
+  const GeoLogVol *  moduleServicesHiLog = new GeoLogVol("ModuleServicesHi", moduleServicesHiShape,  m_materials->gasMaterial());
+  const GeoLogVol *  moduleServicesLoLog = new GeoLogVol("ModuleServicesLo", moduleServicesLoShape,  m_materials->gasMaterial());
     
   m_moduleServicesHi = new GeoPhysVol(moduleServicesHiLog);
   m_moduleServicesLo = new GeoPhysVol(moduleServicesLoLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx
old mode 100755
new mode 100644
index 4c321aa924e..04bc6733559
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdRingCooling.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 "SCT_GeoModel/SCT_FwdRingCooling.h"
@@ -18,8 +18,12 @@
 
 inline double sqr(double x) {return x*x;}
 
-SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType)
-  : SCT_SharedComponentFactory(name), m_ringType(ringType)
+SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType,
+                                       InDetDD::SCT_DetectorManager* detectorManager,
+                                       const SCT_GeometryManager* geometryManager,
+                                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType)
 {
   getParameters();
   m_physVolume = build();
@@ -29,7 +33,7 @@ SCT_FwdRingCooling::SCT_FwdRingCooling(const std::string & name, int ringType)
 void 
 SCT_FwdRingCooling::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
     
   m_materialName= parameters->fwdRingCoolingMaterial(m_ringType);
   m_innerRadius = parameters->fwdRingCoolingInnerRadius(m_ringType);
@@ -41,10 +45,8 @@ SCT_FwdRingCooling::getParameters()
 GeoVPhysVol * 
 SCT_FwdRingCooling::build() 
 {
-  SCT_MaterialManager materials;
-
   const GeoTube * ringCoolingShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
-  m_material = materials.getMaterialForVolume(m_materialName, ringCoolingShape->volume());
+  m_material = m_materials->getMaterialForVolume(m_materialName, ringCoolingShape->volume());
   const GeoLogVol * ringCoolingLog = new GeoLogVol(getName(), ringCoolingShape, m_material);
 
   GeoPhysVol * ringCooling = new GeoPhysVol(ringCoolingLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx
old mode 100755
new mode 100644
index c8cd1d7aa2e..1f47acf4994
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSensor.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
 */
 
 ///////////////////////////////////////////////
@@ -47,8 +47,13 @@ using namespace InDetDD;
 
 
 SCT_FwdSensor::SCT_FwdSensor(const std::string & name,
-                             int ringType)
-  : SCT_UniqueComponentFactory(name), m_ringType(ringType)
+                             int ringType,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType{ringType},
+    m_noElementWarning{true}
 {
   getParameters();
   m_logVolume = preBuild();
@@ -62,15 +67,14 @@ void
 SCT_FwdSensor::getParameters()
 {
 
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
-  SCT_MaterialManager materials;
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
-  m_materialSensor  = materials.getMaterial(parameters->fwdSensorMaterialFar(m_ringType));
+  m_materialSensor  = m_materials->getMaterial(parameters->fwdSensorMaterialFar(m_ringType));
   
  
   m_materialGlass  = 0;
   if (m_ringType == 2) { // Only need to define glass if its a Truncated middle module.
-    m_materialGlass =  materials.getMaterial(parameters->fwdSensorMaterialNear(m_ringType));
+    m_materialGlass =  m_materials->getMaterial(parameters->fwdSensorMaterialNear(m_ringType));
   }
                   
   m_thicknessN = m_thicknessF = parameters->fwdSensorThickness(m_ringType);
@@ -168,7 +172,7 @@ const GeoLogVol * SCT_FwdSensor::preBuild()
   // Make the moduleside design for this sensor
   makeDesign();
 
-  detectorManager()->addDesign(m_design);
+  m_detectorManager->addDesign(m_design);
 
   return sensorLog;
 }
@@ -225,7 +229,7 @@ void SCT_FwdSensor::makeDesign()
   //   eta coordinate of crystal center
   //   phi coordinate of crystal center 
 
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
  
   double radius1=0;
   double radius2=0;
@@ -306,7 +310,7 @@ void SCT_FwdSensor::makeDesign()
 
 
 
-GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const
+GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id)
 {
     
   GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume);
@@ -315,7 +319,7 @@ GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const
   // Only do so if we have a valid id helper.
   //id.print(); // for debugging only
 
-  SiCommonItems* commonItems =  geometryManager()->commonItems();
+  const SiCommonItems* commonItems =  m_geometryManager->commonItems();
 
   if (commonItems->getIdHelper()) {
 
@@ -325,13 +329,12 @@ GeoVPhysVol *SCT_FwdSensor::build(SCT_Identifier id) const
                                                            commonItems);
 
     // Add the detector element.
-    detectorManager()->addDetectorElement(detElement);
+    m_detectorManager->addDetectorElement(detElement);
 
   } else {
-    static bool noElementWarning = true; // So we don't get the message thousands of times.
-    if (noElementWarning) {
+    if (m_noElementWarning) {
       std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl;
-      noElementWarning = false;
+      m_noElementWarning = false;
     }
   }
     
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx
old mode 100755
new mode 100644
index 6c6f13e57d7..128c2418ab2
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSpine.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
 */
 
 ///////////////////////////////////////////////
@@ -30,19 +30,21 @@
 #include <cmath>
 
 SCT_FwdSpine::SCT_FwdSpine(const std::string & name,
-         int ringType)
-  : SCT_SharedComponentFactory(name), m_ringType(ringType)
+                           int ringType,
+                           InDetDD::SCT_DetectorManager* detectorManager,
+                           const SCT_GeometryManager* geometryManager,
+                           SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType)
 {
   getParameters();
   m_physVolume = build();
 }
 
-
-
 void
 SCT_FwdSpine::getParameters()
 {
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
  
   m_materialName = parameters->fwdSpineMaterial(m_ringType);
 
@@ -91,10 +93,8 @@ SCT_FwdSpine::build()
   
   //position = position / 2. * HybPos;
   
-  SCT_MaterialManager materials;
-
   const GeoShape & spinePosMain = (*spineShapeMain << GeoTrf::TranslateZ3D(position) );
-  m_material = materials.getMaterialForVolume(m_materialName, spineShapeMain->volume());  
+  m_material = m_materials->getMaterialForVolume(m_materialName, spineShapeMain->volume());  
   GeoLogVol * spineLog = new GeoLogVol(getName(), &spinePosMain, m_material);
   GeoPhysVol * spine = new GeoPhysVol(spineLog);
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx
old mode 100755
new mode 100644
index 20b6b3db602..8a547d3e722
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSubSpine.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
 */
 
 ///////////////////////////////////////////////
@@ -35,8 +35,12 @@
 
 
 SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name,
-         int ringType, int spineSide)
-  : SCT_SharedComponentFactory(name), m_ringType(ringType), m_spineSide(spineSide)
+                                 int ringType, int spineSide,
+                                 InDetDD::SCT_DetectorManager* detectorManager,
+                                 const SCT_GeometryManager* geometryManager,
+                                 SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_ringType(ringType), m_spineSide(spineSide)
 {
   getParameters();
   m_physVolume = build();
@@ -47,10 +51,9 @@ SCT_FwdSubSpine::SCT_FwdSubSpine(const std::string & name,
 void
 SCT_FwdSubSpine::getParameters()
 {
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
-  SCT_MaterialManager materials;
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
 
-  m_material  = materials.getMaterial(parameters->fwdSubSpineMaterial(m_ringType));
+  m_material  = m_materials->getMaterial(parameters->fwdSubSpineMaterial(m_ringType));
 
   // Width is in direction of module width (ie long axis of arm)
   // Length is in direction of module length (ie short axis of arm)
@@ -73,7 +76,7 @@ GeoVPhysVol * SCT_FwdSubSpine::build()
 {
   // x,y,z are in the geomodel module coordinates
 
-  const SCT_ForwardModuleParameters * parameters = geometryManager()->forwardModuleParameters();
+  const SCT_ForwardModuleParameters * parameters = m_geometryManager->forwardModuleParameters();
   
   const GeoBox * spineShape1 = new GeoBox( m_thickness1/2., m_width1/2., m_length1/2.);
   const GeoBox * spineShape2 = 0;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx
old mode 100755
new mode 100644
index cdac143bd99..3bb364e71c3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdSupportFrame.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 "SCT_GeoModel/SCT_FwdSupportFrame.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name,
+                                         InDetDD::SCT_DetectorManager* detectorManager,
+                                         const SCT_GeometryManager* geometryManager,
+                                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_FwdSupportFrame::SCT_FwdSupportFrame(const std::string & name)
 void 
 SCT_FwdSupportFrame::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
      
   m_materialName = parameters->fwdSupportFrameMaterial();
   m_thickness    = parameters->fwdSupportFrameRadialThickness();
@@ -42,12 +45,10 @@ SCT_FwdSupportFrame::getParameters()
 GeoVPhysVol * 
 SCT_FwdSupportFrame::build() 
 {
-  SCT_MaterialManager materials;
-
   // Make the support disk. A simple tube.
   const GeoTube * supportFrameShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, supportFrameShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, supportFrameShape->volume());
+  if(!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * supportFrameLog = new GeoLogVol(getName(), supportFrameShape, m_material);
 
   GeoPhysVol * supportFrame = new GeoPhysVol(supportFrameLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx
old mode 100755
new mode 100644
index d956aca563f..dceaa95de3a
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdThermalShieldElement.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 "SCT_GeoModel/SCT_FwdThermalShieldElement.h"
@@ -16,8 +16,12 @@
 
 #include <cmath>
 
-SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & name, int iElement)
-  : SCT_SharedComponentFactory(name), m_iElement(iElement)
+SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & name, int iElement,
+                                                         InDetDD::SCT_DetectorManager* detectorManager,
+                                                         const SCT_GeometryManager* geometryManager,
+                                                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iElement(iElement)
 {
   getParameters();
   m_physVolume = build();
@@ -27,7 +31,7 @@ SCT_FwdThermalShieldElement::SCT_FwdThermalShieldElement(const std::string & nam
 void 
 SCT_FwdThermalShieldElement::getParameters()
 { 
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
   
   m_materialName = parameters->fwdThermalShieldMaterial(m_iElement);
   m_innerRadius = parameters->fwdThermalShieldInnerRadius(m_iElement);
@@ -42,12 +46,10 @@ SCT_FwdThermalShieldElement::getParameters()
 GeoVPhysVol * 
 SCT_FwdThermalShieldElement::build() 
 {
-  SCT_MaterialManager materials;
-
   // Make the support disk. A simple tube.
   const GeoTube * elementShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, elementShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, elementShape->volume());
+  if (!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * elementLog = new GeoLogVol(getName(), elementShape, m_material);
 
   GeoPhysVol * element = new GeoPhysVol(elementLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx
old mode 100755
new mode 100644
index a8df7a8d062..24f8b07c163
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_FwdWheel.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 "SCT_GeoModel/SCT_FwdWheel.h"
@@ -49,9 +49,12 @@ inline double sqr(double x) {return x*x;}
 
 SCT_FwdWheel::SCT_FwdWheel(const std::string & name,
                            int iWheel,
-                           const std::vector<const SCT_FwdModule *> & modules,
-                           int ec)
-  : SCT_UniqueComponentFactory(name), 
+                           const std::vector<SCT_FwdModule *> & modules,
+                           int ec,
+                           InDetDD::SCT_DetectorManager* detectorManager,
+                           const SCT_GeometryManager* geometryManager,
+                           SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_iWheel(iWheel), 
     m_endcap(ec),
     m_pPConnector(0),
@@ -87,8 +90,8 @@ SCT_FwdWheel::~SCT_FwdWheel()
 void
 SCT_FwdWheel::getParameters()
 {
-  const SCT_ForwardParameters * parameters = geometryManager()->forwardParameters();
-    
+  const SCT_ForwardParameters * parameters = m_geometryManager->forwardParameters();
+   
   m_zPosition = parameters->fwdWheelZPosition(m_iWheel);
   m_numRings  = parameters->fwdWheelNumRings(m_iWheel);
   for (int iRing = 0; iRing < m_numRings; iRing++) {
@@ -134,10 +137,10 @@ SCT_FwdWheel::getParameters()
     }
   }
 
-  m_safety = geometryManager()->generalParameters()->safety();
+  m_safety = m_geometryManager->generalParameters()->safety();
 
   // Set numerology
-  detectorManager()->numerology().setNumRingsForDisk(m_iWheel,m_numRings);  
+  m_detectorManager->numerology().setNumRingsForDisk(m_iWheel,m_numRings);  
 
 }
 
@@ -146,28 +149,39 @@ SCT_FwdWheel::preBuild()
 {
    
   // Create disc support. 
-  m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel);
+  m_discSupport = new SCT_FwdDiscSupport("DiscSupport"+intToString(m_iWheel), m_iWheel,
+                                         m_detectorManager, m_geometryManager, m_materials);
 
 
   // The rings
   for (int iRing = 0; iRing < m_numRings; iRing++){
     std::string ringName = "Ring"+intToString(iRing)+"For"+getName();
     int ringType = m_ringType[iRing];
-    m_rings.push_back(new SCT_FwdRing(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap));
+    m_rings.push_back(new SCT_FwdRing(ringName, m_modules[ringType], m_iWheel, iRing, m_endcap,
+                                      m_detectorManager, m_geometryManager, m_materials));
   }
 
 
   // Create Patch Panel
   //m_patchPanel = new SCT_FwdPatchPanel("PatchPanel"+intToString(m_iWheel), m_iWheel);
   for (int iPPType = 0; iPPType < m_numPatchPanelTypes; iPPType++) {
-    m_patchPanel.push_back(new SCT_FwdPatchPanel("PatchPanel"+intToString(iPPType), iPPType));
+    m_patchPanel.push_back(new SCT_FwdPatchPanel("PatchPanel"+intToString(iPPType), iPPType,
+                                                 m_detectorManager, m_geometryManager, m_materials));
   }
 
   // Create Patch Pannel Connector and Cooling, and disc Fixations
-  if(m_pPConnectorPresent) {m_pPConnector = new SCT_FwdPPConnector("PPConnector");}
-  if(m_pPCoolingPresent) {m_pPCooling = new SCT_FwdPPCooling("PPCooling");}
-  if(m_discFixationPresent) {m_discFixation = new SCT_FwdDiscFixation("DiscFixation");}
-
+  if (m_pPConnectorPresent) {
+    m_pPConnector = new SCT_FwdPPConnector("PPConnector", 
+                                           m_detectorManager, m_geometryManager, m_materials);
+  }
+  if (m_pPCoolingPresent) {
+    m_pPCooling = new SCT_FwdPPCooling("PPCooling",
+                                       m_detectorManager, m_geometryManager, m_materials);
+  }
+  if (m_discFixationPresent) {
+    m_discFixation = new SCT_FwdDiscFixation("DiscFixation",
+                                             m_detectorManager, m_geometryManager, m_materials);
+  }
 
   // Calculate total number of modules
   m_totalModules = 0;
@@ -181,7 +195,8 @@ SCT_FwdWheel::preBuild()
   for (unsigned int iFSI = 0; iFSI < m_fsiVector->size(); iFSI++) {
     int type = (*m_fsiVector)[iFSI]->simType();
     if (!m_fsiType[type]) {
-      m_fsiType[type] = new SCT_FwdFSI("FSI"+intToString(type), type);
+      m_fsiType[type] = new SCT_FwdFSI("FSI"+intToString(type), type,
+                                       m_detectorManager, m_geometryManager, m_materials);
     }
   }
 
@@ -245,14 +260,12 @@ SCT_FwdWheel::preBuild()
   // m_thickness  = 100 * Gaudi::Units::mm;
 
   // Make envelope for the wheel
-  SCT_MaterialManager materials;
-
   double envelopeShift = 0.5*(m_thicknessBack - m_thicknessFront);
   const GeoTube * tmpShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
   const GeoShape & fwdWheelEnvelopeShape = *tmpShape <<  GeoTrf::Translate3D(0, 0, envelopeShift);
 
   const GeoLogVol * fwdWheelLog = 
-    new GeoLogVol(getName(), &fwdWheelEnvelopeShape, materials.gasMaterial());
+    new GeoLogVol(getName(), &fwdWheelEnvelopeShape, m_materials->gasMaterial());
 
   
   return fwdWheelLog;
@@ -260,7 +273,7 @@ SCT_FwdWheel::preBuild()
 }
 
 GeoVPhysVol * 
-SCT_FwdWheel::build(SCT_Identifier id) const
+SCT_FwdWheel::build(SCT_Identifier id)
 {
   GeoFullPhysVol * wheel = new GeoFullPhysVol(m_logVolume);
 
@@ -277,7 +290,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const
 
   for (int iRing = 0; iRing < m_numRings; iRing++){
    
-    const SCT_FwdRing * ring = m_rings[iRing];
+    SCT_FwdRing * ring = m_rings[iRing];
 
     // Position ring
     double ringZpos = ring->ringSide() * ring->ringOffset(); 
@@ -294,7 +307,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const
     // Position cooling
     // Get a pointer to the cooling ring.
     SCT_FwdRingCooling cooling("RingCoolingW"+intToString(m_iWheel)+"R"+intToString(iRing),
-                               iRing);
+                               iRing, m_detectorManager, m_geometryManager, m_materials);
     double coolingZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + cooling.thickness()));
     wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(coolingZpos)));
     wheel->add(cooling.getVolume());
@@ -302,7 +315,8 @@ SCT_FwdWheel::build(SCT_Identifier id) const
     // Power Tapes
     // Get a pointer to the power tape
     SCT_FwdDiscPowerTape powerTape("PowerTapeW"+intToString(m_iWheel)+
-                                   "R"+intToString(iRing), iRing);
+                                   "R"+intToString(iRing), iRing,
+                                   m_detectorManager, m_geometryManager, m_materials);
 
     double powerTapeZpos = ring->ringSide() * (0.5*(m_discSupport->thickness() + powerTape.thickness()) +
                                                cooling.thickness());
@@ -419,7 +433,8 @@ SCT_FwdWheel::build(SCT_Identifier id) const
     std::string optoharnessName = "OptoHarnessO";
     if(m_numRings > 1) {optoharnessName+="M";}
     if(m_numRings > 2) {optoharnessName+="I";}
-    SCT_FwdOptoHarness optoharness(optoharnessName+"W"+intToString(m_iWheel),m_numRings);
+    SCT_FwdOptoHarness optoharness(optoharnessName+"W"+intToString(m_iWheel), m_numRings,
+                                   m_detectorManager, m_geometryManager, m_materials);
     double optoHarnessZpos = 0.5*m_rotateWheel*(m_discSupport->thickness() + optoharness.thickness());
     wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(optoHarnessZpos)));
     wheel->add(optoharness.getVolume());
@@ -488,7 +503,7 @@ SCT_FwdWheel::build(SCT_Identifier id) const
 
   
   // Extra Material
-  InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager());
+  InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager());
   xMat.add(wheel, "SCTDisc");
   xMat.add(wheel, "SCTDisc"+intToString(m_iWheel));
   if (m_endcap > 0) {
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx
old mode 100755
new mode 100644
index cd861f5e533..bfc74c74349
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeneralParameters.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 "SCT_GeoModel/SCT_GeneralParameters.h"
@@ -14,9 +14,9 @@ const double SCT_SAFETY = 0.01 * Gaudi::Units::mm; // Used in some places to mak
                                      // no overlaps due to rounding errors.
 
 
-SCT_GeneralParameters::SCT_GeneralParameters()
+SCT_GeneralParameters::SCT_GeneralParameters(SCT_DataBase* rdb)
 {
-  m_rdb = SCT_DataBase::instance();
+  m_rdb = rdb;
   m_placements = new TopLevelPlacements(m_rdb->topLevelTable());
 }
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx
old mode 100755
new mode 100644
index febbf924122..1b30a9a0adc
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_GeometryManager.cxx
@@ -1,37 +1,37 @@
 /*
-  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_GeoModel/SCT_GeometryManager.h"
 
+#include "InDetGeoModelUtils/DistortedMaterialManager.h"
+#include "InDetIdentifier/SCT_ID.h"
+#include "InDetReadoutGeometry/SiCommonItems.h"
 #include "SCT_GeoModel/SCT_BarrelParameters.h"
 #include "SCT_GeoModel/SCT_BarrelModuleParameters.h"
+#include "SCT_GeoModel/SCT_DataBase.h"
 #include "SCT_GeoModel/SCT_ForwardParameters.h"
 #include "SCT_GeoModel/SCT_ForwardModuleParameters.h"
 #include "SCT_GeoModel/SCT_GeneralParameters.h"
-#include "InDetGeoModelUtils/DistortedMaterialManager.h"
 #include "SCT_GeoModel/SCT_GeoModelAthenaComps.h"
 
-
-SCT_GeometryManager::SCT_GeometryManager()
-  : m_athenaComps(0),
-    m_commonItems(0),
-    m_barrelParameters(0),
-    m_barrelModuleParameters(0),
-    m_forwardParameters(0),
-    m_forwardModuleParameters(0),
-    m_generalParameters(0),
-    m_distortedMatManager(0)
-{}
+SCT_GeometryManager::SCT_GeometryManager(SCT_DataBase* rdb)
+  : m_athenaComps{rdb->athenaComps()},
+    m_rdb{rdb}
+{
+  // This class uses reference counting. Should not be delete'd in destructor.
+  m_commonItems = new InDetDD::SiCommonItems(m_athenaComps->getIdHelper());
+
+  m_barrelParameters = std::make_unique<SCT_BarrelParameters>(m_rdb);
+  m_barrelModuleParameters = std::make_unique<SCT_BarrelModuleParameters>(m_rdb);
+  m_forwardParameters = std::make_unique<SCT_ForwardParameters>(m_rdb);
+  m_forwardModuleParameters = std::make_unique<SCT_ForwardModuleParameters>(m_rdb);
+  m_generalParameters = std::make_unique<SCT_GeneralParameters>(m_rdb);
+  m_distortedMatManager = std::make_unique<InDetDD::DistortedMaterialManager>();
+}
 
 SCT_GeometryManager::~SCT_GeometryManager()
 {
-  delete m_barrelParameters;
-  delete m_barrelModuleParameters;
-  delete m_forwardParameters;
-  delete m_forwardModuleParameters;
-  delete m_generalParameters;
-  delete m_distortedMatManager;
 }
 
 //
@@ -55,81 +55,53 @@ SCT_GeometryManager::athenaComps() const
   return m_athenaComps;
 }
   
-void 
-SCT_GeometryManager::setAthenaComps(const SCT_GeoModelAthenaComps * athenaComps)
-{
-  m_athenaComps = athenaComps;
-}
-
-
 //
 // SiCommonItems which are passed to SiDetectorElements.
 //
 
-InDetDD::SiCommonItems * 
+const InDetDD::SiCommonItems *
 SCT_GeometryManager::commonItems() const
 {
   return m_commonItems;
 }
 
-
-void 
-SCT_GeometryManager::setCommonItems(InDetDD::SiCommonItems * commonItems)
-{
-  m_commonItems = commonItems;
-}
-
 const SCT_BarrelParameters * 
 SCT_GeometryManager::barrelParameters() const
 {    
-  if (!m_barrelParameters) {
-    m_barrelParameters = new SCT_BarrelParameters; 
-  }
-  return m_barrelParameters;
+  return m_barrelParameters.get();
 }
 
 const SCT_BarrelModuleParameters * 
 SCT_GeometryManager::barrelModuleParameters() const
 {    
-  if (!m_barrelModuleParameters) {
-    m_barrelModuleParameters = new SCT_BarrelModuleParameters;
-  }      
-  return m_barrelModuleParameters;
+  return m_barrelModuleParameters.get();
 }
 
 
 const SCT_ForwardModuleParameters * 
 SCT_GeometryManager::forwardModuleParameters() const
 {    
-  if (!m_forwardModuleParameters) {
-    m_forwardModuleParameters = new SCT_ForwardModuleParameters;
-  }    
-  return m_forwardModuleParameters;
+  return m_forwardModuleParameters.get();
 }
 
 
 const SCT_ForwardParameters * 
 SCT_GeometryManager::forwardParameters() const
 {    
-  if (!m_forwardParameters) {
-    m_forwardParameters = new SCT_ForwardParameters;
-  }
-  return m_forwardParameters;
+  return m_forwardParameters.get();
 }
 
 
 const SCT_GeneralParameters * 
 SCT_GeometryManager::generalParameters() const
 {    
-  if (!m_generalParameters) m_generalParameters = new SCT_GeneralParameters;
-  return m_generalParameters;
+  return m_generalParameters.get();
 }
 
 const InDetDD::DistortedMaterialManager * 
 SCT_GeometryManager::distortedMatManager() const
 {    
-  if (!m_distortedMatManager) m_distortedMatManager = new InDetDD::DistortedMaterialManager;
-  return m_distortedMatManager;
+  return m_distortedMatManager.get();
 }
 
 SCT_GeometryManager&
@@ -138,12 +110,13 @@ SCT_GeometryManager::operator=(const SCT_GeometryManager& right) {
     m_options = right.m_options;
     m_athenaComps = right.m_athenaComps;
     m_commonItems = right.m_commonItems;
-    m_barrelParameters = nullptr;
-    m_barrelModuleParameters = nullptr;
-    m_forwardParameters = nullptr;
-    m_forwardModuleParameters = nullptr;
-    m_generalParameters = nullptr;
-    m_distortedMatManager = nullptr;
+    m_rdb = right.m_rdb;
+    m_barrelParameters.reset(new SCT_BarrelParameters(m_rdb));
+    m_barrelModuleParameters.reset(new SCT_BarrelModuleParameters(m_rdb));
+    m_forwardParameters.reset(new SCT_ForwardParameters(m_rdb));
+    m_forwardModuleParameters.reset(new SCT_ForwardModuleParameters(m_rdb));
+    m_generalParameters.reset(new SCT_GeneralParameters(m_rdb));
+    m_distortedMatManager.reset(new InDetDD::DistortedMaterialManager());
   }
   return *this;
 }
@@ -152,10 +125,11 @@ SCT_GeometryManager::SCT_GeometryManager(const SCT_GeometryManager& right) {
   m_options = right.m_options;
   m_athenaComps = right.m_athenaComps;
   m_commonItems = right.m_commonItems;
-  m_barrelParameters = nullptr;
-  m_barrelModuleParameters = nullptr;
-  m_forwardParameters = nullptr;
-  m_forwardModuleParameters = nullptr;
-  m_generalParameters = nullptr;
-  m_distortedMatManager = nullptr;
+  m_rdb = right.m_rdb;
+  m_barrelParameters.reset(new SCT_BarrelParameters(m_rdb));
+  m_barrelModuleParameters.reset(new SCT_BarrelModuleParameters(m_rdb));
+  m_forwardParameters.reset(new SCT_ForwardParameters(m_rdb));
+  m_forwardModuleParameters.reset(new SCT_ForwardModuleParameters(m_rdb));
+  m_generalParameters.reset(new SCT_GeneralParameters(m_rdb));
+  m_distortedMatManager.reset(new InDetDD::DistortedMaterialManager());
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx
old mode 100755
new mode 100644
index a713cba0173..1de3ead94e8
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Harness.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 "SCT_GeoModel/SCT_Harness.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_Harness::SCT_Harness(const std::string & name, double length)
-  : SCT_SharedComponentFactory(name), m_length(length)
+SCT_Harness::SCT_Harness(const std::string & name, double length,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_length(length)
 {
   getParameters();
   m_physVolume = build();
@@ -26,8 +30,8 @@ SCT_Harness::SCT_Harness(const std::string & name, double length)
 void
 SCT_Harness::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+
   m_materialName  = parameters->harnessMaterial();
   m_thickness = parameters->harnessThickness();
   m_width     = parameters->harnessWidth();
@@ -38,13 +42,10 @@ SCT_Harness::build()
 {
 
   // Build the Harness.
-  SCT_MaterialManager materials;
-
   const GeoBox * harnessShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, harnessShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
-  const GeoLogVol *harnessLog = 
-    new GeoLogVol(getName(), harnessShape, m_material);
+  m_material = m_materials->getMaterialForVolume(m_materialName, harnessShape->volume());
+  if (!m_material) m_material = m_materials->getMaterial(m_materialName);
+  const GeoLogVol *harnessLog = new GeoLogVol(getName(), harnessShape, m_material);
   GeoPhysVol * harness = new GeoPhysVol(harnessLog);
 
   return harness;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx
old mode 100755
new mode 100644
index 3572f165608..83bb9f309ca
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Hybrid.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 "SCT_GeoModel/SCT_Hybrid.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_Hybrid::SCT_Hybrid(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_Hybrid::SCT_Hybrid(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManage,
+                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManage, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -25,10 +28,8 @@ SCT_Hybrid::SCT_Hybrid(const std::string & name)
 void
 SCT_Hybrid::getParameters() 
 {
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
-  SCT_MaterialManager materials;
- 
-  m_material  = materials.getMaterial(parameters->hybridMaterial());
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
+  m_material  = m_materials->getMaterial(parameters->hybridMaterial());
   m_thickness = parameters->hybridThickness();
   m_length    = parameters->hybridLength();
   m_width     = parameters->hybridWidth();
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx
old mode 100755
new mode 100644
index 91b846a5f9b..ca4fbc14c04
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Identifier.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 "SCT_GeoModel/SCT_Identifier.h"
@@ -9,13 +9,11 @@
 #include <cassert>
 #include <iostream>
 
-const SCT_ID * SCT_Identifier::s_idHelper = 0;  
-
 Identifier 
 SCT_Identifier::getWaferId() 
 {
-  assert (s_idHelper);
-  return s_idHelper->wafer_id(m_barrelEC, m_layerDisk, m_phiModule, m_etaModule, m_side);
+  assert (m_idHelper);
+  return m_idHelper->wafer_id(m_barrelEC, m_layerDisk, m_phiModule, m_etaModule, m_side);
 }
 
 void SCT_Identifier::print()
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx
old mode 100755
new mode 100644
index c350e121281..cb8168fa07e
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InnerSide.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
 */
 
 //
@@ -37,8 +37,11 @@
 
 #include <cmath>
 
-SCT_InnerSide::SCT_InnerSide(const std::string & name) 
-  : SCT_UniqueComponentFactory(name),
+SCT_InnerSide::SCT_InnerSide(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_hybrid(0),
     m_sensor(0)
 {
@@ -61,8 +64,8 @@ SCT_InnerSide::~SCT_InnerSide()
 void
 SCT_InnerSide::getParameters()
 {
-  const SCT_BarrelModuleParameters       * parameters = geometryManager()->barrelModuleParameters();
-  const SCT_GeneralParameters     * generalParameters = geometryManager()->generalParameters();
+  const SCT_BarrelModuleParameters       * parameters = m_geometryManager->barrelModuleParameters();
+  const SCT_GeneralParameters     * generalParameters = m_geometryManager->generalParameters();
 
   m_safety           = generalParameters->safety();
   m_hybridOffsetZ    = parameters->hybridOffsetZ();
@@ -73,11 +76,9 @@ SCT_InnerSide::getParameters()
 const GeoLogVol * 
 SCT_InnerSide::preBuild()
 {
-  SCT_MaterialManager materials;
-
   // Create child components
-  m_sensor             = new SCT_Sensor("BRLSensor");
-  m_hybrid             = new SCT_Hybrid("Hybrid");
+  m_sensor             = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials);
+  m_hybrid             = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials);
 
   //
   // Define constants for convenience.
@@ -163,7 +164,7 @@ SCT_InnerSide::preBuild()
 
   const GeoLogVol * InnerSideEnvelopeLog = new GeoLogVol("InnerSideEnvelope",
                                                          &InnerSideEnvelopeShape,
-                                                         materials.gasMaterial());
+                                                         m_materials->gasMaterial());
   // 28th Mar S.Mima modified
   // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (00)*********************************
   //m_thickness = 0.5*t_sensor + hybridPosX + 0.5*t_ise2;
@@ -178,7 +179,7 @@ SCT_InnerSide::preBuild()
 
 
 GeoVPhysVol * 
-SCT_InnerSide::build(SCT_Identifier id) const
+SCT_InnerSide::build(SCT_Identifier id)
 {
   GeoFullPhysVol * innerSide = new GeoFullPhysVol(m_logVolume);
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx
old mode 100755
new mode 100644
index d30351c0efc..a5cd9cfadbc
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_InterLink.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 "SCT_GeoModel/SCT_InterLink.h"
@@ -16,8 +16,11 @@
 #include "GeoModelKernel/GeoTransform.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
-SCT_InterLink::SCT_InterLink(const std::string & name)
-  : SCT_SharedComponentFactory(name),
+SCT_InterLink::SCT_InterLink(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
     m_interLinkShape(nullptr),
     m_interLinkLog(nullptr),
     m_interLink(nullptr),
@@ -45,7 +48,7 @@ SCT_InterLink::~SCT_InterLink() {
 void 
 SCT_InterLink::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
 
   // Interlink parameters   
   m_materialName  = parameters->interLinkMaterial();
@@ -86,14 +89,11 @@ GeoVPhysVol *
 SCT_InterLink::build() 
 {
   // Make the interlink.
- 
-  SCT_MaterialManager materials;
-
   if(m_nRepeat == 1) {
     // For old geometry interlink is a simple tube of material
     m_interLinkShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5*m_length);
-    const GeoMaterial* material = materials.getMaterialForVolume(m_materialName, m_interLinkShape->volume());
-    if(!material) {material = materials.getMaterial(m_materialName);}
+    const GeoMaterial* material = m_materials->getMaterialForVolume(m_materialName, m_interLinkShape->volume());
+    if(!material) {material = m_materials->getMaterial(m_materialName);}
     m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, material);
     m_interLink = new GeoPhysVol(m_interLinkLog);
     m_interLink->ref();
@@ -104,13 +104,13 @@ SCT_InterLink::build()
     // And also include FSI flange segments if defined
     // Air tube:
     m_interLinkShape = new GeoTube(m_innerRadius, m_outerRadiusBearing, 0.5*m_length);
-    m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, materials.gasMaterial());
+    m_interLinkLog = new GeoLogVol(getName(), m_interLinkShape, m_materials->gasMaterial());
     m_interLink = new GeoPhysVol(m_interLinkLog);
     m_interLink->ref();
 
     // Interlink segments:
     m_interLinkSegShape = new GeoTubs(m_innerRadius, m_outerRadius, 0.5*m_length, - 0.5*m_dPhi*Gaudi::Units::radian, m_dPhi*Gaudi::Units::radian);
-    m_interLinkSegLog = new GeoLogVol("InterlinkSegment", m_interLinkSegShape, materials.getMaterialForVolume(m_materialName, m_interLinkSegShape->volume()));
+    m_interLinkSegLog = new GeoLogVol("InterlinkSegment", m_interLinkSegShape, m_materials->getMaterialForVolume(m_materialName, m_interLinkSegShape->volume()));
     m_interLinkSeg = new GeoPhysVol(m_interLinkSegLog);
     m_interLinkSeg->ref();
 
@@ -124,7 +124,7 @@ SCT_InterLink::build()
 
     // B6 bearings
     m_bearingShape = new GeoTubs(m_innerRadiusBearing, m_outerRadiusBearing, 0.5*m_lengthBearing, - 0.5*m_dPhiBearing*Gaudi::Units::radian, m_dPhiBearing*Gaudi::Units::radian);
-    m_bearingLog = new GeoLogVol("Bearing", m_bearingShape, materials.getMaterialForVolume(m_materialNameBearing, m_bearingShape->volume()));
+    m_bearingLog = new GeoLogVol("Bearing", m_bearingShape, m_materials->getMaterialForVolume(m_materialNameBearing, m_bearingShape->volume()));
     m_bearing = new GeoPhysVol(m_bearingLog);
     m_bearing->ref();
 
@@ -141,7 +141,7 @@ SCT_InterLink::build()
     if(m_includeFSIFlange) {
       double dPhiFSI = (360./m_nRepeat)*Gaudi::Units::deg - m_dPhi; 
       m_FSIFlangeShape = new GeoTubs(m_innerRadiusFSIFlange, m_outerRadiusFSIFlange, 0.5*m_length, - 0.5*dPhiFSI*Gaudi::Units::radian, dPhiFSI*Gaudi::Units::radian);
-      m_FSIFlangeLog = new GeoLogVol("FSIFlangeSegment", m_FSIFlangeShape, materials.getMaterialForVolume(m_materialNameFSIFlange, m_FSIFlangeShape->volume()));
+      m_FSIFlangeLog = new GeoLogVol("FSIFlangeSegment", m_FSIFlangeShape, m_materials->getMaterialForVolume(m_materialNameFSIFlange, m_FSIFlangeShape->volume()));
       m_FSIFlange = new GeoPhysVol(m_FSIFlangeLog);
       m_FSIFlange->ref();
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx
old mode 100755
new mode 100644
index 451ca68a6f0..f30d0a0b371
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Layer.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
 */
 
 //
@@ -49,8 +49,11 @@ inline double sqr(double x) {return x * x;}
 
 SCT_Layer::SCT_Layer(const std::string & name,
                      int iLayer,
-                     const SCT_Module * module)
-  : SCT_UniqueComponentFactory(name), 
+                     SCT_Module * module,
+                     InDetDD::SCT_DetectorManager* detectorManager,
+                     const SCT_GeometryManager* geometryManager,
+                     SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_iLayer(iLayer), 
     m_module(module)
 {
@@ -69,7 +72,7 @@ SCT_Layer::~SCT_Layer()
   delete m_skiAux;
   delete m_skiPowerTape;
   delete m_supportCyl;
-  if(m_includeFSI) {
+  if (m_includeFSI) {
     delete m_endJewel;
     delete m_scorpion;
     delete m_fibreMask;
@@ -79,8 +82,8 @@ SCT_Layer::~SCT_Layer()
 void
 SCT_Layer::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
     
   m_safety       = generalParameters->safety();
   m_radius       = parameters->radius(m_iLayer);
@@ -95,7 +98,7 @@ SCT_Layer::getParameters()
   m_cylinderLength = parameters->cylinderLength();
 
   m_includeFSI = parameters->includeFSI();
-  if(m_includeFSI) {
+  if (m_includeFSI) {
     m_nRepeatEndJewel = parameters->fsiEndJewelNRepeat(m_iLayer);
     m_phiEndJewel = parameters->fsiEndJewelPhi(m_iLayer);
     m_zEndJewel = parameters->fsiEndJewelZ(m_iLayer);
@@ -105,8 +108,8 @@ SCT_Layer::getParameters()
   }
 
   // Set numerology
-  detectorManager()->numerology().setNumPhiModulesForLayer(m_iLayer,m_skisPerLayer);
-  detectorManager()->numerology().setNumEtaModulesForLayer(m_iLayer,parameters->modulesPerSki());
+  m_detectorManager->numerology().setNumPhiModulesForLayer(m_iLayer,m_skisPerLayer);
+  m_detectorManager->numerology().setNumEtaModulesForLayer(m_iLayer,parameters->modulesPerSki());
 
 }
 
@@ -120,30 +123,32 @@ SCT_Layer::preBuild()
   std::string layerNumStr = intToString(m_iLayer);
 
   // Build the Flanges
-  m_flange     = new SCT_Flange("Flange"+layerNumStr, m_iLayer);
+  m_flange     = new SCT_Flange("Flange"+layerNumStr, m_iLayer, m_detectorManager, m_geometryManager, m_materials);
   
   // Build the SupportCyl
-  m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength);
+  m_supportCyl = new SCT_SupportCyl("SupportCyl"+layerNumStr, m_iLayer, m_cylinderLength,
+                                    m_detectorManager, m_geometryManager, m_materials);
 
   // Build the FSI end jewel, scorpion and fibre mask
   // Mask runs between scorpions and flange in z - must be built after these
-  if(m_includeFSI) {
-    m_endJewel   = new SCT_FSIEndJewel("FSIEndJewel"+layerNumStr);
-    m_scorpion   = new SCT_FSIScorpion("FSIScorpion"+layerNumStr);
+  if (m_includeFSI) {
+    m_endJewel = new SCT_FSIEndJewel("FSIEndJewel"+layerNumStr, m_detectorManager, m_geometryManager, m_materials);
+    m_scorpion = new SCT_FSIScorpion("FSIScorpion"+layerNumStr, m_detectorManager, m_geometryManager, m_materials);
     double length_mask = 0.5*m_cylinderLength - m_flange->length() - m_zScorpion - 0.5*m_scorpion->length();
-    m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask);
+    m_fibreMask = new SCT_FSIFibreMask("FSIFibreMask"+layerNumStr, m_iLayer, length_mask,
+                                       m_detectorManager, m_geometryManager, m_materials);
   }
   else {
-    m_endJewel = 0;
-    m_scorpion = 0;
-    m_fibreMask = 0;
+    m_endJewel = nullptr;
+    m_scorpion = nullptr;
+    m_fibreMask = nullptr;
   }
 
   //
   // Calculations for making active layer components - called ski.
   // This is the modules + doglegs + cooling blocks + coolingpipe 
   // 
-  double divisionAngle  = 360 * Gaudi::Units::degree / m_skisPerLayer;
+  double divisionAngle  = 360. * Gaudi::Units::degree / m_skisPerLayer;
 
   // We define here the first module(id = 0) as the nearest module to phi = 0 with positive phi.
   // We allow slightly negative in case of rounding errors.
@@ -155,7 +160,8 @@ SCT_Layer::preBuild()
 
   // Make the ski
   // The ski length is now reduced to m_activeLength to make room for the cooling inlet/outlet volumes
-  m_ski = new SCT_Ski("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength);
+  m_ski = new SCT_Ski("Ski"+layerNumStr, m_module, m_stereoSign, m_tilt, m_activeLength,
+                      m_detectorManager, m_geometryManager, m_materials);
 
   //
   // Make SkiAux -  This is the brackets, harness and power tape.
@@ -163,10 +169,12 @@ SCT_Layer::preBuild()
   // Bracket is placed at edge of division. 
   // -tiltSign * (r*divisionAngle/2 - bracket_width/2)
   // Works for both +ve and -ve tilt.
-  m_bracket = new SCT_Bracket("Bracket"+layerNumStr);
+  m_bracket = new SCT_Bracket("Bracket"+layerNumStr, m_detectorManager, m_geometryManager, m_materials);
 
-  m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength);
-  m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength);
+  m_harness = new SCT_Harness("Harness"+layerNumStr, m_cylinderLength,
+                              m_detectorManager, m_geometryManager, m_materials);
+  m_skiPowerTape = new SCT_SkiPowerTape("SkiPowerTape"+layerNumStr, m_ski, m_cylinderLength,
+                                        m_detectorManager, m_geometryManager, m_materials);
 
   int tiltSign = (m_tilt < 0) ? -1 : +1;
   
@@ -185,17 +193,22 @@ SCT_Layer::preBuild()
                             m_outerRadiusOfSupport,
                             bracketOffset, 
                             powerTapeOffset,
-                            divisionAngle);
+                            divisionAngle,
+                            m_detectorManager,
+                            m_geometryManager,
+                            m_materials);
 
   // Build the clamp: we cannot do this until we have the dimensions of SkiAux
-  m_clamp = new SCT_Clamp("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius());
+  m_clamp = new SCT_Clamp("Clamp"+layerNumStr, m_iLayer, m_skiAux->outerRadius(),
+                          m_detectorManager, m_geometryManager, m_materials);
 
   // Build the volume representing the cooling inlets, outlet and U-bends.
   // We cannot do this until we have the dimensions of the clamp
   double coolingInnerRadius = m_clamp->outerRadius();
   double clearance = 1*Gaudi::Units::mm;
   double coolingLength = 0.5*m_cylinderLength - 0.5*m_activeLength - clearance;
-  m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength);
+  m_coolingEnd = new SCT_CoolingEnd("CoolingEnd"+layerNumStr, m_iLayer, coolingInnerRadius, coolingLength,
+                                    m_detectorManager, m_geometryManager, m_materials);
 
   //
   //  Calculate the envelopes.
@@ -235,13 +248,12 @@ SCT_Layer::preBuild()
   //
   // Make envelope for layer; length is now same as support cylinder
   //
-  SCT_MaterialManager materials;
   double length = m_cylinderLength;
   //  double length = m_layerLength;
   //  if (m_iLayer == 0) {length = m_cylinderLength + m_safety;}
   const GeoTube * layerEnvelopeTube = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * length);
 
-  GeoLogVol * layerLog = new GeoLogVol(getName(), layerEnvelopeTube, materials.gasMaterial());
+  GeoLogVol * layerLog = new GeoLogVol(getName(), layerEnvelopeTube, m_materials->gasMaterial());
 
 
   // Check for overlap.
@@ -253,11 +265,8 @@ SCT_Layer::preBuild()
 }
 
 GeoVPhysVol * 
-SCT_Layer::build(SCT_Identifier id) const
+SCT_Layer::build(SCT_Identifier id)
 {
-
-  SCT_MaterialManager materials;
-
   // We make this a fullPhysVol for alignment code.
   GeoFullPhysVol * layer = new GeoFullPhysVol(m_logVolume);
 
@@ -269,7 +278,7 @@ SCT_Layer::build(SCT_Identifier id) const
   // Make envelope for active layer
   //
   const GeoTube * activeLayerEnvelopeShape = new GeoTube(m_innerRadiusActive, m_outerRadiusActive, 0.5 * m_cylinderLength);
-  GeoLogVol * activeLayerLog = new GeoLogVol(getName()+"Active", activeLayerEnvelopeShape, materials.gasMaterial());
+  GeoLogVol * activeLayerLog = new GeoLogVol(getName()+"Active", activeLayerEnvelopeShape, m_materials->gasMaterial());
   GeoPhysVol * activeLayer = new GeoPhysVol(activeLayerLog);
 
   for (int iSki = 0; iSki < m_skisPerLayer; iSki++){
@@ -311,7 +320,7 @@ SCT_Layer::build(SCT_Identifier id) const
   //
   const GeoTube * auxLayerEnvelopeShape = new GeoTube(m_skiAux->innerRadius(), m_skiAux->outerRadius(),
                                                       0.5*m_skiAux->length());
-  GeoLogVol * auxLayerLog = new GeoLogVol(getName()+"Aux", auxLayerEnvelopeShape, materials.gasMaterial());
+  GeoLogVol * auxLayerLog = new GeoLogVol(getName()+"Aux", auxLayerEnvelopeShape, m_materials->gasMaterial());
   GeoPhysVol * auxLayer = new GeoPhysVol(auxLayerLog);
 
   for (int iSki = 0; iSki < m_skisPerLayer; iSki++){
@@ -331,7 +340,7 @@ SCT_Layer::build(SCT_Identifier id) const
   //
   const GeoTube * supportLayerTube = new GeoTube(m_innerRadius, m_outerRadiusOfSupport, 0.5 * m_cylinderLength); 
   GeoLogVol * supportLayerLog = new GeoLogVol(getName()+"Support", supportLayerTube, 
-                                              materials.gasMaterial());
+                                              m_materials->gasMaterial());
   GeoPhysVol * supportLayer = new GeoPhysVol(supportLayerLog);
   
   // Position flanges. One at each end.
@@ -374,7 +383,7 @@ SCT_Layer::build(SCT_Identifier id) const
   }
 
   // Extra Material
-  InDetDD::ExtraMaterial xMat(geometryManager()->distortedMatManager());
+  InDetDD::ExtraMaterial xMat(m_geometryManager->distortedMatManager());
   xMat.add(supportLayer, "SCTLayer"+intToString(m_iLayer));
 
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx
old mode 100755
new mode 100644
index b36f72e11de..101cf3e67c2
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_MaterialManager.cxx
@@ -3,7 +3,6 @@
 */
 
 #include "SCT_GeoModel/SCT_MaterialManager.h"
-#include "InDetGeoModelUtils/InDetMaterialManager.h"
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/GeoElement.h"
 #include "SCT_GeoModel/SCT_DataBase.h"
@@ -15,46 +14,27 @@
 
 #include <iostream>
 
-InDetMaterialManager * SCT_MaterialManager::s_materialManager = 0;
-const GeoMaterial * SCT_MaterialManager::s_gasMaterial = 0;
-
 // Constructor 
-SCT_MaterialManager::SCT_MaterialManager() 
+SCT_MaterialManager::SCT_MaterialManager(SCT_DataBase* db)
 {
-  // Get my material manager if we haven't already done so.
-  if (!s_materialManager) {
-
-    ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap
-    StoreGateSvc* detStore;
-    StatusCode sc = svcLocator->service("DetectorStore", detStore );
-    if (sc.isFailure()) {
-      std::cout << "Could not locate DetectorStore" << std::endl;
-      return;
-    }
-
-    const SCT_DataBase * rdb = SCT_DataBase::instance();
-    s_materialManager =  new InDetMaterialManager("SCT_MaterialManager", rdb->athenaComps());
-    s_materialManager->addWeightTable(rdb->weightTable(), "sct");
-    s_materialManager->addScalingTable(rdb->scalingTable());
-
-    loadMaterials();
+  // Get my material manager.
+  ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap
+  StoreGateSvc* detStore;
+  StatusCode sc = svcLocator->service("DetectorStore", detStore );
+  if (sc.isFailure()) {
+    std::cout << "Could not locate DetectorStore" << std::endl;
+    return;
   }
 
-  if (!s_gasMaterial) {
-    s_gasMaterial = s_materialManager->getMaterial("std::Air");
-  }
+  m_materialManager = std::make_unique<InDetMaterialManager>("SCT_MaterialManager", db->athenaComps());
+  m_materialManager->addWeightTable(db->weightTable(), "sct");
+  m_materialManager->addScalingTable(db->scalingTable());
 
-}    
+  loadMaterials();
 
-void 
-SCT_MaterialManager::reinit()
-{
-  s_gasMaterial = 0;
-  delete s_materialManager;
-  s_materialManager = 0;
+  m_gasMaterial = m_materialManager->getMaterial("std::Air");
 }
 
-
 // Add materials not yet in the database 
 void
 SCT_MaterialManager::loadMaterials()
@@ -64,19 +44,19 @@ SCT_MaterialManager::loadMaterials()
 const GeoElement* 
 SCT_MaterialManager::getElement(const std::string & elementName) const
 {
-  return s_materialManager->getElement(elementName);
+  return m_materialManager->getElement(elementName);
 }
 
 const GeoMaterial* 
 SCT_MaterialManager::getMaterial(const std::string & materialName) const
 {
-  return s_materialManager->getMaterial(materialName);
+  return m_materialManager->getMaterial(materialName);
 }
 
 void
 SCT_MaterialManager::addMaterial(GeoMaterial* material)
 {
-  return s_materialManager->addMaterial(material);
+  return m_materialManager->addMaterial(material);
 }
 
 const GeoMaterial* 
@@ -85,13 +65,13 @@ SCT_MaterialManager::getMaterial(const std::string & originalMaterial,
                                  const std::string & newName)
 {
   
-  return s_materialManager->getMaterial(originalMaterial, density, newName);
+  return m_materialManager->getMaterial(originalMaterial, density, newName);
 }
 
 const GeoMaterial *
 SCT_MaterialManager::getMaterialForVolume(const std::string & materialName, double volume)
 {
-  return s_materialManager->getMaterialForVolume(materialName, volume);
+  return m_materialManager->getMaterialForVolume(materialName, volume);
 }
 
 
@@ -99,21 +79,5 @@ SCT_MaterialManager::getMaterialForVolume(const std::string & materialName, doub
 const GeoMaterial* 
 SCT_MaterialManager::gasMaterial() const
 {
-  return s_gasMaterial;
+  return m_gasMaterial;
 }
-
-
-void 
-SCT_MaterialManager::setGasMaterial(const GeoMaterial* material)
-{
-  s_gasMaterial = material;
-}
-  
-void 
-SCT_MaterialManager::setGasMaterial(const std::string & materialName)
-{
-  // Make sure an instance is created in order to initialize the manager
-  SCT_MaterialManager manager;
-  s_gasMaterial = manager.getMaterial(materialName);
-}  
-
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx
old mode 100755
new mode 100644
index f48ab25d870..22a44d2e87e
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Module.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 "SCT_GeoModel/SCT_Module.h"
@@ -39,8 +39,11 @@
 
 #include <cmath>
 
-SCT_Module::SCT_Module(const std::string & name) 
-  : SCT_UniqueComponentFactory(name),
+SCT_Module::SCT_Module(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+: SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_innerSide(0),
     m_outerSide(0),
     m_baseBoard(0)
@@ -58,7 +61,6 @@ SCT_Module::~SCT_Module()
   delete m_innerSidePos;
   delete m_outerSidePos;
 
-  //delete m_sensor; // 14:00 Thu 14th Jul 2005 D.Naito removed.
   delete m_innerSide;
   delete m_outerSide;
   delete m_baseBoard;
@@ -71,10 +73,8 @@ SCT_Module::~SCT_Module()
 void
 SCT_Module::getParameters()
 {
-  const SCT_BarrelModuleParameters       * parameters = geometryManager()->barrelModuleParameters();
-  const SCT_GeneralParameters     * generalParameters = geometryManager()->generalParameters();
-
-  //const SCT_OuterSide OuterSide("OuterSide"); // 14:00 Thu 14th Jul 2005 D.Naito removed.
+  const SCT_BarrelModuleParameters       * parameters = m_geometryManager->barrelModuleParameters();
+  const SCT_GeneralParameters     * generalParameters = m_geometryManager->generalParameters();
 
   m_safety       = generalParameters->safety();
 
@@ -86,9 +86,6 @@ SCT_Module::getParameters()
   m_stereoInner = -0.5*sign*m_stereoAngle;
   m_stereoOuter =  0.5*sign*m_stereoAngle;
 
-  // 1st Feb 2005 D.Naito modified.
-  //m_hybridAndBaseBoardOffsetDirection = (m_stereoSign == 0) ? -1 : +1;
-
   m_baseBoardOffsetY = parameters->baseBoardOffsetY();
   m_baseBoardOffsetZ = parameters->baseBoardOffsetZ();
 }
@@ -97,13 +94,10 @@ SCT_Module::getParameters()
 const GeoLogVol * 
 SCT_Module::preBuild()
 {
-  SCT_MaterialManager materials;
-
   // Create child components
-  m_outerSide       = new SCT_OuterSide("OuterSide");
-  m_baseBoard = new SCT_BaseBoard("BaseBoard");
-  m_innerSide       = new SCT_InnerSide("InnerSide");
-  //m_sensor          = new SCT_Sensor("BRLSensor"); // 14:00 Thu 14th Jul 2005 D.Naito removed.
+  m_outerSide = new SCT_OuterSide("OuterSide", m_detectorManager, m_geometryManager, m_materials);
+  m_baseBoard = new SCT_BaseBoard("BaseBoard", m_detectorManager, m_geometryManager, m_materials);
+  m_innerSide = new SCT_InnerSide("InnerSide", m_detectorManager, m_geometryManager, m_materials);
 
   //
   // We have 2 envelopes.
@@ -307,7 +301,7 @@ SCT_Module::preBuild()
     add(*envelope2 << GeoTrf::Translate3D(xCenterEnv2, yCenterEnv2, zCenterEnv2)).
     subtract(*subBox << GeoTrf::Translate3D(xCenterSubBox, yCenterSubBox, zCenterSubBox));
 
-  const GeoLogVol * moduleLog           = new GeoLogVol(getName(), &moduleEnvelope, materials.gasMaterial());
+  const GeoLogVol * moduleLog           = new GeoLogVol(getName(), &moduleEnvelope, m_materials->gasMaterial());
   
   //
   // inner side
@@ -335,7 +329,7 @@ SCT_Module::preBuild()
 
 
 GeoVPhysVol * 
-SCT_Module::build(SCT_Identifier id) const
+SCT_Module::build(SCT_Identifier id)
 {
   GeoFullPhysVol * module = new GeoFullPhysVol(m_logVolume); 
 
@@ -362,7 +356,7 @@ SCT_Module::build(SCT_Identifier id) const
   GeoVPhysVol * innerSide = m_innerSide->build(id);
   module->add(innerSide);  
   // Store alignable transform
-  detectorManager()->addAlignableTransform(0, innerId, innerTransform, innerSide);
+  m_detectorManager->addAlignableTransform(0, innerId, innerTransform, innerSide);
      
   // Add outerside
   GeoAlignableTransform * outerTransform = new GeoAlignableTransform(*m_outerSidePos);
@@ -375,7 +369,7 @@ SCT_Module::build(SCT_Identifier id) const
   GeoVPhysVol * outerSide = m_outerSide->build(id);
   module->add(outerSide);
   // Store alignable transform
-  detectorManager()->addAlignableTransform(0, outerId, outerTransform, outerSide);
+  m_detectorManager->addAlignableTransform(0, outerId, outerTransform, outerSide);
   
   return module;
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx
old mode 100755
new mode 100644
index 1a4ee321aeb..a2362fda251
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_OuterSide.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 "SCT_GeoModel/SCT_OuterSide.h"
@@ -32,8 +32,11 @@
 
 #include <cmath>
 
-SCT_OuterSide::SCT_OuterSide(const std::string & name) 
-  : SCT_UniqueComponentFactory(name),
+SCT_OuterSide::SCT_OuterSide(const std::string & name,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_hybrid(0),
     m_pigtail(0),
     m_sensor(0)
@@ -59,8 +62,8 @@ SCT_OuterSide::~SCT_OuterSide()
 void
 SCT_OuterSide::getParameters()
 {
-  const SCT_GeneralParameters     * generalParameters = geometryManager()->generalParameters();
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
+  const SCT_GeneralParameters     * generalParameters = m_geometryManager->generalParameters();
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
 
   m_safety           = generalParameters->safety();
   m_hybridOffsetZ    = parameters->hybridOffsetZ();
@@ -71,12 +74,10 @@ SCT_OuterSide::getParameters()
 const GeoLogVol * 
 SCT_OuterSide::preBuild()
 {
-  SCT_MaterialManager materials;
-
   // Create child components
-  m_sensor             = new SCT_Sensor("BRLSensor");
-  m_hybrid             = new SCT_Hybrid("Hybrid");
-  m_pigtail            = new SCT_Pigtail("Pigtail");
+  m_sensor             = new SCT_Sensor("BRLSensor", m_detectorManager, m_geometryManager, m_materials);
+  m_hybrid             = new SCT_Hybrid("Hybrid", m_detectorManager, m_geometryManager, m_materials);
+  m_pigtail            = new SCT_Pigtail("Pigtail", m_detectorManager, m_geometryManager, m_materials);
 
   //
   // Define constants for convenience.
@@ -170,7 +171,7 @@ SCT_OuterSide::preBuild()
 
   const GeoLogVol * OuterSideEnvelopeLog = new GeoLogVol("OuterSideEnvelope",
                                                          &OuterSideEnvelopeShape,
-                                                         materials.gasMaterial());
+                                                         m_materials->gasMaterial());
 
   // 28th Mar S.Mima modified.
   // *** 16:30 Wed 15th Jun 2005 D.Naito modified. (03)*********************************
@@ -186,7 +187,7 @@ SCT_OuterSide::preBuild()
 
 
 GeoVPhysVol * 
-SCT_OuterSide::build(SCT_Identifier id) const
+SCT_OuterSide::build(SCT_Identifier id)
 {
   GeoFullPhysVol * outerSide = new GeoFullPhysVol(m_logVolume);
 
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx
old mode 100755
new mode 100644
index 11ae5d4618b..74db2bdcec5
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Pigtail.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 "SCT_GeoModel/SCT_Pigtail.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_Pigtail::SCT_Pigtail(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_Pigtail::SCT_Pigtail(const std::string & name,
+                         InDetDD::SCT_DetectorManager* detectorManager,
+                         const SCT_GeometryManager* geometryManager,
+                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -25,10 +28,8 @@ SCT_Pigtail::SCT_Pigtail(const std::string & name)
 void
 SCT_Pigtail::getParameters() 
 {
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
-  SCT_MaterialManager materials;
- 
-  m_material  = materials.getMaterial(parameters->pigtailMaterial());
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
+  m_material  = m_materials->getMaterial(parameters->pigtailMaterial());
   m_thickness = parameters->pigtailThickness();
   m_length    = parameters->pigtailLength();
   m_width     = parameters->pigtailWidth();
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx
old mode 100755
new mode 100644
index 3d3a11f4aba..e8fb7d4e7e3
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PixelAttachment.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 "SCT_GeoModel/SCT_PixelAttachment.h"
@@ -17,8 +17,11 @@
 // This is the SCT to Pixel attachment. This was originally defined in the 
 // general indet services but it is in the SCT mother volume.
 
-SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name,
+                                         InDetDD::SCT_DetectorManager* detectorManager,
+                                         const SCT_GeometryManager* geometryManager,
+                                         SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -28,10 +31,8 @@ SCT_PixelAttachment::SCT_PixelAttachment(const std::string & name)
 void 
 SCT_PixelAttachment::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
-    
-  m_material    = materials.getMaterial(parameters->pixelAttachmentMaterial());
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+  m_material    = m_materials->getMaterial(parameters->pixelAttachmentMaterial());
   m_length      = parameters->pixelAttachmentDeltaZ();
   m_innerRadius = parameters->pixelAttachmentInnerRadius();
   m_outerRadius = parameters->pixelAttachmentOuterRadius();
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx
old mode 100755
new mode 100644
index 2449ed9c07c..41a3bce1552
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_PowerTape.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 "SCT_GeoModel/SCT_PowerTape.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/GeoMaterial.h"
 #include "GeoModelKernel/Units.h"
 
-SCT_PowerTape::SCT_PowerTape(const std::string & name, double length)
-  : SCT_SharedComponentFactory(name), m_length(length)
+SCT_PowerTape::SCT_PowerTape(const std::string & name, double length,
+                             InDetDD::SCT_DetectorManager* detectorManager,
+                             const SCT_GeometryManager* geometryManager,
+                             SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_length(length)
 {
   getParameters();
   m_physVolume = build();
@@ -26,12 +30,8 @@ SCT_PowerTape::SCT_PowerTape(const std::string & name, double length)
 void
 SCT_PowerTape::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  SCT_MaterialManager materials;
-  
-  // 30th Aug 2005 S.Mima modified.
-  //  m_material  = materials.powerTapeMaterial();
-  m_material  = materials.getMaterial(parameters->powerTapeMaterial());
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+  m_material  = m_materials->getMaterial(parameters->powerTapeMaterial());
   m_thickness = parameters->powerTapeThickness();
   m_width     = parameters->powerTapeWidth();
 }
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx
old mode 100755
new mode 100644
index 4a3b15f269e..b5ae55a5f84
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Sensor.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 "SCT_GeoModel/SCT_Sensor.h"
@@ -24,8 +24,12 @@
 
 using namespace InDetDD;
 
-SCT_Sensor::SCT_Sensor(const std::string & name)
-  : SCT_UniqueComponentFactory(name)
+SCT_Sensor::SCT_Sensor(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
+    m_noElementWarning{true}
 {
   getParameters();
   m_logVolume = preBuild();
@@ -36,10 +40,8 @@ void
 SCT_Sensor::getParameters()
 {
   
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
-  SCT_MaterialManager materials;
-
-  m_material  = materials.getMaterial(parameters->sensorMaterial());
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
+  m_material  = m_materials->getMaterial(parameters->sensorMaterial());
   m_thickness = parameters->sensorThickness();
   m_length    = 0;
   if (parameters->sensorNumWafers() == 2) {
@@ -62,7 +64,7 @@ SCT_Sensor::preBuild()
   // Make the moduleside design for this sensor
   makeDesign();
 
-  detectorManager()->addDesign(m_design);
+  m_detectorManager->addDesign(m_design);
   
   return sensorLog;
 }
@@ -74,8 +76,8 @@ SCT_Sensor::makeDesign()
   //SiDetectorDesign::Axis etaAxis   = SiDetectorDesign::zAxis;
   //SiDetectorDesign::Axis phiAxis   = SiDetectorDesign::yAxis;
   //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis;
-  
-  const SCT_BarrelModuleParameters * parameters = geometryManager()->barrelModuleParameters();
+
+  const SCT_BarrelModuleParameters * parameters = m_geometryManager->barrelModuleParameters();
   
   double stripPitch      = parameters->sensorStripPitch();
   double stripLength     = parameters->sensorStripLength();
@@ -131,7 +133,7 @@ SCT_Sensor::makeDesign()
 
 
 GeoVPhysVol * 
-SCT_Sensor::build(SCT_Identifier id) const
+SCT_Sensor::build(SCT_Identifier id)
 {
   GeoFullPhysVol * sensor = new GeoFullPhysVol(m_logVolume); 
   
@@ -140,7 +142,7 @@ SCT_Sensor::build(SCT_Identifier id) const
 
   //id.print(); // for debugging only
 
-  SiCommonItems* commonItems =  geometryManager()->commonItems();
+  const SiCommonItems* commonItems =  m_geometryManager->commonItems();
 
   if (commonItems->getIdHelper()) {
 
@@ -152,14 +154,12 @@ SCT_Sensor::build(SCT_Identifier id) const
                                         commonItems);
     
     // Add the detector element.
-    detectorManager()->addDetectorElement(detElement);
+    m_detectorManager->addDetectorElement(detElement);
 
   } else {
-
-    static bool noElementWarning = true; // So we don't get the message thousands of times.
-    if (noElementWarning) {
+    if (m_noElementWarning) {
       std::cout << "WARNING!!!!: No SCT id helper and so no elements being produced." << std::endl;
-      noElementWarning = false;
+      m_noElementWarning = false;
     }
   }
   return sensor;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx
old mode 100755
new mode 100644
index bb7405a950f..befcaff0024
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Ski.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 "SCT_GeoModel/SCT_Ski.h"
@@ -35,11 +35,14 @@
 #include <cmath>
 
 SCT_Ski::SCT_Ski(const std::string & name,
-                 const SCT_Module * module,
+                 SCT_Module * module,
                  int stereoSign,
                  double tilt,
-                 double length)
-  : SCT_UniqueComponentFactory(name), 
+                 double length,
+                 InDetDD::SCT_DetectorManager* detectorManager,
+                 const SCT_GeometryManager* geometryManager,
+                 SCT_MaterialManager* materials)
+  : SCT_UniqueComponentFactory(name, detectorManager, geometryManager, materials),
     m_stereoSign(stereoSign),
     m_tilt(tilt), 
     m_length(length), 
@@ -66,8 +69,8 @@ void
 SCT_Ski::getParameters()
 {
 
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-  const SCT_GeneralParameters * generalParameters = geometryManager()->generalParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+  const SCT_GeneralParameters * generalParameters = m_geometryManager->generalParameters();
 
   m_safety       = generalParameters->safety();
   
@@ -107,13 +110,11 @@ SCT_Ski::preBuild()
 
 
   // Make components.
-  // 15th Aug 2005 S.Mima modified.
-  //  m_dogleg = new SCT_Dogleg(getName()+"Dogleg");
-  m_dogleg = new SCT_Dogleg(getName()+"Dogleg");
-  // 15th Aug 2005 S.Mima modified.
-  //  m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock");
-  m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock");
-  m_coolingPipe = new SCT_CoolingPipe(getName()+"CoolingPipe",m_length);
+  m_dogleg = new SCT_Dogleg(getName()+"Dogleg", m_detectorManager, m_geometryManager, m_materials);
+  m_coolingBlock = new SCT_CoolingBlock(getName()+"CoolingBlock",
+                                        m_detectorManager, m_geometryManager, m_materials);
+  m_coolingPipe = new SCT_CoolingPipe(getName()+"CoolingPipe", m_length,
+                                      m_detectorManager, m_geometryManager, m_materials);
 
   // We need the sign of the tilt in numerous places
   int tiltSign = (m_tilt < 0) ? -1 : +1;
@@ -432,9 +433,7 @@ SCT_Ski::preBuild()
     add(*envelope2 << GeoTrf::Translate3D(xShift2, yShift2, 0));
   skiEnvelopeShape = &tmpShape;
   
-  
-  SCT_MaterialManager materials;    
-  GeoLogVol * skiLog = new GeoLogVol(getName(), skiEnvelopeShape, materials.gasMaterial());
+  GeoLogVol * skiLog = new GeoLogVol(getName(), skiEnvelopeShape, m_materials->gasMaterial());
 
   //GeoPhysVol * ski = new GeoPhysVol(skiLog);
 
@@ -467,7 +466,7 @@ SCT_Ski::preBuild()
 
 
 GeoVPhysVol * 
-SCT_Ski::build(SCT_Identifier id) const
+SCT_Ski::build(SCT_Identifier id)
 {
   GeoPhysVol * ski = new GeoPhysVol(m_logVolume);
 
@@ -485,7 +484,7 @@ SCT_Ski::build(SCT_Identifier id) const
     ski->add(modulePV);  
     
     // Store alignable transform
-    detectorManager()->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV);
+    m_detectorManager->addAlignableTransform(1, id.getWaferId(), moduleTransform, modulePV);
  
     // Add dogleg
     ski->add(m_refPointTransform);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx
old mode 100755
new mode 100644
index 3c3d51e8e56..1c3d5213f88
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiAux.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
 */
 
 //
@@ -38,17 +38,18 @@ calcMinMaxRatioS(double xCenter, double yCenter,
                  double & minRatio, double & maxRatio);
 
 SCT_SkiAux::SCT_SkiAux(const std::string & name,
-                       const SCT_Ski * ski,
-                       // 14th Aug 2005 S.Mima modified.
-                       //const SCT_Bracket * bracket,
-                       const SCT_Bracket * bracket,
-                       const SCT_Harness * harness,
-                       const SCT_SkiPowerTape * skiPowerTape,
+                       SCT_Ski * ski,
+                       SCT_Bracket * bracket,
+                       SCT_Harness * harness,
+                       SCT_SkiPowerTape * skiPowerTape,
                        double innerRadius,
                        double bracketPhiOffset, 
                        double powerTapePhiOffset,
-                       double divisionAngle) :
-  SCT_SharedComponentFactory(name), 
+                       double divisionAngle,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials) :
+  SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
   m_innerRadius(innerRadius), 
   m_bracketPhiOffset(bracketPhiOffset),
   m_powerTapePhiOffset(powerTapePhiOffset),
@@ -169,12 +170,10 @@ SCT_SkiAux::build()
   // Length is same as power tape length
   m_length = m_skiPowerTape->length();
 
-
-  SCT_MaterialManager materials;
   const GeoTubs * skiAuxShape = new GeoTubs(m_innerRadius, m_outerRadius, 0.5*m_length, 
                                             m_sectorStartAngle, m_sectorAngle);
   const GeoLogVol *skiAuxLog = 
-    new GeoLogVol(getName(), skiAuxShape, materials.gasMaterial());
+    new GeoLogVol(getName(), skiAuxShape, m_materials->gasMaterial());
   GeoPhysVol * skiAux = new GeoPhysVol(skiAuxLog);
   //  std::cout << "SCT_SkiAux: m_sectorStartAngle = " <<  m_sectorStartAngle
   //            << ", m_sectorAngle = " << m_sectorAngle << std::endl;
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx
old mode 100755
new mode 100644
index b28581610c0..a80601666bf
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SkiPowerTape.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
 */
 
 //
@@ -33,8 +33,12 @@
 
 SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name,
                                    const SCT_Ski * ski,
-                                   double length) :
-  SCT_SharedComponentFactory(name), m_length(length), m_ski(ski)
+                                   double length,
+                                   InDetDD::SCT_DetectorManager* detectorManager,
+                                   const SCT_GeometryManager* geometryManager,
+                                   SCT_MaterialManager* materials) :
+  SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+  m_length(length), m_ski(ski)
 {
   getParameters();
   m_physVolume = build();
@@ -43,8 +47,8 @@ SCT_SkiPowerTape::SCT_SkiPowerTape(const std::string & name,
 void 
 SCT_SkiPowerTape::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
-    
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
+
   // Width is the same as the width of a single powertape.
   m_powerTapeThickness        = parameters->powerTapeThickness();
   m_width                     = parameters->powerTapeWidth();
@@ -70,10 +74,9 @@ SCT_SkiPowerTape::build()
 
 
   // This is a volume containing all the power tapes.
-  SCT_MaterialManager materials;
   const GeoBox * skiPowerTapeShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length);
   const GeoLogVol *skiPowerTapeLog = 
-    new GeoLogVol(getName(), skiPowerTapeShape, materials.gasMaterial());
+    new GeoLogVol(getName(), skiPowerTapeShape, m_materials->gasMaterial());
   GeoPhysVol * skiPowerTape = new GeoPhysVol(skiPowerTapeLog);
 
   // Loop over modules in ski as we need their z positions.
@@ -141,9 +144,8 @@ SCT_SkiPowerTape::build()
 
     // Label tape with M# at end of string
     //std::ostringstream label; label << "PowerTapeM" << iModule + 1; 
-    //SCT_PowerTape powerTape(label.str(), tapeLength);
-    //SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength);
-    SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength);
+    SCT_PowerTape powerTape(getName()+"PowerTapeM"+intToString(iModule + 1), tapeLength,
+                            m_detectorManager, m_geometryManager, m_materials);
     
     // Calculate x position of tape. This will depend on the module number.
     // The reference point is the middle of the stack.
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx
old mode 100755
new mode 100644
index fc375224b9d..9036d97e23f
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_Spider.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 "SCT_GeoModel/SCT_Spider.h"
@@ -15,8 +15,11 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_Spider::SCT_Spider(const std::string & name)
-  : SCT_SharedComponentFactory(name)
+SCT_Spider::SCT_Spider(const std::string & name,
+                       InDetDD::SCT_DetectorManager* detectorManager,
+                       const SCT_GeometryManager* geometryManager,
+                       SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +29,7 @@ SCT_Spider::SCT_Spider(const std::string & name)
 void 
 SCT_Spider::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
    
   m_materialName = parameters->spiderMaterial();
   m_length       = parameters->spiderDeltaZ();
@@ -38,11 +41,9 @@ GeoVPhysVol *
 SCT_Spider::build() 
 {
   // Make the spider. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * spiderShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, spiderShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, spiderShape->volume());
+  if (!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * spiderLog = new GeoLogVol(getName(), spiderShape, m_material);
 
   GeoPhysVol * spider = new GeoPhysVol(spiderLog);
diff --git a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx
old mode 100755
new mode 100644
index a9a81399933..fd26d5b3d23
--- a/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.cxx
+++ b/InnerDetector/InDetDetDescr/SCT_GeoModel/src/SCT_SupportCyl.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 "SCT_GeoModel/SCT_SupportCyl.h"
@@ -15,8 +15,12 @@
 #include "GeoModelKernel/Units.h"
 
 
-SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double length)
-  : SCT_SharedComponentFactory(name), m_iLayer(iLayer), m_length(length)
+SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double length,
+                               InDetDD::SCT_DetectorManager* detectorManager,
+                               const SCT_GeometryManager* geometryManager,
+                               SCT_MaterialManager* materials)
+  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
+    m_iLayer(iLayer), m_length(length)
 {
   getParameters();
   m_physVolume = build();
@@ -26,7 +30,7 @@ SCT_SupportCyl::SCT_SupportCyl(const std::string & name, int iLayer, double leng
 void 
 SCT_SupportCyl::getParameters()
 {
-  const SCT_BarrelParameters * parameters = geometryManager()->barrelParameters();
+  const SCT_BarrelParameters * parameters = m_geometryManager->barrelParameters();
        
   m_materialName = parameters->supportCylMaterial(m_iLayer);
   m_innerRadius = parameters->supportCylInnerRadius(m_iLayer);
@@ -38,16 +42,12 @@ GeoVPhysVol *
 SCT_SupportCyl::build() 
 {
   // Make the support cyliner. A simple tube.
-  SCT_MaterialManager materials;
-
   const GeoTube * supportCylShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_length);
-  m_material = materials.getMaterialForVolume(m_materialName, supportCylShape->volume());
-  if(!m_material) {m_material = materials.getMaterial(m_materialName);}
+  m_material = m_materials->getMaterialForVolume(m_materialName, supportCylShape->volume());
+  if (!m_material) m_material = m_materials->getMaterial(m_materialName);
   const GeoLogVol * supportCylLog = new GeoLogVol(getName(), supportCylShape, m_material);
 
   GeoPhysVol * supportCyl = new GeoPhysVol(supportCylLog);
 
   return supportCyl;
 }
-
-
-- 
GitLab


From d8c9bd8deaec09bfe4f8829b554e48cd6974470a Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 8 Mar 2019 14:07:22 +0000
Subject: [PATCH 347/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetRIO_OnTrack
 package and SCT_ClusterOnTrackTool class

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../PixelRIO_OnTrackErrorScaling.h            |  6 ++--
 .../SCTRIO_OnTrackErrorScaling.h              |  6 ++--
 .../InDetRIO_OnTrack/SiClusterOnTrack.h       |  2 +-
 .../TRTRIO_OnTrackErrorScaling.h              |  6 ++--
 .../InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h | 10 ++++---
 .../src/PixelRIO_OnTrackErrorScaling.cxx      |  4 +--
 .../src/SCTRIO_OnTrackErrorScaling.cxx        |  6 ++--
 .../InDetRIO_OnTrack/src/SiClusterOnTrack.cxx | 12 ++++++--
 .../src/TRTRIO_OnTrackErrorScaling.cxx        |  4 +--
 .../src/TRT_DriftCircleOnTrack.cxx            | 28 ++++++++++++-------
 .../SiClusterOnTrackTool/CMakeLists.txt       |  3 +-
 .../SCT_ClusterOnTrackTool.h                  | 10 +++++--
 .../src/PixelClusterOnTrackTool.cxx           |  2 +-
 .../src/SCT_ClusterOnTrackTool.cxx            |  6 +++-
 .../MDTRIO_OnTrackErrorScaling.h              |  6 ++--
 .../MuonEtaPhiRIO_OnTrackErrorScaling.h       |  6 ++--
 .../src/MDTRIO_OnTrackErrorScaling.cxx        |  4 +--
 .../src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx |  4 +--
 .../TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h  |  4 +--
 .../src/RIO_OnTrackErrorScaling.cxx           |  4 +--
 .../src/RIO_OnTrackErrorScalingCondAlg.cxx    |  4 +--
 .../src/RIO_OnTrackErrorScalingIDKits.cxx     |  8 +++---
 .../src/RIO_OnTrackErrorScalingKit.cxx        |  4 +--
 .../src/RIO_OnTrackErrorScalingKit.h          |  4 +--
 .../src/RIO_OnTrackErrorScalingMuonKits.cxx   |  8 +++---
 26 files changed, 95 insertions(+), 67 deletions(-)
 create mode 100644 InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..8bf4b99c097
--- /dev/null
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetRecEvent/InDetRIO_OnTrack
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h
index a34fbe5beea..190643fb7b5 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.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 _PixelRIO_OnTrackErrorScaling_H_
 #define _PixelRIO_OnTrackErrorScaling_H_
@@ -26,11 +26,11 @@ public:
     kPixIBLEta,
     kNParamTypes};
 
-  static const char **paramNames() { return s_names; }
+  static const char* const* paramNames() { return s_names; }
   virtual bool postProcess() override;
  
 protected:
-  static const char *s_names[kNParamTypes];
+  static const char* const s_names[kNParamTypes];
 };
 
 CLASS_DEF( PixelRIO_OnTrackErrorScaling ,           254709438 , 1 )
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h
index c023558cda0..96d626bc911 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.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 _SCTRIO_OnTrackErrorScaling_H_
 #define _SCTRIO_OnTrackErrorScaling_H_
@@ -19,10 +19,10 @@ public:
     kEndcap,
     kNParamTypes};
 
-  static const char **paramNames() { return s_names; }
+  static const char* const* paramNames() { return s_names; }
   virtual bool postProcess() override;
 protected:
-  static const char *s_names[kNParamTypes];
+  static const char* const s_names[kNParamTypes];
 };
 
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
index fc773dd6a15..709cb650c9a 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h
@@ -103,7 +103,7 @@ namespace InDet {
       /** The IdentifierHash - probably not used*/
       IdentifierHash                      m_idDE;
       /** The global position */
-      mutable std::atomic<const Amg::Vector3D*> m_globalPosition;
+      mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr
       bool m_isbroad;
   };
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h
index 134e29578eb..0451a243b93 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.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 _TRTRIO_OnTrackErrorScaling_H_
 #define _TRTRIO_OnTrackErrorScaling_H_
@@ -19,10 +19,10 @@ public:
     kEndcap,
     kNParamTypes};
 
-  static const char **paramNames() { return s_names; }
+  static const char* const* paramNames() { return s_names; }
   virtual bool postProcess() override;
 protected:
-  static const char *s_names[kNParamTypes];
+  static const char* const s_names[kNParamTypes];
 };
 
 
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h
index d63ef19d1e4..98c8522e6d5 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -22,6 +22,8 @@
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
 #include "AthLinks/ElementLink.h"
 
+#include <atomic>
+
 namespace Trk {
   class Surface;
   class LocalParameters;
@@ -156,13 +158,13 @@ namespace InDet{
       void setGlobalPosition(Amg::Vector3D& loc3Dframe) const;   
  
       /** global position to be cached */
-      mutable const Amg::Vector3D*     m_globalPosition;
+      mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr
       
       /**local angle to be written out */     
-      mutable float                           m_localAngle;
+      mutable std::atomic<float> m_localAngle;
       
       /**local position along wire to be written out*/
-      mutable float                           m_positionAlongWire;
+      mutable std::atomic<float> m_positionAlongWire;
       
       /** the contained RIO (PRD, PrepRawData) - TRT_DriftCircle in this case */
 //       mutable const InDet::TRT_DriftCircle*  m_rio;
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx
index d69fe70b807..b6b6f75ff55 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h"
 #include "InDetIdentifier/PixelID.h"
 
-const char *PixelRIO_OnTrackErrorScaling::s_names[PixelRIO_OnTrackErrorScaling::kNParamTypes]={
+const char* const PixelRIO_OnTrackErrorScaling::s_names[PixelRIO_OnTrackErrorScaling::kNParamTypes]={
     "PixPhi Barrel",
     "PixEta Barrel",
     "PixPhi Endcap",
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx
index 1c69e379533..749cb4daa92 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx
@@ -1,13 +1,13 @@
 /*
-  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 "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h"
 #include <iostream>
 
-const char *SCTRIO_OnTrackErrorScaling::s_names[SCTRIO_OnTrackErrorScaling::kNParamTypes]={
+const char * const SCTRIO_OnTrackErrorScaling::s_names[SCTRIO_OnTrackErrorScaling::kNParamTypes]={
     "SCT Barrel",
     "SCT Endcap"
-  };
+};
 
 namespace {
   inline double square(double a) { return a*a; }
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
index 5aa45e5ddf1..acde8bb4711 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx
@@ -84,8 +84,16 @@ InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTr
 
 const Amg::Vector3D& InDet::SiClusterOnTrack::globalPosition() const
 { 
-   if (!m_globalPosition) m_globalPosition = associatedSurface().localToGlobal(localParameters());
-   return (*m_globalPosition);
+  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;
+    }
+  }
+ return (*m_globalPosition);
 }
 
 MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx
index 95362b0fca8..29929fc83a8 100644
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h"
 #include <iostream>
 
-const char *TRTRIO_OnTrackErrorScaling::s_names[TRTRIO_OnTrackErrorScaling::kNParamTypes]={
+const char* const TRTRIO_OnTrackErrorScaling::s_names[TRTRIO_OnTrackErrorScaling::kNParamTypes]={
     "TRT Barrel",
     "TRT Endcap"
   };
diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
index 29317b2ee30..f1875eb771e 100755
--- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx
+++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -96,9 +96,9 @@ 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) : 0 ),
-  m_localAngle(rot.m_localAngle),
-  m_positionAlongWire(rot.m_positionAlongWire),
+  m_globalPosition(rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition.load()) : 0 ),
+  m_localAngle(rot.m_localAngle.load()),
+  m_positionAlongWire(rot.m_positionAlongWire.load()),
   m_rio(rot.m_rio),
   m_idDE(rot.m_idDE),
   m_status(rot.m_status),
@@ -115,8 +115,8 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( const I
     delete m_globalPosition;
     m_globalPosition        = (rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition) : 0);
     m_rio                   = rot.m_rio;
-    m_localAngle            = rot.m_localAngle;
-    m_positionAlongWire     = rot.m_positionAlongWire;
+    m_localAngle            = rot.m_localAngle.load();
+    m_positionAlongWire     = rot.m_positionAlongWire.load();
     m_idDE                  = rot.m_idDE;
     m_status                = rot.m_status;
     m_highLevel             = rot.m_highLevel;
@@ -132,10 +132,10 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( InDet::
   if ( &rot != this) {
     Trk::RIO_OnTrack::operator= (rot);
     delete m_globalPosition;
-    m_globalPosition        = rot.m_globalPosition;
+    m_globalPosition        = rot.m_globalPosition.load();
     m_rio                   = rot.m_rio;
-    m_localAngle            = rot.m_localAngle;
-    m_positionAlongWire     = rot.m_positionAlongWire;
+    m_localAngle            = rot.m_localAngle.load();
+    m_positionAlongWire     = rot.m_positionAlongWire.load();
     m_idDE                  = rot.m_idDE;
     m_status                = rot.m_status;
     m_highLevel             = rot.m_highLevel;
@@ -161,7 +161,15 @@ 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) {
-     m_globalPosition = new  Amg::Vector3D(slsf->transform() * loc3Dframe);
+     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;
+     }
    }else{
     throw GaudiException("Dynamic_cast to StraightLineSurface failed!",             
                     	 "TRT_DriftCircleOnTrack::setGlobalPosition()", 
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt
index fd0bf3e7689..276b06da449 100644
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( SiClusterOnTrackTool )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
+                          Control/CxxUtils
                           Database/AthenaPOOL/AthenaPoolUtilities
                           DetectorDescription/GeoPrimitives
                           GaudiKernel
@@ -40,7 +41,7 @@ atlas_add_component( SiClusterOnTrackTool
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces TrkAmbiguityProcessorLib  StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtils )
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps CxxUtils AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces TrkAmbiguityProcessorLib  StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtils )
 
 # Install files from the package:
 atlas_install_headers( SiClusterOnTrackTool )
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h
index c108691157f..cf979bdc1a8 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h
@@ -18,11 +18,15 @@
 #include "GaudiKernel/ToolHandle.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
-#include "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h"
-#include "TrkParameters/TrackParameters.h"
+
+#include "CxxUtils/checker_macros.h"
+#include "InDetCondTools/ISiLorentzAngleTool.h"
 #include "InDetRIO_OnTrack/SCT_ClusterOnTrack.h"
+#include "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h"
 #include "SCT_ModuleDistortions/ISCT_ModuleDistortionsTool.h"
-#include "InDetCondTools/ISiLorentzAngleTool.h"
+#include "TrkParameters/TrackParameters.h"
+
+ATLAS_CHECK_FILE_THREAD_SAFETY;
 
 namespace InDet {
 
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx
index b179d7b1fa5..a49ca7a88d5 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.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
 */
 
 /////////////////////////////////////////////////////////////////
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx
index c3a6a163210..ba96b1f88e5 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx
@@ -14,14 +14,18 @@
 
 #include "SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h"
 
+#include "CxxUtils/checker_macros.h"
 #include "TrkSurfaces/RectangleBounds.h"
 #include "TrkSurfaces/TrapezoidBounds.h"
-#include <cmath>
 #include "TrkRIO_OnTrack/check_cast.h"
 
+#include <cmath>
+
 using CLHEP::micrometer;
 using CLHEP::deg;
 
+ATLAS_CHECK_FILE_THREAD_SAFETY;
+
 ///////////////////////////////////////////////////////////////////
 // Constructor
 ///////////////////////////////////////////////////////////////////
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h
index 2ce586665d7..0eb7c4fe2e7 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.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 _MDTRIO_OnTrackErrorScaling_H_
 #define _MDTRIO_OnTrackErrorScaling_H_
@@ -20,10 +20,10 @@ public:
     kEndcap,
     kNParamTypes};
 
-  static const char **paramNames() { return s_names; }
+  static const char* const* paramNames() { return s_names; }
   virtual bool postProcess() override;
 protected:
-  static const char *s_names[kNParamTypes];
+  static const char* const s_names[kNParamTypes];
 };
 
 CLASS_DEF( MDTRIO_OnTrackErrorScaling ,  100992927, 1 )
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h
index 8b3634e1307..1c703be8197 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.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 _MUONETAPHIRIO_OnTrackErrorScaling_H_
 #define _MUONETAPHIRIO_OnTrackErrorScaling_H_
@@ -20,10 +20,10 @@ public:
     kEta,
     kNParamTypes};
 
-  static const char **paramNames() { return s_names; }
+  static const char* const* paramNames() { return s_names; }
   virtual bool postProcess() override;
 protected:
-  static const char *s_names[kNParamTypes];
+  static const char* const s_names[kNParamTypes];
 };
 
 CLASS_DEF( MuonEtaPhiRIO_OnTrackErrorScaling ,  92816455, 1 )
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx
index b2d59f77eb6..1c11d76fa6e 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h"
 #include <iostream>
 
-const char *MDTRIO_OnTrackErrorScaling::s_names[MDTRIO_OnTrackErrorScaling::kNParamTypes]={
+const char* const MDTRIO_OnTrackErrorScaling::s_names[MDTRIO_OnTrackErrorScaling::kNParamTypes]={
     "MDT Barrel",
     "MDT Endcap"
   };
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx
index 64c2024ff69..207935704b4 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h"
 #include <iostream>
 
-const char *MuonEtaPhiRIO_OnTrackErrorScaling::s_names[MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes]={
+const char* const MuonEtaPhiRIO_OnTrackErrorScaling::s_names[MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes]={
     "Phi",
     "Eta"
   };
diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h
index 911f87f0e13..f246e48a5ed 100644
--- a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h
+++ b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.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
 */
 /* Dear emacs, this is -*-c++-*- */
 #ifndef _RIO_OnTrackErrorScaling_H_
@@ -30,7 +30,7 @@ protected :
   /// @param n_paramter_sets the number of parameter sets
   /// @param param_names the names of the parameter sets
   /// @param n_paramters the number of parameters per set.
-  void checkParameters(const char *label, unsigned int n_paramter_sets, const char **param_names, unsigned int n_paramters) const;
+  void checkParameters(const char *label, unsigned int n_paramter_sets, const char* const* param_names, unsigned int n_paramters) const;
 private:
   std::vector<std::vector<double> > m_params;
 };
diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx
index 4042a8554fd..df58b593585 100644
--- a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx
+++ b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.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 "TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h"
 
@@ -13,7 +13,7 @@ CLID RIO_OnTrackErrorScaling::clid() const {
 
 void RIO_OnTrackErrorScaling::checkParameters(const char *label,
                                               unsigned int n_paramter_sets,
-                                              const char **param_names,
+                                              const char* const* param_names,
                                               unsigned int n_paramters) const
 {
   if (params().size() != n_paramter_sets ) {
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
index e610ed532e1..b4be7e0f598 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.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 "TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h"
@@ -71,7 +71,7 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::addErrorScaling(const std::string &ty
     return StatusCode::FAILURE;
   }
   m_kits.push_back(the_kit);
-  const char **parameters=the_kit->paramNames();
+  const char* const* parameters=the_kit->paramNames();
   for (unsigned int param_i=0; param_i<the_kit->nParametres(); ++param_i) {
     registerAttribute( std::string(parameters[param_i]), m_kits.size()-1, param_i);
   }
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
index 2559917acee..0011bb440f2 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.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 "RIO_OnTrackErrorScalingKit.h"
 #include "InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h"
@@ -13,7 +13,7 @@ public:
   virtual unsigned int nParametres() const override {
     return PixelRIO_OnTrackErrorScaling::kNParamTypes;
   }
-  virtual const char **paramNames()  const override {
+  virtual const char* const* paramNames()  const override {
     return PixelRIO_OnTrackErrorScaling::paramNames();
   }
 
@@ -37,7 +37,7 @@ public:
   virtual unsigned int nParametres() const override {
     return SCTRIO_OnTrackErrorScaling::kNParamTypes;
   }
-  virtual const char **paramNames()  const override {
+  virtual const char* const* paramNames()  const override {
     return SCTRIO_OnTrackErrorScaling::paramNames();
   }
 
@@ -50,7 +50,7 @@ public:
   virtual unsigned int nParametres() const override {
     return TRTRIO_OnTrackErrorScaling::kNParamTypes;
   }
-  virtual const char **paramNames()  const override {
+  virtual const char* const* paramNames()  const override {
     return TRTRIO_OnTrackErrorScaling::paramNames();
   }
 
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx
index 6b3be9d4d10..f13c9214b96 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx
@@ -1,10 +1,10 @@
 /*
-  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 "RIO_OnTrackErrorScalingKit.h"
 
 size_t RIO_OnTrackErrorScalingKit::getParamIndex(const std::string &name) const {
-  const char **param_names = paramNames();
+  const char* const* param_names = paramNames();
   for(size_t idx=0; idx<nParametres(); ++idx) {
     if (strcmp(param_names[idx],name.c_str())==0) return idx;
   }
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h
index cd5e9328d6a..9300a0eb490 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.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 _RIO_OnTrackErrorScalingKit_H_
@@ -14,7 +14,7 @@ public:
   virtual ~RIO_OnTrackErrorScalingKit() {}
 
   virtual unsigned int nParametres()                        const = 0;
-  virtual const char **paramNames()                         const = 0;
+  virtual const char* const* paramNames()                   const = 0;
   virtual size_t getParamIndex(const std::string &name)     const;
 
   virtual std::unique_ptr<RIO_OnTrackErrorScaling> create() const = 0;
diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
index 935535ad4ec..10cd25b9e8a 100644
--- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx
+++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.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 "RIO_OnTrackErrorScalingKit.h"
 #include "MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h"
@@ -28,8 +28,8 @@ public:
   virtual unsigned int nParametres() const override {
     return MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes;
   }
-  virtual const char **paramNames()  const override {
-    return const_cast<const char **>(m_names);
+  virtual const char* const* paramNames()  const override {
+    return const_cast<const char* const*>(m_names);
   }
 private:
   char **m_names;
@@ -47,7 +47,7 @@ public:
   virtual unsigned int nParametres() const override {
     return MDTRIO_OnTrackErrorScaling::kNParamTypes;
   }
-  virtual const char **paramNames()  const override {
+  virtual const char* const* paramNames()  const override {
     return MDTRIO_OnTrackErrorScaling::paramNames();
   }
 };
-- 
GitLab


From 62f6829d1f4d1facc6072d09a36fe2b4b2da8cd7 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 8 Mar 2019 16:08:19 +0100
Subject: [PATCH 348/404] AthenaPoolUtilities: Enable thread-safety static
 checker.

Enable thread-safety static checker and fix identified issues.
---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../AthenaAttrListAddress.h                   |  6 +-
 .../AthenaAttributeListSpecification.h        |  8 +-
 .../CondAttrListCollAddress.h                 |  6 +-
 .../CondAttrListCollection.h                  |  6 +-
 .../AthenaPoolUtilities/CondAttrListVec.h     | 85 +++++++++++--------
 .../CondAttrListVecAddress.h                  |  6 +-
 .../AthenaPoolUtilities/CMakeLists.txt        |  1 +
 8 files changed, 68 insertions(+), 51 deletions(-)
 create mode 100644 Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/ATLAS_CHECK_THREAD_SAFETY b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6b505768ae8
--- /dev/null
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Database/AthenaPOOL/AthenaPoolUtilities
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttrListAddress.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttrListAddress.h
index 405caf64752..78886fe1def 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttrListAddress.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttrListAddress.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 ATHENAPOOLCNVSVC_ATHENAATTRLISTADDRESS_H
@@ -48,7 +48,7 @@ public:
     AthenaAttrListAddress& operator= (const AthenaAttrListAddress& copy) = delete;
 
     /// Access to AttributeList
-    AthenaAttributeList*  attrList    () const;
+    AthenaAttributeList*  attrList    ();
 
     /// Add AttributeList
     void                  setAttrList (AthenaAttributeList* attrList);
@@ -107,7 +107,7 @@ AthenaAttrListAddress::~AthenaAttrListAddress()
 
 
 inline AthenaAttributeList*
-AthenaAttrListAddress::attrList    () const
+AthenaAttrListAddress::attrList    ()
 {
     return m_attrList;
 }
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttributeListSpecification.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttributeListSpecification.h
index 35048d442f4..e02cb31a7a5 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttributeListSpecification.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/AthenaAttributeListSpecification.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 ATHENAPOOLUTILITIES_ATHENAATTRIBUTELISTSPECIFICATION_H
@@ -12,6 +12,7 @@
 #include <vector>
 #include <map>
 #include <set>
+#include <atomic>
 #include "CoralBase/AttributeSpecification.h"
 #include "CoralBase/AttributeListException.h"
 #include "CoralBase/AttributeListSpecification.h"
@@ -131,7 +132,7 @@ protected:
 
 private:
   /// The reference counter
-  mutable int m_counter;
+  mutable std::atomic<int> m_counter;
 
   /// The specifications
   std::vector< AthenaAttributeSpecification* > m_attributeSpecifications;
@@ -286,8 +287,7 @@ AthenaAttributeListSpecification::release() const
   //std::cerr << "Before decrement " << std::endl;
   //std::cerr << "AthenaAttributeListSpecification release called "
   //          << "with counter = " << m_counter << std::endl;
-  --m_counter;
-  if ( m_counter == 0 ) delete this;
+  if (--m_counter == 0) delete this;
 }
 
 inline void
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollAddress.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollAddress.h
index 643b99ecbb0..76c180e6022 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollAddress.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollAddress.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 ATHENAPOOLCNVSVC_CONDATTRLISTCOLLADDRESS_H
@@ -47,7 +47,7 @@ public:
     virtual ~CondAttrListCollAddress();
 
     /// Access to AttributeList
-    CondAttrListCollection*  attrListColl    () const;
+    CondAttrListCollection*  attrListColl    ();
 
     /// Add AttributeList
     void                  setAttrListColl (CondAttrListCollection* attrListColl);
@@ -117,7 +117,7 @@ CondAttrListCollAddress::~CondAttrListCollAddress()
 }
 
 inline CondAttrListCollection*
-CondAttrListCollAddress::attrListColl    () const
+CondAttrListCollAddress::attrListColl    ()
 {
     return m_attrListColl;
 }
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollection.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollection.h
index 35fb3bf3620..8f773de733a 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollection.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListCollection.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
 */
 
 /**
@@ -399,7 +399,7 @@ CondAttrListCollection::attributeList(ChanNum chanNum) const
     if (itr!=m_attrMap.end()) {
         return itr->second;
     } else {
-        static AttributeList attr;
+        static const AttributeList attr;
         return attr;
     }
 }
@@ -423,7 +423,7 @@ inline const std::string& CondAttrListCollection::chanName(ChanNum chanNum) cons
     if (itr!=m_nameMap.end()) {
         return itr->second;
     } else {
-        static std::string name;
+        static const std::string name;
         return name;
     }
 }
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVec.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVec.h
index bfd2a1af186..7975d18d9de 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVec.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVec.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
 */
 
 /**
@@ -25,6 +25,7 @@
 #include "CoralBase/AttributeListSpecification.h"
 #include "AthenaKernel/IOVRange.h"
 #include "AthenaKernel/CLASS_DEF.h"
+#include "CxxUtils/CachedValue.h"
 #include "GaudiKernel/DataObject.h"
 
 class CondAttrListVec : public DataObject
@@ -41,6 +42,12 @@ class CondAttrListVec : public DataObject
   typedef std::map<unsigned int, std::vector<const coral::AttributeList*> >
     AttrListCVMap;
 
+  struct Index
+  {
+    AttrListCVMap m_indexchanvec;
+    std::vector<unsigned int> m_indexchan;
+  };
+
   // constructor with specification of type of time: run/event or timestamp
   CondAttrListVec(bool runevent);
   // constructor with specification of type and initial size
@@ -106,13 +113,11 @@ class CondAttrListVec : public DataObject
   IOVRange m_minrange;
   bool m_uniqueiov;
   bool m_runevent;
-  mutable bool m_indexed;
   coral::AttributeListSpecification* m_spec;
   // indexing variables
-  mutable AttrListCVMap m_indexchanvec;
-  mutable std::vector<unsigned int> m_indexchan;
+  CxxUtils::CachedValue<Index> m_index;
 
-  void makeIndex() const;
+  const Index& index() const;
 };
 
 CLASS_DEF( CondAttrListVec , 55403898 , 1)
@@ -123,7 +128,7 @@ CONDCONT_DEF( CondAttrListVec, 74272308 );
 inline CondAttrListVec::CondAttrListVec(bool runevent) :
   m_minrange(IOVRange(IOVTime(IOVTime::MINRUN, IOVTime::MINEVENT), 
 		      IOVTime(IOVTime::MAXRUN, IOVTime::MAXEVENT))),
-  m_uniqueiov(true),m_runevent(runevent),m_indexed(false),m_spec(0) {
+  m_uniqueiov(true),m_runevent(runevent),m_spec(0) {
   if (!runevent) m_minrange=IOVRange(IOVTime(IOVTime::MINTIMESTAMP), 
 				     IOVTime(IOVTime::MAXTIMESTAMP));
 }
@@ -131,7 +136,7 @@ inline CondAttrListVec::CondAttrListVec(bool runevent) :
 inline CondAttrListVec::CondAttrListVec(bool runevent, size_type nelm) :
   m_minrange(IOVRange(IOVTime(IOVTime::MINRUN, IOVTime::MINEVENT), 
 		      IOVTime(IOVTime::MAXRUN, IOVTime::MAXEVENT))),
-	 m_uniqueiov(true),m_runevent(runevent),m_indexed(false),m_spec(0) {
+	 m_uniqueiov(true),m_runevent(runevent),m_spec(0) {
   if (!runevent) m_minrange=IOVRange(IOVTime(IOVTime::MINTIMESTAMP), 
 				     IOVTime(IOVTime::MAXTIMESTAMP));
   m_data.reserve(nelm);
@@ -147,7 +152,7 @@ inline CondAttrListVec::CondAttrListVec(const CondAttrListVec& rhs) :
   m_iovmap(rhs.m_iovmap),
   m_minrange(rhs.m_minrange),
   m_uniqueiov(rhs.m_uniqueiov),
-  m_runevent(rhs.m_runevent),m_indexed(false),
+  m_runevent(rhs.m_runevent),
   m_spec(0)
 {
   // members with normal semantics setup in initialisation list
@@ -236,7 +241,7 @@ inline void CondAttrListVec::add(const IOVRange& range,
 	   const unsigned int chan, 
 	   AttrListDataIter data_begin, AttrListDataIter data_end) {
   //invalidate index
-  m_indexed=false;
+  m_index.reset();
   // set minimum range correctly
   IOVTime start=m_minrange.start();
   if (m_minrange.start()<range.start()) start=range.start();
@@ -265,7 +270,7 @@ inline void CondAttrListVec::addSlice(const IOVRange& range,
 	   const std::vector<coral::AttributeList>& data,
 	   const unsigned int datastart,const unsigned int dataend) {
   // invalidate index
-  m_indexed=false;
+  m_index.reset();
   // set minimum range correctly
   IOVTime start=m_minrange.start();
   if (m_minrange.start()<range.start()) start=range.start();
@@ -296,41 +301,51 @@ inline void CondAttrListVec::addNewStop(const IOVTime& stop) {
 }
 
 inline const std::vector<unsigned int>& CondAttrListVec::channelIDs() const {
-  makeIndex();
-  return m_indexchan;
+  return index().m_indexchan;
 }
 
 inline bool CondAttrListVec::hasChannel(const int chan) const {
-  return (m_indexchanvec.find(chan)!=m_indexchanvec.end());
+  const AttrListCVMap& m = index().m_indexchanvec;
+  return (m.find(chan)!=m.end());
 }
 
 inline const std::vector<const coral::AttributeList*>& 
-  CondAttrListVec::attrListVec(const int chan) const {
-  makeIndex();
-  return m_indexchanvec[chan];
+CondAttrListVec::attrListVec(const int chan) const
+{
+  const AttrListCVMap& m = index().m_indexchanvec;
+  AttrListCVMap::const_iterator it = m.find (chan);
+  if (it != m.end()) {
+    return it->second;
+  }
+  static const std::vector<const coral::AttributeList*> dum;
+  return dum;
 }
 
-inline void CondAttrListVec::makeIndex() const {
-  // check if already indexed
-  if (m_indexed) return;
-  m_indexchanvec.clear();
-  m_indexchan.clear();
-  // loop over all the elements, build vector of AttributeList for each channel
-  // and a vector of all the channels
-  for (const_iterator citr=m_data.begin();citr!=m_data.end();++citr) {
-    unsigned int chan=citr->first;
-    AttrListCVMap::iterator clist=m_indexchanvec.find(chan);
-    if (clist==m_indexchanvec.end()) {
-      // channel not seen before, create a new entry in map and vector
-      std::pair<AttrListCVMap::iterator,bool> res=
-	m_indexchanvec.insert(AttrListCVMap::value_type(chan,
-	std::vector<const coral::AttributeList*>()));
-      clist=res.first;
-      m_indexchan.push_back(chan);
+inline
+const CondAttrListVec::Index& CondAttrListVec::index() const
+{
+  if (!m_index.isValid()) {
+    Index index;
+
+    // loop over all the elements, build vector of AttributeList for each channel
+    // and a vector of all the channels
+    for (const AttrListPair& p : m_data) {
+      unsigned int chan=p.first;
+      AttrListCVMap::iterator clist=index.m_indexchanvec.find(chan);
+      if (clist==index.m_indexchanvec.end()) {
+        // channel not seen before, create a new entry in map and vector
+        std::pair<AttrListCVMap::iterator,bool> res=
+          index.m_indexchanvec.insert(AttrListCVMap::value_type(chan,
+                                       std::vector<const coral::AttributeList*>()));
+        clist=res.first;
+        index.m_indexchan.push_back(chan);
+      }
+      clist->second.push_back(&(p.second));
     }
-    clist->second.push_back(&(citr->second));
+
+    m_index.set (std::move (index));
   }
-  m_indexed=true;
+  return *m_index.ptr();
 }
 
 #endif //  DBDATAOBJECTS_CONDATTRLISTVEC_H 
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVecAddress.h b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVecAddress.h
index a7fda864eff..4a25774ba01 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVecAddress.h
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/AthenaPoolUtilities/CondAttrListVecAddress.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 ATHENAPOOLCNVSVC_CONDATTRLISTVECADDRESS_H
@@ -46,7 +46,7 @@ public:
     virtual ~CondAttrListVecAddress();
 
     /// Access to CondAttrListVec
-    CondAttrListVec*  attrListVec    () const;
+    CondAttrListVec*  attrListVec    ();
 
     /// Add CondAttrListVec
     void                  setAttrListVec (CondAttrListVec* attrListVec);
@@ -117,7 +117,7 @@ CondAttrListVecAddress::~CondAttrListVecAddress()
 }
 
 inline CondAttrListVec*
-CondAttrListVecAddress::attrListVec    () const
+CondAttrListVecAddress::attrListVec    ()
 {
     return m_attrListVec;
 }
diff --git a/Database/AthenaPOOL/AthenaPoolUtilities/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolUtilities/CMakeLists.txt
index 7a9ef3c5138..398e6dfc625 100644
--- a/Database/AthenaPOOL/AthenaPoolUtilities/CMakeLists.txt
+++ b/Database/AthenaPOOL/AthenaPoolUtilities/CMakeLists.txt
@@ -11,6 +11,7 @@ atlas_depends_on_subdirs(
    PUBLIC
    Control/AthenaKernel
    Control/AthContainers
+   Control/CxxUtils
    Database/AthenaPOOL/DBDataModel
    Database/PersistentDataModel )
 
-- 
GitLab


From c53d12fea161bcc7af6eb92789f298201c40cfe0 Mon Sep 17 00:00:00 2001
From: Hass AbouZeid <hass.abouzeid@cern.ch>
Date: Fri, 8 Mar 2019 16:34:36 +0100
Subject: [PATCH 349/404] Update overlay test version for master branch

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index d795f8d7d01..467e7d7e23b 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',
                }
-- 
GitLab


From 2877de116775ea8aa601c2d690f30be67848170a Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Fri, 8 Mar 2019 18:56:20 +0100
Subject: [PATCH 350/404] Actually run modifications in trigger case

---
 .../Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
index f4befe98540..f14d2774268 100644
--- a/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
+++ b/Reconstruction/Jet/JetRecTools/JetRecTools/JetConstituentModSequence.h
@@ -129,6 +129,8 @@ JetConstituentModSequence::copyModForTrigger(const T& originals) const
     *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;
-- 
GitLab


From e4e2692faa27f5256e1c29d6660ca807d1159d86 Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Fri, 8 Mar 2019 18:56:49 +0100
Subject: [PATCH 351/404] Remove typo

---
 .../TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
index f14020ea95c..b05b85ced39 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -36,7 +36,7 @@ jetFlags.debug = 4
 
 from JetRec.JetRecStandard import jtm
 from JetRec.JetRecCalibrationFinder import jrcf
-# Calibration Configurarion file (nokw defined in offline code)
+# Calibration Configurarion file (now defined in offline code)
 #cfg_file = "JES_Full2012dataset_Preliminary_Trigger_NoPileup.config"
 #jrcf.configDict["triggerNoPileup"] = cfg_file
 
-- 
GitLab


From da03e4d690b20efdf098e63db9aa4c6ab0e728e5 Mon Sep 17 00:00:00 2001
From: Krzysztof Jamrog <krzysztof.piotr.jamrog@cern.ch>
Date: Fri, 8 Mar 2019 19:21:09 +0100
Subject: [PATCH 352/404] Remove unnecessary ComponentAccumulator import

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py  | 1 -
 .../python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py          | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index dbcefaf3c35..453fb15edf9 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
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
index 45c9c25acd2..707c700706c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
@@ -14,8 +14,8 @@ log = logging.getLogger('HLTCFConfig_newJO')
 log.setLevel( VERBOSE )
 
 
-def connectStepToFilter(chainStep, filter):
-    filter_output = filter.getOutputList()
+def connectStepToFilter(chainStep, filterNode):
+    filter_output = filterNode.getOutputList()
     if len(filter_output) == 0:
         raise ValueError('ERROR: no filter outputs are set')
 
@@ -27,7 +27,7 @@ def connectStepToFilter(chainStep, filter):
     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, filter.Alg.name(), sequence.seed)
+                  sequence.name, filterNode.Alg.name(), sequence.seed)
         sequence.connectToFilter(output)
 
 
-- 
GitLab


From a7176d3d7f58393c87d2123d4119351628c665dc Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 8 Mar 2019 15:52:51 +0100
Subject: [PATCH 353/404] CaloTPCnv: ID helper initialization in
 CaloCompactCellTool_test.

In a unit test, need to record CaloCell_ID and CaloCell_SuperCell_ID in the detector
store  Needed for compatiility with upcoming identifier work.
---
 .../CaloCnv/CaloTPCnv/test/CaloCompactCellTool_test.cxx       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Calorimeter/CaloCnv/CaloTPCnv/test/CaloCompactCellTool_test.cxx b/Calorimeter/CaloCnv/CaloTPCnv/test/CaloCompactCellTool_test.cxx
index c6c1f832e22..d35dc1417a6 100644
--- a/Calorimeter/CaloCnv/CaloTPCnv/test/CaloCompactCellTool_test.cxx
+++ b/Calorimeter/CaloCnv/CaloTPCnv/test/CaloCompactCellTool_test.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
 */
 
 // $Id: CaloCompactCellTool_test.cxx,v 1.12 2009-03-31 19:04:04 ssnyder Exp $
@@ -1115,6 +1115,8 @@ std::vector<CaloCell*> init (IdDictParser* parser)
   CHECK( detstore->record (mgr, "CaloMgr") );
   CHECK( detstore->record (scmgr, "CaloSuperCellMgr") );
   CHECK( detstore->record (idmgr, "CaloIdManager") );
+  CHECK( detstore->record (helper, "CaloCell_ID") );
+  CHECK( detstore->record (schelper, "CaloCell_SuperCell_ID") );
 
   arena = new SG::Arena ("arena");
 
-- 
GitLab


From c76e92323bb437c237a1e0c88f7147115b3fd651 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 8 Mar 2019 04:40:47 +0100
Subject: [PATCH 354/404] LArCalibTools: Fix duplicated Gaudi property.

Fix Gaudi CablingKey property duplicated between base/derived classes.
---
 .../LArCalibTools/LArCalibTools/LArCond2NtupleBase.h       | 2 ++
 LArCalorimeter/LArCalibTools/LArCalibTools/LArOFCBinAlg.h  | 1 -
 LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx    | 7 +++++++
 LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx          | 5 ++---
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h
index 11a125292f3..9eb8d2c3ecb 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h
@@ -42,6 +42,8 @@ class LArCond2NtupleBase : public AthAlgorithm {
   //StatusCode initializeBase(const std::string& path, const std::string& name);
   bool fillFromIdentifier(const HWIdentifier& id); //returns true if connected
 
+  const SG::ReadCondHandleKey<LArOnOffIdMapping>& cablingKey() const;
+
  private:
   bool m_initialized;
 
diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArOFCBinAlg.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArOFCBinAlg.h
index 720fee57e76..310e695e8c3 100644
--- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArOFCBinAlg.h
+++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArOFCBinAlg.h
@@ -25,7 +25,6 @@ class LArOFCBinAlg: public LArCond2NtupleBase {
 
 
  private:
-  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
   std::string m_inputContainer;
   std::string m_outputContainer;
   std::string m_fileName;
diff --git a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
index 4e557d57421..1966aecfb2a 100644
--- a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx
@@ -373,3 +373,10 @@ bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) {
 
  return connected;
 }
+
+
+const SG::ReadCondHandleKey<LArOnOffIdMapping>&
+LArCond2NtupleBase::cablingKey() const
+{
+  return m_cablingKey;
+}
diff --git a/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx b/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
index 5c70fd7fe62..15c72366177 100644
--- a/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArOFCBinAlg.cxx
@@ -31,7 +31,6 @@ StatusCode LArOFCBinAlg::initialize() {
   //}
   m_ntTitle="Bin";
   m_ntpath=std::string("/NTUPLES/FILE1/OFCBINDIFF");
-  ATH_CHECK( m_cablingKey.initialize() );
   return LArCond2NtupleBase::initialize();
 }
 
@@ -98,10 +97,10 @@ StatusCode LArOFCBinAlg::execute() {
     msg(MSG::ERROR) << "Failed to register container with key " << m_outputContainer << " to StoreGate" << endmsg;
   }
 
-  SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
+  SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{cablingKey()};
   const LArOnOffIdMapping* cabling{*cablingHdl};
   if(!cabling) {
-     ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
+      ATH_MSG_ERROR( "Do not have cabling mapping from key " << cablingKey().key() );
      return StatusCode::FAILURE;
   }
   const CaloCell_ID* idHelper = nullptr;
-- 
GitLab


From ba93e8287f5af49fa5cc297a7f23c172c3109f55 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 8 Mar 2019 15:56:44 +0100
Subject: [PATCH 355/404] MuonByteStreamCnvTest: Remove unneeded dependencies
 on EventInfo.

Remove unneeded #includes of EventInfo/TagInfo.h.
---
 .../MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx     | 3 +--
 .../MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx     | 3 +--
 .../MuonCnv/MuonByteStreamCnvTest/src/TgcDigitToTgcRDO.cxx     | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx
index 82f7b729e32..e6d041843eb 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/MdtDigitToMdtRDO.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 "MuonDigitContainer/MdtDigitContainer.h"
@@ -12,7 +12,6 @@
 
 #include "MuonByteStreamCnvTest/MdtDigitToMdtRDO.h"
 
-#include "EventInfo/TagInfo.h"
 #include "EventInfoMgt/ITagInfoMgr.h"
 
 #include <algorithm>
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx
index 3e17338099b..9ca4c0cb6dc 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/RpcDigitToRpcRDO.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
 */
 
 
@@ -12,7 +12,6 @@
 #include "MuonDigitContainer/RpcDigitCollection.h"
 #include "MuonDigitContainer/RpcDigit.h"
 
-#include "EventInfo/TagInfo.h"
 #include "EventInfoMgt/ITagInfoMgr.h"
 
 //#include "RPCcablingInterface/RpcPadIdHash.h"
diff --git a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcDigitToTgcRDO.cxx b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcDigitToTgcRDO.cxx
index db906a51c50..e6cf541215f 100644
--- a/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcDigitToTgcRDO.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonByteStreamCnvTest/src/TgcDigitToTgcRDO.cxx
@@ -1,10 +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 "StoreGate/StoreGateSvc.h"
 
-#include "EventInfo/TagInfo.h"
 #include "EventInfoMgt/ITagInfoMgr.h"
 
 #include "TGCcablingInterface/ITGCcablingServerSvc.h"
-- 
GitLab


From c75c490d872a69821fb2c6dc82d40f7cbd732751 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 8 Mar 2019 16:06:30 +0100
Subject: [PATCH 356/404] TrkVertexSeedFinderUtils: Make IMode3dFinder::Modes1d
 const.

Needed to comply with ToolHandle constness rules.
Also add some override keywords.
---
 .../TrkVertexSeedFinderUtils/IMode3dFinder.h  |  2 +-
 .../Mode3dFromFsmw1dFinder.h                  | 20 +++++++++----------
 .../Mode3dTo1dFinder.h                        | 16 +++++++--------
 .../src/Mode3dFromFsmw1dFinder.cxx            |  2 +-
 .../src/Mode3dTo1dFinder.cxx                  |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IMode3dFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IMode3dFinder.h
index 175a1990292..cb61fa848e8 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IMode3dFinder.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/IMode3dFinder.h
@@ -45,7 +45,7 @@ namespace Trk
        virtual const Amg::Vector3D getMode(const std::vector<Amg::Vector3D> &) const=0;       
 
        virtual unsigned int Modes1d(std::vector<float> &, std::vector<float> &, 
-				    std::vector<float> &, std::vector<float> &) = 0 ;
+				    std::vector<float> &, std::vector<float> &) const = 0 ;
        virtual const std::vector<int> & AcceptedCrossingPointsIndices() const = 0 ;
        virtual void getCorrelationDistance( double &cXY, double &cZ ) = 0 ;
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h
index 02a51ff2142..40a8b8a6cc1 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dFromFsmw1dFinder.h
@@ -30,16 +30,16 @@ namespace Trk
   class Mode3dFromFsmw1dFinder : public AthAlgTool, virtual public IMode3dFinder
   {
   public:
-    StatusCode initialize();
-    StatusCode finalize();
+    virtual StatusCode initialize() override;
+    virtual StatusCode finalize() override;
     
     //default constructor due to Athena interface
       Mode3dFromFsmw1dFinder(const std::string& t, const std::string& n, const IInterface*  p);
       
       //destructor
       virtual ~Mode3dFromFsmw1dFinder();
-      
-      inline void setPriVtxPosition( double vx, double vy )
+
+      inline virtual void setPriVtxPosition( double vx, double vy ) override
       {
         m_Xprivtx = vx ;
         m_Yprivtx = vy ;
@@ -47,18 +47,18 @@ namespace Trk
       } ;
 
       //obtain the 3d-mode (position) from a list of positions (distribution in space)
-      virtual const Amg::Vector3D getMode(const std::vector<Trk::PositionAndWeight> &) const;
+      virtual const Amg::Vector3D getMode(const std::vector<Trk::PositionAndWeight> &) const override;
 
       //obtain the 3d-mode (position) from a list of positions (distribution in space) - NO WEIGHTS
-      virtual const Amg::Vector3D getMode(const std::vector<Amg::Vector3D> &) const;
+      virtual const Amg::Vector3D getMode(const std::vector<Amg::Vector3D> &) const override;
       
-      const std::vector<int> & AcceptedCrossingPointsIndices() const ;
+      virtual const std::vector<int> & AcceptedCrossingPointsIndices() const override;
 
       // Passing some middle result to outside world, useless unless to monitor the tool
-      unsigned int Modes1d( std::vector<float> &, std::vector<float> &, 
-                            std::vector<float> &, std::vector<float> & ) ;
+      virtual unsigned int Modes1d( std::vector<float> &, std::vector<float> &, 
+                                    std::vector<float> &, std::vector<float> & ) const override;
       
-      inline void getCorrelationDistance( double &cXY, double &cZ )
+      inline virtual void getCorrelationDistance( double &cXY, double &cZ ) override
       { cXY = m_correXY ; cZ = m_correZ ; return ; }
 
   private:
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h
index bfd80feb209..3bcfc9c6ea4 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h
@@ -32,8 +32,8 @@ namespace Trk
   class Mode3dTo1dFinder : public AthAlgTool, virtual public IMode3dFinder
   {
   public:
-    StatusCode initialize();
-    StatusCode finalize();
+    virtual StatusCode initialize() override;
+    virtual StatusCode finalize() override;
     
     //default constructor due to Athena interface
       Mode3dTo1dFinder(const std::string& t, const std::string& n, const IInterface*  p);
@@ -42,19 +42,19 @@ namespace Trk
       virtual ~Mode3dTo1dFinder();
             
       //obtain the 3d-mode (position) from a list of positions (distribution in space)
-      virtual const Amg::Vector3D getMode(const std::vector<Trk::PositionAndWeight> &) const;
+      virtual const Amg::Vector3D getMode(const std::vector<Trk::PositionAndWeight> &) const override;
 
       //obtain the 3d-mode (position) from a list of positions (distribution in space) - NO WEIGHTS
-      virtual const Amg::Vector3D getMode(const std::vector<Amg::Vector3D> &) const;
+      virtual const Amg::Vector3D getMode(const std::vector<Amg::Vector3D> &) const override;
      
 
       //The below four functions are dummy functions so that this compiles. The functions are needed in the interface IMode3dFinder.h for Mode3dFromFsmw1dFinder (the seed finder for the Inclusive Secondary Vertex Finder)
-      virtual void setPriVtxPosition( double, double );
+      virtual void setPriVtxPosition( double, double ) override;
       virtual unsigned int Modes1d(std::vector<float> &, std::vector<float> &, 
-				   std::vector<float> &, std::vector<float> &);
+				   std::vector<float> &, std::vector<float> &) const override;
 
-      virtual const std::vector<int> & AcceptedCrossingPointsIndices() const;
-      virtual void getCorrelationDistance( double &cXY, double &cZ );
+      virtual const std::vector<int> & AcceptedCrossingPointsIndices() const override;
+      virtual void getCorrelationDistance( double &cXY, double &cZ ) override;
       
   private:
       
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dFromFsmw1dFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dFromFsmw1dFinder.cxx
index 764bd3c2cfd..94c4f736f26 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dFromFsmw1dFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dFromFsmw1dFinder.cxx
@@ -716,7 +716,7 @@ const Amg::Vector3D Mode3dFromFsmw1dFinder::Mode2Seed( const VeVecIndices & phi,
 }
 
 unsigned int Mode3dFromFsmw1dFinder::Modes1d( std::vector<float> & phi, 
-                  std::vector<float> & radi, std::vector<float> & z, std::vector<float> & wght )
+                  std::vector<float> & radi, std::vector<float> & z, std::vector<float> & wght ) const
 {
   unsigned int min = 0 ;
 
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
index 94ac89d40dd..e6ef09db5b3 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/Mode3dTo1dFinder.cxx
@@ -104,7 +104,7 @@ namespace Trk
   }
 
   unsigned int Mode3dTo1dFinder::Modes1d(std::vector<float> &/* a */, std::vector<float> &/* b */, 
-					 std::vector<float> &/* c */, std::vector<float> &/* d */){
+					 std::vector<float> &/* c */, std::vector<float> &/* d */) const {
     //implemented to satisfy inheritance
     return 0;
   }
-- 
GitLab


From 15ea50aaf2b3d0c853bbd121d759e9e8b89506c7 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 8 Mar 2019 16:06:55 +0100
Subject: [PATCH 357/404] TileRec: Fix clang compilation warnings.

clang warnings: braces in initialization.
---
 TileCalorimeter/TileRec/TileRec/TileAANtuple.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/TileCalorimeter/TileRec/TileRec/TileAANtuple.h b/TileCalorimeter/TileRec/TileRec/TileAANtuple.h
index cac40af3ffe..df20a467ffb 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}}};
 
-- 
GitLab


From 5054711595619553c906cba9b54dc279f72e34be Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Sat, 9 Mar 2019 00:39:40 +0100
Subject: [PATCH 358/404] TrigHLTJetHypo: Add missing component declaration.

Fixes q221 failure.
---
 .../TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx
index 014d7bb1b88..488c7cb4d09 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 )
-- 
GitLab


From c5e53242005f6dd7f79bf2646820026939fa5369 Mon Sep 17 00:00:00 2001
From: MatousVozak <matous.vozak@cern.ch>
Date: Sat, 9 Mar 2019 11:08:32 +0100
Subject: [PATCH 359/404] removing commented lines

---
 .../TrigValidation/TrigUpgradeTest/python/InDetSetup.py  | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
index 47001a6f5bd..690e08dc747 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetSetup.py
@@ -202,8 +202,6 @@ def makeInDetAlgs( whichSignature='' ):
                                                       # ChannelStatus         = InDetSCT_ChannelStatusAlg,
                                                       DataObjectName          = InDetKeys.SCT_RDOs(),
                                                       ClustersName            = "SCT_TrigClusters",
-                                                      #Adding the suffix to flagged conditions
-                                                      #SCT_FlaggedCondData     = "SCT_FlaggedCondData_TRIG",
                                                       conditionsTool          = InDetSCT_ConditionsSummaryToolWithoutFlagged)
   InDetSCT_Clusterization.isRoI_Seeded = True
   InDetSCT_Clusterization.RoIs = "EMViewRoIs"
@@ -258,13 +256,6 @@ def makeInDetAlgs( whichSignature='' ):
   theTrackParticleCreatorAlg.roiCollectionName = "EMViewRoIs"
   viewAlgs.append(theTrackParticleCreatorAlg)
 
-  
- # #Run over all alg and suffix to CondData
- # for alg in viewAlgs: 
- #     if  alg.properties().has_key("SCT_FlaggedCondData"):
- #       #Changing the suffix of FlaggedConditionData
- #        alg.SCT_FlaggedCondData = "SCT_FlaggedCondData_TRIG"
- # #Need to call it on inside tools
 
 
   return (viewAlgs, eventAlgs)
-- 
GitLab


From b9e190b587853fe2f228c7f00e3124ced794c757 Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Sat, 9 Mar 2019 11:35:06 +0000
Subject: [PATCH 360/404] Fixing gcc8 warnings from VP1 packages in master

---
 .../vp13dstandardchannelsnapshotgroupbox.ui   | 13 +++-
 .../VP1/VP1Base/src/vp1customstereoeditor.ui  |  1 -
 .../src/caloreadoutsystemcontroller.ui        |  2 +-
 .../src/geometrysystemcontroller.ui           | 78 ++++++++++++++++---
 4 files changed, 78 insertions(+), 16 deletions(-)

diff --git a/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui b/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui
index 08a0d27d6e0..1cafcc5f2ac 100644
--- a/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui
+++ b/graphics/VP1/VP1Base/src/vp13dstandardchannelsnapshotgroupbox.ui
@@ -14,7 +14,16 @@
    <string>Form</string>
   </property>
   <layout class="QVBoxLayout">
-   <property name="margin">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
     <number>0</number>
    </property>
    <item>
@@ -254,7 +263,7 @@
          </property>
          <layout class="QVBoxLayout" name="verticalLayout_2">
           <item>
-           <layout class="QGridLayout" name="gridLayout">
+           <layout class="QGridLayout" name="gridLayout11">
             <item row="0" column="1">
              <widget class="QRadioButton" name="radioButton_1080p">
               <property name="toolTip">
diff --git a/graphics/VP1/VP1Base/src/vp1customstereoeditor.ui b/graphics/VP1/VP1Base/src/vp1customstereoeditor.ui
index 10b5fa9be10..f1ec670202c 100644
--- a/graphics/VP1/VP1Base/src/vp1customstereoeditor.ui
+++ b/graphics/VP1/VP1Base/src/vp1customstereoeditor.ui
@@ -579,7 +579,6 @@ However, if you have a large scene, where you want to fly around in the scene, a
           </layout>
          </item>
         </layout>
-        <zorder></zorder>
        </widget>
       </item>
       <item>
diff --git a/graphics/VP1/VP1Systems/VP1CaloReadoutSystems/src/caloreadoutsystemcontroller.ui b/graphics/VP1/VP1Systems/VP1CaloReadoutSystems/src/caloreadoutsystemcontroller.ui
index 90d15fdb9b9..3466608a0c4 100644
--- a/graphics/VP1/VP1Systems/VP1CaloReadoutSystems/src/caloreadoutsystemcontroller.ui
+++ b/graphics/VP1/VP1Systems/VP1CaloReadoutSystems/src/caloreadoutsystemcontroller.ui
@@ -686,7 +686,7 @@
            <property name="title" >
             <string>HV Pathologic</string>
            </property>
-           <layout class="QGridLayout" name="gridLayout" >
+           <layout class="QGridLayout" name="gridLayout_7" >
             <item row="0" column="2" >
              <widget class="QLabel" name="hecLabel_2" >
               <property name="text" >
diff --git a/graphics/VP1/VP1Systems/VP1GeometrySystems/src/geometrysystemcontroller.ui b/graphics/VP1/VP1Systems/VP1GeometrySystems/src/geometrysystemcontroller.ui
index d74f4080959..6fa82999c7c 100644
--- a/graphics/VP1/VP1Systems/VP1GeometrySystems/src/geometrysystemcontroller.ui
+++ b/graphics/VP1/VP1Systems/VP1GeometrySystems/src/geometrysystemcontroller.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>287</width>
-    <height>646</height>
+    <width>338</width>
+    <height>822</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -46,7 +46,16 @@
         </sizepolicy>
        </property>
        <layout class="QGridLayout" name="_19">
-        <property name="margin">
+        <property name="leftMargin">
+         <number>0</number>
+        </property>
+        <property name="topMargin">
+         <number>0</number>
+        </property>
+        <property name="rightMargin">
+         <number>0</number>
+        </property>
+        <property name="bottomMargin">
          <number>0</number>
         </property>
         <property name="spacing">
@@ -149,20 +158,38 @@
           <property name="spacing">
            <number>0</number>
           </property>
-          <property name="margin">
+          <property name="leftMargin">
+           <number>4</number>
+          </property>
+          <property name="topMargin">
+           <number>4</number>
+          </property>
+          <property name="rightMargin">
+           <number>4</number>
+          </property>
+          <property name="bottomMargin">
            <number>4</number>
           </property>
           <item>
            <layout class="QGridLayout" name="_4">
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
             <property name="horizontalSpacing">
              <number>6</number>
             </property>
             <property name="verticalSpacing">
              <number>0</number>
             </property>
-            <property name="margin">
-             <number>0</number>
-            </property>
             <item row="0" column="1">
              <widget class="QCheckBox" name="checkBox_SCT">
               <property name="text">
@@ -218,7 +245,16 @@
           <property name="spacing">
            <number>0</number>
           </property>
-          <property name="margin">
+          <property name="leftMargin">
+           <number>4</number>
+          </property>
+          <property name="topMargin">
+           <number>4</number>
+          </property>
+          <property name="rightMargin">
+           <number>4</number>
+          </property>
+          <property name="bottomMargin">
            <number>4</number>
           </property>
           <item>
@@ -538,7 +574,7 @@
         </widget>
        </item>
        <item>
-        <widget class="QGroupBox" name="groupBox_misc">
+        <widget class="QGroupBox" name="groupBox_fwd">
          <property name="title">
           <string>Forward Region</string>
          </property>
@@ -546,7 +582,16 @@
           <property name="spacing">
            <number>0</number>
           </property>
-          <property name="margin">
+          <property name="leftMargin">
+           <number>4</number>
+          </property>
+          <property name="topMargin">
+           <number>4</number>
+          </property>
+          <property name="rightMargin">
+           <number>4</number>
+          </property>
+          <property name="bottomMargin">
            <number>4</number>
           </property>
           <item>
@@ -602,11 +647,20 @@
          <property name="title">
           <string>Miscellaneous</string>
          </property>
-         <layout class="QVBoxLayout" name="_12">
+         <layout class="QVBoxLayout" name="_12_2">
           <property name="spacing">
            <number>0</number>
           </property>
-          <property name="margin">
+          <property name="leftMargin">
+           <number>4</number>
+          </property>
+          <property name="topMargin">
+           <number>4</number>
+          </property>
+          <property name="rightMargin">
+           <number>4</number>
+          </property>
+          <property name="bottomMargin">
            <number>4</number>
           </property>
           <item>
-- 
GitLab


From 23b66ece95d7af0a08196c88b53dcc6405773f9d Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Sat, 9 Mar 2019 11:35:34 +0000
Subject: [PATCH 361/404] AsgTools: Enable thread-safety checker.

---
 .../AthAnalysisBaseComps/AthAnalysisHelper.h  | 12 ++++++---
 .../AsgTools/ATLAS_CHECK_THREAD_SAFETY        |  1 +
 .../AsgTools/AsgTools/AnaToolHandle.icc       |  6 ++++-
 .../AsgTools/AsgTools/AsgMetadataTool.h       |  9 ++++++-
 .../AsgTools/AsgTools/MessageCheck.h          | 13 ++++++----
 .../AsgTools/Root/AnaToolHandle.cxx           |  7 +++++-
 .../AsgTools/Root/MessageCheck.cxx            |  2 +-
 .../AsgTools/Root/ToolStore.cxx               | 25 ++++++++++---------
 8 files changed, 51 insertions(+), 24 deletions(-)
 create mode 100644 Control/AthToolSupport/AsgTools/AsgTools/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
index a4ccad68cec..18ee0c47274 100644
--- a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
+++ b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -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
 */
 
 // AthAnalysisHelper.h 
@@ -229,6 +229,12 @@ public:
   ///evt = ROOT.POOL.TEvent()
   ///...
   ///ROOT.AAH.retrieveMetadata("/Folder","key",evt.inputMetaStore())
+  static std::string retrieveMetadata(const std::string& folder, const std::string& key, const ServiceHandle<StoreGateSvc>& inputMetaStore) {
+    std::string out("");
+    StatusCode result = retrieveMetadata(folder,key,out,inputMetaStore);
+    if(result.isFailure()) { std::cout << "ERROR: Could not retrieve IOVMetadata with folder " << folder << " and key " << key << std::endl; }
+    return out;
+  }
   static std::string retrieveMetadata(const std::string& folder, const std::string& key, ServiceHandle<StoreGateSvc>& inputMetaStore) {
     std::string out("");
     StatusCode result = retrieveMetadata(folder,key,out,inputMetaStore);
@@ -250,7 +256,7 @@ public:
    
    
    ///implemenation where you pass it a particular store instead
-  template<typename T> static StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out, ServiceHandle<StoreGateSvc>& inputMetaStore) {
+  template<typename T> static StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out, const ServiceHandle<StoreGateSvc>& inputMetaStore) {
       const IOVMetaDataContainer* cont = 0;
       if( inputMetaStore->retrieve(cont,folder).isFailure()) return StatusCode::FAILURE;
    
@@ -280,7 +286,7 @@ public:
 
   ///retrieve metadata, for a specified IOVTime and a specific channel, unless the channel is -1, in which case we take the first available channel
   ///channels have to be unsigned int, so can use -1 to signal 'take whatever first channel is (it isn't always 0)'
-  template<typename T> static StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out, ServiceHandle<StoreGateSvc>& inputMetaStore, const IOVTime& time, int channel=-1) {
+  template<typename T> static StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out, const ServiceHandle<StoreGateSvc>& inputMetaStore, const IOVTime& time, int channel=-1) {
       const IOVMetaDataContainer* cont = 0;
       if( inputMetaStore->retrieve(cont,folder).isFailure()) return StatusCode::FAILURE;
    
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/ATLAS_CHECK_THREAD_SAFETY b/Control/AthToolSupport/AsgTools/AsgTools/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3def713b5a3
--- /dev/null
+++ b/Control/AthToolSupport/AsgTools/AsgTools/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Control/AthToolSupport/AsgTools
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/AnaToolHandle.icc b/Control/AthToolSupport/AsgTools/AsgTools/AnaToolHandle.icc
index 2760c2fb828..357c09f3776 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/AnaToolHandle.icc
+++ b/Control/AthToolSupport/AsgTools/AsgTools/AnaToolHandle.icc
@@ -6,6 +6,7 @@
 #define ASGTOOLS_ANATOOLHANDLE_ICC
 
 #include <AsgTools/MessageCheck.h>
+#include "CxxUtils/checker_macros.h"
 #include <assert.h>
 #include <cstdlib>
 
@@ -169,6 +170,8 @@ namespace asg
       /// \brief the shares we manage
     private:
       std::map<std::string,std::weak_ptr<AnaToolShare> > m_shared;
+      mutable std::recursive_mutex m_mutex;
+      typedef std::lock_guard<std::recursive_mutex> lock_t;
     };
 
 
@@ -977,7 +980,8 @@ namespace asg
   AnaToolHandle<T> ::
   get () const
   {
-    return const_cast<AnaToolHandle<T>*>(this)->get();
+    AnaToolHandle<T>* this_nc ATLAS_THREAD_SAFE = const_cast<AnaToolHandle<T>*>(this);
+    return this_nc->get();
   }
 
 
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/AsgMetadataTool.h b/Control/AthToolSupport/AsgTools/AsgTools/AsgMetadataTool.h
index 8ef2deb2421..d533b11c697 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/AsgMetadataTool.h
+++ b/Control/AthToolSupport/AsgTools/AsgTools/AsgMetadataTool.h
@@ -65,7 +65,7 @@ namespace asg {
       /// Type of the metadata store object in Athena
       typedef ServiceHandle< StoreGateSvc > MetaStore_t;
       /// Type of the metadata store pointer in standalone mode
-      typedef ServiceHandle< StoreGateSvc >& MetaStorePtr_t;
+      typedef const ServiceHandle< StoreGateSvc >& MetaStorePtr_t;
 #else
 #   error "What environment are we in?!?"
 #endif // Environment selection
@@ -124,10 +124,17 @@ namespace asg {
       /// @}
 
    private:
+#ifdef ASGTOOL_STANDALONE
       /// Object accessing the input metadata store
       mutable MetaStore_t m_inputMetaStore;
       /// Object accessing the output metadata store
       mutable MetaStore_t m_outputMetaStore;
+#else
+      /// Object accessing the input metadata store
+      MetaStore_t m_inputMetaStore;
+      /// Object accessing the output metadata store
+      MetaStore_t m_outputMetaStore;
+#endif
 
       /// Flag helping to discover when the tool misses the opening of the first
       /// input file
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/MessageCheck.h b/Control/AthToolSupport/AsgTools/AsgTools/MessageCheck.h
index 9eb440917b2..a46b8d4bed5 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/MessageCheck.h
+++ b/Control/AthToolSupport/AsgTools/AsgTools/MessageCheck.h
@@ -6,8 +6,8 @@
 
 
 
-#ifndef ASG_TOOLS__MESSAGE_CHECK_H
-#define ASG_TOOLS__MESSAGE_CHECK_H
+#ifndef ASGTOOLS_MESSAGE_CHECK_H
+#define ASGTOOLS_MESSAGE_CHECK_H
 
 /// \file MessageCheck.h
 /// \brief macros for messaging and checking status codes
@@ -83,6 +83,9 @@
 #include "AthenaBaseComps/AthMessaging.h"
 #endif
 
+#include "CxxUtils/checker_macros.h"
+#include <atomic>
+
 /// \brief for standalone code this creates a new message category
 ///
 /// The idea is that this provides a way to use the "standard"
@@ -121,7 +124,7 @@
   static MsgStream NAME (TITLE);
 #else
 #define ASG_TOOLS_MSG_STREAM(NAME,TITLE)			\
-  static MsgStream NAME (::asg::detail::getMessageSvcAthena(), TITLE);
+  static thread_local MsgStream NAME (::asg::detail::getMessageSvcAthena(), TITLE);
 #endif
 
 /// \brief the source code part of \ref ANA_MSG_SOURCE
@@ -134,9 +137,9 @@
   {						\
   namespace					\
     {						\
-  MSG::Level& msgLevel ()			\
+  std::atomic<MSG::Level>& msgLevel ()          \
     {						\
-  static MSG::Level level = MSG::INFO;		\
+  static std::atomic<MSG::Level> level ATLAS_THREAD_SAFE = MSG::INFO;      \
   return level;					\
     }						\
   }						\
diff --git a/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx b/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
index f1cd7022093..9ff58a0e8b3 100644
--- a/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
+++ b/Control/AthToolSupport/AsgTools/Root/AnaToolHandle.cxx
@@ -11,6 +11,8 @@
 //
 
 #include <AsgTools/AnaToolHandle.h>
+#include "CxxUtils/checker_macros.h"
+#include <mutex>
 
 #include "AsgTools/ToolStore.h"
 
@@ -55,7 +57,7 @@ namespace asg
     AnaToolShareList& AnaToolShareList ::
     singleton () noexcept
     {
-      static AnaToolShareList result;
+      static AnaToolShareList result ATLAS_THREAD_SAFE;
       return result;
     }
 
@@ -64,6 +66,7 @@ namespace asg
     std::shared_ptr<AnaToolShare> AnaToolShareList ::
     getShare (const std::string& name) const
     {
+      lock_t lock (m_mutex);
       auto iter = m_shared.find (name);
       if (iter == m_shared.end())
 	return std::shared_ptr<AnaToolShare> ();
@@ -76,6 +79,7 @@ namespace asg
     setShare (const std::string& name,
 	      std::unique_ptr<AnaToolShare> val_share)
     {
+      lock_t lock (m_mutex);
       std::shared_ptr<AnaToolShare> result = getShare (name);
       if (result != nullptr)
 	return result;
@@ -91,6 +95,7 @@ namespace asg
 	       const AnaToolConfig& config,
 	       std::shared_ptr<AnaToolShare>& result)
     {
+      lock_t lock (m_mutex);
       using namespace msgToolHandle;
 
       auto& share = m_shared[name];
diff --git a/Control/AthToolSupport/AsgTools/Root/MessageCheck.cxx b/Control/AthToolSupport/AsgTools/Root/MessageCheck.cxx
index 1ff7cfcb595..09385aaf7c6 100644
--- a/Control/AthToolSupport/AsgTools/Root/MessageCheck.cxx
+++ b/Control/AthToolSupport/AsgTools/Root/MessageCheck.cxx
@@ -35,7 +35,7 @@ namespace asg
     // Get the Athena message service
     IMessageSvc* getMessageSvcAthena()
     {
-      static IMessageSvc* msgSvc
+      static IMessageSvc* const msgSvc
 	= Gaudi::svcLocator()->service<IMessageSvc>("MessageSvc");
       return msgSvc;
     }
diff --git a/Control/AthToolSupport/AsgTools/Root/ToolStore.cxx b/Control/AthToolSupport/AsgTools/Root/ToolStore.cxx
index a351eee15ee..a78482ea7a8 100644
--- a/Control/AthToolSupport/AsgTools/Root/ToolStore.cxx
+++ b/Control/AthToolSupport/AsgTools/Root/ToolStore.cxx
@@ -27,12 +27,9 @@ typedef std::map< std::string, asg::IAsgTool* > ToolMap_t;
 
 namespace {
 
-   /// Helper function providing the application-wide tool registry
-   ToolMap_t& tools() {
-
-      static ToolMap_t s_tools;
-      return s_tools;
-   }
+   /// The application-wide tool registry
+   static ToolMap_t s_tools ATLAS_THREAD_SAFE;
+  std::mutex s_toolMutex;
 
 } // private namespace
 
@@ -55,15 +52,16 @@ namespace asg {
          return StatusCode::FAILURE;
       }
 
+      std::lock_guard<std::mutex> lock (s_toolMutex);
       // Check whether we already have a tool with this name:
-      if( tools().find( name ) != tools().end() ) {
+      if( s_tools.find( name ) != s_tools.end() ) {
          std::cout << "asg::ToolStore::put       WARNING Tool with name \""
                    << name << "\" already registered" << std::endl;
          return StatusCode::FAILURE;
       }
 
       // Remember the tool:
-      tools()[ name ] = ptool;
+      s_tools[ name ] = ptool;
       return StatusCode::SUCCESS;
    }
 
@@ -93,8 +91,9 @@ namespace asg {
 
    IAsgTool* ToolStore::get( const std::string& name, bool silent ) {
 
-      ToolMap_t::const_iterator itool = tools().find( name );
-      if( itool == tools().end() ) {
+      std::lock_guard<std::mutex> lock (s_toolMutex);
+      ToolMap_t::const_iterator itool = s_tools.find( name );
+      if( itool == s_tools.end() ) {
          if( ! silent ) {
             std::cout << "asg::ToolStore::get       WARNING Tool with name \""
                       << name << "\" not found" << std::endl;
@@ -112,8 +111,9 @@ namespace asg {
 
    StatusCode ToolStore::remove( const std::string& name ) {
 
+      std::lock_guard<std::mutex> lock (s_toolMutex);
       // Remove the tool, not checking if the call was successful or not:
-      tools().erase( name );
+      s_tools.erase( name );
       return StatusCode::SUCCESS;
    }
 
@@ -126,7 +126,8 @@ namespace asg {
     // messages don't interleave the property values
     std::map<std::string,std::map<std::string,std::string> > properties;
 
-    for (auto& tool : tools())
+    std::lock_guard<std::mutex> lock (s_toolMutex);
+    for (auto& tool : s_tools)
     {
       auto& myproperties = properties[tool.first];
       myproperties[""] = std::string (typeid(*tool.second).name()) + "/" + tool.first;
-- 
GitLab


From 4acc2898f8469c5d10859b07b8605532d1edf017 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Sat, 9 Mar 2019 11:38:23 +0000
Subject: [PATCH 362/404] Identifier, etc: Make set_do_checks() and
 set_do_neighbors() non-const.

---
 .../CaloIdentifier/CaloCell_Base_ID.h         |  7 +++----
 .../CaloIdentifier/src/CaloCell_Base_ID.cxx   | 17 +---------------
 .../test/calocell_id_test_common.cxx          |  8 ++------
 .../AtlasDetDescr/AtlasDetectorID.h           |  6 +++---
 .../AtlasDetDescr/src/AtlasDetectorID.cxx     |  6 +++---
 .../IdDict/IdDict/IdDictDefs.h                | 14 ++++++-------
 DetectorDescription/IdDict/src/IdDictMgr.cxx  | 20 +++++++++----------
 .../Identifier/Identifier/IdHelper.h          |  6 +++---
 8 files changed, 31 insertions(+), 53 deletions(-)

diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
index 4a98ef55c4e..09686c48e58 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloCell_Base_ID.h
@@ -17,6 +17,7 @@
 #define CALOIDENTIFIER_CALOCELL_BASE_ID_H
 
 
+#include "AthenaKernel/CLASS_DEF.h"
 #include "AtlasDetDescr/AtlasDetectorID.h"
 #include "CaloIdentifier/CaloID.h"
 #include "CaloIdentifier/LArNeighbours.h"
@@ -72,10 +73,6 @@ public:
 
   int GetSubCaloName( const std::string SubCaloName ) const;
 
-  virtual bool do_checks(void) const override;
-
-  virtual void set_do_checks(bool do_checks) const override;
-
   /// Initialization from the identifier dictionary
   virtual int         initialize_from_dictionary(const IdDictMgr& dict_mgr) override;
 
@@ -414,5 +411,7 @@ private:
 #include "CaloIdentifier/CaloCell_Base_ID.icc"
 
 
+CLASS_DEF( CaloCell_Base_ID , 257140327 , 1 )
+
 
 #endif // not CALOIDENTIFIER_CALOCELL_BASE_ID_H
diff --git a/Calorimeter/CaloIdentifier/src/CaloCell_Base_ID.cxx b/Calorimeter/CaloIdentifier/src/CaloCell_Base_ID.cxx
index d4320b30aeb..67b87dc8212 100644
--- a/Calorimeter/CaloIdentifier/src/CaloCell_Base_ID.cxx
+++ b/Calorimeter/CaloIdentifier/src/CaloCell_Base_ID.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
 */
 
 // $Id$
@@ -138,21 +138,6 @@ int CaloCell_Base_ID::initialize_from_dictionary (const IdDictMgr& dict_mgr)
 }
 
 
-bool 
-CaloCell_Base_ID::do_checks(void) const
-{
-  return(m_emHelper->do_checks()) ;
-}
-
-
-void   
-CaloCell_Base_ID::set_do_checks	(bool do_checks) const
-{
-  for (int i=0; i < NSUBCALO; i++)
-    m_helpers[i]->set_do_checks(do_checks);
-}
-
-
 int   CaloCell_Base_ID::calo_sample   (const Identifier         id) const
 {
   int calo_sampl = (int) Unknown;
diff --git a/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx b/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx
index 50b83f5316b..468c7fd9484 100644
--- a/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx
+++ b/Calorimeter/CaloIdentifier/test/calocell_id_test_common.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
 */
 
 // $Id$
@@ -225,10 +225,6 @@ std::unique_ptr<CALOCELL_ID_T> make_calo_id_t (bool do_neighbours = false)
                                                        tile_id.release());
   assert (calo_id->initialize_from_dictionary (idd) == 0);
 
-  assert (!calo_id->do_checks());
-  calo_id->set_do_checks (true);
-  assert (calo_id->do_checks());
-
   //assert (calo_id->em_idHelper() == em_id);
   //assert (calo_id->hec_idHelper() == hec_id);
   //assert (calo_id->fcal_idHelper() == fcal_id);
@@ -732,7 +728,7 @@ void test_exceptions (const CaloCell_Base_ID& calo_id)
 
   bool caught = false;
   try {
-    /*Identifier wrongChanId =*/ calo_id.cell_id (0, 99, 0, 0, 0, 0);
+    /*Identifier wrongChanId =*/ calo_id.cell_id (0, 99, 0, 0, 0, 0, true);
   }
   catch(LArID_Exception & except){
     caught = true;
diff --git a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h
index 81b5c03ac53..a6dfed9d871 100755
--- a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h
+++ b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.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 ATLASDETDESCR_ATLASDETECTORID_H
@@ -226,13 +226,13 @@ public:
     /// @name  Checks are performed by default in debug compilation and NOT in optimized compilation. One can switch or query this mode for any idHelper with the following methods:
     //@{
     virtual bool        do_checks       (void) const;
-    virtual void        set_do_checks   (bool do_checks) const;
+    virtual void        set_do_checks   (bool do_checks);
     //@}
 
     /// @name neighbours are initialized by default. One can switch or query this mode with the following methods:
     //@{
     virtual bool        do_neighbours       (void) const;
-    virtual void        set_do_neighbours   (bool do_neighbours) const;
+    virtual void        set_do_neighbours   (bool do_neighbours);
     //@}
 
     /// @name setting pointer to the MessageService
diff --git a/DetectorDescription/AtlasDetDescr/src/AtlasDetectorID.cxx b/DetectorDescription/AtlasDetDescr/src/AtlasDetectorID.cxx
index ba06031682d..c2326bc6247 100755
--- a/DetectorDescription/AtlasDetDescr/src/AtlasDetectorID.cxx
+++ b/DetectorDescription/AtlasDetDescr/src/AtlasDetectorID.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
 */
 
 /***************************************************************************
@@ -903,7 +903,7 @@ bool            AtlasDetectorID::do_checks      (void) const
     return (m_do_checks);
 }
 
-void            AtlasDetectorID::set_do_checks  (bool do_checks) const
+void            AtlasDetectorID::set_do_checks  (bool do_checks)
 {
     m_do_checks = do_checks;
 }
@@ -913,7 +913,7 @@ bool            AtlasDetectorID::do_neighbours  (void) const
     return (m_do_neighbours);
 }
 
-void            AtlasDetectorID::set_do_neighbours      (bool do_neighbours) const
+void            AtlasDetectorID::set_do_neighbours      (bool do_neighbours)
 {
     m_do_neighbours = do_neighbours;
 }
diff --git a/DetectorDescription/IdDict/IdDict/IdDictDefs.h b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
index d3745ff85c6..71acce53fb7 100755
--- a/DetectorDescription/IdDict/IdDict/IdDictDefs.h
+++ b/DetectorDescription/IdDict/IdDict/IdDictDefs.h
@@ -1,9 +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
 */
 
-#ifndef __IdDictDefs_h__  
-#define __IdDictDefs_h__  
+#ifndef IDDICT_IDDICTDEFS_H
+#define IDDICT_IDDICTDEFS_H
  
 #include "Identifier/Range.h" 
 #include "Identifier/Identifier.h" 
@@ -63,8 +63,8 @@ public:
     void                  add_subdictionary_name  (const std::string& name);  
     void                  add_metadata            (const std::string& name, const std::string& value);
     void                  set_DTD_version         (const std::string& DTD_version);
-    void                  set_do_checks           (bool do_checks) const;
-    void                  set_do_neighbours       (bool do_neighbours) const;
+    void                  set_do_checks           (bool do_checks);
+    void                  set_do_neighbours       (bool do_neighbours);
     
     
     ///  Construct dictionary after parsing
@@ -259,13 +259,13 @@ public:
     /// in optimized compilation. One can switch or query this mode for
     /// any idHelper with the following methods:
     bool                do_checks       (void) const;
-    void                set_do_checks   (bool do_checks) const;
+    void                set_do_checks   (bool do_checks);
 
     /// Neighbour initialization is performed by default
     /// One can switch or query this mode for
     /// any idHelper with the following methods:
     bool                do_neighbours           (void) const;
-    void                set_do_neighbours       (bool do_neighbours) const;
+    void                set_do_neighbours       (bool do_neighbours);
 
     /// Access to file name
     std::string         file_name        (void) const;
diff --git a/DetectorDescription/IdDict/src/IdDictMgr.cxx b/DetectorDescription/IdDict/src/IdDictMgr.cxx
index 88d65c46562..f5daf711759 100755
--- a/DetectorDescription/IdDict/src/IdDictMgr.cxx
+++ b/DetectorDescription/IdDict/src/IdDictMgr.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
 */
 
 // $Header: /build/atlas/cvs/atlas/offline/DetectorDescription/IdDict/src/IdDictMgr.cxx,v 1.43 2008-12-09 09:49:43 dquarrie Exp $  
@@ -144,12 +144,11 @@ bool IdDictMgr::do_checks               () const
 }
 
 void		
-IdDictMgr::set_do_checks	(bool do_checks) const
+IdDictMgr::set_do_checks	(bool do_checks)
 {
     m_do_checks = do_checks;
-    dictionary_map::const_iterator it; 
-    for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) { 
-	const IdDictDictionary* d = (*it).second; 
+    for (const auto& p : m_dictionaries) {
+        IdDictDictionary* d = p.second; 
 	d->set_do_checks(do_checks);
     } 
 }
@@ -160,12 +159,11 @@ bool IdDictMgr::do_neighbours               () const
 }
 
 void		
-IdDictMgr::set_do_neighbours	(bool do_neighbours) const
+IdDictMgr::set_do_neighbours	(bool do_neighbours)
 {
     m_do_neighbours = do_neighbours;
-    dictionary_map::const_iterator it; 
-    for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) { 
-	const IdDictDictionary* d = (*it).second; 
+    for (const auto& p : m_dictionaries) {
+        IdDictDictionary* d = p.second; 
 	d->set_do_neighbours(do_neighbours);
     } 
 }
@@ -2129,7 +2127,7 @@ IdDictDictionary::do_checks	(void) const
 }
 
 void		
-IdDictDictionary::set_do_checks	(bool do_checks) const
+IdDictDictionary::set_do_checks	(bool do_checks)
 {
     m_do_checks = do_checks;
 }
@@ -2141,7 +2139,7 @@ IdDictDictionary::do_neighbours	(void) const
 }
 
 void		
-IdDictDictionary::set_do_neighbours	(bool do_neighbours) const
+IdDictDictionary::set_do_neighbours	(bool do_neighbours)
 {
     m_do_neighbours = do_neighbours;
 }
diff --git a/DetectorDescription/Identifier/Identifier/IdHelper.h b/DetectorDescription/Identifier/Identifier/IdHelper.h
index bae6c57428c..869015edb55 100644
--- a/DetectorDescription/Identifier/Identifier/IdHelper.h
+++ b/DetectorDescription/Identifier/Identifier/IdHelper.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
 */
 
 /***************************************************************************
@@ -61,12 +61,12 @@ public:
     /// in optimized compilation. One can switch or query this mode for
     /// any idHelper with the following methods:
     virtual bool		do_checks	(void) const = 0;
-    virtual void		set_do_checks	(bool do_checks) const = 0;
+    virtual void		set_do_checks	(bool do_checks) = 0;
     /// Neighbour initialization is performed by default
     /// One can switch or query this mode for
     /// any idHelper with the following method:
     virtual bool		do_neighbours   	(void) const = 0;
-    virtual void		set_do_neighbours	(bool do_neighbours) const = 0;
+    virtual void		set_do_neighbours	(bool do_neighbours) = 0;
 
     // setting pointer to the MessageSvc
     virtual void                setMessageSvc  (IMessageSvc* msgSvc) = 0;
-- 
GitLab


From 5118b289bb1bce6503cd8454d103d968dee84c7a Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Sat, 9 Mar 2019 11:39:49 +0000
Subject: [PATCH 363/404] TrigMissingET: enable thread checker and fixes

---
 .../TrigEFMissingET/CMakeLists.txt            | 29 ++++++-------------
 .../TrigEFMissingET/ATLAS_CHECK_THREAD_SAFETY |  1 +
 .../EFMissingETFromTrackAndClusters.h         | 12 ++++----
 .../src/EFMissingETFromJets.cxx               | 13 +++++----
 .../src/EFMissingETFromTrackAndClusters.cxx   |  6 ++--
 .../TrigL2MissingET/ATLAS_CHECK_THREAD_SAFETY |  1 +
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../TrigMissingETMuon/TrigMissingETMuon.h     |  6 ++--
 .../src/TrigMissingETMuon.cxx                 |  4 ++-
 9 files changed, 36 insertions(+), 37 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigAlgorithms/TrigL2MissingET/TrigL2MissingET/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigEFMissingET/CMakeLists.txt
index 343663d2087..6c24106d7ae 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/CMakeLists.txt
@@ -1,4 +1,3 @@
-# $Id: CMakeLists.txt 800798 2017-03-16 17:29:50Z jburr $
 ################################################################################
 # Package: TrigEFMissingET
 ################################################################################
@@ -21,7 +20,6 @@ atlas_depends_on_subdirs(
    Event/FourMomUtils
    GaudiKernel
    LArCalorimeter/LArIdentifier
-   LArCalorimeter/LArTools
    Trigger/TrigAlgorithms/TrigT2CaloCommon
    Trigger/TrigEvent/TrigCaloEvent
    Trigger/TrigEvent/TrigMissingEtEvent
@@ -29,7 +27,6 @@ atlas_depends_on_subdirs(
    Trigger/TrigSteer/TrigInterfaces
    Trigger/TrigTools/TrigTimeAlgs
    PRIVATE
-   PhysicsAnalysis/AnalysisCommon/PATCore
    Tools/PathResolver
    InnerDetector/InDetRecTools/InDetTrackSelectionTool
    Control/CxxUtils
@@ -48,25 +45,17 @@ find_package( ROOT COMPONENTS Core Hist Matrix )
 find_package( tdaq-common COMPONENTS eformat )
 
 # Component(s) in the package:
-atlas_add_library( TrigEFMissingETLib
-   TrigEFMissingET/*.h src/*.cxx
-   PUBLIC_HEADERS TrigEFMissingET
-   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} 
-   PRIVATE_INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS}
-   LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} CaloEvent CaloGeoHelpers CaloIdentifier
-   AthenaBaseComps xAODCaloEvent xAODJet xAODTrigMissingET GaudiKernel
-   LArIdentifier TrigCaloEvent TrigMissingEtEvent TrigParticle CaloDetDescrLib
-   LArToolsLib TrigT2CaloCommonLib TrigInterfacesLib TrigTimeAlgsLib
-   PRIVATE_LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} CxxUtils Identifier
-   EventKernel xAODEventInfo JetEvent TrigMuonEvent TrigSteeringEvent
-   PathResolver PATCoreLib
-   TrigT1Interfaces )
-
 atlas_add_component( TrigEFMissingET
+   src/*.cxx
    src/components/*.cxx
-   LINK_LIBRARIES GaudiKernel TrigEFMissingETLib ${FASTJET_LIBRARIES}  
-   PRIVATE_LINK_LIBRARIES ${FASTJETCONTRIB_LIBRARIES}
-)
+   INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS}
+   LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES}
+   AthenaBaseComps CaloDetDescrLib CaloEvent CaloGeoHelpers
+   CaloIdentifier CxxUtils EventKernel GaudiKernel Identifier
+   JetEvent LArIdentifier PathResolver
+   TrigCaloEvent TrigInterfacesLib TrigMissingEtEvent TrigMuonEvent
+   TrigParticle TrigSteeringEvent TrigT1Interfaces TrigT2CaloCommonLib
+   TrigTimeAlgsLib xAODCaloEvent xAODEventInfo xAODJet xAODTrigMissingET )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..6423e1bf082
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigEFMissingET
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromTrackAndClusters.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromTrackAndClusters.h
index bdd618af344..3f726bd8a7c 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromTrackAndClusters.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromTrackAndClusters.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 TRIGEFMISSINGET_EFMissingETFromTrackAndClusters_H
@@ -79,8 +79,8 @@ public:
 
     int calculateWeight(xAOD::CaloCluster cl) const;
     int calculateSplitWeight(xAOD::CaloCluster cl) const;
-    void RunClusters(std::vector<xAOD::CaloCluster> m_clust) const;
-    void RunSplitClusters(std::vector<xAOD::CaloCluster> m_clust) const;
+    void RunClusters(std::vector<xAOD::CaloCluster> m_clust);
+    void RunSplitClusters(std::vector<xAOD::CaloCluster> m_clust);
 
 
 
@@ -112,9 +112,9 @@ private:
     float m_rapmax;
     float m_rapminApplied;
     float m_rapmaxApplied;
-    mutable double m_minPt;
-    mutable double m_minPtECal;
-    mutable double m_minPtHCal;
+    double m_minPt;
+    double m_minPtECal;
+    double m_minPtHCal;
 
 
    float m_deltaR;
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJets.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJets.cxx
index 7691bec1c7f..c5bc4ab513d 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJets.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJets.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
 */
 
 /********************************************************************
@@ -17,6 +17,7 @@ PURPOSE:  Updates TrigMissingETHelper using info from jets
 
 #include "TrigTimeAlgs/TrigTimerSvc.h"
 #include "CxxUtils/sincosf.h"
+#include "CxxUtils/checker_macros.h"
 
 #include "JetEvent/JetCollection.h"
 #include "JetEvent/Jet.h"
@@ -113,7 +114,12 @@ StatusCode EFMissingETFromJets::execute(xAOD::TrigMissingET *,
   ATH_MSG_DEBUG( "num of jets: " << MHTJetsVec.size() );
 
  //--- fetching the topo. cluster component
- float upperlim[4] = {m_etacut,0,5,-m_etacut}; float lowerlim[4] = {0,-m_etacut,m_etacut,-5};
+ float upperlim[4] = {m_etacut,0,5,-m_etacut};
+ float lowerlim[4] = {0,-m_etacut,m_etacut,-5};
+
+ static const xAOD::JetAttributeAccessor::AccessorWrapper< std::vector<float> >& acc_ePerSample ATLAS_THREAD_SAFE =
+   *xAOD::JetAttributeAccessor::accessor< std::vector<float> >(xAOD::JetAttribute::EnergyPerSampling);
+ static const xAOD::JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> acc_uncalibrated("JetConstitScaleMomentum");
 
  for(int i = 0; i < 5; i++) {
 
@@ -125,9 +131,6 @@ StatusCode EFMissingETFromJets::execute(xAOD::TrigMissingET *,
     float scale = 1.;
     if (m_applyTileGap3Correction) {
       // get the uncalibrated energy and tile gap 3 fractions
-      static const xAOD::JetAttributeAccessor::AccessorWrapper< std::vector<float> >& acc_ePerSample =
-        *xAOD::JetAttributeAccessor::accessor< std::vector<float> >(xAOD::JetAttribute::EnergyPerSampling);
-      static xAOD::JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> acc_uncalibrated("JetConstitScaleMomentum");
       const std::vector<float>& eInSampling = acc_ePerSample.getAttribute(*aJet);
       float e_tileGap3 = eInSampling.at(CaloSampling::TileGap3);
       scale = 1 - e_tileGap3/acc_uncalibrated.getAttribute(*aJet).E();
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromTrackAndClusters.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromTrackAndClusters.cxx
index 91ba2e45b42..52d0974627e 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromTrackAndClusters.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromTrackAndClusters.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
 */
 
 /********************************************************************
@@ -747,7 +747,7 @@ double EFMissingETFromTrackAndClusters::findMinPt(std::vector<fastjet::PseudoJet
 }
 
 // Reweights clusters (when calo isn't split)
-void EFMissingETFromTrackAndClusters::RunClusters(std::vector<xAOD::CaloCluster> clust) const
+void EFMissingETFromTrackAndClusters::RunClusters(std::vector<xAOD::CaloCluster> clust)
 {
     vector<fastjet::PseudoJet> clustPJ;
 
@@ -763,7 +763,7 @@ void EFMissingETFromTrackAndClusters::RunClusters(std::vector<xAOD::CaloCluster>
     m_minPt = findMinPt(&clustSK);
 }
 
-void EFMissingETFromTrackAndClusters::RunSplitClusters(std::vector<xAOD::CaloCluster> clust) const
+void EFMissingETFromTrackAndClusters::RunSplitClusters(std::vector<xAOD::CaloCluster> clust)
 {
     vector<fastjet::PseudoJet> clustPJ_ECal;
     vector<fastjet::PseudoJet> clustPJ_HCal;
diff --git a/Trigger/TrigAlgorithms/TrigL2MissingET/TrigL2MissingET/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigL2MissingET/TrigL2MissingET/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..be5ae8e5940
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2MissingET/TrigL2MissingET/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigL2MissingET
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..11bfe9bfa37
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigMissingETMuon
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/TrigMissingETMuon.h b/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/TrigMissingETMuon.h
index b7a8d263540..9d09210b02e 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/TrigMissingETMuon.h
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/TrigMissingETMuon/TrigMissingETMuon.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
 */
 
 /**********************************************************************************
@@ -12,7 +12,6 @@
  * @author Hongtao Yang     <Hongtao.Yang@cern.ch>     - UW Madsion, USA
  *
  * File and Version Information:
- * $Id: TrigMissingETMuon.h,v 0.01 2012-03-05 09:00:20 yanght Exp $
  **********************************************************************************/
 
 
@@ -26,6 +25,9 @@
 
 #include "xAODTrigMissingET/TrigMissingET.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 namespace HLT {
   class TriggerElement;
 }
diff --git a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
index 993068ca234..a1154fbb719 100755
--- a/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.cxx
+++ b/Trigger/TrigAlgorithms/TrigMissingETMuon/src/TrigMissingETMuon.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
 */
 
 // ********************************************************************
@@ -38,6 +38,8 @@
 #include <cmath>
 #include <cstdio>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 TrigMissingETMuon::TrigMissingETMuon(const std::string& name, ISvcLocator* pSvcLocator)
   : HLT::AllTEAlgo(name, pSvcLocator),
     m_useCachedResult(false),
-- 
GitLab


From 6a2dcfbeaefab20daeaa74dad1c9dfea7e24fc06 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Sat, 9 Mar 2019 12:29:06 +0000
Subject: [PATCH 364/404] Fix initialization in IDC_WriteHandle

---
 Event/EventContainers/EventContainers/IdentifiableContainerMT.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/EventContainers/EventContainers/IdentifiableContainerMT.h b/Event/EventContainers/EventContainers/IdentifiableContainerMT.h
index f88270c4be5..5324a8aa40a 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){
-- 
GitLab


From 969d3c32bf3a457fbfd512fc87cc9eda8f44a8a7 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sat, 9 Mar 2019 05:54:06 +0100
Subject: [PATCH 365/404] Code cleanup

---
 .../SCT_CalibAlgs/ISCT_CalibEvtInfo.h         |   79 +-
 .../SCT_CalibAlgs/ISCT_CalibHistoTool.h       |  103 +-
 .../SCT_CalibAlgs/ISCT_CalibModuleListTool.h  |   59 +-
 .../SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h    |  524 +-
 .../SCT_CalibAlgs/SCTCalibWriteTool.h         |  349 +-
 .../SCT_CalibAlgs/SCT_LorentzAngleFunc.h      |   32 +-
 .../SCT_CalibAlgs/src/IElementStreamer.cxx    |   51 +-
 .../SCT_CalibAlgs/src/IElementStreamer.h      |   40 +-
 .../SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx |   82 +-
 .../SCT_CalibAlgs/src/SCTCalib.cxx            | 5692 ++++++++---------
 .../SCT_CalibAlgs/src/SCTCalibWriteTool.cxx   | 1039 ++-
 .../src/SCT_CalibBsErrorTool.cxx              |  219 +-
 .../SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h  |   83 +-
 .../SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx  |  141 +-
 .../SCT_CalibAlgs/src/SCT_CalibEventInfo.h    |  116 +-
 .../SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx |  279 +-
 .../SCT_CalibAlgs/src/SCT_CalibHitmapTool.h   |   70 +-
 .../SCT_CalibAlgs/src/SCT_CalibHvTool.cxx     |  359 +-
 .../SCT_CalibAlgs/src/SCT_CalibHvTool.h       |  145 +-
 .../SCT_CalibAlgs/src/SCT_CalibLbTool.cxx     |  452 +-
 .../SCT_CalibAlgs/src/SCT_CalibLbTool.h       |   85 +-
 .../src/SCT_CalibModuleListTool.cxx           |   79 +-
 .../src/SCT_CalibModuleListTool.h             |   63 +-
 .../SCT_CalibAlgs/src/SCT_CalibNumbers.h      |   24 +-
 .../SCT_CalibAlgs/src/SCT_CalibUtilities.cxx  |   88 +-
 .../SCT_CalibAlgs/src/SCT_CalibUtilities.h    |   44 +-
 .../SCT_CalibAlgs/src/XmlHeader.cxx           |   16 +-
 .../SCT_CalibAlgs/src/XmlHeader.h             |   26 +-
 .../SCT_CalibAlgs/src/XmlStreamer.cxx         |   79 +-
 .../SCT_CalibAlgs/src/XmlStreamer.h           |   18 +-
 30 files changed, 5131 insertions(+), 5305 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
index 2f4b3812bc2..301351eb89c 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,48 @@
 #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 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;
     
-    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 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 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 void setBunchCrossing(const int bc)=0;
+  virtual void setCounter(const int counterVal)=0;
+  virtual void incrementCounter()=0;
 
-    virtual void getTimeStamps(int & begin, int & end) const=0;
-    virtual void getTimeStamps(std::string & begin, std::string & end) 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 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;
 
 };
 
-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 eaa5fd3122c..7e8ead5eaf6 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,58 @@ 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();
+  /// 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;
+  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);
+  }
 };
 
 
-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 76134814338..ba75b263d92 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)=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);
+  }
 };
 
-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 c353f51b28e..6d534817e03 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,
+ 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 );
-      std::string
-      getStripList( const std::set<Identifier>& stripIdList ) const;
+                             const std::map< Identifier, std::set<Identifier> >& moduleListRef,
+                             const std::string& badStripsFile) const;
 
-      StatusCode
-      noisyStripsToXml( const std::map< Identifier, std::set<Identifier> >& moduleList, const std::string& badStripsFile ) const;
+  std::set<int>
+    getNoisyChips( const std::set<Identifier>& stripIdList ) 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::pair< std::string, float >
+    getNoisyLB( const Identifier& moduleId, int& chipId ) 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;
+  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 e1bf6cbb1c4..aba4ca429da 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,181 @@ 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;
+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();
 
-      StatusCode createListNO( const Identifier& wafer_id,
-                               const SCT_ID* m_sctId,
-                               const int samplesize,
-                               const float noise_occ ) const;
+  //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;
+  }
 
-      StatusCode createListRawOccu( const Identifier& wafer_id,
-                                    const SCT_ID* m_sctId,
-                                    const int samplesize,
-                                    const float raw_occu ) const;
+  std::string
+  addDefect(const std::string& defectlist,const int defectBeginChannel,const int defectEndChannel) const;
 
-      StatusCode createListBSErr(const Identifier& wafer_id,
-                                 const SCT_ID* m_sctId,
-                                 const int samplesize,
-                                 const std::string & errorList,
-                                 const std::string & probList) const ;
+  std::string
+  addNumber(const std::string numStr,const unsigned long long number) const;
 
-      StatusCode createListLA(const Identifier& wafer_id,
+  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 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 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 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;
+
+  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_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;
+
+  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;
 };
 
-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 6f71c74312e..5bb3931d985 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 8531a1de422..5cccb7a98aa 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 a1708e2aa28..67c2db5b67d 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 dcf0375ba0c..69f51c1c9f8 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;
+  return m_nLb;
 }
 
 void
 ISCT_CalibHistoTool::setLbToMerge(const int nLbMerge) {
-   m_nLbMerge=nLbMerge;
+  m_nLbMerge = nLbMerge;
 }
 
 int
 ISCT_CalibHistoTool::LbToMerge() {
-   return m_nLbMerge;
+  return m_nLbMerge;
 }
-
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
index a9537e5ab47..87bdd23a734 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -4,19 +4,19 @@
 
 
 /**
-* @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"
@@ -57,274 +57,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 +325,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 +369,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 +477,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 +488,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 +525,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 +637,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;
-
-               }
-
-               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;
-                  }
+            hasDeadStrip=true;
 
-                  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 +1162,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");
+          }
+        }
+      }
+    }
+  }
+
+  //--- 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;
-   }
-   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;
-      }
-   }
+    }
+  }
 
-   return StatusCode::SUCCESS;
+  return StatusCode::SUCCESS;
 
 }
 
@@ -1391,148 +1379,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 +1530,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 +1710,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 +2058,356 @@ 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], 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");
+    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 +2415,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) {
+  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) {
+  //--- 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 b98c334f7e5..666bdb99b69 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,153 @@
 
 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{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_version{0},
+  m_beginRun{IOVTime::MINRUN},
+  m_endRun{IOVTime::MAXRUN},
+  m_streamName{"CondStreamTest"},
+
+  m_regSvc{0},
+  m_streamer{0},
+  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("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);
+
+  }
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
 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;
+  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;
 }
 
 StatusCode
 SCTCalibWriteTool::fillData() {
-   // this is a dummy function
-   return StatusCode::SUCCESS;
+  // this is a dummy function
+  return StatusCode::SUCCESS;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -198,76 +198,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 +276,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;
-         }
+  // 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;
+  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 3fe1ffba284..6c44f98d6bd 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_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}
 {
 }
 
 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(m_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 b21ef94a797..6f0d0fadab7 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
@@ -3,18 +3,14 @@
 */
 
 /**
-* @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"
@@ -26,52 +22,51 @@
 //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:
+  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;
 
-      // 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 f21d3bcf696..cd4ff4d4833 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;
+  return StatusCode::SUCCESS;
 }
 
 int SCT_CalibEventInfo::lumiBlock() const {
-   return m_lumiBlock;
+  return m_lumiBlock;
 }
 
 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);
+  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;
+  return m_duration;
 }
 
 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::getLumiBlock(int& begin, int& end) const {
+  begin = m_LBBegin;
+  end = m_LBEnd;
 }
 
 void
 SCT_CalibEventInfo::setLumiBlock(const int begin, const int end) {
-   m_LBBegin=begin;
-   m_LBEnd=end;
-   m_numLB=end-begin+1;
+  m_LBBegin = begin;
+  m_LBEnd = end;
+  m_numLB = end-begin+1;
 }
 
 void
 SCT_CalibEventInfo::setLumiBlock(const int lb) {
-   m_lumiBlock=lb;
+  m_lumiBlock = lb;
 }
 
 void
 SCT_CalibEventInfo::setSource(const std::string source) {
-   m_source=source;
+  m_source = source;
 }
 
 void
 SCT_CalibEventInfo::setRunNumber(const int rn) {
-   m_runNumber=rn;
+  m_runNumber = rn;
 }
 
 void
 SCT_CalibEventInfo::setBunchCrossing(const int bc) {
-   m_bunchCrossing=bc;
+  m_bunchCrossing = bc;
 }
 
 void
-SCT_CalibEventInfo::getTimeStamps(std::string & begin, std::string & end) const {
-   begin=m_tsBeginString;
-   end=m_tsEndString;
+SCT_CalibEventInfo::getTimeStamps(std::string& begin, std::string& end) const {
+  begin = m_tsBeginString;
+  end = m_tsEndString;
 }
 
 void
-SCT_CalibEventInfo::getTimeStamps(int & begin, int & end) const {
-   begin=m_timeStampBegin;
-   end=m_timeStampEnd;
+SCT_CalibEventInfo::getTimeStamps(int& begin, int& end) const {
+  begin = m_timeStampBegin;
+  end = m_timeStampEnd;
 }
 
 int
 SCT_CalibEventInfo::timeStamp() const {
-   return m_timeStamp;
+  return m_timeStamp;
 }
 
 int
 SCT_CalibEventInfo::runNumber() const {
-   return m_runNumber;
+  return m_runNumber;
 }
 
 int
 SCT_CalibEventInfo::counter() const {
-   return m_counter;
+  return m_counter;
 }
 
 void
 SCT_CalibEventInfo::incrementCounter() {
-   ++m_counter;
+  ++m_counter;
 }
 
 void
 SCT_CalibEventInfo::setCounter(const int counterVal) {
-   m_counter=counterVal;
+  m_counter = counterVal;
 }
 
 int
 SCT_CalibEventInfo::numLumiBlocks() const {
-   return m_numLB;
+  return m_numLB;
 }
 
 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 54d44636ff0..d0318ed3be6 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
@@ -6,15 +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 "GaudiKernel/ToolHandle.h"
+
 #include <atomic>
 #include <string>
 
@@ -24,62 +26,60 @@ 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 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;
 };
 
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
index 5b9d0c950f0..8e36090a7ac 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,162 @@
 
 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_detStore{"DetectorStore", name},
+  m_evtStore{"StoreGateSvc", name},
+  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(m_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 996ee330190..0fa66d6ff69 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,48 @@
 //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);
-      //@}
+ 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();
+  //@}
 
-   private:
-      ServiceHandle<StoreGateSvc> m_detStore;
-      ServiceHandle<StoreGateSvc> m_evtStore;
+ private:
+  ServiceHandle<StoreGateSvc> m_detStore;
+  ServiceHandle<StoreGateSvc> m_evtStore;
 
-      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;
+  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 aac90abdc7d..3828d7cacb4 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,197 @@
 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_detStore{"DetectorStore", name},
+  m_evtStore{"StoreGateSvc", name},
+  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 082980f99e6..15a4341ebbb 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
@@ -6,22 +6,14 @@
  * @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 +22,16 @@
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h" //template parameter
 
+// Gaudi includes
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/ServiceHandle.h"
+
+//STL includes
+#include <string>
+#include <vector>
+#include <queue>
+#include <utility> //for 'pair'
+
 //fwd declarations
 class StatusCode;
 class ISvcLocator;
@@ -39,68 +41,69 @@ 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
+  };
+
+  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()) {
+      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 0ad0ddc382a..32cd4b7d0db 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,254 @@
 #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_detStore{"DetectorStore", name},
+  m_evtStore{"StoreGateSvc", name},
+  m_evtInfo{"SCT_CalibEventInfo", name},
+  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(m_detStore->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(m_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 e3eee1990eb..8ca36c824da 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
@@ -6,7 +6,7 @@
  * @file SCT_CalibLbTool.h
  * Header file for the SCT_CalibLbTool class
  * @author Shaun Roe
-**/
+ **/
 
 #ifndef SCT_CalibLbTool_h
 #define SCT_CalibLbTool_h
@@ -32,7 +32,7 @@
 //fwd declarations
 
 namespace InDetDD {
-class  SCT_DetectorManager;
+  class  SCT_DetectorManager;
 }
 class StatusCode;
 class ISvcLocator;
@@ -41,48 +41,45 @@ 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:
+  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);
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
index 43a0b00fc0d..0cbbed15031 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
@@ -1,72 +1,47 @@
 /*
-  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_detStore{"DetectorStore", name},
+  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(m_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) {
+  //--- 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 c66830f8362..2de3a743f57 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,21 @@ 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);
+
+ 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;
 
 };
 #endif
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibNumbers.h
index 5a5dd67d19f..56459138fea 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 291051f1bab..1f30a0d1a6d 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 6078988736a..c3dccda0e85 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 893a8184927..c3ee81616db 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 8c11634bccc..543bfc6d7a4 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 8cb1e0dfeab..f731bd8ff89 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 62bcf2df6dd..a5bbd5ef908 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
-- 
GitLab


From 042f49c26785fd336031d4e97cd77a384da5b6aa Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 9 Mar 2019 16:14:45 +0100
Subject: [PATCH 366/404] CxxUtils: CachedPointer::store() should not be const.

CachedPointer::store() is the non-atomic, non-const version.
---
 Control/CxxUtils/CxxUtils/CachedPointer.h   | 4 ++--
 Control/CxxUtils/CxxUtils/CachedPointer.icc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Control/CxxUtils/CxxUtils/CachedPointer.h b/Control/CxxUtils/CxxUtils/CachedPointer.h
index a0e29b666a6..220cf6edbcf 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 325d0ddb1a8..2ad3b164366 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);
 }
-- 
GitLab


From 6025b5980b75b5ffdbc8f3b9b4d871197817aac6 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 6 Mar 2019 15:19:38 +0100
Subject: [PATCH 367/404] TestTools: Search JO path for Gaudi JO file.

Extend initGaudi so that it will search JOBOPTSEARCHPATH to find
the JO file passed to it.
---
 AtlasTest/TestTools/share/post.sh     |  1 +
 AtlasTest/TestTools/src/initGaudi.cxx | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/AtlasTest/TestTools/share/post.sh b/AtlasTest/TestTools/share/post.sh
index 426541c251f..71a10cc92ea 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 bc58fa6ee8e..630e662261a 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;
-- 
GitLab


From bf487a7e82fc2fd08f8e7869836da6ceb2f28dac Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 9 Mar 2019 16:17:41 +0100
Subject: [PATCH 368/404] MVAUtils: cmake fix

Declare dependency on CxxUtils (for checker_macros.h).
---
 Reconstruction/MVAUtils/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Reconstruction/MVAUtils/CMakeLists.txt b/Reconstruction/MVAUtils/CMakeLists.txt
index 7774cf602d8..3b392df10ad 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 )
 
-- 
GitLab


From 680a4101a89dcc43c4616d702ffd4dcc2a93ebfe Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 9 Mar 2019 16:18:00 +0100
Subject: [PATCH 369/404] TrkVertexSeedFinderTools: Fix clang warning.

clang warning: unused private member variable.
---
 .../TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h   | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/IndexedCrossDistancesSeedFinder.h
index 774b897c6f6..abb13724740 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;
-- 
GitLab


From b76a0b1ebf5d573cabb19c9fbdaf642e4e0a0b0b Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 9 Mar 2019 16:18:15 +0100
Subject: [PATCH 370/404] MDT_Digitization: Fix clang warnings.

clang warnings: Missing override keywords.
---
 .../MDT_Digitization/MDT_Digitization/RT_Relation_DB_DigiTool.h | 2 +-
 .../MDT_Digitization/MDT_Digitization/RT_Relation_DigiTool.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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 19d4232d28a..5021f574c83 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 6cce27f63a5..8c004f60c83 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();
 
-- 
GitLab


From 72ed67e27c2bc8ef50e776f59e70cba3cebc0ac7 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Sun, 10 Mar 2019 17:59:01 +0100
Subject: [PATCH 371/404] Remove old jobOption so we always uses the new one in
 CI tests

---
 Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO_build.sh
index cb8351b9d03..eb228cfa982 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
-- 
GitLab


From e9ff254a5f41aba20004210cc942eb0cabef1d05 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Sun, 10 Mar 2019 17:08:09 +0000
Subject: [PATCH 372/404] Rename SiLorentzAngleSvc package to
 SiLorentzAngleTool package (ATLASRECTS-4048)

---
 .../ATLAS_CHECK_THREAD_SAFETY                  |  1 -
 .../python/SiLorentzAngleSvcConfigDb.py        |  8 --------
 .../CMakeLists.txt                             | 10 +++++-----
 .../ATLAS_CHECK_THREAD_SAFETY                  |  1 +
 .../SiLorentzAngleCondData.h                   |  0
 .../doc/packagedoc.h                           | 18 +++++++++---------
 .../python/PixelLorentzAngleToolSetup.py       |  4 ++--
 .../python/SCTLorentzAngleToolSetup.py         |  2 +-
 .../python/SiLorentzAngleToolConfig.py}        |  4 ++--
 .../python/SiLorentzAngleToolConfigDb.py       |  8 ++++++++
 .../python/__init__.py                         |  0
 .../share/testSCTLorentzAngle.py               |  4 ++--
 .../src/PixelSiLorentzAngleCondAlg.cxx         |  0
 .../src/PixelSiLorentzAngleCondAlg.h           |  2 +-
 .../src/SCTSiLorentzAngleCondAlg.cxx           |  0
 .../src/SCTSiLorentzAngleCondAlg.h             |  2 +-
 .../src/SCTSiLorentzAngleTestAlg.cxx           |  0
 .../src/SCTSiLorentzAngleTestAlg.h             |  0
 .../src/SiLorentzAngleCondData.cxx             |  2 +-
 .../src/SiLorentzAngleTool.cxx                 |  0
 .../src/SiLorentzAngleTool.h                   |  2 +-
 .../components/SiLorentzAngleTool_entries.cxx} |  0
 .../python/FastSiDigitizationConfig.py         |  4 ++--
 .../python/PixelDigitizationConfig.py          |  4 ++--
 .../python/SCT_DigitizationConfig.py           |  2 +-
 .../InDetPrepRawDataToxAOD/share/InDetDxAOD.py |  2 +-
 .../share/testSCTDecode.py                     |  4 ++--
 .../share/ElectronEoverPTracking.py            |  2 +-
 .../share/ReadSiDetectorElements_jobOptions.py |  4 ++--
 .../share/InDetRecConditionsAccess.py          |  4 ++--
 .../InDetRecExample/share/InDetRecLoadTools.py | 12 ++++++------
 .../share/InDetRecPreProcessingSilicon.py      |  4 ++--
 .../python/InDetTrigConfigConditions.py        |  8 ++++----
 .../python/InDetTrigConfigRecLoadTools.py      |  2 +-
 .../share/ElectronEoverPTracking.py            |  2 +-
 .../InDetPrepRawDataFormation/CMakeLists.txt   |  1 -
 .../share/ReadSiDetectorElements_jobOptions.py |  4 ++--
 .../egammaRec/python/EMCommonRefitter.py       |  6 +++---
 ...rap_64TowersIBL_InDetClusters_jobOptions.py |  2 +-
 .../share/FTKMonitor_topOptions.py             |  2 +-
 .../python/TrigFTKLoadTools.py                 |  2 +-
 .../python/TrigFTKTrackConverter_Config.py     |  2 +-
 .../python/TrigInDetRecToolsFTK.py             |  2 +-
 .../python/TrigInDetTrackFitter_Config.py      |  2 +-
 .../python/TrigOnlineSpacePointTool_Config.py  |  4 ++--
 .../TrigUpgradeTest/python/InDetConfig.py      |  8 ++++----
 46 files changed, 78 insertions(+), 79 deletions(-)
 delete mode 100644 InnerDetector/InDetConditions/SiLorentzAngleSvc/SiLorentzAngleSvc/ATLAS_CHECK_THREAD_SAFETY
 delete mode 100644 InnerDetector/InDetConditions/SiLorentzAngleSvc/python/SiLorentzAngleSvcConfigDb.py
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/CMakeLists.txt (89%)
 create mode 100644 InnerDetector/InDetConditions/SiLorentzAngleTool/SiLorentzAngleTool/ATLAS_CHECK_THREAD_SAFETY
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc/SiLorentzAngleSvc => SiLorentzAngleTool/SiLorentzAngleTool}/SiLorentzAngleCondData.h (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/doc/packagedoc.h (79%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/python/PixelLorentzAngleToolSetup.py (94%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/python/SCTLorentzAngleToolSetup.py (97%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc/python/SiLorentzAngleSvcConfig.py => SiLorentzAngleTool/python/SiLorentzAngleToolConfig.py} (81%)
 create mode 100644 InnerDetector/InDetConditions/SiLorentzAngleTool/python/SiLorentzAngleToolConfigDb.py
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/python/__init__.py (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/share/testSCTLorentzAngle.py (94%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/PixelSiLorentzAngleCondAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/PixelSiLorentzAngleCondAlg.h (97%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SCTSiLorentzAngleCondAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SCTSiLorentzAngleCondAlg.h (98%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SCTSiLorentzAngleTestAlg.cxx (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SCTSiLorentzAngleTestAlg.h (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SiLorentzAngleCondData.cxx (98%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SiLorentzAngleTool.cxx (100%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc => SiLorentzAngleTool}/src/SiLorentzAngleTool.h (98%)
 rename InnerDetector/InDetConditions/{SiLorentzAngleSvc/src/components/SiLorentzAngleSvc_entries.cxx => SiLorentzAngleTool/src/components/SiLorentzAngleTool_entries.cxx} (100%)

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 8fd15b490e9..00000000000
--- 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 77499920a05..00000000000
--- 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 50f42535de4..86125e6f55e 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 00000000000..372bf00d2df
--- /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 c83b5134890..6b1909528d4 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 f6bad11a9b6..f9f0e2b6d0e 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 e259c39cc97..270b01b6f0a 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 305fe9fe0e1..00c6e6103ce 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 00000000000..2176f55ea05
--- /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 2824eb15221..0da2a95e94f 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 0537d770ab0..6cc0db2b261 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 189038555b4..f8819e34118 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 ffbcb392192..5ecd26e9480 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 37a02d76913..80a054455c2 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/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py
index f661898dcc5..216d0071c57 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 f676c1442ae..971dd4962dc 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 0f8996f573e..a753c90b1b3 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/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
index b757c825632..6b51841abe7 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/SCT_RawDataByteStreamCnv/share/testSCTDecode.py b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/share/testSCTDecode.py
index f67b4de2e4d..4e62db0218b 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 d0c8b10b17b..48d91adf59a 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 f417a79e9e7..14186022d58 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 e84ea5da786..ef043d6801f 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 b1b74a7ec6e..fe6329886ca 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 57a5bf0ee8a..3eba016b161 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 dcef2787056..a6e0389c911 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 bfc77bbc008..d9c5eb709bc 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 50868637b9b..e46f6e1db33 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/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt
index a08cf39d914..cd3ae93527b 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/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
index b6702d3e911..74951c2704b 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/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py
index c42ebc0cd12..88c83ee1763 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/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py b/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimRegionalWrap_64TowersIBL_InDetClusters_jobOptions.py
index 4ea54f381f9..0016477cf6f 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 76dd63324cc..b853f7f2523 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 d40a71e2140..16f50abaaf9 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/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py b/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py
index 0030fd1b738..92dd11e939e 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 c62802a90a8..9cc70329891 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 0af00a77642..7930fe15ed8 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 b55388c2af0..7d3225a1a09 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/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index aa5e993d021..1ceea268c68 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
@@ -116,12 +116,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 +177,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)
-- 
GitLab


From 6a271d8febbdc1538e8d40024a6e54838b734150 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 11 Mar 2019 08:23:29 +0000
Subject: [PATCH 373/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetReadoutGeometry
 package

---
 .../InDetReadoutGeometry/CMakeLists.txt       |  3 +-
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../InDetDetectorManager.h                    | 21 ++++--
 .../InDetReadoutGeometry/PixelModuleDesign.h  |  7 +-
 .../InDetReadoutGeometry/SiCommonItems.h      | 22 ++++--
 .../InDetReadoutGeometry/SiDetectorElement.h  | 28 ++++----
 .../InDetReadoutGeometry/SurfaceCache.h       | 10 +--
 .../TRT_BarrelDescriptor.h                    | 10 +--
 .../InDetReadoutGeometry/TRT_BarrelElement.h  |  6 +-
 .../InDetReadoutGeometry/TRT_BaseElement.h    | 21 ++++--
 .../InDetReadoutGeometry/TRT_Conditions.h     | 14 ++--
 .../TRT_EndcapDescriptor.h                    | 10 +--
 .../InDetReadoutGeometry/TRT_EndcapElement.h  |  6 +-
 .../src/InDetDetectorManager.cxx              |  6 +-
 .../src/PixelDetectorManager.cxx              |  3 +-
 .../src/PixelModuleDesign.cxx                 | 13 +---
 .../src/SiCommonItems.cxx                     |  6 +-
 .../src/SiDetectorElement.cxx                 | 11 +--
 .../src/TRT_BarrelDescriptor.cxx              | 14 +---
 .../src/TRT_BarrelElement.cxx                 | 15 ++--
 .../src/TRT_BaseElement.cxx                   | 70 ++++++++++++-------
 .../src/TRT_Conditions.cxx                    |  9 ++-
 .../src/TRT_DetectorManager.cxx               |  2 +-
 .../src/TRT_EndcapDescriptor.cxx              | 16 +----
 .../src/TRT_EndcapElement.cxx                 | 14 ++--
 25 files changed, 178 insertions(+), 160 deletions(-)
 create mode 100644 InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/CMakeLists.txt
index beb81329593..d18d34bbc21 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 00000000000..e7b2f6455b3
--- /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 f78d94baa0d..5765370a8b2 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 c07431ea306..1155f300323 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 a50148bad4d..3dbdfcfc406 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 6400ac183d1..2c052109eb4 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 8c112a5b97c..07e3e245847 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 244ff8ec08b..c9c0c73e17f 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 fcd4d0a8b42..4ef4b18957f 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 a59add9b67b..92120626306 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 fd3d53b578a..be435ec9657 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 a6edf251a9c..394a9c1adf8 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 10fe067ac08..351c969d8a2 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 090b5e9d86c..ae8514eb2ce 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 1272a3136a6..9139354154e 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 573c1cf92e9..5b874a21196 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 9df5ae1d295..46e095a29d9 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 bd2a80a8c96..bf87647bbb2 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 d6ed3d40064..7e071c0dbef 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 e44a52697d0..834d334c72e 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 b4fd30cbe94..e7408f3bf23 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 ac5974f9876..bf1fbd4fec6 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 df691eebd22..43f1ab2de47 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 205496e2039..fc31fde3b64 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 c5637d308b5..f4a344c7853 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();
     }
 
 
-- 
GitLab


From ccfb0a296132700f16e3d2873eaed39f5a5bb0ec Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Mon, 11 Mar 2019 09:23:33 +0100
Subject: [PATCH 374/404] moved cache creators to the main branch of the CF

---
 .../python/MuonBytestreamDecodeConfig.py      |   8 +-
 .../MuonConfig/python/MuonRdoDecodeConfig.py  |   6 +
 .../MuonConfig/share/MuonDataDecodeTest.ref   | 485 ++++++++++++++++-
 .../share/MuonDataDecodeTest_Cache.ref        | 502 +++++++++++++++++-
 .../TrigUpgradeTest/python/InDetConfig.py     |  48 +-
 .../TrigUpgradeTest/share/newJOtest.py        |   9 -
 .../TriggerJobOpts/python/TriggerConfig.py    | 111 ++--
 7 files changed, 1083 insertions(+), 86 deletions(-)

diff --git a/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonBytestreamDecodeConfig.py
index 6363d17ae0f..14e4ea9065f 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 f96f53de934..1398b7bf5ca 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 80ddcf2e960..9ad83eb8eb9 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 5c116b9ab32..c461c6a9685 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
@@ -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
@@ -327,7 +331,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
@@ -1118,7 +1124,6 @@ Py:Athena            INFO Print Config
 |-MonitorService                          = 'MonitorSvc'
 |-OutputLevel                             = 0
 |-RegisterForContextService               = False
-|-Sequential                              = False
 |-StopOverride                            = False
 |-TimeOut                                 = 0.0
 |=/***** Algorithm Muon::RpcRawDataProvider/RpcRawDataProvider ***************************************
@@ -1590,6 +1595,500 @@ 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 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::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) ---------------------------------------------------
 
 JOs reading stage finished, launching Athena from pickle file
 
@@ -3130,7 +3629,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/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py
index 1ceea268c68..3c78e435483 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()
@@ -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/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index 50fbefbe843..52d08bb197a 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/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index 16edb349cb7..9fbf72f64a1 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()
-
-- 
GitLab


From 47015c35e685d06d0caaa217b0d5bf786e2c71c9 Mon Sep 17 00:00:00 2001
From: Claire Antel <claire.antel@cern.ch>
Date: Mon, 11 Mar 2019 08:39:16 +0000
Subject: [PATCH 375/404] merging FTK-related jet trigger changes 21.3 to
 master (ATR-19010 ATR-19217)

---
 .../JetMomentTools/JetVertexFractionTool.h    |    2 +
 .../JetMomentTools/JetVertexTaggerTool.h      |    8 +-
 .../Root/JetVertexFractionTool.cxx            |   30 +-
 .../Root/JetVertexTaggerTool.cxx              |   12 +-
 .../Jet/JetRec/Root/IParticleExtractor.cxx    |    2 +-
 .../TrigHLTJetRec/ITriggerJetBuildTool.h      |    1 +
 .../TrigHLTJetRec/PseudoJetCreatorFunctions.h |    5 +
 .../TrigHLTJetRec/TrigHLTJetRecBase.h         |    5 +
 .../TrigHLTJetRec/TrigHLTJetRecBase_tpl.h     |   54 +-
 .../TrigHLTJetRec/TriggerJetBuildTool.h       |    1 +
 .../python/TrigHLTJetRecConfig.py             |   92 +-
 .../src/PseudoJetCreatorFunctions.cxx         |   28 +
 .../TrigHLTJetRec/src/TriggerJetBuildTool.cxx |   51 +
 .../TrigJetMonitoring/HLTJetMonTool.h         |   10 +-
 .../python/TrigJetMonitoringConfig.py         |  294 ++--
 .../TrigJetMonitoring/src/HLTJetMonTool.cxx   |  128 +-
 .../TriggerMenu/python/jet/AlgFactory.py      |   21 +-
 .../python/jet/JetSequencesBuilder.py         |    1 +
 .../TriggerMenu/python/menu/MC_pp_v8.py       | 1299 +++++++++++++++++
 19 files changed, 1844 insertions(+), 200 deletions(-)
 create mode 100644 Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v8.py

diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h
index 68c9e910b6b..ac3f1931fd7 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 68823c71171..2e4f3789415 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 06ce33713eb..695f73a27b7 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 09e0fd97d5c..6c4a709b2f7 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 2e3ed355f62..f1fdd906fd7 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/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ITriggerJetBuildTool.h
index 8f7308f1c7d..4338415f253 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/PseudoJetCreatorFunctions.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/PseudoJetCreatorFunctions.h
index ea2852bf602..3e35a299f11 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 266fbdeefd1..1deb1cf693d 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 ac0c3e5483c..1c100a4baa0 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/TriggerJetBuildTool.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TriggerJetBuildTool.h
index 335f8f797d1..31e7b477a08 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 c7c6a162316..bfdbbf2ba16 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/python/TrigHLTJetRecConfig.py
@@ -192,6 +192,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 +252,7 @@ def configTVassocTool(name,
         TrackParticleContainer = tpcSGkey,
         TrackVertexAssociation = tvSGkey,
         VertexContainer = vcSGkey,
+        TrackVertexAssoTool = jtm.jetLooseTVAtool,
     )
 
     # Build the tool :
@@ -451,6 +497,7 @@ def _getJetBuildTool2(merge_param,
                       iParticleRejectionTool,
                       name='',
                       secondary_label='',
+		      trkopt = '',
                       outputLabel='',
                       OutputLevel=INFO,
                       fromJet=False
@@ -476,7 +523,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 +537,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 +627,7 @@ def _getJetBuildTool2(merge_param,
 
     try:
         # jetBuildTool = jtm.addJetFinderTrigger(
+        #OutputLevel=VERBOSE
         jetBuildTool = jtm.addTriggerJetBuildTool(
             name=name,
             alg="AntiKt",
@@ -1137,8 +1198,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 +1231,7 @@ class TrigHLTJetRecGroomer(TrigHLTJetRecConf.TrigHLTJetRecGroomer):
                  OutputLevel=INFO,
                  ):
 
-        # OutputLevel = VERBOSE
+        #OutputLevel = VERBOSE
         
         TrigHLTJetRecConf.TrigHLTJetRecGroomer.__init__(self, name = name)
 
@@ -1502,6 +1564,7 @@ class TrigHLTTrackMomentHelpers(TrigHLTJetRecConf.TrigHLTTrackMomentHelpers):
 
     def __init__(self,
                  name,
+                 trkopt,
                  tvassocSGkey,
                  trackSGkey,
                  primVtxSGkey,
@@ -1512,7 +1575,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 +1585,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/PseudoJetCreatorFunctions.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/PseudoJetCreatorFunctions.cxx
index 070d35ac21b..6632ec4280d 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/TriggerJetBuildTool.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TriggerJetBuildTool.cxx
index 8a3b5e367c0..94d04a79b29 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/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h b/Trigger/TrigMonitoring/TrigJetMonitoring/TrigJetMonitoring/HLTJetMonTool.h
index ffd4f3df133..fcbcd0cb5d5 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 bcfd5c07a51..af6652a753b 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,8 +894,7 @@ def TrigJetMonitoringTool():
  # from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
  # HLTMonFlags.doEgamma.set_Value_and_Lock(False)
 
-  
-  #ToolSvc += HLTJetMon;
+  ToolSvc += HLTJetMon;
 
   # Set up the trigger configuration tool:
   #ToolSvc += CfgMgr.TrigConf__xAODConfigTool( "xAODConfigTool",
diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx b/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx
index 4429f2a220e..4cdba058480 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/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
index f7a604febe6..19fbda2c9b6 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/AlgFactory.py
@@ -172,9 +172,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 +223,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)]
diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
index e4e24ec5ef4..a765f83ddb5 100644
--- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
+++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py
@@ -296,6 +296,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:
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 00000000000..b0fbcaafe01
--- /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 
+######################################################
-- 
GitLab


From 335f0481fa90ad731345447b3dfb5c8998cc028f Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Mon, 11 Mar 2019 09:22:56 +0000
Subject: [PATCH 376/404] Don't check RootComp result in fullMenu and newJO
 unit tests

---
 Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 1812e23ad02..27a0c889194 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
    )
-- 
GitLab


From cc588bba177431b92459054b75cbede8a0170dea Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 11 Mar 2019 10:37:21 +0000
Subject: [PATCH 377/404] Add ATLAS_CHECK_THREAD_SAFETY to InDetEventAthenaPool
 and InDetEventTPCnv packages

---
 .../ATLAS_CHECK_THREAD_SAFETY                 |  1 +
 .../src/InDetLowBetaCandidateCnv.cxx          |  2 +-
 .../src/InDetLowBetaContainerCnv.cxx          |  2 +-
 .../src/InDetSimDataCollectionCnv.cxx         |  8 +--
 .../src/InDetTrackCnv.cxx                     |  4 +-
 .../src/PixelClusterContainerCnv.cxx          |  8 +--
 .../src/PixelGangedClusterAmbiguitiesCnv.cxx  | 12 ++---
 .../src/PixelGangedClusterAmbiguitiesCnv.h    |  5 +-
 .../src/PixelRDO_ContainerCnv.cxx             |  6 +--
 .../src/SCT_ClusterContainerCnv.cxx           |  8 +--
 .../src/SCT_FlaggedCondDataCnv.cxx            |  2 +-
 .../src/SCT_RDO_ContainerCnv.cxx              | 12 ++---
 .../src/TRT_DriftCircleContainerCnv.cxx       |  6 +--
 .../src/TRT_RDO_ContainerCnv.cxx              |  8 +--
 .../src/TRT_RDO_ContainerCnv_p1.cxx           |  4 +-
 .../InDetLowBetaCandidateCnv_tlp1.h           |  2 +-
 .../InDetLowBetaCandidateCnv_tlp1.cxx         |  4 +-
 .../InDetLowBetaContainerCnv_tlp1.cxx         |  4 +-
 .../PixelGangedClusterAmbiguitiesCnv_p1.cxx   |  5 +-
 .../PixelClusterOnTrackCnv_p2.cxx             | 50 +++++++-----------
 .../TRT_DriftCircleOnTrackCnv_p2.cxx          | 52 +++++++------------
 21 files changed, 90 insertions(+), 115 deletions(-)
 create mode 100644 InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/ATLAS_CHECK_THREAD_SAFETY

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 00000000000..5b6a560431a
--- /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 fa83294187d..8979a60dfe0 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 c731090f9c2..5935d17948e 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 39be5b68628..aaa95ca0363 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 718b5792236..678a345f52f 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 8504cdc5a64..f3bc60d9f82 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 12bf6d5a06a..26699ff8843 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 758951702bf..0544c746e31 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 4d922261b33..a9558b57ac0 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 0818e7b2c89..4ce7fb35838 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 d9224ba1285..299160dca6b 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 74a877fda4a..3e16fae0d15 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 23d13c3cbc9..986cdee6792 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 1004b4dc54d..0f39ff830d8 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 c6798a99dd2..f3241b70beb 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 83c1e0a38ed..abc0586e408 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 a6da6b05f8f..009a96b3881 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 5fc314510ef..8c32046c886 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 e88a6af7f1e..140c825e10f 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 cfed0f93cff..05bb16bd4a8 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 7abd3842ef0..b7154388802 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;
 }
-- 
GitLab


From 520b6206a9e8c0d20ec4e16c9b7938de3ec488a5 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 7 Mar 2019 17:21:41 +0100
Subject: [PATCH 378/404] Fix auto-configuration for isOnline mode

The fully fledge AutoConfiguration is not usable with `isOnline=True`
outside of P1 because it actually tries to access information from IS
servers. Revert back to using `AthFile` directly as it was done in
runHLT_standalone.py

The default is still `isOnline=False` but added a command line option to
switch the mode for ease of debugging problems we are currently seeing.
Once those are fixed we should set the default to `isOnline=True`.
---
 .../TrigUpgradeTest/share/testHLT_MT.py       | 61 ++++++++++---------
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py
index 4fbecdf062b..87274d1411c 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
-- 
GitLab


From 040ea55e342303f5ba3fdf1ec69de4935cd73a80 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 11 Mar 2019 13:20:22 +0100
Subject: [PATCH 379/404] Update references

The changes are due to the new geometry/conditions tag.
---
 .../TrigUpgradeTest/share/RunMenuTest.ref     |  6 +-
 .../TrigUpgradeTest/share/bJetMenu.ref        | 12 ++--
 .../TrigUpgradeTest/share/bJetMenuALLTE.ref   | 12 ++--
 .../TrigUpgradeTest/share/egammaRunData.ref   | 72 +++++++++----------
 .../TrigUpgradeTest/share/electronMenu.ref    |  6 +-
 .../TrigUpgradeTest/share/fullMenu.ref        |  6 +-
 .../TrigUpgradeTest/share/met_standalone.ref  |  2 +-
 .../TrigUpgradeTest/share/muMenu.ref          |  6 +-
 8 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/RunMenuTest.ref
index e3e3846fd41..8373d8fc4fa 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 bf716b4bc55..7f1e238a596 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 bf716b4bc55..7f1e238a596 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/egammaRunData.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
index 1c772ff2c5e..2586c1efa39 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
@@ -5,8 +5,8 @@ HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -14,8 +14,8 @@ HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -23,8 +23,8 @@ HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -32,8 +32,8 @@ HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -41,8 +41,8 @@ HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -50,8 +50,8 @@ HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -59,8 +59,8 @@ HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -68,8 +68,8 @@ HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -77,8 +77,8 @@ HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigEMClusterConta
 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::TrigEMClusterContainer#HLT_xAOD__TrigEMClusterContainer_L2CaloClusters Fragment size :204 bytes
@@ -92,8 +92,8 @@ HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -101,8 +101,8 @@ HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -110,8 +110,8 @@ HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -119,8 +119,8 @@ HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -151,8 +151,8 @@ HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigEMClusterConta
 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
@@ -169,15 +169,15 @@ HLTRMakerAlg.MKTool.Serialiser          19  0     DEBUG xAOD::TrigEMClusterConta
 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 8e8cfe440be..9e7fb876f60 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 f235b86abb8..3038ae267ad 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.ref
@@ -188,15 +188,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_j100                      20        20        6         0         6         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref
index 0fd92ec5843..411aed96043 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 11a30853613..40cec9c9150 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         
-- 
GitLab


From 236a02c44cd22313f4086439f35d309b2f9237fe Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Mon, 11 Mar 2019 14:46:27 +0000
Subject: [PATCH 380/404] Fixes the VP1 BatchMode RandomConfig in master

---
 graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx b/graphics/VP1/VP1Gui/src/VP1ExecutionScheduler.cxx
index bac60a9e21f..ec8fb317447 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 ) {
-- 
GitLab


From 71e7d1fe7bf67c83e707c75046ee27ef7670768b Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Mon, 11 Mar 2019 14:48:17 +0000
Subject: [PATCH 381/404] Remove static keyword from some SCT classes

---
 .../src/xAODSCTRDOContainerCnv.cxx            |  2 +-
 .../SCT_ByteStreamFractionContainerCnv.cxx    |  2 +-
 .../src/SCT_ModuleVetoCondAlg.cxx             | 20 ++++++++++---------
 .../src/SCT_TdaqEnabledCondAlg.cxx            |  4 ++--
 .../src/SCT_TdaqEnabledCondAlg.h              |  3 +++
 .../SCT_Cabling/SCT_Cabling/SCT_OnlineId.h    |  2 +-
 .../SCT_Cabling/src/SCT_OnlineId.cxx          |  4 ++--
 7 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx b/Event/xAOD/xAODTrackingAthenaPool/src/xAODSCTRDOContainerCnv.cxx
index f3d85fb051b..8d74ff2d9ea 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/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx b/InnerDetector/InDetConditions/InDetByteStreamErrorsAthenaPool/src/SCT_ByteStreamFractionContainerCnv.cxx
index 30964437443..a896010a4d8 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 41879063b3f..cd8b13726c5 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 8ceee2302db..f1e516fd71a 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 6822548b0f2..d2836a30099 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/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h b/InnerDetector/InDetDetDescr/SCT_Cabling/SCT_Cabling/SCT_OnlineId.h
index b8d328d9d43..73938ec0779 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 c1b55e48d42..d5f737e2069 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)) ;
-- 
GitLab


From e68fd0ed37f733e195d86a49b639b43d5b4ba181 Mon Sep 17 00:00:00 2001
From: Fernando Monticelli <fernando.monticelli@cern.ch>
Date: Mon, 11 Mar 2019 15:38:37 +0000
Subject: [PATCH 382/404] Pseudomerge of TrigEgammaRec from 21.1 to master

---
 .../TrigEgammaRec/CMakeLists.txt              |   8 +-
 .../TrigEgammaRec/TrigEgammaRec.h             |   5 +-
 .../python/TrigEgammaRecConfig.py             |   4 +-
 .../python/TrigEgammaToolFactories.py         |  15 +-
 .../python/TrigEgammaTrackTools.py            | 112 ++++++
 .../TrigEgammaRec/src/TrigEgammaRec.cxx       | 379 +++++++++++-------
 6 files changed, 360 insertions(+), 163 deletions(-)
 create mode 100644 Trigger/TrigAlgorithms/TrigEgammaRec/python/TrigEgammaTrackTools.py

diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigEgammaRec/CMakeLists.txt
index 27eefb6b34e..13a3ced0d6e 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 5e86e07598d..1a049aed5d7 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 40a003b5ac7..1721caa5a02 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 befd1e2ce4b..723459a24f2 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 00000000000..a5fe6863b36
--- /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 578aa0d87c3..8b95163cef4 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)){
-- 
GitLab


From 4351604f73e7b22d20ca9ba4e14a0a813dee3958 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 11 Mar 2019 17:26:09 +0100
Subject: [PATCH 383/404] Migration to xAOD::EventInfo and cleanup of several
 obsolete includes of the old EventInfo

---
 .../DataQualityTools/DQTNonCollBkg_ZDC.h            |  5 -----
 .../InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx | 13 +++----------
 .../InDetBeamSpotFinder/src/InDetBeamSpotReader.h   |  6 +++---
 .../InDetBeamSpotFinder/src/InDetBeamSpotRooFit.cxx |  4 +---
 .../InDetBeamSpotFinder/src/InDetBeamSpotVertex.cxx |  6 +-----
 5 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h b/DataQuality/DataQualityTools/DataQualityTools/DQTNonCollBkg_ZDC.h
index 01b59351621..2f0222d474e 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/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx b/InnerDetector/InDetCalibAlgs/InDetBeamSpotFinder/src/InDetBeamSpotReader.cxx
index bdd0ef2c849..69ba8b91c1e 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 8533e0c8247..ee83cf1be1d 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 dc21a470243..f658c6308e7 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 ac58270dba1..bfcd4dc9eae 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"
-- 
GitLab


From 21379bc3464d3d9dbb77d196f64b4bb58c3bd396 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 11 Mar 2019 17:14:42 +0100
Subject: [PATCH 384/404] Remove timestamp and fix uninitialized variables

- Remove the timestamp from the MessageSvc by default as this should be
  added by our top-level job options used for online running
- Fix uninitialized variables
---
 .../TrigControl/TrigServices/python/TrigServicesConfig.py     | 2 +-
 HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
index ab121e6cb5f..25a6d9bc20a 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
diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.h
index 550eff3e302..182d6a8f7a2 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
-- 
GitLab


From 1046018fbfeda3d6a62dd3a94110acd9c40149be Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 11 Mar 2019 17:39:22 +0100
Subject: [PATCH 385/404] Dropped dependency on the old EventInfo from
 TRT_ConditionsServices

---
 .../TRT_ConditionsServices/CMakeLists.txt     |  3 +-
 .../src/TRT_DAQ_ConditionsSvc.cxx             | 48 +------------------
 .../src/TRT_DAQ_ConditionsSvc.h               |  3 +-
 3 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_ConditionsServices/CMakeLists.txt
index 5e629ca4b09..2c971cbeffc 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 285e51981ec..be20e1a6947 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 096cf161981..0e1d29c39e9 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
-- 
GitLab


From 1fb32860c8ed8592266c5214c813841e021a505e Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 11 Mar 2019 18:03:55 +0100
Subject: [PATCH 386/404] TrigValTools: delete obsolete validation scripts

Delete obsolete validation scripts that are no longer used/usable in
release 22.
---
 .../TrigValTools/bin/atn_summary.pl           |  658 --------
 .../TrigValTools/bin/atn_summary_ART.pl       |  816 ----------
 .../TrigValTools/bin/atn_timeline.py          |  198 ---
 .../TrigValTools/bin/test-xml-autoconf.py     |   63 -
 .../TrigValTools/bin/trigtest.pl              | 1372 ----------------
 .../TrigValTools/bin/trigtest_ART.pl          | 1393 -----------------
 .../TrigValTools/bin/trigtestlink.py          |   69 -
 .../TrigValTools/share/leakCheck.py           |   10 -
 .../TrigValTools/share/trig_counts_summary.py |  523 -------
 9 files changed, 5102 deletions(-)
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/atn_summary_ART.pl
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/atn_timeline.py
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/test-xml-autoconf.py
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/trigtest.pl
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/trigtest_ART.pl
 delete mode 100755 Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py
 delete mode 100644 Trigger/TrigValidation/TrigValTools/share/leakCheck.py
 delete mode 100755 Trigger/TrigValidation/TrigValTools/share/trig_counts_summary.py

diff --git a/Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl b/Trigger/TrigValidation/TrigValTools/bin/atn_summary.pl
deleted file mode 100755
index 25a2404739f..00000000000
--- 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 e90ca91cf87..00000000000
--- 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 040d6cce260..00000000000
--- 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/test-xml-autoconf.py b/Trigger/TrigValidation/TrigValTools/bin/test-xml-autoconf.py
deleted file mode 100755
index 820942beb24..00000000000
--- 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 aeadb4440fd..00000000000
--- 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 4e7729dfbd4..00000000000
--- 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 99c2c0e9757..00000000000
--- 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 bd580ea6a6a..00000000000
--- 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 ceea9269bf9..00000000000
--- 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)
-
-    
-- 
GitLab


From 81d51a0b0f8970440d68fc446d2a892fa565d544 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 11 Mar 2019 18:21:03 +0100
Subject: [PATCH 387/404] Dropped dependency on the old EventInfo from
 PixelMonitoring and TRT_Monitoring

---
 InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt | 4 ++--
 .../PixelMonitoring/PixelMonitoring/PixelMainMon.h           | 4 +---
 InnerDetector/InDetMonitoring/PixelMonitoring/src/Hits.cxx   | 5 ++---
 .../InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx     | 4 +---
 InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt  | 3 +--
 .../TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h      | 4 +---
 .../TRT_Monitoring/src/TRT_Monitoring_Tool.cxx               | 5 +----
 7 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/PixelMonitoring/CMakeLists.txt
index 71730b7c224..1aa1e1e716e 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 12e994d3993..b7a41aeaa2f 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 82130edd020..50c90a7378d 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 7482d602487..67a8b1c8a7b 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/TRT_Monitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/TRT_Monitoring/CMakeLists.txt
index 2a00f918142..089e390212a 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 905d285c752..b52230686c7 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 b54aad98739..e0a57db301f 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() );
-- 
GitLab


From 0f1d50f0318bc5eaf24c5a1fc3f5615967c461a1 Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <janders@lxplus018.cern.ch>
Date: Mon, 11 Mar 2019 18:23:02 +0100
Subject: [PATCH 388/404] Changed q220 which should now run in Master

---
 Tools/Tier0ChainTests/test/test_q220.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Tools/Tier0ChainTests/test/test_q220.sh b/Tools/Tier0ChainTests/test/test_q220.sh
index bd2d1be252b..29b7b66fa0d 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
-- 
GitLab


From bb601c226fca7a7127a03e485bce51f6a39d60d1 Mon Sep 17 00:00:00 2001
From: Tim Martin <tim.martin@cern.ch>
Date: Mon, 11 Mar 2019 18:00:57 +0000
Subject: [PATCH 389/404] ATR-19379 Consistent use of DecisionID typedef.
 Consistent use of ElementLinkVector "seed" in R3 trigger steering.

---
 .../Root/TrigCompositeAuxContainer_v2.cxx     |   2 +
 .../xAODTrigger/Root/TrigComposite_v1.cxx     |  43 +++--
 .../xAODTrigger/xAODTrigger/TrigComposite.h   |   5 -
 .../versions/TrigCompositeAuxContainer_v2.h   |   4 +
 .../xAODTrigger/versions/TrigComposite_v1.h   |  18 ++-
 .../xAODTrigger/versions/TrigComposite_v1.icc |  12 +-
 .../src/PEBInfoWriterAlg.cxx                  |   2 +-
 .../src/TrigL2CaloHypoAlgMT.cxx               |   4 +-
 .../TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx  |   4 +-
 .../TrigMuonHypoMT/src/TrigMuisoHypoAlg.cxx   |   4 +-
 .../src/TrigMuonEFCombinerHypoAlg.cxx         |   4 +-
 .../src/TrigMuonEFMSonlyHypoAlg.cxx           |   4 +-
 .../src/TrigMuonEFTrackIsolationHypoAlg.cxx   |   4 +-
 .../TrigMuonHypoMT/src/TrigmuCombHypoAlg.cxx  |   4 +-
 .../TrigTauHypo/src/TrigTauCaloHypoAlgMT.cxx  |  14 +-
 .../DecisionHandling/TrigCompositeUtils.h     |  73 +++++----
 .../DecisionHandling/TrigCompositeUtils.icc   |  18 +++
 .../share/TrigCompositeUtils_test.ref         |  59 +++----
 .../DecisionHandling/src/ComboHypo.cxx        |  92 +++++------
 .../DecisionHandling/src/InputMakerBase.cxx   |  81 +++++-----
 .../DecisionHandling/src/InputMakerForRoI.cxx |  42 ++---
 .../DecisionHandling/src/RoRSeqFilter.cxx     |  61 +++++---
 .../DecisionHandling/src/RoRSeqFilter.h       |   4 +-
 .../src/TrigCompositeUtils.cxx                | 148 +++++++++---------
 .../test/TrigCompositeUtils_test.cxx          |  39 +++--
 .../src/EventViewCreatorAlgorithm.cxx         |  81 +++++-----
 .../TrigUpgradeTest/share/dataScoutingTest.py |   2 +-
 .../TrigUpgradeTest/share/egamma.withViews.py |   2 +-
 .../TrigUpgradeTest/share/egammaRunData.ref   |  58 +++----
 .../TrigUpgradeTest/share/pebTest.py          |   2 +-
 .../TrigUpgradeTest/src/TestHypoAlg.cxx       |  70 ++++-----
 .../TrigUpgradeTest/src/TestHypoTool.cxx      |  84 +++++-----
 .../TrigUpgradeTest/src/TestInputMaker.cxx    |  83 +++++-----
 .../TrigUpgradeTest/src/TestMerger.cxx        |  20 +--
 .../TrigUpgradeTest/src/TestRoRSeqFilter.cxx  |  52 +++---
 .../test/test_egamma_run_data.sh              |   2 +-
 .../TrigValidation/TrigValAlgs/CMakeLists.txt |   3 +-
 .../TrigValAlgs/src/TrigEDMChecker.cxx        |  78 +++++----
 38 files changed, 693 insertions(+), 589 deletions(-)

diff --git a/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx b/Event/xAOD/xAODTrigger/Root/TrigCompositeAuxContainer_v2.cxx
index d6fdf943c3c..a9ae9559fdf 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 50905d65e45..c0603fb755d 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 32524ccb8d3..6fc5a85eec5 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 a930c557c24..fce55c86b24 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 b65c66e1b88..6b529cabc19 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 360664965ad..598f2611017 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/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/src/PEBInfoWriterAlg.cxx
index 42ea4e63556..9b288cf02da 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/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypoAlgMT.cxx
index b5d7bcf9eb1..bb07fa0e5b2 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/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMufastHypoAlg.cxx
index df1a85c30c1..981fb5a24e1 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 166b8cc483c..f5bed116b9a 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 2de33a5573a..be33078a44f 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 40bed09b2bd..e91f559945a 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 f1a59c2d650..8c991854a1f 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 ea94c0bc76e..95ecf0836b6 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 e03f9bac680..f709144b229 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/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h b/Trigger/TrigSteer/DecisionHandling/DecisionHandling/TrigCompositeUtils.h
index f72f8f21b16..1bbd5cdcd5b 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 4f47a254305..198d9a223fa 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 4336ef8e73c..0efaa06a2d0 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 02488db94d8..a99a873cd12 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 6406db2a9d7..ae9f403eb8c 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 a527412adc0..e396a41734d 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 dc97402c087..33aa17f4655 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 ee6a6dd2f9f..6e572e48d7f 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 581958e813a..8a8e92a003e 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 48940d6b336..b2ef8139eb0 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/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
index 3929467e038..f952bea8208 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/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/dataScoutingTest.py
index 19ef84faf0d..06ad199e389 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 474e1c36b3f..00c05345fad 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 1c772ff2c5e..26c1b35bf69 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/egammaRunData.ref
@@ -1,6 +1,5 @@
 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
@@ -8,8 +7,7 @@ HLTRMakerAlg.MKTool.Serialiser          0   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -17,8 +15,7 @@ HLTRMakerAlg.MKTool.Serialiser          1   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -26,8 +23,7 @@ HLTRMakerAlg.MKTool.Serialiser          2   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -35,8 +31,7 @@ HLTRMakerAlg.MKTool.Serialiser          3   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -44,8 +39,7 @@ HLTRMakerAlg.MKTool.Serialiser          4   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -53,8 +47,7 @@ HLTRMakerAlg.MKTool.Serialiser          5   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -62,8 +55,7 @@ HLTRMakerAlg.MKTool.Serialiser          6   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -71,8 +63,7 @@ HLTRMakerAlg.MKTool.Serialiser          7   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -80,14 +71,13 @@ HLTRMakerAlg.MKTool.Serialiser          8   0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -95,8 +85,7 @@ HLTRMakerAlg.MKTool.Serialiser          10  0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -104,8 +93,7 @@ HLTRMakerAlg.MKTool.Serialiser          11  0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -113,8 +101,7 @@ HLTRMakerAlg.MKTool.Serialiser          12  0     DEBUG xAOD::TrigElectronContai
 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          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
@@ -122,8 +109,7 @@ HLTRMakerAlg.MKTool.Serialiser          13  0     DEBUG xAOD::TrigElectronContai
 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          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,22 +117,20 @@ 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
@@ -154,8 +138,7 @@ HLTRMakerAlg.MKTool.Serialiser          17  0     DEBUG xAOD::TrigElectronContai
 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          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,8 +146,7 @@ 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
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/pebTest.py
index 5c2e333931c..45862afb45c 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/src/TestHypoAlg.cxx b/Trigger/TrigValidation/TrigUpgradeTest/src/TestHypoAlg.cxx
index 94b86c7dfa5..a220b439677 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 cac352bfc08..e3f0bf919a5 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 3d7b76d870f..226e7820b9a 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 43495b0c805..7a0af223d1a 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 968b9f7e8c1..db31e748bfd 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 f7156c46c3c..74e9973310d 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/TrigValAlgs/CMakeLists.txt b/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt
index 395e1ccd0c7..db9b326dafe 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 4ccbf728073..a9837a115ca 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]"; 
-- 
GitLab


From b5f3c2c29d667c6aafeb22daf09556be4cd6783f Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 11 Mar 2019 13:48:59 +0100
Subject: [PATCH 390/404] PileUpComps: cmake fix

Remove unneeded dependency on xAODEventInfoCnv.
---
 Control/PileUpComps/CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Control/PileUpComps/CMakeLists.txt b/Control/PileUpComps/CMakeLists.txt
index 0447977975a..18d80ceba95 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 )
 
 
-- 
GitLab


From 7a8e6bdec43ff3e21533591861229557c0d69996 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 11 Mar 2019 13:48:44 +0100
Subject: [PATCH 391/404] EventInfoUtils: cmake fix.

Typo: Eventinfo -> EventInfo.
---
 Event/EventInfoUtils/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/EventInfoUtils/CMakeLists.txt b/Event/EventInfoUtils/CMakeLists.txt
index 4aafaf0e65a..3d2168afe77 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
                           )
                           
-- 
GitLab


From 266b924edddf93fec9fe6822dcd28a6e210e016a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 11 Mar 2019 13:45:53 +0100
Subject: [PATCH 392/404] IdDict: Enable thread-safety static checker.

Enable the thread-safety static checker and fix identified issues.
---
 .../IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY   |  1 +
 .../IdDict/IdDict/IdDictDefs.h                |  8 +-
 DetectorDescription/IdDict/src/IdDictMgr.cxx  | 95 ++++++-------------
 3 files changed, 32 insertions(+), 72 deletions(-)
 create mode 100644 DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY

diff --git a/DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/IdDict/IdDict/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..8d4017a3d23
--- /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 71acce53fb7..dc3c36e3e9b 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 f5daf711759..a6256fce4f8 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); 
-- 
GitLab


From fb1ce224841b0465433501777f52abe5d9e4e0c0 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 11 Mar 2019 13:45:18 +0100
Subject: [PATCH 393/404] LArRecUtils: Remove MT-unsafe uses of CaloIdManager.

Remove MT-unsafe uses of CaloIdManager.
---
 .../share/LArFCalTowerBuilderTool.ref         | 64 +++++++-------
 .../LArRecUtils/src/LArAutoCorrNoiseTool.h    |  1 -
 .../LArRecUtils/src/LArAutoCorrTotalTool.cxx  | 21 ++---
 .../LArRecUtils/src/LArAutoCorrTotalTool.h    |  2 -
 .../src/LArCellFakeProbElectronics.cxx        | 11 +--
 .../src/LArFCalTowerBuilderTool.cxx           | 19 +++--
 .../LArRecUtils/src/LArFCalTowerBuilderTool.h |  5 +-
 .../LArRecUtils/src/LArFCalTowerStore.cxx     | 25 ++----
 .../LArRecUtils/src/LArFCalTowerStore.h       |  8 +-
 .../LArRecUtils/src/LArHVCondAlg.cxx          | 14 ++--
 LArCalorimeter/LArRecUtils/src/LArHVCondAlg.h |  6 +-
 .../LArRecUtils/src/LArHVCorrTool.cxx         | 83 +++++--------------
 .../LArRecUtils/src/LArHVCorrTool.h           |  4 +-
 .../src/LArHVPathologyDbCondAlg.cxx           | 32 ++-----
 .../LArRecUtils/src/LArHVPathologyDbCondAlg.h |  6 +-
 .../LArRecUtils/src/LArHVScaleCorrCondAlg.cxx | 12 +--
 .../LArRecUtils/src/LArHVScaleCorrCondAlg.h   |  6 +-
 LArCalorimeter/LArRecUtils/src/LArOFCTool.cxx | 19 +++--
 LArCalorimeter/LArRecUtils/src/LArOFCTool.h   |  2 -
 .../LArRecUtils/src/MakeLArCellFromRaw.cxx    | 42 +++++-----
 20 files changed, 162 insertions(+), 220 deletions(-)

diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
index f34b7e7551f..75bbc81bbf5 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 479f407611a..2b772f17eb6 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 2c81adb18e3..56088671e7f 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 c633bc200cb..3c099b7f676 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 a57a496306f..af68292c7f0 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 cc6edfaa6f1..04e29ec37bc 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 d4a29876951..8702d99873f 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 35cde60f2d5..1b849095818 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 089b24b54e9..f54ab5ab290 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 56284850ad2..5c45c9d1954 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 b69427da2f8..a05c1138996 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 c09f3e35d53..8893edfe85a 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")
 {
   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 bce0b2ae3ca..608689b6a4a 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 f0429461496..d3eb7dedd5f 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 95c034f44ff..c5bce4d3e10 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 7c4b510f422..825822bd62c 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 0e31884e910..da4f21cfba5 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 dd212ff648a..f880811e763 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 92f5e8f8073..0698de4b3fe 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 ee6788a58d1..c20397cb439 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 ; 
-- 
GitLab


From 8bd9a5a23aba6d0160ade441e7f4418223c2d392 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 11 Mar 2019 13:47:32 +0100
Subject: [PATCH 394/404] DataModelRunTests: More patterns to ignore.

More patterns to ignore when comparing test reference files.
Fix typo in cmake file.
---
 Control/DataModelTest/DataModelRunTests/CMakeLists.txt | 2 +-
 Control/DataModelTest/DataModelRunTests/test/post.sh   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Control/DataModelTest/DataModelRunTests/CMakeLists.txt b/Control/DataModelTest/DataModelRunTests/CMakeLists.txt
index 3a9761d10db..47d1fa11d17 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 7c177930a9f..cc91e52a5e2 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)'
-- 
GitLab


From af7662a353744679fa6aee255696fde7936de528 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 12 Mar 2019 00:42:11 +0100
Subject: [PATCH 395/404] Remove dependency on EventInfo of SCT_ConditionsTools

---
 .../InDetConditions/SCT_ConditionsTools/CMakeLists.txt       | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt b/InnerDetector/InDetConditions/SCT_ConditionsTools/CMakeLists.txt
index 73dc39b601c..6f3c6525d75 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
-- 
GitLab


From 392633d8a21df40d6aca37dacdc62d409612bbbb Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 12 Mar 2019 07:17:28 +0100
Subject: [PATCH 396/404] ref update (again)

---
 .../share/MuonDataDecodeTest_Cache.ref        | 88 +++++++++----------
 1 file changed, 43 insertions(+), 45 deletions(-)

diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
index c461c6a9685..bca879f265a 100644
--- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
+++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref
@@ -36,6 +36,7 @@ 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
@@ -420,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
@@ -499,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
@@ -1126,6 +1124,27 @@ Py:Athena            INFO Print Config
 |-RegisterForContextService               = 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
@@ -1223,27 +1242,6 @@ 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 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::MdtRawDataProvider/MdtRawDataProvider ***************************************
 | |-AuditAlgorithms                         = False
 | |-AuditBeginRun                           = False
@@ -1621,6 +1619,27 @@ Py:Athena            INFO Save Config
 |-RegisterForContextService               = 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
@@ -1718,27 +1737,6 @@ Py:Athena            INFO Save 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 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::MdtRawDataProvider/MdtRawDataProvider ***************************************
 | |-AuditAlgorithms                         = False
 | |-AuditBeginRun                           = False
-- 
GitLab


From fc043c9a090494c9531c1c9bb49c5a0ad8d1a711 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 12 Mar 2019 13:04:18 +0000
Subject: [PATCH 397/404] Further code cleanup of SCT_CalibAlgs package

---
 .../SCT_CalibAlgs/ISCT_CalibEvtInfo.h         |  23 ++--
 .../SCT_CalibAlgs/ISCT_CalibHistoTool.h       |   7 +-
 .../SCT_CalibAlgs/ISCT_CalibModuleListTool.h  |   4 +-
 .../SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h    |  58 +++++-----
 .../SCT_CalibAlgs/SCTCalibWriteTool.h         |  52 ++++-----
 .../SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx |   4 +-
 .../SCT_CalibAlgs/src/SCTCalib.cxx            | 104 +++++++++---------
 .../SCT_CalibAlgs/src/SCTCalibWriteTool.cxx   |  65 ++++-------
 .../src/SCT_CalibBsErrorTool.cxx              |  14 +--
 .../SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h  |   5 +-
 .../SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx  |  82 +++++++-------
 .../SCT_CalibAlgs/src/SCT_CalibEventInfo.h    |  27 ++---
 .../SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx |   4 +-
 .../SCT_CalibAlgs/src/SCT_CalibHitmapTool.h   |   3 -
 .../SCT_CalibAlgs/src/SCT_CalibHvTool.cxx     |   2 -
 .../SCT_CalibAlgs/src/SCT_CalibHvTool.h       |   6 +-
 .../SCT_CalibAlgs/src/SCT_CalibLbTool.cxx     |   7 +-
 .../SCT_CalibAlgs/src/SCT_CalibLbTool.h       |   9 +-
 .../src/SCT_CalibModuleListTool.cxx           |   5 +-
 .../src/SCT_CalibModuleListTool.h             |   3 +-
 20 files changed, 214 insertions(+), 270 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
index 301351eb89c..a3b3cca59e9 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibEvtInfo.h
@@ -33,31 +33,30 @@ class ISCT_CalibEvtInfo: virtual public IAlgTool{
   /// interfaceID re-implemented from IInterface
   static const InterfaceID& interfaceID();
   /// specific methods for this class
-  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 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 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 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 int runNumber() const =0;
+
   virtual void setCounter(const int counterVal)=0;
   virtual void incrementCounter()=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 setBunchCrossing(const int bc)=0;
 };
 
 inline const InterfaceID& ISCT_CalibEvtInfo::interfaceID() {
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
index 7e8ead5eaf6..bd16f81542b 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibHistoTool.h
@@ -52,11 +52,11 @@ class ISCT_CalibHistoTool: virtual public IAlgTool {
   /// set number of lumiblocks
   void setNumberOfLb(const int nLb);
   /// get number of lumiblocks
-  int numberOfLb();
+  int numberOfLb() const;
   /// set number of lumiblocks
   void setLbToMerge(const int nLbMerge);
   /// get number of lumiblocks
-  int LbToMerge();
+  int LbToMerge() const;
  protected:
   std::vector<TH1F*> m_phistoVector;
   std::vector<TH2F*> m_phistoVector2D;
@@ -68,13 +68,12 @@ class ISCT_CalibHistoTool: virtual public IAlgTool {
   //
   bool init();
   template<class T>
-    std::pair<std::string, bool> retrievedTool(T& tool) {
+    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;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
index ba75b263d92..e8c0d1d733d 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/ISCT_CalibModuleListTool.h
@@ -32,11 +32,11 @@ class ISCT_CalibModuleListTool : virtual public IAlgTool {
   virtual ~ISCT_CalibModuleListTool() = default;
   static const InterfaceID& interfaceID();
   //@}
-  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList)=0;
+  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) const =0;
 
  protected:
   template<class T>
-    std::pair<std::string, bool> retrievedTool(T& tool) {
+    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);
   }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
index 6d534817e03..961ecac85a5 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalib.h
@@ -111,8 +111,8 @@ class SCTCalib : public AthAlgorithm {
 
   // 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::vector<std::vector<std::pair<int, int>>> m_summarytrips;
+  std::vector<std::vector<std::pair<int, int>>> m_summarytripslb;
 
   std::ofstream m_gofile;
 
@@ -230,7 +230,7 @@ class SCTCalib : public AthAlgorithm {
   StringProperty m_LorentzAngleSummaryFile{this, "LorentzAngleSummaryFile", "LorentzAngleSummaryFile.xml", "Output XML for summary of lorentz angle"};
 
   // Event related
-  int             m_numOfLBsProcessed;
+  int m_numOfLBsProcessed;
   unsigned long long m_numberOfEvents;
   unsigned long long m_numberOfEventsHist; // For number of events from HIST
   std::string        m_utcBegin;
@@ -266,60 +266,60 @@ class SCTCalib : public AthAlgorithm {
   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;
+  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;
+  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() ) {
+    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;
+    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;
+    xmlChannelEfficiencyDataString(const Identifier& waferId, const float efficiency, const SCT_SerialNumber& serial) const;
 
   std::pair<int, bool>
-    getNumNoisyStrips( const Identifier& waferId ) const;
+    getNumNoisyStrips(const Identifier& waferId) const;
 
   StatusCode
-    addStripsToList( Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew );
+    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 );
+    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;
+    getStripList(const std::set<Identifier>& stripIdList) const;
 
   StatusCode
-    noisyStripsToXml( const std::map< Identifier, std::set<Identifier> >& moduleList, const std::string& badStripsFile ) const;
+    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;
+    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;
+    getNoisyChips(const std::set<Identifier>& stripIdList) const;
 
-  std::pair< std::string, float >
-    getNoisyLB( const Identifier& moduleId, int& chipId ) const;
+  std::pair<std::string, float>
+    getNoisyLB(const Identifier& moduleId, int& chipId) const;
 
   std::string
-    getLBList( const std::set<int>& LBList ) const;
+    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 aba4ca429da..49061504086 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/SCT_CalibAlgs/SCTCalibWriteTool.h
@@ -64,14 +64,6 @@ public:
   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;
 
@@ -82,36 +74,36 @@ public:
   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;
+  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 createListChip( const Identifier& wafer_id,
+  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;
+                             const std::string& defectList) const;
 
-  StatusCode createListEff( const Identifier& wafer_id,
+  StatusCode createListChip(const Identifier& wafer_id,
                             const SCT_ID* m_sctId,
                             const int samplesize,
-                            const float eff ) const;
+                            const std::string& defectType,
+                            const float threshold,
+                            const std::string& defectList) const;
 
-  StatusCode createListNO( const Identifier& wafer_id,
+  StatusCode createListEff(const Identifier& wafer_id,
                            const SCT_ID* m_sctId,
                            const int samplesize,
-                           const float noise_occ ) const;
+                           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 raw_occu ) 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,
@@ -133,7 +125,7 @@ public:
                           const float fitParam_sigma,
                           const float err_sigma,
                           const float MCW,
-                          const float err_MCW ) const;
+                          const float err_MCW) const;
 
   StatusCode wrapUpNoisyChannel();
   StatusCode wrapUpDeadStrips();
@@ -147,15 +139,14 @@ public:
 private:
   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 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);
+  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;
@@ -208,7 +199,6 @@ private:
   IIOVRegistrationSvc*         m_regSvc;
   IAthenaOutputStreamTool*     m_streamer;
 
-  std::set<Identifier>         m_badIds;
   bool                         m_defectRecorded;
   bool                         m_deadStripRecorded;
   bool                         m_deadChipRecorded;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
index 69f51c1c9f8..9670b6aabe9 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/ISCT_CalibHistoTool.cxx
@@ -79,7 +79,7 @@ ISCT_CalibHistoTool::setNumberOfLb(const int nLb) {
 }
 
 int
-ISCT_CalibHistoTool::numberOfLb() {
+ISCT_CalibHistoTool::numberOfLb() const {
   return m_nLb;
 }
 
@@ -89,6 +89,6 @@ ISCT_CalibHistoTool::setLbToMerge(const int nLbMerge) {
 }
 
 int
-ISCT_CalibHistoTool::LbToMerge() {
+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 87bdd23a734..c8b5ddfbe8e 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -20,13 +20,8 @@
 
 #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"
 
@@ -59,11 +54,11 @@ 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"};
+  const std::string detectorNames[] = {"negativeEndcap", "Barrel", "positiveEndcap"};
   // String names for the detector parts
-  const std::string shortNames[]{"EndCapC", "Barrel", "EndCapA"};
+  const std::string shortNames[] = {"EndCapC", "Barrel", "EndCapA"};
   // Path names to become part of the histogram paths
-  const std::string detectorPaths[]{"SCTEC", "SCTB", "SCTEA"};
+  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);
@@ -658,7 +653,7 @@ StatusCode SCTCalib::getDeadStrip() {
   //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_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++) {
@@ -1165,16 +1160,16 @@ 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}
+  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};
@@ -1382,16 +1377,16 @@ 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}
+  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};
@@ -1533,16 +1528,16 @@ 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}
+  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};
@@ -1713,16 +1708,16 @@ 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}
+  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};
@@ -2077,8 +2072,8 @@ StatusCode SCTCalib::getLorentzAngle() {
   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};
+  string module[2] = {"100", "111"};
+  int moduleint[2] = {100, 111};
 
   int FitFlag[n_barrels][2][2] = {{{0}, {0}}, {{0}, {0}}};  // fit status flag
 
@@ -2283,7 +2278,6 @@ StatusCode SCTCalib::getLorentzAngle() {
 
         //--- 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;
@@ -2624,7 +2618,7 @@ SCTCalib::getNumNoisyStrips(const Identifier& waferId) const {
 }
 
 StatusCode
-SCTCalib::addStripsToList(Identifier& waferId, std::set<Identifier>& stripIdList, bool isNoisy, bool isNew) {
+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) {
@@ -2654,7 +2648,7 @@ SCTCalib::addStripsToList(Identifier& waferId, std::set<Identifier>& stripIdList
 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) {
+                                const std::map<Identifier, std::set<Identifier>>& moduleListRef) const {
   //--- Write out strips
   float noisyStripThr{m_noisyStripThrDef?(m_noisyStripThrOffline):(m_noisyStripThrOnline)};
   int nDefects{0};
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
index 666bdb99b69..9bc1e38ff96 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalibWriteTool.cxx
@@ -59,30 +59,17 @@ SCTCalibWriteTool::SCTCalibWriteTool(const std::string& type, const std::string&
   AthAlgTool(type, name, parent),
   m_eventInfoKey{"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_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_beginRun{IOVTime::MINRUN},
-  m_endRun{IOVTime::MAXRUN},
-  m_streamName{"CondStreamTest"},
-
-  m_regSvc{0},
-  m_streamer{0},
-  m_badIds{},
-
+  m_regSvc{nullptr},
+  m_streamer{nullptr},
   m_defectRecorded{false},
   m_deadStripRecorded{false},
   m_deadChipRecorded{false},
@@ -91,18 +78,18 @@ SCTCalibWriteTool::SCTCalibWriteTool(const std::string& type, const std::string&
   m_RawOccuRecorded{false},
   m_BSErrRecorded{false},
   m_LARecorded{false},
-  m_pHelper{0}
+  m_pHelper{nullptr}
   {
-    declareProperty("WriteCondObjs",        m_writeCondObjs);
-    declareProperty("RegisterIOV",          m_regIOV);
-    declareProperty("ReadWriteCool",        m_readWriteCool);
-    declareProperty("TwoStepWriteReg",      m_twoStepWriteReg);
-    declareProperty("ManualIOV",            m_manualiov);
-
-    declareProperty("BeginRun",             m_beginRun);
-    declareProperty("EndRun",               m_endRun);
+    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);
+    declareProperty("StreamName",           m_streamName="CondStreamTest");
     declareProperty("TagID4NoisyStrips",    m_tagID4NoisyStrips);
     declareProperty("TagID4DeadStrips",     m_tagID4DeadStrips);
     declareProperty("TagID4DeadChips",      m_tagID4DeadChips);
@@ -185,12 +172,6 @@ SCTCalibWriteTool::computeIstrip4moncond(const Identifier& elementId) const {
   return 768*iiside + iistrip;
 }
 
-StatusCode
-SCTCalibWriteTool::fillData() {
-  // this is a dummy function
-  return StatusCode::SUCCESS;
-}
-
 //////////////////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////////////////////
@@ -586,7 +567,7 @@ SCTCalibWriteTool::wrapUpNoiseOccupancy() {
 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;
+  if (registerCondObjectsWithErrMsg(s_RawOccuFolderName, m_tagID4RawOccupancy).isFailure()) return StatusCode::FAILURE;
   return StatusCode::SUCCESS;
 }
 
@@ -649,7 +630,7 @@ SCTCalibWriteTool::streamOutCondObjectsWithErrMsg(const std::string& foldername)
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::registerCondObjects(const std::string& foldername,const std::string& tagname) {
+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
@@ -696,7 +677,7 @@ SCTCalibWriteTool::registerCondObjects(const std::string& foldername,const std::
 ///////////////////////////////////////////////////////////////////////////////////////
 
 StatusCode
-SCTCalibWriteTool::registerCondObjectsWithErrMsg(const std::string& foldername,const std::string& tagname) {
+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);
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
index 6c44f98d6bd..f8bf2271855 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.cxx
@@ -37,9 +37,7 @@ 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_pSCTHelper{nullptr},
   m_scterr_bec{0},
   m_scterr_layer{0},
   m_scterr_eta{0},
@@ -53,7 +51,7 @@ SCT_CalibBsErrorTool::SCT_CalibBsErrorTool(const std::string& type, const std::s
 StatusCode
 SCT_CalibBsErrorTool::initialize() {
   ATH_CHECK(service("THistSvc", m_thistSvc));
-  ATH_CHECK(m_detStore->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
   ATH_CHECK(m_bytestreamErrorsTool.retrieve());
 
   m_maxHash = m_pSCTHelper->wafer_hash_max();
@@ -85,13 +83,15 @@ SCT_CalibBsErrorTool::book() {
   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 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 );
+    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;
 }
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
index 6f0d0fadab7..183b25c52f0 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibBsErrorTool.h
@@ -13,7 +13,6 @@
 
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "InDetIdentifier/SCT_ID.h"
 
@@ -43,14 +42,12 @@ class SCT_CalibBsErrorTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
   //@name ISCT_CalibHistoSvc methods, reimplemented
   //@{
   virtual bool book();
-  virtual bool read(const std::string & fileName);
+  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;
 
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
index cd4ff4d4833..6a7bf37050e 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.cxx
@@ -54,10 +54,6 @@ SCT_CalibEventInfo::finalize() {
   return StatusCode::SUCCESS;
 }
 
-int SCT_CalibEventInfo::lumiBlock() const {
-  return m_lumiBlock;
-}
-
 void
 SCT_CalibEventInfo::setTimeStamp(const int begin, const int end) {
   m_timeStampBegin = begin;
@@ -67,15 +63,11 @@ SCT_CalibEventInfo::setTimeStamp(const int begin, const int end) {
   m_tsEndString = toUtc(end);
 }
 
-int SCT_CalibEventInfo::duration() const {
-  return m_duration;
-}
-
 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);
+  setTimeStamp(ibegin, iend);
 }
 
 void
@@ -84,21 +76,24 @@ SCT_CalibEventInfo::setTimeStamp(const int 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
@@ -107,30 +102,35 @@ SCT_CalibEventInfo::setSource(const std::string 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;
+}
+
+void
+SCT_CalibEventInfo::setRunNumber(const int rn) {
+  m_runNumber = rn;
 }
 
 int
@@ -138,9 +138,9 @@ SCT_CalibEventInfo::runNumber() const {
   return m_runNumber;
 }
 
-int
-SCT_CalibEventInfo::counter() const {
-  return m_counter;
+void
+SCT_CalibEventInfo::setCounter(const int counterVal) {
+  m_counter = counterVal;
 }
 
 void
@@ -148,14 +148,14 @@ SCT_CalibEventInfo::incrementCounter() {
   ++m_counter;
 }
 
-void
-SCT_CalibEventInfo::setCounter(const int counterVal) {
-  m_counter = counterVal;
+int
+SCT_CalibEventInfo::counter() const {
+  return m_counter;
 }
 
-int
-SCT_CalibEventInfo::numLumiBlocks() const {
-  return m_numLB;
+void
+SCT_CalibEventInfo::setBunchCrossing(const int bc) {
+  m_bunchCrossing = bc;
 }
 
 std::string
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
index d0318ed3be6..c245513fa07 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
@@ -37,28 +37,29 @@ class SCT_CalibEventInfo: public extends<AthAlgTool, ISCT_CalibEvtInfo>
   //@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 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 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 getLumiBlock(int& begin, int& end) const;
+  virtual int lumiBlock() const;
+  virtual int numLumiBlocks() const;
 
   virtual void setRunNumber(const int rn);
-  virtual void setBunchCrossing(const int bc);
+  virtual int runNumber() const;
+
   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;
+
+  virtual void setBunchCrossing(const int bc);
   //@}
 
  private:
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
index 8e36090a7ac..d3ee38ea9e5 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.cxx
@@ -36,8 +36,6 @@ 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{nullptr},
   m_sct_waferHash{0},
   m_sct_firstStrip{0},
@@ -48,7 +46,7 @@ SCT_CalibHitmapTool::SCT_CalibHitmapTool(const std::string& type, const std::str
 
 StatusCode
 SCT_CalibHitmapTool::initialize() {
-  ATH_CHECK(m_detStore->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
   //
   m_waferItrBegin = m_pSCTHelper->wafer_begin();
   m_waferItrEnd = m_pSCTHelper->wafer_end();
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
index 0fa66d6ff69..46117f6d4c8 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHitmapTool.h
@@ -53,9 +53,6 @@ class SCT_CalibHitmapTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
   //@}
 
  private:
-  ServiceHandle<StoreGateSvc> m_detStore;
-  ServiceHandle<StoreGateSvc> m_evtStore;
-
   const SCT_ID* m_pSCTHelper;
   SCT_ID::const_id_iterator m_waferItrBegin;
   SCT_ID::const_id_iterator m_waferItrEnd;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
index 3828d7cacb4..1239b093f58 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.cxx
@@ -30,8 +30,6 @@ namespace {
 
 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{nullptr},
   m_sct_waferHash{0},
   m_sct_numHitsInWafer{0},
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
index 15a4341ebbb..60cd5ff9b15 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibHvTool.h
@@ -13,7 +13,6 @@
 
 //Athena includes
 #include "AthenaBaseComps/AthAlgTool.h"
-#include "StoreGate/StoreGateSvc.h"
 
 //Inner detector includes
 #include "InDetIdentifier/SCT_ID.h"
@@ -24,7 +23,6 @@
 
 // Gaudi includes
 #include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
 
 //STL includes
 #include <string>
@@ -63,8 +61,6 @@ class SCT_CalibHvTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
         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;
@@ -97,7 +93,7 @@ class SCT_CalibHvTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
   int m_lowHitCut;
   ///retrieve a tool and report if it failed
   template<class T>
-    bool retrievedTool(T & tool, const std::string & toolName) {
+    bool retrievedTool(T& tool, const std::string& toolName) const {
     if (tool.retrieve().isFailure()) {
       ATH_MSG_ERROR("Unable to retrieve " << toolName);
       return false;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
index 32cd4b7d0db..17a1b867018 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.cxx
@@ -46,9 +46,6 @@ 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_detStore{"DetectorStore", name},
-  m_evtStore{"StoreGateSvc", name},
-  m_evtInfo{"SCT_CalibEventInfo", name},
   m_pSCTHelper{nullptr},
   m_pManager{nullptr},
   m_sct_waferHash{0},
@@ -66,8 +63,8 @@ StatusCode
 SCT_CalibLbTool::initialize() {
   ATH_MSG_INFO("Initialize of " << PACKAGE_VERSION);
   ATH_CHECK(service("THistSvc", m_thistSvc));
-  ATH_CHECK(m_detStore->retrieve(m_pSCTHelper, "SCT_ID"));
-  ATH_CHECK(m_detStore->retrieve(m_pManager, "SCT"));
+  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);
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
index 8ca36c824da..0ec1456490a 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
@@ -13,9 +13,7 @@
 
 //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,6 +23,9 @@
 //local includes
 #include "SCT_CalibAlgs/ISCT_CalibHistoTool.h"
 
+//Gaudi includes
+#include "GaudiKernel/ToolHandle.h"
+
 //STL includes
 #include <atomic>
 #include <string>
@@ -58,9 +59,7 @@ class SCT_CalibLbTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
   //@}
 
  private:
-  ServiceHandle<StoreGateSvc> m_detStore;
-  ServiceHandle<StoreGateSvc> m_evtStore;
-  ServiceHandle<ISCT_CalibEvtInfo> m_evtInfo;
+  ToolHandle<ISCT_CalibEvtInfo> m_evtInfo{this, "SCT_CalibEvtInfo", "SCT_CalibEvtInfo"};
 
   const SCT_ID* m_pSCTHelper;
   const InDetDD::SCT_DetectorManager* m_pManager;
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
index 0cbbed15031..bb5c39831d1 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.cxx
@@ -7,7 +7,6 @@
 SCT_CalibModuleListTool::SCT_CalibModuleListTool(const std::string& type, const std::string& name, const IInterface* parent):
   base_class(type, name, parent),
   m_pSCTHelper{nullptr},
-  m_detStore{"DetectorStore", name},
   m_IOVDbSvc{"IOVDbSvc", name}
 {
 }
@@ -15,7 +14,7 @@ SCT_CalibModuleListTool::SCT_CalibModuleListTool(const std::string& type, const
 StatusCode SCT_CalibModuleListTool::initialize() {
   ATH_MSG_DEBUG("Initializing SCT_CalibModuleListTool");
 
-  ATH_CHECK(m_detStore->retrieve(m_pSCTHelper, "SCT_ID"));
+  ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID"));
   ATH_CHECK(m_MonitorConditionsTool.retrieve());
   ATH_CHECK(m_IOVDbSvc.retrieve());
 
@@ -26,7 +25,7 @@ StatusCode SCT_CalibModuleListTool::finalize() {
   return StatusCode::SUCCESS;
 }
 
-StatusCode SCT_CalibModuleListTool::readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) {
+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()};
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
index 2de3a743f57..e0ade40160f 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibModuleListTool.h
@@ -43,11 +43,10 @@ class SCT_CalibModuleListTool : public extends<AthAlgTool, ISCT_CalibModuleListT
   virtual StatusCode initialize();
   virtual StatusCode finalize();
   //@}
-  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList);
+  virtual StatusCode readModuleList(std::map<Identifier, std::set<Identifier>>& moduleList) const;
 
  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;
 
-- 
GitLab


From 4943d62aa836ead44768bd7cd0ebbb93d02c6b90 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 9 Mar 2019 12:46:26 +0100
Subject: [PATCH 398/404] Modernise CscOverlay overlayContainer method

---
 .../CscOverlay/CscOverlay/CscOverlay.h        |  24 +-
 .../MuonOverlay/CscOverlay/src/CscOverlay.cxx | 359 +++++++++---------
 2 files changed, 197 insertions(+), 186 deletions(-)

diff --git a/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h b/MuonSpectrometer/MuonOverlay/CscOverlay/CscOverlay/CscOverlay.h
index 042c28904d7..66d18512650 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 7006962cdab..97dde499aad 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 ");
 }
-- 
GitLab


From 5f27a21824cacb3d629671ddbb0682342a04764a Mon Sep 17 00:00:00 2001
From: TJ Khoo <khoo@cern.ch>
Date: Tue, 12 Mar 2019 17:11:59 +0100
Subject: [PATCH 399/404] Re-remove HLTJetMon addition to TToolSvc

---
 .../TrigJetMonitoring/python/TrigJetMonitoringConfig.py        | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
index bcfd5c07a51..ee24083121c 100644
--- a/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
+++ b/Trigger/TrigMonitoring/TrigJetMonitoring/python/TrigJetMonitoringConfig.py
@@ -823,9 +823,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 )
-- 
GitLab


From b44ba1d2f3c46583f371b6f65c038468d49ca50b Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Tue, 12 Mar 2019 17:28:43 +0000
Subject: [PATCH 400/404] Protect the ConstIter against invalid temporary data

---
 .../TrigConfData/CMakeLists.txt               |   7 +-
 .../TrigConfData/ATLAS_CHECK_THREAD_SAFETY    |   1 +
 .../TrigConfData/TrigConfData/ConstIter.h     |  14 +-
 .../TrigConfData/test/itertest.cxx            | 128 ++++++++++++++++++
 4 files changed, 146 insertions(+), 4 deletions(-)
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/test/itertest.cxx

diff --git a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
index 083e0420bd2..c3c71b0df56 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 00000000000..b6f30c083c0
--- /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 a0938698d93..9d5cbbee6f3 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 00000000000..42124d91293
--- /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;
+}
-- 
GitLab


From 05ad293bad89ff315579f1904adbb0c46f00b89f Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Tue, 12 Mar 2019 17:30:10 +0000
Subject: [PATCH 401/404] Use CachedUniquePtr in ID PRDs.

---
 .../InDetCompetingRIOsOnTrack/CMakeLists.txt  |  3 +-
 .../CompetingPixelClustersOnTrack.h           |  4 +-
 .../CompetingSCT_ClustersOnTrack.h            | 14 ++---
 .../CompetingTRT_DriftCirclesOnTrack.h        |  3 +-
 .../src/CompetingPixelClustersOnTrack.cxx     | 37 +++++++-------
 .../src/CompetingSCT_ClustersOnTrack.cxx      | 24 +++++----
 .../src/CompetingTRT_DriftCirclesOnTrack.cxx  | 37 +++++++-------
 .../InDetPrepRawData/CMakeLists.txt           |  5 +-
 .../InDetPrepRawData/SiCluster.h              | 15 ++----
 .../InDetPrepRawData/src/SiCluster.cxx        | 41 +++++++--------
 .../InDetRIO_OnTrack/CMakeLists.txt           |  5 +-
 .../InDetRIO_OnTrack/SiClusterOnTrack.h       |  5 +-
 .../InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h |  6 ++-
 .../src/SCT_ClusterOnTrack.cxx                |  4 +-
 .../InDetRIO_OnTrack/src/SiClusterOnTrack.cxx | 42 +++++++--------
 .../src/TRT_DriftCircleOnTrack.cxx            | 51 ++++++++++---------
 .../src/CompetingPixelClustersOnTrackTool.cxx | 10 ++--
 .../src/CompetingSCT_ClustersOnTrackTool.cxx  | 10 ++--
 .../CompetingTRT_DriftCirclesOnTrackTool.cxx  |  5 +-
 19 files changed, 162 insertions(+), 159 deletions(-)

diff --git a/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt b/InnerDetector/InDetRecEvent/InDetCompetingRIOsOnTrack/CMakeLists.txt
index 7a98df7a123..a62acee4850 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 1d3aa42df21..b4051ac6e2f 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 4d535d49296..5f4b07ee0a6 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 22fe614c83a..177d5c07648 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 b3b8234e1d2..047359f83a5 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 ac3bdd91975..5460461be31 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 d56f06d795e..36cb7590723 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 15f4c0a5e7a..2149394712e 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 fc668b7f792..a479fe3f0e1 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 004125d0d9b..67382e4eae4 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 f14486e6c05..c356fc192d6 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 709cb650c9a..da6123160f8 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 98c8522e6d5..23a14802159 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 d1bcf1e158b..dfda5beff5c 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 acde8bb4711..357c703d42a 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 f1875eb771e..f4ecaafff05 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 8e8da7b4e95..39b1e0c85a8 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 4c03a8418bc..4490984037a 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 8be554aff34..19e04cf777b 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();
-- 
GitLab


From 45e2e98847ee008772aa31f782ee85c0e3aeba01 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Mon, 11 Mar 2019 15:28:20 +0000
Subject: [PATCH 402/404] Some improvements to the atomics logic in
 SCT_CalibAlgs

---
 .../SCT_CalibAlgs/src/SCT_CalibEventInfo.h               | 9 ++++-----
 .../InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h   | 3 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
index c245513fa07..15c6e755dd9 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibEventInfo.h
@@ -17,7 +17,6 @@
 
 #include "GaudiKernel/ToolHandle.h"
 
-#include <atomic>
 #include <string>
 
 class StatusCode;
@@ -75,10 +74,10 @@ class SCT_CalibEventInfo: public extends<AthAlgTool, ISCT_CalibEvtInfo>
   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_runNumber;
+  int  m_lumiBlock;
+  int  m_timeStamp;
+  int  m_bunchCrossing;
   int  m_counter;
   std::string toUtc(const int timestamp) const;
 };
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
index 0ec1456490a..12f5ccf4a03 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCT_CalibLbTool.h
@@ -27,7 +27,6 @@
 #include "GaudiKernel/ToolHandle.h"
 
 //STL includes
-#include <atomic>
 #include <string>
 
 //fwd declarations
@@ -70,7 +69,7 @@ class SCT_CalibLbTool : public extends<AthAlgTool, ISCT_CalibHistoTool>
   VecInt* m_sct_firstStrip;
   VecInt* m_sct_rdoGroupSize;
 
-  mutable std::atomic_int m_lumiBlock;
+  int m_lumiBlock;
 
   //private use in this class
   int m_LbRange;
-- 
GitLab


From 934c3d380f433bd42bdb3f9f7a816c289b28096a Mon Sep 17 00:00:00 2001
From: Werner Wiedenmann <werner.wiedenmann@cern.ch>
Date: Wed, 13 Mar 2019 12:34:04 +0000
Subject: [PATCH 403/404] Implement a ROBDataProvider extended and interfaced
 with DCM (ATR-19249)

---
 .../IROBDataProviderSvc.h                     |   18 +-
 .../ByteStreamCnvSvcBase/ROBDataProviderSvc.h |   15 +-
 .../src/ROBDataProviderSvc.cxx                |    9 +-
 .../TrigControl/TrigServices/CMakeLists.txt   |    1 +
 .../TrigServices/python/TrigServicesConfig.py |   31 +
 .../python/TriggerUnixStandardSetup.py        |   33 +-
 .../src/HltROBDataProviderSvc.cxx             | 1620 +++++------------
 .../TrigServices/src/HltROBDataProviderSvc.h  |  385 ++--
 .../MonROBDataProviderSvc.h                   |    4 +-
 .../src/MonROBDataProviderSvc.cxx             |    6 +-
 .../ITrigROBDataProviderSvc.h                 |    5 +-
 .../src/TrigROBDataProviderSvc.cxx            |   12 +-
 .../src/TrigROBDataProviderSvc.h              |   10 +-
 .../src/TrigROBDataProviderSvc_RTT.cxx        |    6 +-
 .../src/TrigROBDataProviderSvc_RTT.h          |   10 +-
 15 files changed, 753 insertions(+), 1412 deletions(-)

diff --git a/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h b/Event/ByteStreamCnvSvcBase/ByteStreamCnvSvcBase/IROBDataProviderSvc.h
index f78e47850d2..da4f888ce9a 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 bedb316f828..fe62e9b6920 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 879cd668dec..ab5c970fcdd 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/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt b/HLT/Trigger/TrigControl/TrigServices/CMakeLists.txt
index 90df1bb8274..e778a7736a9 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 25a6d9bc20a..4f7f02252d2 100644
--- a/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
+++ b/HLT/Trigger/TrigControl/TrigServices/python/TrigServicesConfig.py
@@ -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 edee483270a..8523783a3fa 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/HltROBDataProviderSvc.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltROBDataProviderSvc.cxx
index a1451a407eb..a796a8f58d3 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 a9e37fbdcfb..56f09782d28 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/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/TrigDataAccessMonitoring/MonROBDataProviderSvc.h
index 1a0794746da..355f9299c8d 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 a4edba585d3..898bec780b5 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 4d4cd640ef4..a961547179e 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 5ccb3971b32..222554bcfb8 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 675b042d79c..8eccb1f8040 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 07523ce449b..5762978e5f9 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 d197e49b15e..912731206e7 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; };
-- 
GitLab


From 7660ec672c308db52b895ae7811dc3b17e6978b1 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Wed, 13 Mar 2019 13:38:45 +0000
Subject: [PATCH 404/404] Cleanups of SCT_Monitoring package (ATLASDQ-679)

---
 .../SCT_Monitoring/SCTErrMonTool.h            |   0
 .../SCT_Monitoring/SCTHitEffMonTool.h         |   0
 .../SCT_Monitoring/SCTLorentzMonTool.h        |   0
 .../SCT_Monitoring/SCTMotherTrigMonTool.h     |   0
 .../SCT_Monitoring/SCTRatioNoiseMonTool.h     |   0
 .../SCT_Monitoring/SCTSummaryMonTool.h        |   0
 .../SCT_Monitoring/SCTTracksMonTool.h         |   0
 .../SCT_Monitoring/SCT_ClusterStruct.h        |   0
 .../SCT_Monitoring/src/SCTErrMonTool.cxx      |   0
 .../SCT_Monitoring/src/SCTHitEffMonTool.cxx   |  72 ++-
 .../src/SCTHitsNoiseMonTool.cxx               | 418 ++++++++----------
 .../SCT_Monitoring/src/SCTLorentzMonTool.cxx  |  79 +---
 .../src/SCTMotherTrigMonTool.cxx              |   2 +-
 .../src/SCTRatioNoiseMonTool.cxx              |  25 +-
 .../SCT_Monitoring/src/SCTSummaryMonTool.cxx  |   0
 .../SCT_Monitoring/src/SCTTracksMonTool.cxx   | 113 ++---
 .../SCT_Monitoring/src/SCT_NameFormatter.h    |   4 +-
 .../SCT_Monitoring/src/deletePointers.h       |  37 --
 18 files changed, 277 insertions(+), 473 deletions(-)
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
 mode change 100755 => 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx
 delete mode 100644 InnerDetector/InDetMonitoring/SCT_Monitoring/src/deletePointers.h

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 dad87c13808..c509749d608
--- 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 2234eb8c6c3..e18850fb3b3
--- 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 a578cbcbb60..cf4ccd06728
--- 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 78240d503e5..b935037b782
--- 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 7cc6669cdaa..778dc20c4bc
--- 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 9d281448370..69914f5e1c3 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 8cab566b35e..498959900e5 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 eba2e1356f3..00000000000
--- 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
-- 
GitLab