21def DecoratePhotonPointingAlgCfg(flags, name="DecoratePhotonPointingAlg", **kwargs):
22 acc = ComponentAccumulator()
23
24 kwargs.setdefault("PhotonContainerKey", "Photons")
25
26 if "PhotonPointingTool" not in kwargs:
27 toolAcc = PhotonPointingToolCfg(flags, ContainerName=kwargs['PhotonContainerKey'])
28 tool = toolAcc.popPrivateTools()
29 acc.merge(toolAcc)
30 kwargs["PhotonPointingTool"] = tool
31 if "PhotonVertexSelectionTool" not in kwargs:
32 from TrkConfig.VertexFindingFlags import VertexSortingSetup
33 pvContainer = "PrimaryVertices_initial" if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting else "PrimaryVertices"
34 kwargs.setdefault("PhotonVertexSelectionTool", acc.popToolsAndMerge(PhotonVertexSelectionToolCfg(flags, VertexContainer=pvContainer)))
35
36 alg = CompFactory.DecoratePhotonPointingAlg("DecoratePhotonPointingAlg", **kwargs)
37 acc.addEventAlgo(alg)
38 return acc
39
40