ATLAS Offline Software
ImprovedJetFitterRoutinesConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from BTagging.ImprovedJetFitterInitializationHelperConfig import ImprovedJetFitterInitializationHelperCfg
6 from BTagging.TrkDistanceFinderNeutralNeutralConfig import TrkDistanceFinderNeutralNeutralCfg
7 from BTagging.TrkDistanceFinderNeutralChargedConfig import TrkDistanceFinderNeutralChargedCfg
8 
9 def ImprovedJetFitterRoutinesCfg(flags, name, useBTagFlagsDefaults = True, **options):
10  """Sets up a ImprovedJetFitterRoutines tool and returns it.
11 
12  The following options have BTaggingFlags defaults:
13 
14  BeFast default: False
15  maxDRshift default: 0.0
16  noPrimaryVertexRefit default: False
17 
18  input: name: The name of the tool (should be unique).
19  useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
20  **options: Python dictionary with options for the tool.
21  output: The actual tool, which can then by added to ToolSvc via ToolSvc += output."""
22  acc = ComponentAccumulator()
23  if useBTagFlagsDefaults:
24  improvedJetFitterInitializationHelper = acc.popToolsAndMerge(ImprovedJetFitterInitializationHelperCfg(flags, 'ImprovedJFInitHelper'))
25  trkDistanceFinderNeutralNeutral = acc.popToolsAndMerge(TrkDistanceFinderNeutralNeutralCfg(flags, 'TrkDistFinderNeutralNeutral'))
26  trkDistanceFinderNeutralCharged = acc.popToolsAndMerge(TrkDistanceFinderNeutralChargedCfg(flags, 'TrkDistFinderNeutralCharged'))
27  #JFKalmanVertexOnJetAxisSmoother = acc.popToolsAndMerge(KalmanVertexOnJetAxisSmootherCfg(flags, 'JFKalmanVertexOnJetAxisSmoother')
28  defaults = {
29  'BeFast' : False,
30  'maxDRshift' : 0.0,
31  'noPrimaryVertexRefit' : False,
32  'JetFitterInitializationHelper' : improvedJetFitterInitializationHelper,
33  'JetFitterMinimumDistanceFinder' : trkDistanceFinderNeutralCharged,
34  'JetFitterMinimumDistanceFinderNeutral' : trkDistanceFinderNeutralNeutral,
35  #'KalmanVertexOnJetAxisSmoother' : JFKalmanVertexOnJetAxisSmoother,
36  }
37  for option in defaults:
38  options.setdefault(option, defaults[option])
39  options['name'] = name
40  acc.setPrivateTools(CompFactory.Trk.JetFitterRoutines(**options))
41 
42  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrkDistanceFinderNeutralNeutralConfig.TrkDistanceFinderNeutralNeutralCfg
def TrkDistanceFinderNeutralNeutralCfg(flags, name, **options)
Definition: TrkDistanceFinderNeutralNeutralConfig.py:6
python.TrkDistanceFinderNeutralChargedConfig.TrkDistanceFinderNeutralChargedCfg
def TrkDistanceFinderNeutralChargedCfg(flags, name, **options)
Definition: TrkDistanceFinderNeutralChargedConfig.py:6
python.ImprovedJetFitterRoutinesConfig.ImprovedJetFitterRoutinesCfg
def ImprovedJetFitterRoutinesCfg(flags, name, useBTagFlagsDefaults=True, **options)
Definition: ImprovedJetFitterRoutinesConfig.py:9
python.ImprovedJetFitterInitializationHelperConfig.ImprovedJetFitterInitializationHelperCfg
def ImprovedJetFitterInitializationHelperCfg(flags, name, useBTagFlagsDefaults=True, **options)
Definition: ImprovedJetFitterInitializationHelperConfig.py:6