ATLAS Offline Software
Loading...
Searching...
No Matches
CondProxyProviderConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3# File: EventSelectorAthenaPool/python/CondProxyProviderConfig.py
4# Created: Jun 2020, sss
5# Purpose: Configure CondProxyProvider.
6
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.ComponentFactory import CompFactory
9
10
11def CondProxyProviderCfg (flags, poolFiles):
12 if not isinstance (poolFiles, list):
13 poolFiles = [poolFiles]
14
15 result = ComponentAccumulator()
16
17 ProxyProviderSvc = CompFactory.ProxyProviderSvc # SGComps
18 pps = ProxyProviderSvc (ProviderNames = ['CondProxyProvider'])
19 result.addService (pps)
20
21 CondProxyProvider = CompFactory.CondProxyProvider # EventSelectorAthenaPool
22 cpp = CondProxyProvider (InputCollections = poolFiles,
23 ConversionService="AthenaPoolSharedIOCnvSvc" if flags.MP.UseSharedReader or flags.MP.UseSharedWriter else "AthenaPoolCnvSvc")
24 result.addService (cpp)
25
26 return result
27
28
29if __name__ == "__main__":
30 from AthenaConfiguration.AllConfigFlags import initConfigFlags
31 from AthenaConfiguration.Enums import LHCPeriod
32 flags = initConfigFlags()
33 flags.Input.Files = []
34 flags.GeoModel.Run = LHCPeriod.Run2 # flags validation workaround
35 flags.lock()
36
37 acc1 = ComponentAccumulator()
38 acc1.merge (CondProxyProviderCfg (flags, 'file1'))
39 acc1.merge (CondProxyProviderCfg (flags, ['file2', 'file3']))
40 acc1.printConfig (summariseProps=True)
41 print ('CondProxyProvider:', acc1.getService('CondProxyProvider'))
42 acc1.wasMerged()
CondProxyProviderCfg(flags, poolFiles)