From 50a85cd5ea1d37de1616399bdef71e2357db9ff1 Mon Sep 17 00:00:00 2001
From: Chris Jones <jonesc@hep.phy.cam.ac.uk>
Date: Mon, 13 Jan 2025 10:30:58 +0000
Subject: [PATCH] Make RICH test ROOT filenames test specific

---
 .../tests/options/rich-decode.py                | 17 ++++++++++++++++-
 .../tests/options/rich-dst-reco.py              | 10 ++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/Rich/RichFutureRecSys/tests/options/rich-decode.py b/Rich/RichFutureRecSys/tests/options/rich-decode.py
index 82f0c33d349..d0b27610cd0 100644
--- a/Rich/RichFutureRecSys/tests/options/rich-decode.py
+++ b/Rich/RichFutureRecSys/tests/options/rich-decode.py
@@ -12,6 +12,8 @@
 # --------------------------------------------------------------------------------------
 
 from Gaudi.Configuration import *
+from Configurables import Gaudi__Monitoring__MessageSvcSink as MessageSvcSink
+from Configurables import Gaudi__Histograming__Sink__Root as RootHistoSink
 from Configurables import GaudiSequencer
 from Configurables import Gaudi__Hive__FetchDataFromFile as FetchDataFromFile
 from Configurables import LHCb__UnpackRawEvent as UnpackRawEvent
@@ -20,6 +22,14 @@ from Configurables import Rich__Future__RawBankDecoder as RichDecoder
 from Configurables import Rich__Future__SmartIDClustering as RichClustering
 from Configurables import Rich__Future__Rec__SIMDSummaryPixels as RichSIMDPixels
 from Configurables import Rich__Future__Rec__Moni__DetectorHits as DetectorHits
+import os
+
+# get test name
+nameEnvVar = "QMTTEST_NAME"
+if nameEnvVar not in os.environ:
+    raise RuntimeError(
+        f"Could not determine test NAME via EnvVar {nameEnvVar}")
+myName = os.environ[nameEnvVar]
 
 # Event numbers
 nEvents = 100
@@ -38,7 +48,12 @@ all = GaudiSequencer("All", MeasureTime=True)
 app = ApplicationMgr(
     TopAlg=[all],
     EvtMax=nEvents,  # events to be processed
-    ExtSvc=['ToolSvc', 'AuditorSvc'],
+    ExtSvc=[
+        ToolSvc(),
+        AuditorSvc(),
+        MessageSvcSink(),
+        RootHistoSink(FileName=myName + "-hists.root")
+    ],
     AuditAlgorithms=True)
 
 # Are we using DD4Hep ?
diff --git a/Rich/RichFutureRecSys/tests/options/rich-dst-reco.py b/Rich/RichFutureRecSys/tests/options/rich-dst-reco.py
index 646b333e9fd..8b3f9255eac 100644
--- a/Rich/RichFutureRecSys/tests/options/rich-dst-reco.py
+++ b/Rich/RichFutureRecSys/tests/options/rich-dst-reco.py
@@ -84,10 +84,12 @@ preUnpackSeq.Members += [fetcher]
 app = ApplicationMgr(
     TopAlg=[all],
     EvtMax=nEvents,  # events to be processed
-    ExtSvc=[ToolSvc(),
-            AuditorSvc(),
-            MessageSvcSink(),
-            RootHistoSink()],
+    ExtSvc=[
+        ToolSvc(),
+        AuditorSvc(),
+        MessageSvcSink(),
+        RootHistoSink(FileName=myName + "-hists.root")
+    ],
     AuditAlgorithms=True)
 
 # Are we using DD4Hep ?
-- 
GitLab