327def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs):
328
329 kwargs.setdefault("neutral_FE_cont_name", "")
330 kwargs.setdefault("charged_FE_cont_name", "")
331 kwargs.setdefault("LinkNeutralFEClusters", True)
332 kwargs.setdefault("doTCC", False)
333 kwargs.setdefault("useGlobal", False)
334
335 useMuonTopoClusters = False
336 from AthenaConfiguration.Enums import ProductionStep
337
338
339 if inputFlags.Common.ProductionStep in [ProductionStep.Derivation] or inputFlags.DQ.Environment == "AOD":
340 useMuonTopoClusters = True
341
342
343 PFMuonFlowElementLinkerAlgorithmFactory=CompFactory.PFMuonFlowElementAssoc
344 if not algName:
345 algName="PFMuonFlowElementAssoc"
346 PFMuonFlowElementLinkerAlgorithm=PFMuonFlowElementLinkerAlgorithmFactory(algName)
347
348
349
350
351
352 if kwargs['neutral_FE_cont_name']:
353
354 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer = kwargs['neutral_FE_cont_name']
355
356
357 if kwargs['charged_FE_cont_name']:
358 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer = kwargs['charged_FE_cont_name']
359
360 PFMuonFlowElementLinkerAlgorithm.LinkNeutralFEClusters = kwargs['LinkNeutralFEClusters']
361 PFMuonFlowElementLinkerAlgorithm.useMuonTopoClusters = useMuonTopoClusters
362
363
364
365
366 if kwargs['doTCC']:
367
368
369 service_key=""
370 PFMuonFlowElementLinkerAlgorithm.MuonContainer=service_key+"Muons"
371 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer=service_key+"TrackCaloClustersCharged"
372 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer=service_key+"TrackCaloClustersNeutral"
373
374
375
376
377 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="chargedTCCLinks"
378 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="neutralTCCLinks"
379 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="TCC_MuonLinks"
380 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="TCC_MuonLinks"
381 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="TCC_efrac_matched_muon"
382
383 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="TCC_nMatchedMuons"
384 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="TCC_efrac_matched_muon"
385
386 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_TCC"
387
388 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_TCCalg"
389
390 if kwargs['useGlobal']:
391 PFMuonFlowElementLinkerAlgorithm.JetEtMissChargedFlowElementContainer="GlobalChargedParticleFlowObjects"
392 PFMuonFlowElementLinkerAlgorithm.JetEtMissNeutralFlowElementContainer="GlobalNeutralParticleFlowObjects"
393
394 PFMuonFlowElementLinkerAlgorithm.MuonContainer_chargedFELinks="chargedGlobalFELinks"
395 PFMuonFlowElementLinkerAlgorithm.MuonContainer_neutralFELinks="neutralGlobalFELinks"
396
397 PFMuonFlowElementLinkerAlgorithm.JetETMissNeutralFlowElementContainer_FE_MuonLinks="GlobalFE_MuonLinks"
398 PFMuonFlowElementLinkerAlgorithm.JetETMissChargedFlowElements_FE_MuonLinks="GlobalFE_MuonLinks"
399 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_ChargedFE_ennergy_matched_muon="GlobalFE_efrac_matched_muon"
400
401 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_nMatchedMuons="GlobalFE_nMatchedMuons"
402 PFMuonFlowElementLinkerAlgorithm.FlowElementContainer_FE_efrac_matched_muon="GlobalFE_efrac_matched_muon"
403
404 PFMuonFlowElementLinkerAlgorithm.MuonContainer_muon_efrac_matched_FE="muon_efrac_matched_GlobalFE"
405
406 PFMuonFlowElementLinkerAlgorithm.MuonContainer_ClusterInfo_deltaR="deltaR_muon_clus_GlobalFEalg"
407
408 if kwargs['LinkNeutralFEClusters'] and not useMuonTopoClusters:
409
410
411 PFMuonFlowElementLinkerAlgorithm.ExtraInputs.add(('CaloCellContainer', inputFlags.Egamma.Keys.Input.CaloCells))
412
413 if kwargs['LinkNeutralFEClusters']:
414 if kwargs['doTCC']:
415
416
417 from AthenaCommon.Logging import logging
418 msg=logging.getLogger("PFCfg.py::getMuonFlowElementAssocAlgorithm")
419 msg.error("Neutral FE from AOD configured to be linked with Muon. This link will fail due to missing CaloCells in the AOD")
420 msg.info("Terminating job")
421 exit(0)
422
423
424 return PFMuonFlowElementLinkerAlgorithm
425