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