208def hlt_result_cfg(flags, hypo_algs):
209 from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID
210 from TrigEDMConfig.TriggerEDMRun3 import EDMDetailsRun3
211 from TrigEDMConfig.TriggerEDM import getRawTriggerEDMList
212 from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, StreamTagMakerToolCfg, TriggerBitsMakerToolCfg
213
214
215 serialiser = TriggerEDMSerialiserToolCfg(flags, 'Serialiser')
216
217 serialiser.addCollectionListToMainResult([
218 coll[0]
for coll
in getRawTriggerEDMList(flags, runVersion=3)
if 'BS' in coll[1]
and coll[2]==
'Steer' and not coll[0].
split(
'#')[0]
in EDMDetailsRun3
219 ])
220 for hypo in hypo_algs:
221 serialiser.addCollectionListToMainResult([
222 'xAOD::TrigCompositeContainer#%s' % hypo.HypoOutputDecisions,
223 'xAOD::TrigCompositeAuxContainer#%sAux.' % hypo.HypoOutputDecisions,
224 ])
225
226
227 resultList = [getFullHLTResultID(), 1]
229 chain_names = []
230 for hypo in hypo_algs:
231 for hypo_tool in hypo.HypoTools:
232 chain_names.append(hypo_tool.name)
233 if hasattr(hypo_tool,'CreateRandomData'):
234 for coll_name in hypo_tool.CreateRandomData.keys():
235 collections.add(coll_name)
236 for coll_name in collections:
237 serialiser.addCollectionListToResults([
238 'xAOD::TrigCompositeContainer#{:s}'.format(coll_name),
239 'xAOD::TrigCompositeAuxContainer#{:s}Aux.'.format(coll_name)
240 ], resultList)
241
242
243 streamPhysicsMain = {
244 'name': 'Main',
245 'type': 'physics',
246 'obeyLB': True,
247 'forceFullEventBuilding': True
248 }
249 streamExamplePEB = {
250 'name': 'ExamplePEB',
251 'type': 'calibration',
252 'obeyLB': True,
253 'forceFullEventBuilding': False
254 }
255 streamExampleDataScoutingPEB = {
256 'name': 'ExampleDataScoutingPEB',
257 'type': 'physics',
258 'obeyLB': True,
259 'forceFullEventBuilding': False
260 }
261 chain_to_streams = {}
262 for counter, ch in enumerate(chain_names, start=1):
263 if counter % 3 == 1:
264 chain_to_streams[ch] = [streamPhysicsMain]
265 elif counter % 3 == 2:
266 chain_to_streams[ch] = [streamExamplePEB]
267 elif counter % 3 == 0:
268 chain_to_streams[ch] = [streamExampleDataScoutingPEB]
269
270 menu_json = write_dummy_menu_json(flags, chain_to_streams.keys(), chain_to_streams)
271
272 acc = ComponentAccumulator()
273
274
275 from TrigConfigSvc.TrigConfigSvcCfg import HLTConfigSvcCfg
276 hltConfigSvcCfg = HLTConfigSvcCfg(flags)
277 hltConfigSvcCfg.getService("HLTConfigSvc").HLTJsonFileName = menu_json
278 acc.merge(hltConfigSvcCfg)
279
280
281 stmaker = StreamTagMakerToolCfg()
282 stmaker.ChainDecisions = 'HLTNav_Summary'
283 stmaker.PEBDecisionKeys = [str(hypo.HypoOutputDecisions) for hypo in hypo_algs]
284
285
286 bitsmaker = TriggerBitsMakerToolCfg()
287 bitsmaker.ChainDecisions = 'HLTNav_Summary'
288
289
290 from TrigServices.TrigServicesConfig import TrigServicesCfg
291 trigServicesCfg = TrigServicesCfg(flags)
292 hltEventLoopMgr = trigServicesCfg.getPrimary()
293 hltEventLoopMgr.ResultMaker.StreamTagMaker = stmaker
294 hltEventLoopMgr.ResultMaker.MakerTools = [bitsmaker, serialiser]
295 acc.merge(trigServicesCfg)
296
297 return acc
298
299
std::vector< std::string > split(const std::string &s, const std::string &t=":")