ATLAS Offline Software
Loading...
Searching...
No Matches
TauAnalysisToolsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6def TauSelectionToolCfg(flags, name, **kwargs):
7 """Configure the tau selection tool"""
8 acc = ComponentAccumulator()
9 TauSelectionTool = CompFactory.TauAnalysisTools.TauSelectionTool
10 acc.setPrivateTools(TauSelectionTool(name, **kwargs))
11 return acc
12
13
14def TauTruthMatchingToolCfg(flags, name, **kwargs):
15 acc = ComponentAccumulator()
16 tool = CompFactory.TauAnalysisTools.TauTruthMatchingTool(name, **kwargs)
17 acc.setPrivateTools(tool)
18 return acc
19
20
21def BuildTruthTausCfg(flags, name, **kwargs):
22 """Configure the BuildTruthTaus tool"""
23 acc = ComponentAccumulator()
24 acc.setPrivateTools(CompFactory.TauAnalysisTools.BuildTruthTaus(name, **kwargs))
25 return acc
26
27
28def TauHFVetoToolCfg(flags, name, **kwargs):
29 acc=ComponentAccumulator()
30 execution_provider = flags.AthOnnx.ExecutionProvider
31 pathToHFVetoModels = 'TauAnalysisTools/00-04-00/HFVeto'
32 from AthOnnxComps.OnnxRuntimeInferenceConfig import OnnxRuntimeInferenceToolCfg
33 for model in ("bveto1p", "bveto3p", "cveto1p", "cveto3p"):
34 kwargs.setdefault(model, acc.popToolsAndMerge(
35 OnnxRuntimeInferenceToolCfg(flags, f'{pathToHFVetoModels}/{model}.onnx', execution_provider, name=model)
36 ))
37 tool = CompFactory.TauAnalysisTools.TauHFVetoTool(name, **kwargs)
38 acc.setPrivateTools(tool)
39 return acc
40
TauHFVetoToolCfg(flags, name, **kwargs)
TauSelectionToolCfg(flags, name, **kwargs)
TauTruthMatchingToolCfg(flags, name, **kwargs)
BuildTruthTausCfg(flags, name, **kwargs)