ATLAS Offline Software
AddressRemappingConfig.py
Go to the documentation of this file.
1 """ Helpers for configuring the AddressRemappingSvc
2 
3 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4 """
5 
6 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory import CompFactory
8 
9 
10 def 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()
19  svc = AddressRemappingSvc()
20  svc.TypeKeyRenameMaps = renameMaps
21  svc.TypeKeyOverwriteMaps = overwriteMaps
22  acc.addService(svc)
23  acc.addService(ProxyProviderSvc(ProviderNames=["AddressRemappingSvc"]))
24 
25  return acc
26 
27 
28 def 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 
50 def 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) ])
AddressRemappingSvc
This class provides the interface to the LCG POOL persistency software.
Definition: AddressRemappingSvc.h:41
AddressRemappingConfig.AddressRemappingCfg
def AddressRemappingCfg(renameMaps=[], overwriteMaps=[])
Definition: AddressRemappingConfig.py:10
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ProxyProviderSvc
manages the address providers and add proxies on demand to the store
Definition: ProxyProviderSvc.h:42
AddressRemappingConfig.InputOverwriteCfg
def InputOverwriteCfg(from_type, from_name, to_type, to_name)
Definition: AddressRemappingConfig.py:50
AddressRemappingConfig.InputRenameCfg
def InputRenameCfg(type, from_name, to_name)
Definition: AddressRemappingConfig.py:28