32def STDM16Kernel(flags, name='STDM16Kernel', **kwargs):
33 """Configure the derivation framework driving algorithm (kernel) for STDM16"""
34 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
35
36 acc = ComponentAccumulator()
37
38
39
40
41
42
43 if flags.Input.isMC:
44 from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
45 AddStandardTruthContentsCfg,
46
47 AddMiniTruthCollectionLinksCfg,
48 AddPVCollectionCfg,
49 AddTruthCollectionNavigationDecorationsCfg,
50 TruthClassificationAugmentationsCfg)
51 acc.merge(TruthClassificationAugmentationsCfg(flags))
52 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import DFCommonTruthCharmToolCfg
53 STDM16CommonTruthCharmTool = acc.getPrimaryAndMerge(DFCommonTruthCharmToolCfg(
54 flags,
55 name = "STDM16CommonTruthCharmTool"))
56 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
57 acc.addEventAlgo(CommonAugmentation("STDM16CommonTruthCharmKernel",AugmentationTools=[STDM16CommonTruthCharmTool]))
58
59 acc.merge(AddStandardTruthContentsCfg(flags))
60 acc.merge(AddTruthCollectionNavigationDecorationsCfg(
61 flags,
62 TruthCollections=["TruthMuons",
63 "TruthBottom",
64 "TruthCharm"
65 ],
66 prefix = 'STDM16_'))
67
68 acc.merge(AddMiniTruthCollectionLinksCfg(flags))
69 acc.merge(AddPVCollectionCfg(flags))
70
71
72 from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
73 from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
74 from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
75
76
77
78 acc.merge(InDetCommonCfg(flags,
79 DoVertexFinding = flags.Tracking.doVertexFinding,
80 AddPseudoTracks = flags.Tracking.doPseudoTracking,
81 DecoLRTTTVA = False,
82 DoR3LargeD0 = flags.Tracking.doLargeD0,
83 StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
84 MergeLRT = False))
85 acc.merge(MuonsCommonCfg(flags))
86 acc.merge(EGammaCommonCfg(flags))
87
88
89 from DerivationFrameworkJetEtMiss.JetCommonConfig import JetCommonCfg
90
91
92 acc.merge(JetCommonCfg(flags))
93
94
95
96
97
98 from TrkConfig.TrkV0FitterConfig import TrkV0VertexFitter_InDetExtrCfg
99
100 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, "STDM16"))
101 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, "STDM16"))
102 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, "STDM16"))
103 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, "STDM16"))
104 v0fitter = acc.popToolsAndMerge(TrkV0VertexFitter_InDetExtrCfg(flags))
105
106 acc.addPublicTool(vkalvrt)
107 acc.addPublicTool(V0Tools)
108 acc.addPublicTool(trackselect)
109 acc.addPublicTool(vpest)
110 acc.addPublicTool(v0fitter)
111
112
113
114
115
116
117 STDM16_AugmentationTools = []
118
119
120
121
122
123 STDM16_Finder_D0 = CompFactory.Analysis.JpsiFinder(
124 name = "STDM16_Finder_D0",
125
126 muAndMu = False,
127 muAndTrack = False,
128 TrackAndTrack = True,
129 assumeDiMuons = False,
130 invMassUpper = 3000.0,
131 invMassLower = 0.0,
132 Chi2Cut = 200.,
133 oppChargesOnly = True,
134 atLeastOneComb = False,
135 useCombinedMeasurement = False,
136 track1Mass = massPiPlus,
137 track2Mass = massPiPlus,
138 trackThresholdPt = 1000.0,
139 muonCollectionKey = "Muons",
140 TrackParticleCollection = "InDetTrackParticles",
141 V0VertexFitterTool = v0fitter,
142 useV0Fitter = False,
143 TrkVertexFitterTool = vkalvrt,
144 TrackSelectorTool = trackselect,
145 VertexPointEstimator = vpest,
146 useMCPCuts = False)
147
148 acc.addPublicTool(STDM16_Finder_D0)
149
150
151 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
152 STDM16_Reco_D0 = CompFactory.DerivationFramework.Reco_Vertex(
153 name = "STDM16_Reco_D0",
154 VertexSearchTool = STDM16_Finder_D0,
155 OutputVtxContainerName = "STDM16_D0Candidates",
156 PVContainerName = "PrimaryVertices",
157 V0Tools = V0Tools,
158 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
159 DoVertexType = 7,
160 RefPVContainerName = "SHOULDNOTBEUSED",
161 RefitPV = False)
162
163 acc.addPublicTool(STDM16_Reco_D0)
164 STDM16_AugmentationTools += [STDM16_Reco_D0]
165
166
167
168
169
170
171 cutMinLxy = -999
172 cutMinMass = 1600.0
173 cutMaxMass = 2100.0
174 cutMaxChiSq = 50.0
175
176
177 STDM16_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
178 name = "STDM16_Select_D0",
179 HypothesisName = "D0",
180 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
181 TrkMasses = [massPiPlus,massKPlus],
182 VtxMassHypo = massD0,
183 MassMin = cutMinMass,
184 MassMax = cutMaxMass,
185 Chi2Max = cutMaxChiSq,
186 LxyMin = cutMinLxy)
187
188 acc.addPublicTool(STDM16_Select_D0)
189 STDM16_AugmentationTools += [STDM16_Select_D0]
190
191 STDM16_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
192 name = "STDM16_Select_D0b",
193 HypothesisName = "D0b",
194 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
195 TrkMasses = [massKPlus,massPiPlus],
196 VtxMassHypo = massD0,
197 MassMin = cutMinMass,
198 MassMax = cutMaxMass,
199 Chi2Max = cutMaxChiSq,
200 LxyMin = cutMinLxy)
201
202 acc.addPublicTool(STDM16_Select_D0b)
203 STDM16_AugmentationTools += [STDM16_Select_D0b]
204
205
206
207
208
209
210
211 STDM16_DStarSelectionTool = acc.getPrimaryAndMerge(DStarSelectionToolCfg(flags,
212 name = "STDM16_DStarSelectionTool",
213 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
214 DeltaMassMax = 200.0))
215
216 STDM16_AugmentationTools += [STDM16_DStarSelectionTool]
217
218
219
220
221
222 STDM16_SkimmingTools = []
223
224
225
226
227
228
229 SelectExpression = "count(STDM16_D0Candidates.passed_Dstar) > 0"
230
231 STDM16_SelectEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
232 name = "STDM16_SelectEvent",
233 expression = SelectExpression)
234 acc.addPublicTool(STDM16_SelectEvent)
235 STDM16_SkimmingTools += [STDM16_SelectEvent]
236
237
238
239
240 STDM16_ThinningTools = []
241
242
243
244
245
246 STDM16_Thin_Vertex = CompFactory.DerivationFramework.Thin_vtxTrk(
247 name = "STDM16_Thin_Vertex",
248 StreamName = streamName,
249 ThinTracks = False,
250 VertexContainerNames = ["STDM16_D0Candidates"],
251 PassFlags = ["passed_Dstar"] )
252 STDM16_ThinningTools += [STDM16_Thin_Vertex]
253 acc.addPublicTool(STDM16_Thin_Vertex)
254
255
256
257
258
259
260 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
261
262 track_thinning_expression = "(InDetTrackParticles.trackPassDstar == 1)"
263 STDM16_Thin_Tracks = acc.getPrimaryAndMerge(
264 GenericObjectThinningCfg(flags,
265 name = "STDM16_Thin_Tracks",
266 ContainerName = "InDetTrackParticles",
267 StreamName = streamName,
268 SelectionString = track_thinning_expression))
269 STDM16_ThinningTools += [STDM16_Thin_Tracks]
270 acc.addPublicTool(STDM16_Thin_Tracks)
271
272 acc.addPublicTool(STDM16_SelectEvent)
273 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("STDM16Kernel",
274 SkimmingTools = STDM16_SkimmingTools,
275 ThinningTools = STDM16_ThinningTools,
276 AugmentationTools = STDM16_AugmentationTools))
277
278 return acc
279
280