ATLAS Offline Software
Loading...
Searching...
No Matches
AddressRemappingConfig.py
Go to the documentation of this file.
1""" Helpers for configuring the AddressRemappingSvc
2
3Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4"""
5
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8
9
10def AddressRemappingCfg(renameMaps=[], overwriteMaps=[]):
11 """
12 Creates a ComponentAccumulator instance containing the
13 AddressRemappingSvc and other needed services
14 """
15
16 AddressRemappingSvc, ProxyProviderSvc=CompFactory.getComps("AddressRemappingSvc","ProxyProviderSvc",)
17
18 acc = ComponentAccumulator()
20 svc.TypeKeyRenameMaps = renameMaps
21 svc.TypeKeyOverwriteMaps = overwriteMaps
22 acc.addService(svc)
23 acc.addService(ProxyProviderSvc(ProviderNames=["AddressRemappingSvc"]))
24
25 return acc
26
27
28def InputRenameCfg(type, from_name, to_name):
29 """ Add a new input renaming.
30
31 For example:
32
33 InputRenameCfg ("Foo", "foo", "bar")
34
35 to rename the object of type Foo named `foo' to `bar'.
36
37 May also be used to rename dynamic (but NOT static) auxiliary variables:
38
39 InputRenameCfg ("Foo", "foo.d1", "foo.x1")
40
41 If both are combined, write it like this:
42
43 InputRenameCfg ("Foo", "foo", "bar")
44 InputRenameCfg ("Foo", "foo.d1", "bar.x1")
45 """
46
47 return AddressRemappingCfg(renameMaps = [ '%s#%s->%s' % (type, from_name, to_name) ])
48
49
50def InputOverwriteCfg(from_type, from_name, to_type, to_name):
51 """ Add a new type overwrite mapping. """
52
53 return AddressRemappingCfg(overwriteMaps = [ '%s#%s->%s#%s' % (from_type, from_name,
54 to_type, to_name) ])
This class provides the interface to the LCG POOL persistency software.
manages the address providers and add proxies on demand to the store
InputRenameCfg(type, from_name, to_name)
InputOverwriteCfg(from_type, from_name, to_type, to_name)
AddressRemappingCfg(renameMaps=[], overwriteMaps=[])