ATLAS Offline Software
Loading...
Searching...
No Matches
ResortVerticesConfig.py
Go to the documentation of this file.
1#!/usr/bin/env athena.py
2
3# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5from AthenaConfiguration.ComponentFactory import CompFactory
6
7
8def ResortVerticesCfg(flags,vxin,vxout,vxsortercfg,algname="ResortVx"):
9 cfg = ComponentAccumulator()
10 vxsorter = cfg.popToolsAndMerge(vxsortercfg)
11 resortvxalg = CompFactory.InDet.InDetPriVxResorter(
12 algname,
13 VerticesIn=vxin,
14 VerticesOut=vxout,
15 VertexCollectionSortingTool=vxsorter,
16 )
17 cfg.addEventAlgo(resortvxalg)
18 return cfg
19
20# Executable function, for testing
21def main():
22 from AthenaConfiguration.AllConfigFlags import initConfigFlags
23 flags = initConfigFlags()
24 flags.fillFromArgs()
25 flags.Exec.VerboseMessageComponents = ['ResortVx']
26 flags.lock()
27
28 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
29 cfg=MainServicesCfg(flags)
30 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
31 cfg.merge(PoolReadCfg(flags))
32
33 from TrkConfig.TrkVertexToolsConfig import JetRestrictedSumPt2VertexCollectionSortingToolCfg
34 vxsort_jettrks = JetRestrictedSumPt2VertexCollectionSortingToolCfg(flags)
35 cfg.merge(ResortVerticesCfg(flags,'PrimaryVertices','PrimaryVertices_resorted',vxsort_jettrks))
36
37 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
38 cfg.merge(
39 OutputStreamCfg(
40 flags,
41 streamName='xAOD',
42 ItemList=[
43 'xAOD::VertexContainer#PrimaryVertices',
44 'xAOD::VertexAuxContainer#PrimaryVerticesAux.',
45 'xAOD::VertexContainer#PrimaryVertices_resorted',
46 'xAOD::VertexAuxContainer#PrimaryVertices_resortedAux.',
47 ])
48 )
49
50 cfg.run()
51
52if __name__=='__main__':
53 main()
ResortVerticesCfg(flags, vxin, vxout, vxsortercfg, algname="ResortVx")