686def TrigMuonEFFastRecoSAHypoToolFromDict( flags, chainDict ) :
687
688 chainPart = chainDict['chainParts'][0]
689
690 thresholds = getThresholdsFromDict( chainDict )
691 if int(chainPart['multiplicity']) == 0:
692 thresholds = [chainPart['threshold']]
693
694 doOverlapRemoval = False
695
696 if chainPart['signature'] == 'Bphysics' or 'l2io' in chainPart['l2AlgInfo']:
697 doOverlapRemoval = False
698 elif int(chainPart['multiplicity']) > 1:
699 doOverlapRemoval = True
700 elif len(chainDict['signatures']) > 1 and not chainPart['extra']:
701 doOverlapRemoval = True
702
703 kwargs={}
704 kwargs["RequireSAMuons"] = True
705 kwargs["IsFastReco"] = True
706 kwargs["RemoveOverlaps"] = doOverlapRemoval
707
708
709 if monitorAll or any(group in muonHypoMonGroups for group in chainDict['monGroups']):
710 if doOverlapRemoval:
711 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigL2MuonOverlapRemoverMonitoringMufast
712 kwargs["MonTool"] = TrigL2MuonOverlapRemoverMonitoringMufast(flags, 'TrigMuonEFFastSAHypoTool/' + chainDict['chainName'])
713 else:
714 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigMufastHypoMonitoring
715 kwargs["MonTool"] = TrigMufastHypoMonitoring(flags, 'TrigMuonEFFastSAHypoTool/' + chainDict['chainName'])
716
717 kwargs["ConeSize"] = 0.0
718 kwargs["NarrowScan"] = False
719
720 name = chainDict['chainName']
721 log = logging.getLogger(name)
722
723
724
725 nt = len(thresholds)
726 log.debug('Set %d thresholds', nt)
727 PtBins = [ [ 0.0, 2.5 ] ] * nt
728 PtThresholds = [ [ 5.49 * GeV ] ] * nt
729
730 for th, thvalue in enumerate(thresholds):
731 thvaluename = '6GeV_v15a'
732
733 useGeV_v15a = any(x in chainPart['addInfo'] for x in ['idperf', 'idtp', '3layersEC'])
734 if useGeV_v15a or int(thvalue) < 5:
735 thvaluename = thvalue + 'GeV_v15a'
736 if int(thvalue) == 3:
737 thvaluename = thvalue + 'GeV_v22a'
738
739 isBarrelOnly = '0eta105' in chainPart['etaRange']
740 if isBarrelOnly:
741 thvaluename = thvalue+ "GeV_barrelOnly_v15a"
742
743 if int(thvalue) >= 20:
744 thvaluename = thvalue + 'GeV_v15a'
745
746 log.debug('Number of threshold = %d, Value of threshold = %s', th, thvaluename)
747
748 values = muFastThresholds[thvaluename]
749
750 PtBins[th] = values[0]
751 PtThresholds[th] = [ x * GeV for x in values[1] ]
752 log.debug('Configration of threshold[%d] %s', th, PtThresholds[th])
753 log.debug('Configration of PtBins[%d] %s', th, PtBins[th])
754
755 kwargs["AcceptAll"] = 'mucombTag' in chainPart['extra']
756 kwargs["PtBins"] = PtBins
757 kwargs["PtThresholds"] = PtThresholds
758 return CompFactory.TrigMuonEFHypoTool(name, **kwargs)
759