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
99 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, "STDM16"))
100 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, "STDM16"))
101 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, "STDM16"))
102 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, "STDM16"))
103
104 acc.addPublicTool(vkalvrt)
105 acc.addPublicTool(V0Tools)
106 acc.addPublicTool(trackselect)
107 acc.addPublicTool(vpest)
108
109
110
111
112
113
114 STDM16_AugmentationTools = []
115
116
117
118
119
120 STDM16_Finder_D0 = CompFactory.Analysis.JpsiFinder(
121 name = "STDM16_Finder_D0",
122
123 muAndMu = False,
124 muAndTrack = False,
125 TrackAndTrack = True,
126 assumeDiMuons = False,
127 invMassUpper = 3000.0,
128 invMassLower = 0.0,
129 Chi2Cut = 200.,
130 oppChargesOnly = True,
131 atLeastOneComb = False,
132 useCombinedMeasurement = False,
133 track1Mass = massPiPlus,
134 track2Mass = massPiPlus,
135 trackThresholdPt = 1000.0,
136 muonCollectionKey = "Muons",
137 TrackParticleCollection = "InDetTrackParticles",
138 TrkVertexFitterTool = vkalvrt,
139 TrackSelectorTool = trackselect,
140 VertexPointEstimator = vpest,
141 useMCPCuts = False)
142
143 acc.addPublicTool(STDM16_Finder_D0)
144
145 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
146 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
147 acc.addPublicTool(PVrefit)
148
149 STDM16_Reco_D0 = CompFactory.DerivationFramework.Reco_Vertex(
150 name = "STDM16_Reco_D0",
151 VertexSearchTool = STDM16_Finder_D0,
152 OutputVtxContainerName = "STDM16_D0Candidates",
153 PVContainerName = "PrimaryVertices",
154 V0Tools = V0Tools,
155 PVRefitter = PVrefit,
156 DoVertexType = 7,
157 RefPVContainerName = "SHOULDNOTBEUSED",
158 RefitPV = False)
159
160 acc.addPublicTool(STDM16_Reco_D0)
161 STDM16_AugmentationTools += [STDM16_Reco_D0]
162
163
164
165
166
167
168 cutMinLxy = -999
169 cutMinMass = 1600.0
170 cutMaxMass = 2100.0
171 cutMaxChiSq = 50.0
172
173
174 STDM16_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
175 name = "STDM16_Select_D0",
176 HypothesisName = "D0",
177 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
178 TrkMasses = [massPiPlus,massKPlus],
179 VtxMassHypo = massD0,
180 MassMin = cutMinMass,
181 MassMax = cutMaxMass,
182 Chi2Max = cutMaxChiSq,
183 LxyMin = cutMinLxy)
184
185 acc.addPublicTool(STDM16_Select_D0)
186 STDM16_AugmentationTools += [STDM16_Select_D0]
187
188 STDM16_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
189 name = "STDM16_Select_D0b",
190 HypothesisName = "D0b",
191 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
192 TrkMasses = [massKPlus,massPiPlus],
193 VtxMassHypo = massD0,
194 MassMin = cutMinMass,
195 MassMax = cutMaxMass,
196 Chi2Max = cutMaxChiSq,
197 LxyMin = cutMinLxy)
198
199 acc.addPublicTool(STDM16_Select_D0b)
200 STDM16_AugmentationTools += [STDM16_Select_D0b]
201
202
203
204
205
206
207
208 STDM16_DStarSelectionTool = acc.getPrimaryAndMerge(DStarSelectionToolCfg(flags,
209 name = "STDM16_DStarSelectionTool",
210 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
211 DeltaMassMax = 200.0))
212
213 STDM16_AugmentationTools += [STDM16_DStarSelectionTool]
214
215
216
217
218
219 STDM16_SkimmingTools = []
220
221
222
223
224
225
226 SelectExpression = "count(STDM16_D0Candidates.passed_Dstar) > 0"
227
228 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
229 xAODStringSkimmingToolCfg)
230 STDM16_SelectEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
231 flags, name = "STDM16_SelectEvent", expression = SelectExpression))
232 STDM16_SkimmingTools += [STDM16_SelectEvent]
233
234
235
236
237 STDM16_ThinningTools = []
238
239
240
241
242
243 STDM16_Thin_Vertex = CompFactory.DerivationFramework.Thin_vtxTrk(
244 name = "STDM16_Thin_Vertex",
245 StreamName = streamName,
246 ThinTracks = False,
247 VertexContainerNames = ["STDM16_D0Candidates"],
248 PassFlags = ["passed_Dstar"] )
249 STDM16_ThinningTools += [STDM16_Thin_Vertex]
250 acc.addPublicTool(STDM16_Thin_Vertex)
251
252
253
254
255
256
257 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
258
259 track_thinning_expression = "(InDetTrackParticles.trackPassDstar == 1)"
260 STDM16_Thin_Tracks = acc.getPrimaryAndMerge(
261 GenericObjectThinningCfg(flags,
262 name = "STDM16_Thin_Tracks",
263 ContainerName = "InDetTrackParticles",
264 StreamName = streamName,
265 SelectionString = track_thinning_expression))
266 STDM16_ThinningTools += [STDM16_Thin_Tracks]
267 acc.addPublicTool(STDM16_Thin_Tracks)
268
269 acc.addPublicTool(STDM16_SelectEvent)
270 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("STDM16Kernel",
271 SkimmingTools = STDM16_SkimmingTools,
272 ThinningTools = STDM16_ThinningTools,
273 AugmentationTools = STDM16_AugmentationTools))
274
275 return acc
276
277