From 7eda07190b788547c0b49df1b6ee66cd0878a996 Mon Sep 17 00:00:00 2001 From: Emmanuel Le Guirriec <emmanuel.le.guirriec@cern.ch> Date: Fri, 20 Jan 2017 17:20:06 +0100 Subject: [PATCH] fix Flip taggers (BTagging-00-07-80) * Modify (mainly renew) NewJetFitterIP3DNegCollection configuration * Tagged as BTagging-00-07-80 --- ...iguration_NewJetFitterIP3DNegCollection.py | 257 ++++++++++++------ 1 file changed, 174 insertions(+), 83 deletions(-) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterIP3DNegCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterIP3DNegCollection.py index 54dc39cd2d5..9c8d64a9ec3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterIP3DNegCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterIP3DNegCollection.py @@ -2,58 +2,148 @@ # Configuration functions for NewJetFitterTag # Author: Wouter van den Wollenberg (2013-2014) -# Containing the modified JetFitter tools required for JetFitterCOMBNNIP3DNeg -# Depends heavily on NewJetFitterCollection +# Because there are some many different JetFitter tools floating around +# now, this file was created to contain them all. from BTagging.BTaggingFlags import BTaggingFlags -metaJetFitterTagCOMBNNIP3DNeg = { 'IsATagger' : True, - 'xAODBaseName' : 'JetFitterCombNNIP3DNeg', - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterTagNNFlip', - 'IP3DNegTag', - 'InDetVKalVxInJetTool', - 'BTagFullLinearizedTrackFactory', - 'BTagTrackToVertexIPEstimator', - 'JetFitterCOMBNNTool', - 'NeuralNetworkToHistoToolCOMBNN', - 'JetFitterNtupleWriterCOMBNN'], - 'PassByPointer' : { 'jetfitterClassifier' : 'JetFitterCOMBNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterCOMBNN'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterIP3DNegCollection' } +### +#### VD: I deleted the extrapolator since one is enough -def toolJetFitterTagCOMBNNIP3DNeg(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagCOMBNNIP3D tool and returns it. +### +#### VD: I deleted the track selector since one is enough + +### +#### VD: I deleted the Linearised trackfactory since one is enough + +### +#### VD: I deleted the Mode3dto1 since one is enough + +### +#### VD: I deleted the SequentialVertexSmoother since one is enough + +### +#### VD: I deleted the InternalEdmFactory since one is enough + +### +#### VD: I deleted the SequentialVertexFitter since one is enough + +### +#### VD: I deleted the InitialisationHelper since one is enough + +### +#### VD: I deleted the TrkDistanceFinderNeutralNutral since one is enough + +### +#### VD: I deleted the TrkDistanceFinderNeutralCharged since one is enough + +### +#### VD: I deleted the ImprovedFitterRoutine since one is enough + +### +#### VD: I deleted the InDetJetFitterUtils since one is enough + +#-------------------------------------------------------------------------- +metaNewJetFitterVxFinderFlip = { 'IsAVertexFinder' : True, + 'VertexFinderxAODBaseName' : 'JetFitterFlip', + #'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JFVarFactoryFlip' }, + 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, + 'DependsOn' : ['BTagTrackToVertexTool', + 'InDetJetFitterUtils', + 'ImprovedJetFitterRoutines', + 'TrkDistanceFinderNeutralCharged', + 'TrkDistanceFinderNeutralNeutral', + 'ImprovedJetFitterInitializationHelper', + 'JetFitterSequentialVertexFitter', + 'JetFitterSequentialVertexSmoother', + 'JetFitterMode3dTo1dFinder', + 'InDetImprovedJetFitterTrackSelectorTool', + 'JetFitterExtrapolator', + 'JetFitterFullLinearizedTrackFactory', + #'JFVarFactoryFlip', + 'JetFitterVariablesFactory', + 'VxInternalEdmFactory'], + 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', + 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', + 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', + 'InDetJetFitterUtils' : 'InDetJetFitterUtils', + 'Extrapolator' : 'JetFitterExtrapolator', + 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', + 'JetFitterRoutines' : 'ImprovedJetFitterRoutines', + 'VertexEdmFactory' : 'VxInternalEdmFactory' }, + 'ToolCollection' : 'JetFitterIP3DNegCollection' } + +def toolNewJetFitterVxFinderFlip(name, useBTagFlagsDefaults = True, **options): + """Sets up a NewJetFitterVxFinder tool with Flip enabled!! and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "JetFitter" - useForcedCalibration default: False - ipinfoTaggerName default: "IP3DNeg" + VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName + MaxNumDeleteIterations default: 30 + VertexProbCut default: 0.001 + MaxClusteringIterations default: 30 + VertexClusteringProbabilityCut default: 0.005 + revertFromPositiveToNegativeTags default: True 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, - 'SecVxFinderName' : 'JetFitter', - 'useForcedCalibration' : False, - 'ipinfoTaggerName' : 'IP3DNeg', - } + if not 'InDetKeys' in dir(): + from InDetRecExample.InDetKeys import InDetKeys + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, + 'MaxNumDeleteIterations' : 30, + 'VertexProbCut' : 0.001, + 'MaxClusteringIterations' : 30, + 'VertexClusteringProbabilityCut' : 0.005, + 'revertFromPositiveToNegativeTags' : True } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) + from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder + return InDet__InDetImprovedJetFitterVxFinder(**options) -#------------------------------------------------------------------------------------ + +#-------------------------------------------------------------------------- +#metaJFVarFactoryFlip = { 'ToolCollection' : 'JetFitterIP3DNegCollection' } + +#def toolJFVarFactoryFlip(name, useBTagFlagsDefaults = True, **options): +# """Sets up a NewJetFitterVariablesFactory tool and returns it. +# +# The following options have BTaggingFlags defaults: +# +# OutputLevel default: BTaggingFlags.OutputLevel +# JetFitterInstance default: "JetFitterTag" +# secVxFinderName default: "JetFitterVxFinder" +# +# 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, +# 'JetFitterInstance' : 'JetFitterTagFlip', +# 'secVxFinderName' : 'JetFitterFlip', +# 'revertFromPositiveToNegativeTags' : True } +# for option in defaults: +# options.setdefault(option, defaults[option]) +# options['name'] = name +# from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory +# return Analysis__JetFitterVariablesFactory(**options) + + +### +#### VD: I deleted the NtupleWriter since one is enough + +### +#### VD: I deleted the NNtoHistoTool since one is enough + +### +#### VD: I deleted the NNTool since one is enough + +#------------------------------------------------------------------------- metaJetFitterTagNNFlip = { 'IsATagger' : True, 'xAODBaseName' : 'JetFitterFlip', @@ -69,14 +159,14 @@ metaJetFitterTagNNFlip = { 'IsATagger' : True, 'ToolCollection' : 'JetFitterIP3DNegCollection' } def toolJetFitterTagNNFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagNNFlip tool and returns it. + """Sets up a JetFitterTagNN tool and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel Runmodus default: BTaggingFlags.Runmodus jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "JetFitterFlip" + SecVxFinderName default: "JetFitter" useForcedCalibration default: False ipinfoTaggerName default: "" @@ -98,65 +188,66 @@ def toolJetFitterTagNNFlip(name, useBTagFlagsDefaults = True, **options): from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag return Analysis__JetFitterTag(**options) -#------------------------------------------------------------------------------------ +#------------------------------------------------------------------------- -metaNewJetFitterVxFinderFlip = { 'IsAVertexFinder' : True, - 'VertexFinderxAODBaseName' : 'JetFitterFlip', - 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'JetFitterVariablesFactory' }, - 'DependsOn' : ['BTagTrackToVertexTool', - 'InDetJetFitterUtils', - 'ImprovedJetFitterRoutines', - 'TrkDistanceFinderNeutralCharged', - 'TrkDistanceFinderNeutralNeutral', - 'ImprovedJetFitterInitializationHelper', - 'JetFitterSequentialVertexFitter', - 'JetFitterSequentialVertexSmoother', - 'JetFitterMode3dTo1dFinder', - 'InDetImprovedJetFitterTrackSelectorTool', - 'JetFitterExtrapolator', - 'JetFitterFullLinearizedTrackFactory', - 'JetFitterVariablesFactory', - 'VxInternalEdmFactory'], - 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', - 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', - 'InDetJetFitterUtils' : 'InDetJetFitterUtils', - 'Extrapolator' : 'JetFitterExtrapolator', - 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', - 'JetFitterRoutines' : 'ImprovedJetFitterRoutines', - 'VertexEdmFactory' : 'VxInternalEdmFactory' }, - 'ToolCollection' : 'JetFitterIP3DNewCollection' } +### +#### VD: I deleted the JFNtupleWriterCOMBNN since one is enough -def toolNewJetFitterVxFinderFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinderFlip tool and returns it. +### +#### VD: I deleted the NNtoHistoCOMBNN since one is enough + +### +#### VD: I deleted the JetFitterCombNNTool since it's not used + +#----------------------------------------------------------------------------- + +metaJetFitterTagCOMBNNIP3DNeg = { 'IsATagger' : True, + 'xAODBaseName' : 'TagCOMBNNIP3DNeg', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagTrackToVertexTool', + 'JetFitterTagNNFlip', + 'IP3DNegTag', + 'InDetVKalVxInJetTool', + 'BTagFullLinearizedTrackFactory', + 'BTagTrackToVertexIPEstimator', + 'JetFitterCOMBNNTool', + 'NeuralNetworkToHistoToolCOMBNN', + 'JetFitterNtupleWriterCOMBNN'], + 'PassByPointer' : { 'jetfitterClassifier' : 'JetFitterCOMBNNTool', + 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterCOMBNN'}, + 'JetCollectionList' : 'jetCollectionList', + 'ToolCollection' : 'JetFitterIP3DNegCollection' } + +def toolJetFitterTagCOMBNNIP3DNeg(name, useBTagFlagsDefaults = True, **options): + """Sets up a JetFitterTagCOMBNN tool and returns it. The following options have BTaggingFlags defaults: OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: BTaggingFlags.PrimaryVertexCollectionName - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - revertFromPositiveToNegativeTags default: True + Runmodus default: BTaggingFlags.Runmodus + jetCollectionList default: BTaggingFlags.Jets + SecVxFinderName default: "JetFitter" + useForcedCalibration default: False + ipinfoTaggerName default: "IP3D" 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: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : BTaggingFlags.PrimaryVertexCollectionName, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005, - 'revertFromPositiveToNegativeTags' : True } + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'jetCollectionList' : BTaggingFlags.Jets, + 'SecVxFinderName' : 'JetFitterFlip', + 'useForcedCalibration' : False, + 'ipinfoTaggerName' : 'IP3DNeg', + } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) + from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag + return Analysis__JetFitterTag(**options) + +### +#### VD: I deleted the JetFitterTagCOMBNN since it's not used -- GitLab