def toolImprovedJetFitterRoutines(name, useBTagFlagsDefaults=True, **options):
    """Sets up a ImprovedJetFitterRoutines tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    BeFast                              default: False
    maxDRshift                          default: 0.0
    noPrimaryVertexRefit                default: False

    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,
            'BeFast': False,
            'maxDRshift': 0.0,
            'noPrimaryVertexRefit': False
        }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines
    return Trk__JetFitterRoutines(**options)
Exemplo n.º 2
0
def toolImprovedJetFitterRoutines(name, useBTagFlagsDefaults=True, **options):
    """Sets up a ImprovedJetFitterRoutines tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    BeFast                              default: False
    maxDRshift                          default: 0.0
    noPrimaryVertexRefit                default: False

    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:
        improvedJetFitterInitializationHelper = toolImprovedJetFitterInitializationHelper(
            'ImprovedJFInitHelper')
        trkDistanceFinderNeutralNeutral = toolTrkDistanceFinderNeutralNeutral(
            'TrkDistFinderNeutralNeutral')
        trkDistanceFinderNeutralCharged = toolTrkDistanceFinderNeutralCharged(
            'TrkDistFinderNeutralCharged')
        defaults = {
            'OutputLevel':
            BTaggingFlags.OutputLevel,
            'BeFast':
            False,
            'maxDRshift':
            0.0,
            'noPrimaryVertexRefit':
            False,
            'JetFitterInitializationHelper':
            improvedJetFitterInitializationHelper,
            'JetFitterMinimumDistanceFinder':
            trkDistanceFinderNeutralCharged,
            'JetFitterMinimumDistanceFinderNeutral':
            trkDistanceFinderNeutralNeutral,
        }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines
    return Trk__JetFitterRoutines(**options)
    if BTaggingFlags.OutputLevel < 3:
      print TrkDistanceFinderNeutralNeutral

    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralCharged
    TrkDistanceFinderNeutralCharged=Trk__TrkDistanceFinderNeutralCharged("TrkDistanceFinderNeutralCharged",
                                                                         OutputLevel=BTaggingFlags.OutputLevel)

    ToolSvc+=TrkDistanceFinderNeutralCharged
    if BTaggingFlags.OutputLevel < 3:
      print TrkDistanceFinderNeutralCharged

    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines
    NewJetFitterRoutines = Trk__JetFitterRoutines( name = "ImprovedJetFitterRoutines",
                                                   JetFitterInitializationHelper = NewJetFitterInitializationHelper,
                                                   BeFast = False,
                                                   maxDRshift = 0.,
                                                   noPrimaryVertexRefit = False,
                                                   JetFitterMinimumDistanceFinder=TrkDistanceFinderNeutralCharged,
                                                   JetFitterMinimumDistanceFinderNeutral=TrkDistanceFinderNeutralNeutral,
                                                   OutputLevel = BTaggingFlags.OutputLevel)
    ToolSvc += NewJetFitterRoutines
    if BTaggingFlags.OutputLevel < 3:
      print NewJetFitterRoutines

#LOAD JETFITTER VERTEX FINDER

    from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterUtils
    NewInDetJetFitterUtils = InDet__InDetJetFitterUtils(name = "InDetJetFitterUtils",
                                                        LinearizedTrackFactory = JetFitterLinFactory,
                                                        Extrapolator = JetFitterExtrapolator,
                                                        OutputLevel =BTaggingFlags.OutputLevel)
ToolSvc += JetFitterLinFactory
if BTaggingFlags.OutputLevel < 3:
  print JetFitterLinFactory

from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper
JetFitterInitializationHelper = Trk__JetFitterInitializationHelper( name = "JetFitterInitializationHelper",
                                                                    LinearizedTrackFactory = JetFitterLinFactory,
                                                                    OutputLevel = BTaggingFlags.OutputLevel)
ToolSvc += JetFitterInitializationHelper
if BTaggingFlags.OutputLevel < 3:
  print JetFitterInitializationHelper

from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines
jetFitterRoutines = Trk__JetFitterRoutines( name = "JetFitterRoutines",
                                            JetFitterInitializationHelper = JetFitterInitializationHelper,
                                            BeFast = False,
                                            maxDRshift = 0.,
                                            noPrimaryVertexRefit = False,
                                            OutputLevel = BTaggingFlags.OutputLevel)
ToolSvc += jetFitterRoutines
if BTaggingFlags.OutputLevel < 3:
  print jetFitterRoutines

from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterVxFinder
JetFitterVxFinder = InDet__InDetJetFitterVxFinder( name = "JetFitterVxFinder",
                                                   JetFitterRoutines = jetFitterRoutines,
                                                   OutputLevel = BTaggingFlags.OutputLevel,
                                                   MaxNumDeleteIterations = 30,
                                                   VertexProbCut = 0.01,
                                                   MaxClusteringIterations = 30,
                                                   VertexClusteringProbabilityCut = 0.01,
					           JetFitterInitializationHelper = JetFitterInitializationHelper,