From 712b868ef80c0c8edd67dc43bb2ec6646fc71e44 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Mon, 17 Feb 2025 17:43:09 +0100
Subject: [PATCH] Add a 'PoolSvc.PersSvcPerInputType' flag

---
 Control/AthenaConfiguration/python/AllConfigFlags.py           | 2 ++
 .../AthenaPOOL/AthenaPoolCnvSvc/python/PoolCommonConfig.py     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index 64c785b9b922..a6464a2b8ab2 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -342,9 +342,11 @@ def initConfigFlags():
         acf.addFlag("IOVDb.CleanerRingSize",lambda prevFlags : 0 if prevFlags.Trigger.doHLT else 2*max(1, prevFlags.Concurrency.NumConcurrentEvents), help='size of ring-buffer for conditions cleaner')
         acf.addFlag("IOVDb.SqliteInput","",help="Folders found in this file will be used instead of the production db")
         acf.addFlag("IOVDb.SqliteFolders",(),help="Folders listed here will be taken from the IOVDb.SqliteInput file instead of the production db. If empty, all folders found in the file are used.")
+
 #PoolSvc Flags:
     acf.addFlag("PoolSvc.MaxFilesOpen", lambda prevFlags : 2 if prevFlags.MP.UseSharedReader else 0, help='maximum number of open files')
     acf.addFlag('PoolSvc.DefaultContainerType', 'ROOTTREEINDEX', help='set the underlying POOL storage technology for the default container type')
+    acf.addFlag("PoolSvc.PersSvcPerInputType", False, help='enable separate persistency service for each input type')
 
 
     def __bfield():
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolCommonConfig.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolCommonConfig.py
index fa0ba63a7b0c..811c5bc89a3b 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolCommonConfig.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolCommonConfig.py
@@ -30,6 +30,9 @@ def PoolSvcCfg(flags, withCatalogs=False, **kwargs):
 def AthenaPoolCnvSvcCfg(flags, **kwargs):
     acc = PoolSvcCfg(flags)
 
+    if flags.PoolSvc.PersSvcPerInputType:
+        kwargs.setdefault("PersSvcPerInputType", "CollectionTree")
+
     service = CompFactory.AthenaPoolCnvSvc(**kwargs)
     acc.addService(service)
     acc.addService(CompFactory.EvtPersistencySvc("EventPersistencySvc",
-- 
GitLab