ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_VertexReco.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#==============================================================
4# Job options file for the AFP_VertexReco package
5#==============================================================
6
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.ComponentFactory import CompFactory
9from IOVDbSvc.IOVDbSvcConfig import addFolders
10from TrigEDMConfig.TriggerEDM import recordable
11
12# Prepare Vertex reconstruction algorithm tools
13def AFP_VertexReco_Cfg(flags, kwargs={}):
14
15 acc = ComponentAccumulator()
16
17 if flags.Input.isMC:
18 acc.merge(addFolders(flags, "/FWD/AFP/ToFParameters/Vertex<tag>AFPMCToFVtx-ideal-01</tag>", 'FWD_OFL', className='CondAttrListCollection', db='OFLP200'))
19 tofVtxParamTool = CompFactory.getComp("AFP::ToFVtxParamDBTool")("ToFVtxParamDBTool", vtx_param_key="/FWD/AFP/ToFParameters/Vertex")
20 else:
21 acc.merge(addFolders(flags, "/FWD/Onl/AFP/ToFParameters/Vertex<tag>AFPToFVtx-01</tag>", 'FWD_ONL', className='CondAttrListCollection', db='CONDBR2'))
22 tofVtxParamTool = CompFactory.getComp("AFP::ToFVtxParamDBTool")("ToFVtxParamDBTool", vtx_param_key="/FWD/Onl/AFP/ToFParameters/Vertex")
23
24 afpVertexRecoTool = CompFactory.AFP_VertexRecoBasic("AFP_VertexRecoBasic", TrackDistance=0.5, tofVtxParamDBTool=tofVtxParamTool, **kwargs)
25
26 verticesToolsList=[afpVertexRecoTool]
27
28 # collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_VertexRecoTool::initialize() will complain
29 outputVertexList=[]
30 for vertexTool in verticesToolsList:
31 contName=getattr(vertexTool, "verticesContainerName", vertexTool.getDefaultProperty("verticesContainerName"))
32 if contName not in outputVertexList:
33 outputVertexList.append(contName)
34
35 # prepare vertex reco tool
36 vertexRecoTool = CompFactory.AFP_VertexRecoTool("AFP_VertexRecoTool", RecoToolsList=verticesToolsList, AFPVertexContainerList=outputVertexList )
37
38 # actually setup the vertex reco
39 acc.addEventAlgo(CompFactory.AFP_VertexReco("AFP_VertexReco", recoTool = vertexRecoTool))
40
41 return acc
42
43
45 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
46 acc = ComponentAccumulator()
47
48 acc.merge(AFP_VertexReco_Cfg(flags, {"AFPToFTrackContainerKey": "HLT_AFPToFTrackContainer", "AFPProtonContainerKey": "HLT_AFPProtonContainer", "verticesContainerName": recordable("HLT_AFPVertexContainer")}))
49
50 return acc
51
AFP_VertexReco_HLT(flags)
AFP_VertexReco_Cfg(flags, kwargs={})