7def JetSecVertexingAlgCfg(flags, BTagVxSecVertexInfoName, SVAlgName, JetCollection, TrackCollection, PrimaryVertexCollectionName="", SVFinder="", **options):
8 """Adds a SecVtxTool instance and registers it.
9
10 input: name: The tool's name.
11 JetCollection The name of the jet collections.
12 ToolSvc: The ToolSvc instance.
13 options: Python dictionary of options to be passed to the SecVtxTool.
14 output: The tool."""
15
16 acc = ComponentAccumulator()
17
18 if SVFinder == 'JetFitter':
19 JetSVLink = 'JFVtx'
20 if SVFinder == 'JetFitterFlip':
21 JetSVLink = 'JFVtxFlip'
22 if SVFinder == 'SV1':
23 JetSVLink = 'SecVtx'
24 if SVFinder == 'SV1Flip':
25 JetSVLink = 'SecVtxFlip'
26
27 jetcol_no_suffix = JetCollection.replace("Jets","")
28 BTaggingCollection = f'BTagging_{jetcol_no_suffix}'
29 options = {}
30 options.setdefault('SecVtxFinderxAODBaseName', SVFinder)
31 options.setdefault('vxPrimaryCollectionName', PrimaryVertexCollectionName)
32 options['JetCollectionName'] = JetCollection
33 options['BTagVxSecVertexInfoName'] = BTagVxSecVertexInfoName
34 options['TrackCollectionName'] = TrackCollection
35 options['BTagJFVtxCollectionName'] = BTaggingCollection + JetSVLink
36 options['BTagSVCollectionName'] = BTaggingCollection + JetSVLink
37 options['JetSecVtxLinkName'] = JetCollection + '.' + JetSVLink
38 options['name'] = SVAlgName
39
40
41 acc.addEventAlgo(CompFactory.Analysis.JetSecVertexingAlg(**options))
42
43 return acc