8def JetFitterTagCfg(flags, name = 'JetFitterTagNN', scheme = '', CombinedIPNN = False, useBTagFlagsDefaults = True, runNN=False, **options):
9 """Sets up a JetFitterTagNN tool and returns it.
10
11 The following options have BTaggingFlags defaults:
12
13 Runmodus default: BTagging.RunModus
14 jetCollectionList default: BTaggingFlags.Jets
15 SecVxFinderName default: "JetFitter"
16 useForcedCalibration default: False
17 ipinfoTaggerName default: ""
18
19 If CombinedIPNN is True
20 ipinfoTaggerName default: "IP3D"
21
22
23 input: name: The name of the tool (should be unique).
24 useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
25 **options: Python dictionary with options for the tool.
26 output: The actual tool."""
27 acc = ComponentAccumulator()
28 options['name'] = name
29 options['xAODBaseName'] = 'JetFitter'
30
31 if scheme == "" or scheme == "Trig":
32 if useBTagFlagsDefaults:
33 if not CombinedIPNN:
34 if runNN:
35 jetfitterClassifier = acc.popToolsAndMerge(JetFitterNNToolCfg(flags, 'JetFitterNNTool', scheme))
36 else:
37
38
39 inneracc = ComponentAccumulator()
40 DummyClassifier = (
41 CompFactory.Analysis.JetFitterDummyClassifier)
42 inneracc.setPrivateTools(DummyClassifier(
43 name='JetFitterDummyClassifier'))
44 jetfitterClassifier = acc.popToolsAndMerge(inneracc)
45
46 jetFitterNtupleWriterNN = acc.popToolsAndMerge(JetFitterNtupleWriterNNCfg('JetFitterNtupleWriterNN'))
47 defaults = { 'Runmodus' : flags.BTagging.RunModus,
48 'jetCollectionList' : [],
49 'SecVxFinderName' : 'JetFitter',
50 'useForcedCalibration' : False,
51 'ipinfoTaggerName' : "",
52 'jetfitterNtupleWriter' : jetFitterNtupleWriterNN,
53 'jetfitterClassifier' : jetfitterClassifier,
54 }
55 else:
56 defaults = { 'Runmodus' : flags.BTagging.RunModus,
57 'jetCollectionList' : [],
58 'SecVxFinderName' : 'JetFitter',
59 'useForcedCalibration' : False,
60 'ipinfoTaggerName' : 'IP3D',
61 }
62 elif (scheme == "Flip"):
63
64 if useBTagFlagsDefaults:
65 defaults = { 'Runmodus' : flags.BTagging.RunModus,
66 'jetCollectionList' : [],
67 'SecVxFinderName' : 'JetFitterFlip',
68 'useForcedCalibration' : False,
69 'ipinfoTaggerName' : 'IP3D',
70 }
71 for option in defaults:
72 options.setdefault(option, defaults[option])
73 acc.setPrivateTools(CompFactory.Analysis.JetFitterTag(**options))
74
75 return acc