ATLAS Offline Software
Loading...
Searching...
No Matches
HIHoughVtxFinderConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
6
7def HoughVtxFinderToolCfg(flags, name="HoughVtxFinderTool", **kwargs):
8 """Configures HoughVtxFinderTool"""
9 acc = ComponentAccumulator()
10
11 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
12 acc.merge(BeamSpotCondAlgCfg(flags))
13 kwargs.setdefault("BeamSpotKey", "BeamSpotData")
14
15 acc.setPrivateTools(CompFactory.ActsTrk.HoughVtxFinderTool(name, **kwargs))
16 return acc
17
18def HIHoughVtxRecoCfg(flags, name="HIHoughVtxReco", **kwargs):
19 """Configures HIHoughVtxReco"""
20 acc = ComponentAccumulator()
21
22 if "HoughVtxFinderTool" not in kwargs:
23 houghVtxFinderTool = acc.popToolsAndMerge(HoughVtxFinderToolCfg(flags, name = "HoughVtxFinderTool"))
24 kwargs.setdefault("HoughVtxFinderTool", houghVtxFinderTool)
25
26 kwargs.setdefault("inputPixelSpacePoints", "PixelSpacePoints")
27 kwargs.setdefault("outputHoughVtx", "HoughVertices")
28
29 acc.addEventAlgo(CompFactory.HIHoughVtxReco(name, **kwargs))
30 return acc
31
33 """Configures Heavy Ion Global quantities """
34 acc = ComponentAccumulator()
35
36 acc.merge(HIHoughVtxRecoCfg(flags))
37 output = [ "xAOD::VertexContainer#HoughVertices", "xAOD::VertexAuxContainer#HoughVerticesAux."]
38
39 acc.merge(addToESD(flags, output))
40 acc.merge(addToAOD(flags, output))
41
42 return acc
43
44
45if __name__ == "__main__":
46 from AthenaConfiguration.AllConfigFlags import initConfigFlags
47 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
48 flags = initConfigFlags()
49
50 flags.Input.Files = defaultTestFiles.RAW_RUN3_DATA24_HI
51 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA24
52 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
53
54 flags.Exec.MaxEvents=20
55 flags.Concurrency.NumThreads=1
56
57 flags.Output.doWriteAOD = True
58 flags.Output.AODFileName = "myAOD.pool.root"
59 flags.Output.doWriteESD = True
60 flags.Output.ESDFileName = "myESD.pool.root"
61
62 # enable to pass flags from command line, e.g.:
63
64 flags.fillFromArgs()
65
66 flags.lock()
67
68 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
69 acc = MainServicesCfg(flags)
70 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
71 acc.merge(ByteStreamReadCfg(flags))
72
73 # get beamspot
74 from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoBeamSpotDecoratorAlgCfg
75 acc.merge(EventInfoBeamSpotDecoratorAlgCfg(flags))
76
77 # add standard track-based vertex, needs calorimeter first
78 from CaloRec.CaloRecoConfig import CaloRecoCfg
79 acc.merge(CaloRecoCfg(flags))
80 from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
81 acc.merge(InDetTrackRecoCfg(flags))
82
83 # need PixelSpacePoints first
84 from InDetConfig.InDetPrepRawDataFormationConfig import PixelClusterizationCfg, SCTClusterizationCfg
85 acc.merge(PixelClusterizationCfg(flags))
86 acc.merge(SCTClusterizationCfg(flags))
87 from InDetConfig.SiSpacePointFormationConfig import InDetSiTrackerSpacePointFinderCfg, IDInDetToXAODSpacePointConversionCfg
88 acc.merge(InDetSiTrackerSpacePointFinderCfg(flags))
89 acc.merge(IDInDetToXAODSpacePointConversionCfg(flags))
90
91 # main algorithm
92 acc.merge(HIHoughVtxFinderCfg(flags))
93
94 # output
95 from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
96 acc.merge(PoolWriteCfg(flags))
97
98 # debug
99 from AthenaCommon.Constants import DEBUG
100 acc.foreach_component("*Hough*").OutputLevel=DEBUG
101
102 acc.printConfig(withDetails=True, summariseProps=True)
103 flags.dump()
104
105 import sys
106 sys.exit(acc.run().isFailure())
HIHoughVtxRecoCfg(flags, name="HIHoughVtxReco", **kwargs)
HoughVtxFinderToolCfg(flags, name="HoughVtxFinderTool", **kwargs)