ATLAS Offline Software
Loading...
Searching...
No Matches
TrigValAlgsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6def TrigEDMCheckerCfg(flags, name="TrigEDMChecker", doDumpAll=True):
7 from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
8 cfg = ComponentAccumulator()
9 edmchecker = CompFactory.TrigEDMChecker(
10 name,
11 doDumpAll = doDumpAll,
12 TriggerDecisionTool = cfg.getPrimaryAndMerge(TrigDecisionToolCfg(flags)) )
13
14 if doDumpAll:
15 from MuonConfig.MuonRecToolsConfig import MuonEDMPrinterToolCfg
16 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg, MuonIdHelperSvcCfg
17 cfg.merge(MuonGeoModelCfg(flags))
18 cfg.merge(MuonIdHelperSvcCfg(flags))
19 edmchecker.MuonPrinter = CompFactory.Rec.MuonPrintingTool(
20 MuonStationPrinter = cfg.getPrimaryAndMerge(MuonEDMPrinterToolCfg(flags)) )
21
22 cfg.addEventAlgo(edmchecker)
23
24 return cfg
25
26
27def TrigEDMAuxCheckerCfg(flags, name="TrigEDMAuxChecker"):
28 cfg = ComponentAccumulator()
29
30 alg = CompFactory.TrigEDMAuxChecker(name, AuxContainerList=getEDMAuxList(flags))
31 cfg.addEventAlgo(alg)
32 return cfg
33
34
35def getEDMAuxList(flags):
36 from TrigEDMConfig.TriggerEDM import getTriggerEDMList
37 tlist=getTriggerEDMList(flags, key=flags.Trigger.AODEDMSet)
38 objlist=[]
39 for t,kset in tlist.items():
40 for k in kset:
41 if 'Aux.' in k:
42 s = k.split('.',1)[0] + "."
43 # Types of these collections from Run 2 do not inherit from xAOD::AuxContainerBase, so can't test them here
44 if flags.Trigger.EDMVersion == 2 and "HLT_xAOD__JetContainer" in s or "xTrigDecisionAux" in s or "TrigNavigationAux" in s:
45 continue
46 objlist += [s]
47 return objlist
48
49
50if __name__ == '__main__':
51 from AthenaConfiguration.AllConfigFlags import initConfigFlags
52 from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags
53 flags = initConfigFlags()
54 flags.Input.Files = defaultTestFiles.RAW_RUN3
55 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
56 flags.lock()
57
58 cfg = ComponentAccumulator()
59 cfg.merge( TrigEDMCheckerCfg(flags) )
60 cfg.merge( TrigEDMAuxCheckerCfg(flags) )
61 cfg.wasMerged()
TrigEDMCheckerCfg(flags, name="TrigEDMChecker", doDumpAll=True)
TrigEDMAuxCheckerCfg(flags, name="TrigEDMAuxChecker")