17 """Main config for common ID track decorations"""
20 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
23 flags.Beam.Type
is not BeamType.Cosmics
and
24 (any(
'PrimaryVertices' in elements
for elements
25 in flags.Input.TypedCollections)))
26 if not have_PV_container
and kwargs[
'DoVertexFinding']:
28 any(
'PixelRDOs' in elements
for elements
29 in flags.Input.TypedCollections)
or
30 any(
'SCT_RDOs' in elements
for elements
in
31 flags.Input.TypedCollections))
37 from DerivationFrameworkInDet.InDetToolsConfig
import (
38 InDetTrackSelectionToolWrapperCfg)
39 DFCommonTrackSelection = acc.getPrimaryAndMerge(
42 name =
"DFCommonTrackSelection",
43 CutLevel =
"TightPrimary",
44 DecorationName =
"DFCommonTightPrimary"))
46 if kwargs[
'AddPseudoTracks']:
47 from DerivationFrameworkInDet.InDetToolsConfig
import (
48 PseudoTrackSelectorCfg)
49 PseudoTrackSelectorTool = acc.getPrimaryAndMerge(
52 name =
"PseudoTrackSelectorTool",
53 RecoTrackParticleLocation =
"InDetTrackParticles",
54 PseudoTrackParticleLocation =
"InDetPseudoTrackParticles",
55 OutputRecoReplacedWithPseudo =
"InDetReplacedWithPseudoTrackParticles",
56 OutputRecoReplacedWithPseudoFromB =
"InDetReplacedWithPseudoFromBTrackParticles",
57 OutputRecoReplacedWithPseudoNotFromB =
"InDetReplacedWithPseudoNotFromBTrackParticles",
58 OutputRecoPlusPseudo =
"InDetPlusPseudoTrackParticles",
59 OutputRecoPlusPseudoFromB =
"InDetPlusPseudoFromBTrackParticles",
60 OutputRecoPlusPseudoNotFromB =
"InDetPlusPseudoNotFromBTrackParticles",
61 OutputRecoNoFakes =
"InDetNoFakesTrackParticles",
62 OutputRecoNoFakesFromB =
"InDetNoFakesFromBTrackParticles",
63 OutputRecoNoFakesNotFromB =
"InDetNoFakesNotFromBTrackParticles"))
65 acc.addEventAlgo(CommonAugmentation(
66 "InDetSelectedPseudo",
67 AugmentationTools=[PseudoTrackSelectorTool]))
72 from DerivationFrameworkInDet.InDetToolsConfig
import (
73 TrackParametersAtPVCfg)
76 name =
"DFCommonZ0AtPV",
77 TrackParticleContainerName =
"InDetTrackParticles",
78 VertexContainerName =
"PrimaryVertices",
79 Z0SGEntryName =
"DFCommonInDetTrackZ0AtPV"))
84 from InDetConfig.InDetHardScatterSelectionToolConfig
import (
85 InDetHardScatterSelectionToolCfg)
86 DFCommonHSSelectionTool = acc.popToolsAndMerge(
88 name=
"DFCommonHSSelectionTool"))
89 acc.addPublicTool(DFCommonHSSelectionTool)
91 from DerivationFrameworkInDet.InDetToolsConfig
import HardScatterVertexDecoratorCfg
97 from InDetConfig.InDetUsedInFitTrackDecoratorToolConfig
import (
98 InDetUsedInFitTrackDecoratorToolCfg)
99 DFCommonUsedInFitDecoratorTool = acc.popToolsAndMerge(
102 name =
"DFCommonUsedInFitDecoratorTool",
103 AMVFVerticesDecoName =
"TTVA_AMVFVertices",
104 AMVFWeightsDecoName =
"TTVA_AMVFWeights",
105 TrackContainer =
"InDetTrackParticles",
106 VertexContainer =
"PrimaryVertices"))
107 acc.addPublicTool(DFCommonUsedInFitDecoratorTool)
109 from DerivationFrameworkInDet.InDetToolsConfig
import (
110 UsedInVertexFitTrackDecoratorCfg)
111 DFCommonUsedInFitDecorator = acc.getPrimaryAndMerge(
114 name=
"DFCommonUsedInFitDecorator",
115 UsedInFitDecoratorTool=DFCommonUsedInFitDecoratorTool))
117 if kwargs[
'AddPseudoTracks']:
118 PseudoTrackContainers = [
119 "InDetPseudoTrackParticles",
120 "InDetReplacedWithPseudoTrackParticles",
121 "InDetReplacedWithPseudoFromBTrackParticles",
122 "InDetReplacedWithPseudoNotFromBTrackParticles",
123 "InDetPlusPseudoTrackParticles",
124 "InDetPlusPseudoFromBTrackParticles",
125 "InDetPlusPseudoNotFromBTrackParticles",
126 "InDetNoFakesTrackParticles",
127 "InDetNoFakesFromBTrackParticles",
128 "InDetNoFakesNotFromBTrackParticles"
130 PseudoTrackDecorators = []
131 for t
in PseudoTrackContainers:
132 InDetDecorator = acc.popToolsAndMerge(
135 name=
"DFCommonUsedInFitDecoratorTool" +
136 t.replace(
'InDetPseudo',
'Pseudo').
replace(
137 'InDet',
'Reco').
replace(
'TrackParticles',
''),
138 AMVFVerticesDecoName=
"TTVA_AMVFVertices",
139 AMVFWeightsDecoName=
"TTVA_AMVFWeights",
141 VertexContainer=
"PrimaryVertices"))
142 DerivDecorator = acc.getPrimaryAndMerge(
145 name=
"DFCommonUsedInFitDecorator" +
146 t.replace(
'InDetPseudo',
'Pseudo').
replace(
147 'InDet',
'Reco').
replace(
'TrackParticles',
''),
148 UsedInFitDecoratorTool=InDetDecorator))
149 PseudoTrackDecorators.append(DerivDecorator)
152 if (kwargs[
'DecoLRTTTVA']
and kwargs[
'DoR3LargeD0']
and
153 kwargs[
'StoreSeparateLargeD0Container']):
158 DFCommonUsedInFitDecoratorToolLRT = acc.popToolsAndMerge(
161 name =
"DFCommonUsedInFitDecoratorToolLRT",
162 AMVFVerticesDecoName =
"TTVA_AMVFVertices",
163 AMVFWeightsDecoName =
"TTVA_AMVFWeights",
164 TrackContainer =
"InDetLargeD0TrackParticles",
165 VertexContainer =
"PrimaryVertices"))
167 DFCommonUsedInFitDecoratorLRT = acc.getPrimaryAndMerge(
170 name=
"DFCommonUsedInFitDecoratorLRT",
171 UsedInFitDecoratorTool=DFCommonUsedInFitDecoratorToolLRT))
175 for tool
in [DFCommonTrackSelection,
177 DFCommonUsedInFitDecorator,
178 DFCommonUsedInFitDecoratorLRT]:
179 acc.addEventAlgo(CommonAugmentation(
"InDetCommonKernel"+tool.name,
180 AugmentationTools=[tool]))
182 AugTools = [DFCommonTrackSelection,
184 DFCommonUsedInFitDecorator]
185 if kwargs[
'AddPseudoTracks']:
186 AugTools += PseudoTrackDecorators
187 for tool
in AugTools:
188 acc.addEventAlgo(CommonAugmentation(
"InDetCommonKernel"+tool.name,
189 AugmentationTools=[tool]))
192 if (kwargs[
'MergeLRT']
and kwargs[
'DoR3LargeD0']
and
193 kwargs[
'StoreSeparateLargeD0Container']):
197 from DerivationFrameworkInDet.InDetToolsConfig
import InDetLRTMergeCfg