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 result.addService (cpp)
24
25 return result
26
27if __name__ == "__main__":
28 from AthenaConfiguration.AllConfigFlags import initConfigFlags
29 from AthenaConfiguration.Enums import LHCPeriod
30 flags = initConfigFlags()
31 flags.Input.Files = []
32 flags.GeoModel.Run = LHCPeriod.Run2 # flags validation workaround
33 flags.lock()
34
35 acc1 = ComponentAccumulator()
36 acc1.merge (CondProxyProviderCfg (flags, 'file1'))
37 acc1.merge (CondProxyProviderCfg (flags, ['file2', 'file3']))
38 acc1.printConfig (summariseProps=True)
39 print ('CondProxyProvider:', acc1.getService('CondProxyProvider'))
40 acc1.wasMerged()
CondProxyProviderCfg(flags, poolFiles)