ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkConfig
python
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
# Configuration of TrkVertexWeightCalculators package
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
7
def
SumPt2VertexWeightCalculatorCfg
(flags, name="SumPt2VertexWeightCalculator",
8
**kwargs):
9
acc = ComponentAccumulator()
10
kwargs.setdefault(
"DoSumPt2Selection"
,
True
)
11
acc.setPrivateTools(
12
CompFactory.Trk.SumPtVertexWeightCalculator(name, **kwargs))
13
return
acc
14
15
16
def
SumPtVertexWeightCalculatorCfg
(flags, name="SumPtVertexWeightCalculator",
17
**kwargs):
18
acc = ComponentAccumulator()
19
kwargs.setdefault(
"DoSumPt2Selection"
,
False
)
20
acc.setPrivateTools(
21
CompFactory.Trk.SumPtVertexWeightCalculator(name, **kwargs))
22
return
acc
23
24
25
def
GNNVertexWeightCalculatorCfg
(flags, name="GNNVertexWeightCalculator",
26
**kwargs):
27
acc = ComponentAccumulator()
28
acc.setPrivateTools(
29
CompFactory.GNNVertexWeightCalculator(name, **kwargs))
30
return
acc
31
32
def
BDTVertexWeightCalculatorCfg
(flags, **kwargs):
33
"""
34
Configure the BDTVertexWeightCalculator. Note: this tool needs to be run after the
35
DecoratePhotonPointingAlg and BuildVertexPointingAlg.
36
Use BDTVertexWeightCalculatorSeqCfg to have the full sequence.
37
"""
38
acc = ComponentAccumulator()
39
kwargs.setdefault(
40
"BDTFile"
,
"PhotonVertexSelection/BDT/2023-02-28/global_ggHW_phcount_BDT.root"
41
)
42
kwargs.setdefault(
"BDTName"
,
"lgbm"
)
43
kwargs.setdefault(
"PointingVertexContainerKey"
,
"PhotonPointingVertices"
)
44
tool = CompFactory.BDTVertexWeightCalculator(
45
"BDTVertexWeightCalculator"
, **kwargs
46
)
47
acc.setPrivateTools(tool)
48
return
acc
49
50
51
def
BDTVertexWeightCalculatorSeqCfg
(flags, container='Photons', **kwargs):
52
"""
53
Configure BDTVertexWeightCalculator and the algorithms that are needed to run before.
54
Optional parameters are passed only to the tool.
55
"""
56
acc = ComponentAccumulator()
57
58
from
PhotonVertexSelection.PhotonVertexSelectionConfig
import
(
59
DecoratePhotonPointingAlgCfg,
60
BuildVertexPointingAlgCfg,
61
)
62
63
# this algorithm decorates the photons with the pointing information
64
acc.merge(DecoratePhotonPointingAlgCfg(flags,
"DecoratePhotonPointingAlg"
, PhotonContainerKey=container))
65
66
# this algorithm creates the vertex from photon pointing
67
acc.merge(
68
BuildVertexPointingAlgCfg(
69
flags,
70
"BuildVertexPointingAlg"
,
71
PhotonContainerKey=container,
72
PointingVertexContainerKey=kwargs.get(
73
"PointingVertexContainerKey"
,
"PhotonPointingVertices"
74
),
75
)
76
)
77
78
accTool =
BDTVertexWeightCalculatorCfg
(flags, **kwargs)
79
tool = acc.popToolsAndMerge(accTool)
80
acc.setPrivateTools(tool)
81
return
acc
82
83
84
def
JetRestrictedSumPt2VertexWeightCalculatorCfg
(
85
flags,
86
name="JetRestrictedSumPt2VertexWeightCalculator",
87
TrackParticleLocation="InDetTrackParticles",
88
**kwargs):
89
acc = ComponentAccumulator()
90
kwargs.setdefault(
"DoSumPt2Selection"
,
True
)
91
kwargs.setdefault(
"JetContainer"
,
"AntiKt4EMTopoJets"
)
92
acc.setPrivateTools(
93
CompFactory.Trk.JetRestrictedSumPtVertexWeightCalculator(
94
name,
95
TracksInConeTool=CompFactory.xAOD.TrackParticlesInConeTool(
96
'JetVertexTracksInCone'
,
97
TrackParticleLocation=TrackParticleLocation
98
),
99
**kwargs,
100
))
101
return
acc
python.TrkVertexWeightCalculatorsConfig.SumPtVertexWeightCalculatorCfg
SumPtVertexWeightCalculatorCfg(flags, name="SumPtVertexWeightCalculator", **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:17
python.TrkVertexWeightCalculatorsConfig.SumPt2VertexWeightCalculatorCfg
SumPt2VertexWeightCalculatorCfg(flags, name="SumPt2VertexWeightCalculator", **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:8
python.TrkVertexWeightCalculatorsConfig.GNNVertexWeightCalculatorCfg
GNNVertexWeightCalculatorCfg(flags, name="GNNVertexWeightCalculator", **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:26
python.TrkVertexWeightCalculatorsConfig.BDTVertexWeightCalculatorCfg
BDTVertexWeightCalculatorCfg(flags, **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:32
python.TrkVertexWeightCalculatorsConfig.BDTVertexWeightCalculatorSeqCfg
BDTVertexWeightCalculatorSeqCfg(flags, container='Photons', **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:51
python.TrkVertexWeightCalculatorsConfig.JetRestrictedSumPt2VertexWeightCalculatorCfg
JetRestrictedSumPt2VertexWeightCalculatorCfg(flags, name="JetRestrictedSumPt2VertexWeightCalculator", TrackParticleLocation="InDetTrackParticles", **kwargs)
Definition
TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:88
Generated on
for ATLAS Offline Software by
1.17.0