ATLAS Offline Software
Loading...
Searching...
No Matches
AODFixConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from EventInfoMgt.TagInfoMgrConfig import TagInfoMgrCfg
5from AthenaCommon.Logging import logging
6
7
8_doneAODFixes=set()
9
10
11def AODFixCfg(flags):
12
13 nAODFixes=0
14 msg=logging.getLogger("AODFixCfg")
15 aodFixesDone=flags.Input.AODFixesDone
16 if len(aodFixesDone):
17 msg.info("Already done fixes = %s",aodFixesDone)
18
19 if isinstance(aodFixesDone,str):
20 aodFixesDone=aodFixesDone.split()
21
22 for doneFix in aodFixesDone:
23 _doneAODFixes.add(doneFix)
24
25 result=ComponentAccumulator()
26
27 # #Add list of known AOD Fixes here:
28 from egammaAlgs.egammaAODFixesConfig import egammaAODFixesCfg
29 from LArCellRec.EventInfoClearAlgConfig import EventVetoCearAlgCfg
30 listOfFixes=[egammaAODFixesCfg,EventVetoCearAlgCfg]
31
32 for aodFix in listOfFixes:
33 aodFixName=aodFix.__name__
34 if aodFixName in _doneAODFixes:
35 msg.warning("AODFix %s already applied, not applying again",aodFixName)
36 continue
37
38 #The method is supposed to verify if the AOD-fix must be applied for the input data,
39 #typically based on flags.Input.Release. If yes, returns a ComponentAccumulator, otherwise None
40 ca=aodFix(flags)
41 aodFixName=aodFix.__name__
42 if ca is not None:
43 msg.info("Applying AOD fix %s",aodFixName)
44 result.merge(ca)
45 _doneAODFixes.add(aodFixName)
46 nAODFixes+=1
47 else:
48 msg.info("AODFix \"%s\" not applicable for this input AOD",aodFixName)
49
50
51 if nAODFixes>0:
52 result.merge(TagInfoMgrCfg(flags,{"AODFixVersion":" ".join(_doneAODFixes)}))
53 else:
54 msg.info("No AOD fix scheduled")
55 return result
STL class.