11def IP2DTagCfg( flags, name = 'IP2DTag', scheme = '', useBTagFlagsDefaults = True, FlipOption='STANDARD', **options ):
12 """Sets up a IP2DTag tool and returns it.
13
14 The following options have BTaggingFlags defaults:
15
16 Runmodus default: BTagging.RunModus
17 referenceType default: BTagging.ReferenceType
18 impactParameterView default: "2D"
19 trackGradePartitions default: [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ]
20 RejectBadTracks default: False
21 jetCollectionList default: BTaggingFlags.Jets
22 unbiasIPEstimation default: False (switch to true (better!) when creating new PDFs)
23 SecVxFinderName default: "SV1"
24 UseCHypo default: True
25
26 input: name: The name of the tool (should be unique).
27 useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
28 **options: Python dictionary with options for the tool.
29 output: The actual tool."""
30 acc = ComponentAccumulator()
31 options['name'] = name
32 options['xAODBaseName'] = 'IP2D'
33 options['trackAssociationName'] = 'BTagTrackToJetAssociator'
34
35 if useBTagFlagsDefaults:
36 trackToVertexIPEstimator = acc.popToolsAndMerge(AtlasTrackToVertexIPEstimatorCfg(flags, 'TrkToVxIPEstimator'))
37 svForIPTool = acc.popToolsAndMerge(SVForIPToolCfg('SVForIPTool'))
38 trackGradeFactory = acc.popToolsAndMerge(IPDetailedTrackGradeFactoryCfg(flags, 'IP2DDetailedTrackGradeFactory'))
39 trackSelectorTool = acc.popToolsAndMerge(IPTrackSelectorCfg(flags, 'IP2DTrackSelector'))
40 likelihood = acc.popToolsAndMerge(NewLikelihoodToolCfg(flags, 'IP2DNewLikelihoodTool', 'IP2D', scheme))
41
42 defaults = { 'Runmodus' : flags.BTagging.RunModus,
43 'referenceType' : flags.BTagging.ReferenceType,
44 'jetPtMinRef' : flags.BTagging.JetPtMinRef,
45 'impactParameterView' : '2D',
46 'trackGradePartitions' : flags.BTagging.Grades,
47 'RejectBadTracks' : True,
48 'jetCollectionList' : [],
49 'unbiasIPEstimation' : False,
50 'UseCHypo' : True,
51 'SecVxFinderName' : 'SV1',
52 'storeTrackParticles': True,
53 'storeTrackParameters': True,
54 'storeIpValues': False,
55 'LikelihoodTool' : likelihood,
56 'trackSelectorTool' : trackSelectorTool,
57 'SVForIPTool' : svForIPTool,
58 'trackGradeFactory' : trackGradeFactory,
59 'TrackToVertexIPEstimator' : trackToVertexIPEstimator,
60 }
61 for option in defaults:
62 options.setdefault(option, defaults[option])
63
64
65
66
67 if FlipOption=='NEGATIVE_IP_ONLY':
68 negtagoptions = {
69 'flipIPSign' : True,
70 'flipZIPSign' : True,
71 'usePosIP' : True,
72 'useNegIP' : False,
73
74 }
75
76 nameNeg=''
77 if 'NegTag' in name:
78 nameNeg=name
79 elif 'Tag' in name:
80 nameNeg=name.replace("Tag","NegTag")
81 else:
82 nameNeg=name+"Neg"
83 options['name'] = nameNeg
84 options['xAODBaseName'] = 'IP2DNeg'
85 for option in negtagoptions:
86 options.setdefault(option, negtagoptions[option])
87
88 elif FlipOption=='FLIP_SIGN':
89 flipoptions = {
90 'flipIPSign' : True,
91 'flipZIPSign' : True,
92 'usePosIP' : True,
93 'useNegIP' : True
94 }
95 nameFlip=''
96 if 'FlipTag' in name:
97 nameFlip=name
98 elif 'Tag' in name:
99 nameFlip=name.replace("Tag","FlipTag")
100 else:
101 nameFlip=name+"Flip"
102 options['name'] = nameFlip
103 options['xAODBaseName'] = 'IP2DFlip'
104 for option in flipoptions:
105 options.setdefault(option, flipoptions[option])
106
107
108
109 acc.setPrivateTools(CompFactory.Analysis.IPTag( **options))
110
111 return acc