def toolSoftMuonTag(name, useBTagFlagsDefaults=True, **options): """Sets up a SoftMuonTag tool and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel Runmodus default: BTaggingFlags.Runmodus jetCollectionList default: BTaggingFlags.Jets originalMuCollectionName default: BTaggingFlags.MuonCollectionName BTagJetEtamin default: 2.5 (only if BTaggingFlags.Runmodus == 'reference') input: name: The name of the tool (should be unique). useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" if useBTagFlagsDefaults: defaults = { 'OutputLevel': BTaggingFlags.OutputLevel, 'Runmodus': BTaggingFlags.Runmodus, 'jetCollectionList': BTaggingFlags.Jets, 'originalMuCollectionName': BTaggingFlags.MuonCollectionName } if (BTaggingFlags.Runmodus == 'reference'): defaults['BTagJetEtamin'] = 2.5 for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag return Analysis__SoftMuonTag(**options)
def toolSoftMuonTag(name, useBTagFlagsDefaults=True, **options): """Sets up a SoftMuonTag tool and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel Runmodus default: BTaggingFlags.Runmodus jetCollectionList default: BTaggingFlags.Jets originalMuCollectionName default: BTaggingFlags.MuonCollectionName BTagJetEtamin default: 2.5 (only if BTaggingFlags.Runmodus == 'reference') MuonQuality default: xAOD::Muon::Medium input: name: The name of the tool (should be unique). useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" if useBTagFlagsDefaults: from BTagging.BTaggingConfiguration_CommonTools import toolBTagTrackToVertexIPEstimator as toolBTagTrackToVertexIPEstimator trackToVertexIPEstimator = toolBTagTrackToVertexIPEstimator( 'TrkToVxIPEstimator') #from BTagging.BTaggingConfiguration_CommonTools import toolBTagTrackToVertexTool as toolBTagTrackToVertexTool #trackToVertexTool = toolBTagTrackToVertexTool('BTagTrackToVertexTool') muonSelectorTool = toolMuonSelectorTool('MuonSelectorTool') likelihood = toolSoftMuonTagNewLikelihoodTool( 'SoftMuonTagNewLikelihoodTool') defaults = { 'OutputLevel': BTaggingFlags.OutputLevel, 'Runmodus': BTaggingFlags.Runmodus, 'jetCollectionList': BTaggingFlags.Jets, 'originalMuCollectionName': BTaggingFlags.MuonCollectionName, 'MuonQuality': 2, 'muonSelectorTool': muonSelectorTool, 'LikelihoodTool': likelihood, #'TrackToVertexTool' : trackToVertexTool, 'TrackToVertexIPEstimator': trackToVertexIPEstimator, } if (BTaggingFlags.Runmodus == 'reference'): defaults['BTagJetEtamin'] = 2.5 for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag return Analysis__SoftMuonTag(**options)
def toolSoftMuonTagChi2(name, useBTagFlagsDefaults=True, **options): """Sets up a SoftMuonTagChi2 tool and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel Runmodus default: BTaggingFlags.Runmodus jetCollectionList default: BTaggingFlags.Jets originalMuCollectionName default: BTaggingFlags.MuonCollectionName MuonAssociationName default: "Muons" TaggingAlgType default: "CHI2" (this is what switches the chi2 tagger ON) RecAlgorithm default: 0 (use only combined muons) writeInfoPlus default: 1 (turn InfoPlus off because the L1D tagger takes care of it (albeit cuts on the chi2...) --> # Turn on (for rel 17.2)) CutMatchChi2 default: 10000 (no match-chi2 cut) input: name: The name of the tool (should be unique). useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" if useBTagFlagsDefaults: defaults = { 'OutputLevel': BTaggingFlags.OutputLevel, 'Runmodus': BTaggingFlags.Runmodus, 'jetCollectionList': BTaggingFlags.Jets, 'originalMuCollectionName': BTaggingFlags.MuonCollectionName, 'MuonAssociationName': 'Muons', 'TaggingAlgType': 'CHI2', 'RecAlgorithm': 0, 'writeInfoPlus': 1, 'CutMatchChi2': 10000 } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag return Analysis__SoftMuonTag(**options)
name="SoftMuonTagChi2NewLikelihoodTool", OutputLevel=BTaggingFlags.OutputLevel, taggerName="SoftMuChi2", calibrationTool=BTagCalibrationBrokerTool, smoothNTimes=0, normalizedProb=True, interpolate=True) ToolSvc += SoftMuonTagChi2NewLikelihood if BTaggingFlags.OutputLevel < 3: print SoftMuonTagChi2NewLikelihood from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag SoftMuonTagChi2Tool = Analysis__SoftMuonTag( name="SoftMuonTagChi2", Runmodus=BTaggingFlags.Runmodus, OutputLevel=BTaggingFlags.OutputLevel, LikelihoodTool=SoftMuonTagChi2NewLikelihood, TrackToVertexTool=BTagTrackToVertexTool, MuonAssociationName="Muons", jetCollectionList=BTaggingFlags.Jets, originalMuCollectionName=BTaggingFlags.MuonCollectionName) SoftMuonTagChi2Tool.TaggingAlgType = "CHI2" # this is what switches the chi2 tagger ON SoftMuonTagChi2Tool.RecAlgorithm = 0 # use only combined muons SoftMuonTagChi2Tool.writeInfoPlus = 1 # turn InfoPlus off because the L1D tagger takes care of it (albeit cuts on the chi2...) --> # Turn-on (for rel 17.2) SoftMuonTagChi2Tool.CutMatchChi2 = 10000 # no match-chi2 cut ToolSvc += SoftMuonTagChi2Tool if BTaggingFlags.OutputLevel < 3: print SoftMuonTagChi2Tool
calibrationTool = BTagCalibrationBrokerTool, smoothNTimes = 0, normalizedProb = True, interpolate = True ) ToolSvc += SoftMuonTagNewLikelihood if BTaggingFlags.OutputLevel < 3: print SoftMuonTagNewLikelihood from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag SoftMuonTagTool = Analysis__SoftMuonTag( name = "SoftMuonTag", Runmodus = BTaggingFlags.Runmodus, OutputLevel = BTaggingFlags.OutputLevel, LikelihoodTool = SoftMuonTagNewLikelihood, TrackToVertexTool = BTagTrackToVertexTool, jetCollectionList = BTaggingFlags.Jets, originalMuCollectionName = BTaggingFlags.MuonCollectionName ) if BTaggingFlags.Runmodus == 'reference': SoftMuonTagTool.BTagJetEtamin = 2.5 SoftMuonTagNewLikelihood.smoothNTimes = 1 ToolSvc += SoftMuonTagTool if BTaggingFlags.OutputLevel < 3: print SoftMuonTagTool
calibrationTool = BTagCalibrationBrokerTool, smoothNTimes = 0, normalizedProb = True, interpolate = True ) ToolSvc += SoftMuonTagChi2NewLikelihood if BTaggingFlags.OutputLevel < 3: print SoftMuonTagChi2NewLikelihood from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag SoftMuonTagChi2Tool = Analysis__SoftMuonTag( name = "SoftMuonTagChi2", Runmodus = BTaggingFlags.Runmodus, OutputLevel = BTaggingFlags.OutputLevel, LikelihoodTool = SoftMuonTagChi2NewLikelihood, TrackToVertexTool = BTagTrackToVertexTool, MuonAssociationName="Muons", jetCollectionList = BTaggingFlags.Jets, originalMuCollectionName = BTaggingFlags.MuonCollectionName ) SoftMuonTagChi2Tool.TaggingAlgType = "CHI2" # this is what switches the chi2 tagger ON SoftMuonTagChi2Tool.RecAlgorithm = 0 # use only combined muons SoftMuonTagChi2Tool.writeInfoPlus = 1 # turn InfoPlus off because the L1D tagger takes care of it (albeit cuts on the chi2...) --> # Turn-on (for rel 17.2) SoftMuonTagChi2Tool.CutMatchChi2 = 10000 # no match-chi2 cut ToolSvc += SoftMuonTagChi2Tool if BTaggingFlags.OutputLevel < 3: print SoftMuonTagChi2Tool