ATLAS Offline Software
TauAnalysisToolsConfig.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 
6 def TauSelectionToolCfg(flags, name, **kwargs):
7  """Configure the tau selection tool"""
9  TauSelectionTool = CompFactory.TauAnalysisTools.TauSelectionTool
10  acc.setPrivateTools(TauSelectionTool(name, **kwargs))
11  return acc
12 
13 def TauTruthMatchingToolCfg(flags, name, **kwargs):
14  acc = ComponentAccumulator()
15  tool = CompFactory.TauAnalysisTools.TauTruthMatchingTool(name, **kwargs)
16  acc.setPrivateTools(tool)
17  return acc
18 
19 def TauHFVetoToolCfg(flags, name, **kwargs):
21  execution_provider = flags.AthOnnx.ExecutionProvider
22  pathToHFVetoModels = 'TauAnalysisTools/00-04-00/HFVeto'
23  model_fname_bveto1p = f'{pathToHFVetoModels}/bveto1p.onnx'
24  model_fname_bveto3p = f'{pathToHFVetoModels}/bveto3p.onnx'
25  model_fname_cveto1p = f'{pathToHFVetoModels}/cveto1p.onnx'
26  model_fname_cveto3p = f'{pathToHFVetoModels}/cveto3p.onnx'
27  from AthOnnxComps.OnnxRuntimeInferenceConfig import OnnxRuntimeInferenceToolCfg
28  kwargs.setdefault("bveto1p", acc.popToolsAndMerge(
29  OnnxRuntimeInferenceToolCfg(flags, model_fname_bveto1p, execution_provider, name="bveto1p")
30  ))
31  kwargs.setdefault("bveto3p", acc.popToolsAndMerge(
32  OnnxRuntimeInferenceToolCfg(flags, model_fname_bveto3p, execution_provider, name="bveto3p")
33  ))
34  kwargs.setdefault("cveto1p", acc.popToolsAndMerge(
35  OnnxRuntimeInferenceToolCfg(flags, model_fname_cveto1p, execution_provider, name="cveto1p")
36  ))
37  kwargs.setdefault("cveto3p", acc.popToolsAndMerge(
38  OnnxRuntimeInferenceToolCfg(flags, model_fname_cveto3p, execution_provider, name="cveto3p")
39  ))
40  tool = CompFactory.TauAnalysisTools.TauHFVetoTool(name, **kwargs)
41  acc.setPrivateTools(tool)
42  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TauAnalysisToolsConfig.TauTruthMatchingToolCfg
def TauTruthMatchingToolCfg(flags, name, **kwargs)
Definition: TauAnalysisToolsConfig.py:13
TauAnalysisToolsConfig.TauHFVetoToolCfg
def TauHFVetoToolCfg(flags, name, **kwargs)
Definition: TauAnalysisToolsConfig.py:19
TauAnalysisToolsConfig.TauSelectionToolCfg
def TauSelectionToolCfg(flags, name, **kwargs)
Definition: TauAnalysisToolsConfig.py:6
python.OnnxRuntimeInferenceConfig.OnnxRuntimeInferenceToolCfg
def OnnxRuntimeInferenceToolCfg(flags, str model_fname=None, Optional[OnnxRuntimeType] execution_provider=None, name="OnnxRuntimeInferenceTool", **kwargs)
Definition: OnnxRuntimeInferenceConfig.py:9