5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaCommon.Logging
import logging
13 return any(checkString
in entry
for entry
in flags.Input.Collections)
22 onlineSlim = CompFactory.TrigNavSlimmingMTAlg(
'TrigNavSlimmingMTAlg_Online')
23 onlineSlim.TrigDecisionTool =
""
24 onlineSlim.OutputCollection =
"HLTNav_Summary_OnlineSlimmed"
25 onlineSlim.PrimaryInputCollection =
"HLTNav_Summary"
26 onlineSlim.KeepFailedBranched =
True
27 onlineSlim.KeepOnlyFinalFeatures =
False
28 onlineSlim.RemoveEmptySteps =
False
29 onlineSlim.EdgesToDrop = []
30 onlineSlim.NodesToDrop = []
31 onlineSlim.ChainsFilter = []
32 onlineSlim.RuntimeValidation = flags.Trigger.doRuntimeNaviVal
56 log = logging.getLogger(
"TrigNavSlimmingMTDerivationCfg.py")
59 log.info(
"Will not create a new DAOD Slimmed Trigger Navigation Collection in this job (already present in input file)")
60 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
63 from TrigDecisionTool.TrigDecisionToolConfig
import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
64 from TrigDecisionTool.TrigDecisionToolHelpers
import possible_keys
70 daodSlim = CompFactory.TrigNavSlimmingMTAlg(
'TrigNavSlimmingMTAlg_DAOD')
71 daodSlim.TrigDecisionTool = tdt
72 daodSlim.OutputCollection =
"HLTNav_Summary_DAODSlimmed"
73 daodSlim.PrimaryInputCollection = inputCollection
74 daodSlim.AllOutputContainers = possible_keys
75 daodSlim.KeepFailedBranched =
False
76 daodSlim.KeepOnlyFinalFeatures =
True
77 daodSlim.RemoveEmptySteps =
True
78 daodSlim.RepackROIs =
False
79 daodSlim.RepackROIsOutputCollection =
"HLTNav_RepackedROIs"
80 daodSlim.RepackMET =
True
81 daodSlim.RepackFeatures =
True
83 daodSlim.RepackFeaturesOutputCollection_Particle =
"HLTNav_RepackedFeatures_Particle"
84 daodSlim.RepackFeaturesOutputCollection_MET =
"HLTNav_RepackedFeatures_MET"
85 daodSlim.EdgesToDrop = [
"view"]
86 daodSlim.NodesToDrop = [
"F",
"CH"]
87 daodSlim.ChainsFilter = chainsFilter
88 ca.addEventAlgo(daodSlim)
90 log.info(
"Producing DAOD Slimmed Trigger Navigation Collection. Reading {} and writing {}".
format(daodSlim.PrimaryInputCollection, daodSlim.OutputCollection))
92 if daodSlim.OutputCollection
not in possible_keys:
93 log.error(
"Producing a collection {} which is not listed in 'possible_keys'! Add this here too.".
format(daodSlim.OutputCollection))
99 slimmingHelper.AppendToDictionary.update({
'HLTNav_Summary_DAODSlimmed':
'xAOD::TrigCompositeContainer',
'HLTNav_Summary_DAODSlimmedAux':
'xAOD::TrigCompositeAuxContainer',
100 'HLTNav_RepackedFeatures_Particle':
'xAOD::ParticleContainer',
'HLTNav_RepackedFeatures_ParticleAux':
'xAOD::ParticleAuxContainer',
101 'HLTNav_RepackedFeatures_MET':
'xAOD::TrigMissingETContainer',
'HLTNav_RepackedFeatures_METAux':
'xAOD::TrigMissingETAuxContainer',
102 'HLTNav_RepackedROIs':
'TrigRoiDescriptorCollection'})
105 slimmingHelper.ExtraVariables += [
'HLTNav_RepackedFeatures_Particle.px.py.pz.e',
106 'HLTNav_RepackedFeatures_MET.ex.ey.ez.sumEt.sumE.flag.roiWord']
109 slimmingHelper.AllVariables += [
'HLTNav_Summary_DAODSlimmed',
110 'HLTNav_RepackedROIs']
136 log = logging.getLogger(
"TrigNavSlimmingMTCfg.py")
138 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
141 if flags.Trigger.EDMVersion
in [1, 2]
and not flags.Trigger.doEDMVersionConversion:
142 log.debug(
"Not going to run Run 3 navigation slimming on a R2 input file as we are not setup to run the navigation conversion in this job")
146 if flags.Trigger.decodeHLT
is False:
147 log.debug(
"Nothing to do as Trigger.decodeHLT is False")
150 if flags.Trigger.doNavigationSlimming
is False:
151 log.debug(
"Nothing to do as Trigger.doNavigationSlimming is False")
154 doESD = flags.Output.doWriteESD
155 doAOD = flags.Output.doWriteAOD
157 from TrigDecisionTool.TrigDecisionToolConfig
import TrigDecisionToolCfg, getRun3NavigationContainerFromInput
158 from TrigDecisionTool.TrigDecisionToolHelpers
import possible_keys
166 if doESD
and doESDSlim:
168 esdSlim = CompFactory.TrigNavSlimmingMTAlg(
'TrigNavSlimmingMTAlg_ESD')
169 esdSlim.TrigDecisionTool = tdt
170 esdSlim.OutputCollection =
"HLTNav_Summary_ESDSlimmed"
171 esdSlim.PrimaryInputCollection = inputCollection
172 esdSlim.AllOutputContainers = possible_keys
173 esdSlim.KeepFailedBranched =
True
174 esdSlim.KeepOnlyFinalFeatures =
False
175 esdSlim.RemoveEmptySteps =
False
176 esdSlim.RepackROIs =
False
177 esdSlim.RepackFeatures =
False
178 esdSlim.EdgesToDrop = [
"view"]
179 esdSlim.NodesToDrop = [
"F"]
180 esdSlim.ChainsFilter = []
181 ca.addEventAlgo(esdSlim)
183 collections = [f
"xAOD::TrigCompositeContainer#{esdSlim.OutputCollection}", f
"xAOD::TrigCompositeAuxContainer#{esdSlim.OutputCollection}Aux.-"]
184 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD
185 ca.merge(
addToESD(flags, collections))
187 log.info(
"Producing ESD Slimmed Trigger Navigation Collection. Reading {} and writing {}".
format(esdSlim.PrimaryInputCollection, esdSlim.OutputCollection))
188 if esdSlim.OutputCollection
not in possible_keys:
189 log.error(
"Producing a collection {} which is not listed in 'possible_keys'! Add this here too.".
format(esdSlim.OutputCollection))
191 log.info(
"Will not create ESD Slimmed Trigger Navigation Collection in this job")
193 if doAOD
and doAODSlim:
195 aodSlim = CompFactory.TrigNavSlimmingMTAlg(
'TrigNavSlimmingMTAlg_AOD')
196 aodSlim.TrigDecisionTool = tdt
197 aodSlim.OutputCollection =
"HLTNav_Summary_AODSlimmed"
198 aodSlim.PrimaryInputCollection = inputCollection
199 aodSlim.AllOutputContainers = possible_keys
200 aodSlim.RemoveEmptySteps =
False
201 aodSlim.RepackROIs =
False
202 aodSlim.RepackFeatures =
False
203 aodSlim.EdgesToDrop = [
"view"]
204 aodSlim.NodesToDrop = [
"F"]
205 aodSlim.ChainsFilter = []
207 if flags.Trigger.AODEDMSet ==
"AODSLIM":
208 aodSlim.KeepFailedBranched =
False
209 aodSlim.KeepOnlyFinalFeatures =
True
210 log.info(
"Producing AODSLIM Trigger Navigation Collection. Reading {} and writing {}".
format(aodSlim.PrimaryInputCollection, aodSlim.OutputCollection))
212 aodSlim.KeepFailedBranched =
True
213 aodSlim.KeepOnlyFinalFeatures =
False
214 log.info(
"Producing AODFULL Slimmed Trigger Navigation Collection. Reading {} and writing {}".
format(aodSlim.PrimaryInputCollection, aodSlim.OutputCollection))
215 ca.addEventAlgo(aodSlim)
217 collections = [f
"xAOD::TrigCompositeContainer#{aodSlim.OutputCollection}", f
"xAOD::TrigCompositeAuxContainer#{aodSlim.OutputCollection}Aux.-"]
218 from OutputStreamAthenaPool.OutputStreamConfig
import addToAOD
219 ca.merge(
addToAOD(flags, collections))
221 if aodSlim.OutputCollection
not in possible_keys:
222 log.error(
"Producing a collection {} which is not listed in 'possible_keys'! Add this here too.".
format(esdSlim.OutputCollection))
224 log.info(
"Will not create AOD Slimmed Trigger Navigation Collection in this job")