ATLAS Offline Software
AODFixDemoConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from RecJobTransforms.AODFixHelper import releaseInRange
6 
7 
8 def AODFixDemoCfg(flags):
9 
10  #first check if we need to apply this AODFix
11  #Let's assume the bug is in Athena-22.0.80 to Athena 22.0.89
12  if not releaseInRange(flags,"Athena-22.0.80","Athena-22.0.89"):
13  return None
14 
15  result=ComponentAccumulator()
16 
17  #Use the AddressRemappingSvc to rename the input object
18  from SGComps.AddressRemappingConfig import InputRenameCfg
19  result.merge(InputRenameCfg("xAOD::ElectronContainer", "Electrons", "old_Electrons"))
20 
21 
22 
23  #Re-run the required algorithms or schedule and ad-hoc algorithm
24  #that creates a new container by correcting the values in the
25  #renamed input container
26  result.addEventAlgo(CompFactory.electronRescaler(InputName="old_Electrons",
27  OutputName="Electrons"))
28 
29  return result
30 
31 
32 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AODFixHelper.releaseInRange
def releaseInRange(flags, rel1, rel2)
Definition: AODFixHelper.py:9
python.AODFixDemoConfig.AODFixDemoCfg
def AODFixDemoCfg(flags)
Definition: AODFixDemoConfig.py:8
AddressRemappingConfig.InputRenameCfg
def InputRenameCfg(type, from_name, to_name)
Definition: AddressRemappingConfig.py:28