ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
MuonID
MuonSelectorTools
python
MuonSelectorToolsConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3
#********************************************************************
4
# MuonsSelectionToolConfig.py
5
# Configures muon selection tool which is used to select muons
6
# for use in physics analysis
7
#********************************************************************
8
9
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
10
from
AthenaConfiguration.ComponentFactory
import
CompFactory
11
from
AthenaConfiguration.Enums
import
LHCPeriod
12
13
def
MuonLoosenedNonCalibratedSelectionToolCfg
(flags, name="MuonLoosenedNonCalibratedSelectionTool", **kwargs):
14
"""Configure the muon selection tool"""
15
kwargs.setdefault(
"DisablePtCuts"
,
True
)
16
kwargs.setdefault(
"TurnOffMomCorr"
,
True
)
17
return
MuonSelectionToolCfg
(flags, name, **kwargs)
18
19
20
#Pretty much copy of the above but without expert flags on disabling pt cuts and turning off momentum corrections. This is for use in physics analysis
21
def
MuonSelectionToolCfg
(flags, name="MuonSelectionTool", **kwargs):
22
"""Configure the muon selection tool"""
23
acc = ComponentAccumulator()
24
if
flags.Muon.scheduleActsReco:
25
acc.setPrivateTools(CompFactory.CP.MuonPhaseIISelectionTool(name))
26
return
acc
27
28
# Configure the Onnx tool FIRST
29
from
AthOnnxComps.OnnxRuntimeFlags
import
OnnxRuntimeType
30
from
AthOnnxComps.OnnxRuntimeInferenceConfig
import
OnnxRuntimeInferenceToolCfg
31
32
model_fname =
"MuonSelectorTools/TightNN_Experimental_18062025/model_DNN3norm_MC20ade.onnx"
33
if
flags.GeoModel.Run >= LHCPeriod.Run3:
34
model_fname =
"MuonSelectorTools/TightNN_Experimental_18062025/model_DNN3norm_MC23ad.onnx"
35
36
execution_provider = OnnxRuntimeType.CPU
37
# Set defaults AFTER ort_tool is available
38
kwargs.setdefault(
"IsRun3Geo"
, flags.GeoModel.Run >= LHCPeriod.Run3)
39
kwargs.setdefault(
"ORTInferenceTool"
,
40
acc.popToolsAndMerge(OnnxRuntimeInferenceToolCfg(flags, model_fname, execution_provider, name=f
"{name}_ORTInferenceTool"
)))
41
42
43
# Now construct the tool with all kwargs set
44
the_tool = CompFactory.CP.MuonSelectionTool(name, **kwargs)
45
acc.setPrivateTools(the_tool)
46
return
acc
47
python.MuonSelectorToolsConfig.MuonSelectionToolCfg
MuonSelectionToolCfg(flags, name="MuonSelectionTool", **kwargs)
Definition
MuonSelectorToolsConfig.py:21
python.MuonSelectorToolsConfig.MuonLoosenedNonCalibratedSelectionToolCfg
MuonLoosenedNonCalibratedSelectionToolCfg(flags, name="MuonLoosenedNonCalibratedSelectionTool", **kwargs)
Definition
MuonSelectorToolsConfig.py:13
Generated on
for ATLAS Offline Software by
1.17.0