Exemple #1
0
def toolImprovedJetFitterInitializationHelper(name,
                                              useBTagFlagsDefaults=True,
                                              **options):
    """Sets up a ImprovedJetFitterInitializationHelper tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel

    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:
        jetFitterFullLinearizedTrackFactory = toolJetFitterFullLinearizedTrackFactory(
            'JFFullLinearizedTrackFactory')
        defaults = {
            'OutputLevel': BTaggingFlags.OutputLevel,
            'LinearizedTrackFactory': jetFitterFullLinearizedTrackFactory
        }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper
    return Trk__JetFitterInitializationHelper(**options)
  from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter
  sequentialVtxFitter = Trk__SequentialVertexFitter(name = "JetFitterSequentialVertexFitter",
                                                    VertexSmoother= vertexsmoother,
                                                    LinearizedTrackFactory=JetFitterLinFactory)

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


  #LOAD JETFITTER TOOLS

  from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper
  NewJetFitterInitializationHelper = Trk__JetFitterInitializationHelper( name = "ImprovedJetFitterInitializationHelper",
                                                                         LinearizedTrackFactory = JetFitterLinFactory,
                                                                         OutputLevel = BTaggingFlags.OutputLevel)
  #                                                                    errphiJetAxis = 0.15,
  #                                                                    erretaJetAxis = 0.15)

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

    from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralNeutral
    TrkDistanceFinderNeutralNeutral=Trk__TrkDistanceFinderNeutralNeutral("TrkDistanceFinderNeutralNeutral",
                                                                     OutputLevel=BTaggingFlags.OutputLevel)

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