13 """Configures Run 1/2 to Run 3 navigation conversion algorithm for all triggers"""
14 if len(chainsList) == 0:
15 log.info(
"Chains list is empty, the conversion will happen for all chains, but no validation will be performed")
16 log.info(
"The later is enabled when an explicit chain list is provided")
20 if flags.Trigger.EDMVersion >= 3:
23 if not flags.Trigger.doEDMVersionConversion:
26 from TrigDecisionTool.TrigDecisionToolConfig
import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
31 cnvAlg = CompFactory.Run2ToRun3TrigNavConverterV2(
"TrigRun2ToRun3NavConverter")
32 cnvAlg.TrigDecisionTool = tdt
33 cnvAlg.TrigNavReadKey =
""
34 cnvAlg.TrigConfigSvc = tdt.TrigConfigSvc
35 cnvAlg.OutputNavKey = r2ToR3OutputName
36 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD, addToESD
37 collections = [f
"xAOD::TrigCompositeContainer#{r2ToR3OutputName}", f
"xAOD::TrigCompositeAuxContainer#{r2ToR3OutputName}Aux."]
38 acc.merge(
addToAOD(flags, collections))
39 acc.merge(
addToESD(flags, collections))
41 cnvAlg.Rois = [
"initialRoI",
"forID",
"forID1",
"forID2",
"forMS",
"forSA",
"forTB",
"forMT",
"forCB"]
43 from TrigEDMConfig.TriggerEDM
import getTriggerEDMList
46 def cleanKey(type, name):
47 return name.replace(
"HLT_",
"", 1).
replace(type.replace(
"::",
"__"),
"", 1).
replace(
"_",
"", 1)
49 for type, keys
in edm.items():
52 types.append(type+
"#"+cleanKey(type, key))
54 log.info(
"Assuming these collections are relevant for trigger: %s",
" ".
join(types))
55 cnvAlg.Collections = types
56 cnvAlg.Chains = chainsList
57 cnvAlg.doCompression =
True
58 acc.addEventAlgo(cnvAlg)
61 checker = CompFactory.Trig.NavigationTesterAlg(FailOnDifference =
False, TrigDecisionTool = tdt)
62 checker.RetrievalToolRun2Nav = CompFactory.Trig.IParticleRetrievalTool()
65 run3tdt = CompFactory.Trig.TrigDecisionTool(
"Run3TrigDecisionTool",
66 HLTSummary = r2ToR3OutputName,
67 NavigationFormat =
'TrigComposite',
68 AcceptMultipleInstance=
True,
69 TrigConfigSvc = tdt.TrigConfigSvc)
70 acc.addPublicTool(run3tdt)
71 checker.RetrievalToolRun3Nav = CompFactory.Trig.R3IParticleRetrievalTool(TrigDecisionTool = run3tdt)
72 checker.Chains = chainsList
73 checker.TrigDecisionToolRun3 = run3tdt
74 checker.TrigDecisionToolRun2 = tdt
76 acc.addEventAlgo(checker)