3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 name: str =
"InDetPriVxFinder",
9 **kwargs) -> ComponentAccumulator:
12 if "VertexCollectionSortingTool" not in kwargs:
13 from TrkConfig.TrkVertexToolsConfig
import (
14 VertexCollectionSortingToolCfg)
15 kwargs.setdefault(
"VertexCollectionSortingTool", acc.popToolsAndMerge(
18 if "VertexFinderTool" not in kwargs:
19 from InDetConfig.InDetPriVxFinderToolConfig
import (
21 kwargs.setdefault(
"VertexFinderTool", acc.popToolsAndMerge(
24 kwargs.setdefault(
"doVertexSorting",
True)
26 if flags.Tracking.perigeeExpression ==
"Vertex":
27 from xAODTrackingCnv.xAODTrackingCnvConfig
import (
28 BeamLineTrackParticleCnvAlgCfg)
29 from InDetConfig.TrackRecoConfig
import (
30 ClusterSplitProbabilityContainerName)
33 ClusterSplitProbabilityName = \
35 AssociationMapName =
"PRDtoTrackMapMerge_CombinedInDetTracks",
36 xAODTrackParticlesFromTracksContainerName = \
37 "InDetTrackParticlesTemporary"))
38 kwargs[
"TracksName"]=
"InDetTrackParticlesTemporary"
40 acc.addEventAlgo(CompFactory.InDet.InDetPriVxFinder(name, **kwargs))
46 name: str =
"InDetTrigPriVxFinder",
47 **kwargs) -> ComponentAccumulator:
51 kwargs[
"TracksName"] = inputTracks
52 kwargs[
"VxCandidatesOutputName"] = outputVtx
54 if "VertexFinderTool" not in kwargs:
55 from InDetConfig.InDetPriVxFinderToolConfig
import (
56 TrigVertexFinderToolCfg)
57 kwargs.setdefault(
"VertexFinderTool", acc.popToolsAndMerge(
60 if "VertexCollectionSortingTool" not in kwargs:
61 from TrkConfig.TrkVertexToolsConfig
import (
62 SumPt2VertexCollectionSortingToolCfg)
63 kwargs.setdefault(
"VertexCollectionSortingTool", acc.popToolsAndMerge(
66 if "PriVxMonTool" not in kwargs:
67 from InDetPriVxFinder.InDetPriVxFinderMonitoring
import (
68 InDetPriVxFinderMonitoringTool)
71 kwargs.setdefault(
"doVertexSorting",
True)
73 acc.addEventAlgo(CompFactory.InDet.InDetPriVxFinder(name+flags.Tracking.ActiveConfig.input_name,
79 name: str =
"InDetPriVxFinder",
80 vxCandidatesOutputName: str =
"PrimaryVertices",
81 **kwargs) -> ComponentAccumulator:
85 VxCandidatesOutputName=vxCandidatesOutputName,
88 if flags.Tracking.perigeeExpression ==
"Vertex":
89 from xAODTrackingCnv.xAODTrackingCnvConfig
import TrackParticleCnvAlgCfg
90 from InDetConfig.TrackRecoConfig
import (
91 ClusterSplitProbabilityContainerName)
96 AssociationMapName=
"PRDtoTrackMapMerge_CombinedInDetTracks"))
98 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD, addToAOD
100 excludedVtxAuxData =
"-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV.-TruthEventMatchingInfos.-TruthEventRawMatchingInfos.-VertexMatchType"
101 verticesContainer = [
102 f
"xAOD::VertexContainer#{vxCandidatesOutputName}",
103 f
"xAOD::VertexAuxContainer#{vxCandidatesOutputName}Aux." + excludedVtxAuxData,
106 acc.merge(
addToAOD(flags, verticesContainer))
107 acc.merge(
addToESD(flags, verticesContainer))
111 if __name__ ==
"__main__":
112 from AthenaCommon.Logging
import logging
113 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
116 from AthenaConfiguration.TestDefaults
import defaultTestFiles
117 from AthenaConfiguration.ComponentAccumulator
import printProperties
118 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
119 from TrkConfig.VertexFindingFlags
import VertexSetup
121 flags.Input.Files = defaultTestFiles.RDO_RUN2
123 if 'ActsGaussAdaptiveMultiFinding' in sys.argv:
124 flags.Tracking.PriVertex.setup = VertexSetup.ActsGaussAMVF
125 elif "IterativeFinding" in sys.argv:
126 flags.Tracking.PriVertex.setup = VertexSetup.IVF
127 elif "FastIterativeFinding" in sys.argv:
128 flags.Tracking.PriVertex.setup = VertexSetup.FastIVF
134 mlog = logging.getLogger(
"primaryVertexFindingConfigTest")
135 mlog.info(
"Configuring primaryVertexFinding: ")
139 acc.getEventAlgo(
"InDetPriVxFinder"),