From ca3099f76b58f8397913d6a57e3025c9a9c89141 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Fri, 14 Aug 2020 19:40:20 +0200
Subject: [PATCH] Update MC+MC Overlay tests for new-style transform

---
 .../test/test_MCOverlay_ConfigTest_ttbar.sh   | 18 ++++++++++++---
 .../test_MCOverlay_ConfigTest_ttbar_BCM.sh    | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_L1Calo.sh | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_LAr.sh    | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_Muon.sh   | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_Pixel.sh  | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_SCT.sh    | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_TRT.sh    | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_Tile.sh   | 23 +++++++++++++++----
 .../test_MCOverlay_ConfigTest_ttbar_Truth.sh  | 23 +++++++++++++++----
 ...t_MCOverlay_ConfigTest_ttbar_sequential.sh | 14 ++++++++---
 ...t_MCOverlay_MT_ttbar_8threads_NewConfig.sh | 15 ++++++++++--
 12 files changed, 201 insertions(+), 53 deletions(-)

diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
index c1d908125d5..b1480bdc49e 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -40,14 +40,26 @@ Overlay_tf.py \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
index 53e048a0258..8fa0c0abbb7 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors BCM \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.BCMOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors BCM \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.BCMOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py BCM -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors BCM \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
index 4523f071ca8..6772d7efc6a 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_L1Calo.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors L1Calo \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:EventOverlayJobTransforms/preInclude.L1CaloOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors L1Calo \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:EventOverlayJobTransforms/preInclude.L1CaloOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py L1Calo -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors L1Calo \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
index 78047794dd9..b238fddc3d5 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors LAr \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.LArOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors LAr \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.LArOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py LAr -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors LAr \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
index 7690e142d31..5f5ee538b52 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors Muon \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.MuonOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors Muon \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.MuonOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py Muon -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors Muon \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
index 1a02f0bb8e5..50fa523c851 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors Pixel \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.PixelOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors Pixel \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.PixelOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py Pixel -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors Pixel \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
index 2bd7e73d2fe..0f9faa41e41 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors SCT \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.SCTOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors SCT \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.SCTOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py SCT -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors SCT \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
index 1d06f36adcd..22aeb9c1727 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors TRT \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TRTOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors TRT \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TRTOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py TRT -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors TRT \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
index e65aa301c9c..67a83e5458d 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors Tile \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TileOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors Tile \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TileOnlyConfig.py,SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py Tile -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors Tile \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
index 220f7eccf24..ca0198b67ee 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # art-description: MC+MC Overlay with MT support, config test
 # art-type: grid
@@ -18,6 +18,7 @@ set -o pipefail
 events=2
 
 Overlay_tf.py \
+--detectors Truth \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -25,11 +26,11 @@ Overlay_tf.py \
 --conditionsTag OFLCOND-MC16-SDR-20 \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False \
 --athenaopts '"--config-only=ConfigLegacy.pkl"'
 
 Overlay_tf.py \
+--detectors Truth \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
 --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
@@ -38,18 +39,30 @@ Overlay_tf.py \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preExec '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);' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
---preInclude 'Overlay:SimulationJobOptions/preInclude.TruthOnlyConfig.py' \
 --imf False
 
 rc=$?
-echo "art-result: $rc configLegacy"
 mv log.Overlay log.OverlayLegacy
+echo "art-result: $rc configLegacy"
 
 rc2=-9999
 if [ $rc -eq 0 ]
 then
-    OverlayTest.py Truth -t 1 -n $events 2>&1 | tee log.OverlayTest
+    Overlay_tf.py \
+    --CA \
+    --detectors Truth \
+    --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+    --inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+    --outputRDOFile mcOverlayRDO.pool.root \
+    --maxEvents $events \
+    --conditionsTag OFLCOND-MC16-SDR-20 \
+    --geometryVersion ATLAS-R2-2016-01-00-01 \
+    --postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+    --postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+    --imf False \
+    --athenaopts="--threads=1"
     rc2=$?
+    mv log.Overlay log.OverlayTest
 fi
 echo  "art-result: $rc2 configNew"
 
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
index 771c1e3c28e..0a4ea5eb980 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
@@ -12,9 +12,17 @@
 # art-output: *.pkl
 # art-output: *Config.txt
 
-set -o pipefail
-
-OverlayTest.py -n 10 -t 0 2>&1 | tee log.OverlayTest
+Overlay_tf.py \
+--CA \
+--inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+--inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+--outputRDOFile mcOverlayRDO.pool.root \
+--maxEvents 10 \
+--conditionsTag OFLCOND-MC16-SDR-20 \
+--geometryVersion ATLAS-R2-2016-01-00-01 \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+--imf False
 
 rc=$?
 echo "art-result: $rc overlay"
diff --git a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
index bdfc98b342b..4f690fbb616 100755
--- a/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
+++ b/Simulation/Tests/OverlayTestsMT/test/test_MCOverlay_MT_ttbar_8threads_NewConfig.sh
@@ -13,9 +13,20 @@
 # art-output: *.pkl
 # art-output: *Config.txt
 
-set -o pipefail
+export ATHENA_CORE_NUMBER=8
 
-OverlayTest.py -n 100 -t 8 2>&1 | tee log.OverlayTest
+Overlay_tf.py \
+--CA \
+--multithreaded \
+--inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
+--inputRDO_BKGFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayMonitoringRTT/PileupPremixing/22.0/v4/RDO.merged-pileup-MT.100events.pool.root \
+--outputRDOFile MC_plus_MC.RDO.pool.root \
+--maxEvents 50 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
+--conditionsTag OFLCOND-MC16-SDR-20 \
+--geometryVersion ATLAS-R2-2016-01-00-01 \
+--postInclude 'OverlayConfiguration.OverlayTestHelpers.JobOptsDumperCfg' \
+--postExec 'with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)' \
+--imf False
 
 rc=$?
 echo "art-result: $rc overlay"
-- 
GitLab