ATLAS Offline Software
TrkVertexToolsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 # Configuration of TrkVertexTools package
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from TrkConfig.VertexFindingFlags import VertexSortingSetup
6 
7 def SumPt2VertexCollectionSortingToolCfg(flags, name="SumPt2VertexCollectionSortingTool", **kwargs):
9 
10  if "VertexWeightCalculator" not in kwargs:
11  from TrkConfig.TrkVertexWeightCalculatorsConfig import (
12  SumPt2VertexWeightCalculatorCfg)
13  kwargs.setdefault("VertexWeightCalculator", acc.popToolsAndMerge(
15 
16  kwargs.setdefault("decorationName", "sumPt2")
17 
18  acc.setPrivateTools(
19  CompFactory.Trk.VertexCollectionSortingTool(name,**kwargs))
20  return acc
21 
22 def SumPtVertexCollectionSortingToolCfg(flags, name="SumPtVertexCollectionSortingTool", **kwargs):
23  acc = ComponentAccumulator()
24 
25  if "VertexWeightCalculator" not in kwargs:
26  from TrkConfig.TrkVertexWeightCalculatorsConfig import (
27  SumPtVertexWeightCalculatorCfg)
28  kwargs.setdefault("VertexWeightCalculator", acc.popToolsAndMerge(
30 
31  kwargs.setdefault("decorationName", "sumPt")
32 
33  acc.setPrivateTools(
34  CompFactory.Trk.VertexCollectionSortingTool(name,**kwargs))
35  return acc
36 
37 
38 def JetRestrictedSumPt2VertexCollectionSortingToolCfg(flags, name="JetRestrictedSumPt2VertexCollectionSortingTool", **kwargs):
39  acc = ComponentAccumulator()
40 
41  if "VertexWeightCalculator" not in kwargs:
42  from TrkConfig.TrkVertexWeightCalculatorsConfig import (
43  JetRestrictedSumPt2VertexWeightCalculatorCfg)
44  kwargs.setdefault("VertexWeightCalculator", acc.popToolsAndMerge(
46 
47  kwargs.setdefault("decorationName", "sumPt2")
48 
49  acc.setPrivateTools(
50  CompFactory.Trk.VertexCollectionSortingTool(name,**kwargs))
51  return acc
52 
53 def GNNVertexCollectionSortingToolCfg(flags, name="GNNVertexCollectionSortingTool", **kwargs):
54  acc = ComponentAccumulator()
55 
56  if "VertexWeightCalculator" not in kwargs:
57  from TrkConfig.TrkVertexWeightCalculatorsConfig import GNNVertexWeightCalculatorCfg
58  kwargs.setdefault("VertexWeightCalculator", acc.popToolsAndMerge(
60 
61  kwargs.setdefault("decorationName", "gnnScore")
62 
63  acc.setPrivateTools(
64  CompFactory.Trk.VertexCollectionSortingTool(name,**kwargs))
65  return acc
66 
67 def VertexCollectionSortingToolCfg(flags, **kwargs):
68  if flags.Tracking.PriVertex.sortingSetup == \
69  VertexSortingSetup.SumPt2Sorting:
70  return SumPt2VertexCollectionSortingToolCfg(flags, **kwargs)
71  elif flags.Tracking.PriVertex.sortingSetup == \
72  VertexSortingSetup.SumPtSorting:
73  return SumPtVertexCollectionSortingToolCfg(flags, **kwargs)
74  elif flags.Tracking.PriVertex.sortingSetup == \
75  VertexSortingSetup.JetWeightedSumPt2Sorting:
77 
78 
79 def SecVertexMergingToolCfg(flags, name='SecVertexMergingTool', **kwargs):
80 
81  acc = ComponentAccumulator()
82 
83  if "VertexFitterTool" not in kwargs:
84  from TrkConfig.TrkVertexFittersConfig import AdaptiveVertexFitterCfg
85  kwargs.setdefault("VertexFitterTool", acc.popToolsAndMerge(AdaptiveVertexFitterCfg(flags)))
86 
87  kwargs.setdefault("MininumDistance", 5.0)
88  kwargs.setdefault("CompatibilityDimension", 2)
89 
90 
91  acc.setPrivateTools(CompFactory.Trk.SecVertexMergingTool(name,**kwargs))
92  return acc
python.TrkVertexToolsConfig.SumPt2VertexCollectionSortingToolCfg
def SumPt2VertexCollectionSortingToolCfg(flags, name="SumPt2VertexCollectionSortingTool", **kwargs)
Definition: TrkVertexToolsConfig.py:7
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrkVertexFittersConfig.AdaptiveVertexFitterCfg
def AdaptiveVertexFitterCfg(flags, name="AdaptiveVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:76
python.TrkVertexToolsConfig.SumPtVertexCollectionSortingToolCfg
def SumPtVertexCollectionSortingToolCfg(flags, name="SumPtVertexCollectionSortingTool", **kwargs)
Definition: TrkVertexToolsConfig.py:22
python.TrkVertexWeightCalculatorsConfig.SumPt2VertexWeightCalculatorCfg
def SumPt2VertexWeightCalculatorCfg(flags, name="SumPt2VertexWeightCalculator", **kwargs)
Definition: TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:7
python.TrkVertexToolsConfig.VertexCollectionSortingToolCfg
def VertexCollectionSortingToolCfg(flags, **kwargs)
Definition: TrkVertexToolsConfig.py:67
python.TrkVertexToolsConfig.GNNVertexCollectionSortingToolCfg
def GNNVertexCollectionSortingToolCfg(flags, name="GNNVertexCollectionSortingTool", **kwargs)
Definition: TrkVertexToolsConfig.py:53
python.TrkVertexWeightCalculatorsConfig.SumPtVertexWeightCalculatorCfg
def SumPtVertexWeightCalculatorCfg(flags, name="SumPtVertexWeightCalculator", **kwargs)
Definition: TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:16
python.TrkVertexToolsConfig.SecVertexMergingToolCfg
def SecVertexMergingToolCfg(flags, name='SecVertexMergingTool', **kwargs)
Definition: TrkVertexToolsConfig.py:79
python.TrkVertexToolsConfig.JetRestrictedSumPt2VertexCollectionSortingToolCfg
def JetRestrictedSumPt2VertexCollectionSortingToolCfg(flags, name="JetRestrictedSumPt2VertexCollectionSortingTool", **kwargs)
Definition: TrkVertexToolsConfig.py:38
python.TrkVertexWeightCalculatorsConfig.GNNVertexWeightCalculatorCfg
def GNNVertexWeightCalculatorCfg(flags, name="GNNVertexWeightCalculator", **kwargs)
Definition: TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:25
python.TrkVertexWeightCalculatorsConfig.JetRestrictedSumPt2VertexWeightCalculatorCfg
def JetRestrictedSumPt2VertexWeightCalculatorCfg(flags, name="JetRestrictedSumPt2VertexWeightCalculator", TrackParticleLocation="InDetTrackParticles", **kwargs)
Definition: TrkConfig/python/TrkVertexWeightCalculatorsConfig.py:84