Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
InnerDetector/InDetConfig/python/ActsPriVxFinderConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
8  name: str = "ActsPriVxFinder",
9  **kwargs) -> ComponentAccumulator:
10  acc = ComponentAccumulator()
11 
12  if "VertexCollectionSortingTool" not in kwargs:
13  from TrkConfig.TrkVertexToolsConfig import (
14  VertexCollectionSortingToolCfg)
15  kwargs.setdefault("VertexCollectionSortingTool", acc.popToolsAndMerge(
17 
18  if "VertexFinderTool" not in kwargs:
19  from InDetConfig.InDetPriVxFinderToolConfig import (
20  VertexFinderToolCfg)
21  kwargs.setdefault("VertexFinderTool", acc.popToolsAndMerge(
22  VertexFinderToolCfg(flags)))
23 
24  kwargs.setdefault("doVertexSorting", True)
25  acc.addEventAlgo(CompFactory.InDet.InDetPriVxFinder(name, **kwargs))
26  return acc
27 
28 
30  name: str = "InDetPriVxFinder",
31  *,
32  TracksName: str,
33  vxCandidatesOutputName: str = None,
34  **kwargs) -> ComponentAccumulator:
35  # Handle vertex collection name
36  if not vxCandidatesOutputName:
37  vxCandidatesOutputName = "PrimaryVertices"
38  from AthenaConfiguration.Enums import ProductionStep
39  if flags.Common.ProductionStep in [ProductionStep.MinbiasPreprocessing]:
40  vxCandidatesOutputName = f"{flags.Overlay.BkgPrefix}{vxCandidatesOutputName}"
41 
42  # Compute the primary vertex on the track particle collection
43  # Creation of track particles is handled externally
44  acc = ActsPriVxFinderCfg(flags,
45  name = name,
46  VxCandidatesOutputName = vxCandidatesOutputName,
47  TracksName = TracksName,
48  **kwargs)
49 
50  # Persistification to both AOD and ESD
51  from OutputStreamAthenaPool.OutputStreamConfig import addToESD, addToAOD
52 
53  excludedVtxAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV.-TruthEventMatchingInfos.-TruthEventRawMatchingInfos.-VertexMatchType"
54  verticesContainer = [
55  f"xAOD::VertexContainer#{vxCandidatesOutputName}",
56  f"xAOD::VertexAuxContainer#{vxCandidatesOutputName}Aux." + excludedVtxAuxData,
57  ]
58 
59  acc.merge(addToAOD(flags, verticesContainer))
60  acc.merge(addToESD(flags, verticesContainer))
61  return acc
62 
python.ActsPriVxFinderConfig.primaryVertexFindingCfg
ComponentAccumulator primaryVertexFindingCfg(flags, str name="InDetPriVxFinder", *str TracksName, str vxCandidatesOutputName=None, **kwargs)
Definition: InnerDetector/InDetConfig/python/ActsPriVxFinderConfig.py:29
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ActsPriVxFinderConfig.ActsPriVxFinderCfg
ComponentAccumulator ActsPriVxFinderCfg(flags, str name="ActsPriVxFinder", **kwargs)
Definition: InnerDetector/InDetConfig/python/ActsPriVxFinderConfig.py:7
python.TrkVertexToolsConfig.VertexCollectionSortingToolCfg
def VertexCollectionSortingToolCfg(flags, **kwargs)
Definition: TrkVertexToolsConfig.py:67
python.InDetPriVxFinderToolConfig.VertexFinderToolCfg
def VertexFinderToolCfg(flags, **kwargs)
Definition: InDetPriVxFinderToolConfig.py:120
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:134
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:149