16 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (
17 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
18 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
20 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
21 acc = ComponentAccumulator()
22 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
23 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
24 acc.addPublicTool(vkalvrt)
25 acc.addPublicTool(V0Tools)
26 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
27 acc.addPublicTool(trackselect)
28 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
29 acc.addPublicTool(vpest)
30 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
31 acc.addPublicTool(PVrefit)
32 isSimulation = flags.Input.isMC
34 BPHY15JpsiFinder = CompFactory.Analysis.JpsiFinder(
35 name =
"BPHY15JpsiFinder",
38 TrackAndTrack =
False,
40 muonThresholdPt = 2700,
41 invMassUpper = 3400.0,
42 invMassLower = 2800.0,
44 oppChargesOnly =
True,
47 atLeastOneComb =
False,
48 useCombinedMeasurement =
False,
49 muonCollectionKey =
"Muons",
50 TrackParticleCollection =
"InDetTrackParticles",
51 TrkVertexFitterTool = vkalvrt,
52 TrackSelectorTool = trackselect,
53 VertexPointEstimator = vpest,
55 acc.addPublicTool(BPHY15JpsiFinder)
56 BPHY15JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
57 name =
"BPHY15JpsiSelectAndWrite",
58 VertexSearchTool = BPHY15JpsiFinder,
59 OutputVtxContainerName =
"BPHY15JpsiCandidates",
62 PVContainerName =
"PrimaryVertices",
63 RefPVContainerName =
"SHOULDNOTBEUSED",
66 BPHY15_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
67 name =
"BPHY15_Select_Jpsi2mumu",
68 HypothesisName =
"Jpsi",
69 InputVtxContainerName =
"BPHY15JpsiCandidates",
71 VtxMassHypo = 3096.900,
78 BPHY15BcJpsipi = CompFactory.Analysis.JpsiPlus1Track(
79 name =
"BPHY15BcJpsipi",
80 pionHypothesis =
True,
81 kaonHypothesis =
False,
82 trkThresholdPt = 2700,
87 JpsiContainerKey =
"BPHY15JpsiCandidates",
88 TrackParticleCollection =
"InDetTrackParticles",
89 MuonsUsedInJpsi =
"Muons",
90 TrkVertexFitterTool = vkalvrt,
91 TrackSelectorTool = trackselect,
92 UseMassConstraint =
True,
94 TrkTrippletMassUpper = 6900,
95 TrkTrippletMassLower = 5600)
96 acc.addPublicTool(BPHY15BcJpsipi)
97 BPHY15BcJpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
98 name =
"BPHY15BcJpsipiSelectAndWrite",
99 VertexSearchTool = BPHY15BcJpsipi,
101 PVRefitter = PVrefit,
102 OutputVtxContainerName =
"BPHY15BcJpsipiCandidates",
103 PVContainerName =
"PrimaryVertices",
104 RefPVContainerName =
"BPHY15RefittedPrimaryVertices1",
107 BPHY15_Select_Bc2Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
108 name =
"BPHY15_Select_Bc2Jpsipi",
109 HypothesisName =
"Bc",
110 InputVtxContainerName =
"BPHY15BcJpsipiCandidates",
112 TrkMasses = [105.658, 105.658, 139.571],
113 VtxMassHypo = 6274.9,
117 BPHY15JpsipiFinder = CompFactory.Analysis.JpsiPlus1Track(
118 name =
"BPHY15JpsipiFinder",
119 pionHypothesis =
True,
120 kaonHypothesis =
False,
121 trkThresholdPt = 350.0,
123 BThresholdPt = 5000.0,
127 TrkQuadrupletPt = 5000,
128 JpsiContainerKey =
"BPHY15JpsiCandidates",
129 TrackParticleCollection =
"InDetTrackParticles",
130 MuonsUsedInJpsi =
"Muons",
131 TrkVertexFitterTool = vkalvrt,
132 TrackSelectorTool = trackselect,
133 UseMassConstraint =
True,
135 TrkTrippletMassUpper = 3600,
136 TrkTrippletMassLower = 3200)
137 acc.addPublicTool(BPHY15JpsipiFinder)
139 BPHY15JpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
140 name =
"BPHY15JpsipiSelectAndWrite",
141 VertexSearchTool = BPHY15JpsipiFinder,
142 PVRefitter = PVrefit,
144 OutputVtxContainerName =
"BPHY15JpsipiCandidates",
145 PVContainerName =
"PrimaryVertices",
146 RefPVContainerName =
"SHOULDNOTBEUSED",
149 BPHY15_Select_Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
150 name =
"BPHY15_Select_Jpsipi",
151 HypothesisName =
"Jpsipi",
153 TrkMasses = [105.658, 105.658, 139.571],
154 InputVtxContainerName =
"BPHY15JpsipiCandidates",
155 VtxMassHypo = 3396.900,
162 BPHY15DiTrkFinder = CompFactory.Analysis.JpsiFinder(
163 name =
"BPHY15DiTrkFinder",
166 TrackAndTrack =
True,
167 assumeDiMuons =
False,
168 trackThresholdPt = 900,
169 invMassUpper = 1900.0,
170 invMassLower = 280.0,
172 oppChargesOnly =
True,
173 atLeastOneComb =
False,
174 useCombinedMeasurement =
False,
175 muonCollectionKey =
"Muons",
176 TrackParticleCollection =
"InDetTrackParticles",
177 TrkVertexFitterTool = vkalvrt,
178 TrackSelectorTool = trackselect,
179 VertexPointEstimator = vpest,
181 track1Mass = 139.571,
182 track2Mass = 139.571)
183 acc.addPublicTool(BPHY15DiTrkFinder)
184 BPHY15DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
185 name =
"BPHY15DiTrkSelectAndWrite",
186 VertexSearchTool = BPHY15DiTrkFinder,
187 OutputVtxContainerName =
"BPHY15DiTrkCandidates",
188 PVContainerName =
"PrimaryVertices",
190 PVRefitter = PVrefit,
191 RefPVContainerName =
"SHOULDNOTBEUSED",
192 CheckCollections =
True,
193 CheckVertexContainers = [
'BPHY15JpsiCandidates'],
196 BPHY15_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
197 name =
"BPHY15_Select_D0",
198 HypothesisName =
"D0",
199 InputVtxContainerName =
"BPHY15DiTrkCandidates",
201 TrkMasses = [139.571, 493.677],
202 VtxMassHypo = 1864.83,
203 MassMin = 1864.83-170,
204 MassMax = 1864.83+170,
208 BPHY15_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
209 name =
"BPHY15_Select_D0b",
210 HypothesisName =
"D0b",
211 InputVtxContainerName =
"BPHY15DiTrkCandidates",
213 TrkMasses = [493.677, 139.571],
214 VtxMassHypo = 1864.83,
215 MassMin = 1864.83-170,
216 MassMax = 1864.83+170,
220 BPHY15Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
221 name =
"BPHY15Dh3Finder",
222 pionHypothesis =
True,
223 kaonHypothesis =
False,
224 trkThresholdPt = 900.0,
226 BThresholdPt = 2000.0,
230 TrkTrippletMassUpper = 1800,
231 TrkTrippletMassLower = 500,
232 TrkQuadrupletPt = 2000,
233 JpsiContainerKey =
"BPHY15DiTrkCandidates",
234 TrackParticleCollection =
"InDetTrackParticles",
235 MuonsUsedInJpsi =
"NONE",
236 ExcludeCrossJpsiTracks =
False,
237 TrkVertexFitterTool = vkalvrt,
238 TrackSelectorTool = trackselect,
239 UseMassConstraint =
False,
241 acc.addPublicTool(BPHY15Dh3Finder)
242 BPHY15Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
243 name =
"BPHY15Dh3SelectAndWrite",
244 VertexSearchTool = BPHY15Dh3Finder,
246 PVRefitter = PVrefit,
247 OutputVtxContainerName =
"BPHY15Dh3Candidates",
248 PVContainerName =
"PrimaryVertices",
249 RefPVContainerName =
"SHOULDNOTBEUSED",
252 BPHY15_Select_Ds = CompFactory.DerivationFramework.Select_onia2mumu(
253 name =
"BPHY15_Select_Ds",
254 HypothesisName =
"Ds",
256 TrkMasses = [493.677, 493.677, 139.571],
257 InputVtxContainerName =
"BPHY15Dh3Candidates",
258 VtxMassHypo = 1968.28,
259 MassMin = 1968.28-200,
260 MassMax = 1968.28+200,
265 BPHY15_Select_Dp = CompFactory.DerivationFramework.Select_onia2mumu(
266 name =
"BPHY15_Select_Dp",
267 HypothesisName =
"Dp",
269 TrkMasses = [139.571, 493.677, 139.571],
270 InputVtxContainerName =
"BPHY15Dh3Candidates",
271 VtxMassHypo = 1869.59,
272 MassMin = 1869.59-200,
273 MassMax = 1869.59+200,
278 BPHY15_Select_Dm = CompFactory.DerivationFramework.Select_onia2mumu(
279 name =
"BPHY15_Select_Dm",
280 HypothesisName =
"Dm",
282 TrkMasses = [493.677, 139.571, 139.571],
283 InputVtxContainerName =
"BPHY15Dh3Candidates",
284 VtxMassHypo = 1869.59,
285 MassMin = 1869.59-200,
286 MassMax = 1869.59+200,
291 BcJpsiDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDx", CascadeCnstPrecision = 1e-6))
292 acc.addPublicTool(BcJpsiDxVertexFit)
293 BPHY15JpsiDs = CompFactory.DerivationFramework.JpsiPlusDsCascade(
294 name =
"BPHY15JpsiDs",
295 HypothesisName =
"Bc",
297 TrkVertexFitterTool = BcJpsiDxVertexFit,
298 PVRefitter = PVrefit,
300 ApplyDxMassConstraint =
True,
301 ApplyJpsiMassConstraint =
True,
302 JpsiMassLowerCut = 2600.,
303 JpsiMassUpperCut = 3600.,
304 DxMassLowerCut = 1968.28 - 200.,
305 DxMassUpperCut = 1968.28 + 200.,
306 MassLowerCut = 6274.90 - 600.,
307 MassUpperCut = 6274.90 + 600.,
310 RefPVContainerName =
"BPHY15RefittedPrimaryVertices2",
311 JpsiVertices =
"BPHY15JpsiCandidates",
312 CascadeVertexCollections = [
"BcJpsiDsCascadeSV2",
"BcJpsiDsCascadeSV1"],
313 DxVertices =
"BPHY15Dh3Candidates")
315 BPHY15JpsiDp = CompFactory.DerivationFramework.JpsiPlusDsCascade(
316 name =
"BPHY15JpsiDp",
317 HypothesisName =
"Bc",
319 TrkVertexFitterTool = BcJpsiDxVertexFit,
320 PVRefitter = PVrefit,
322 ApplyDxMassConstraint =
True,
323 ApplyJpsiMassConstraint =
True,
324 JpsiMassLowerCut = 2600.,
325 JpsiMassUpperCut = 3600.,
326 DxMassLowerCut = 1869.59 - 180.,
327 DxMassUpperCut = 1869.59 + 180.,
328 MassLowerCut = 6274.90 - 600.,
329 MassUpperCut = 6274.90 + 600.,
332 RefPVContainerName =
"BPHY15RefittedPrimaryVertices3",
333 JpsiVertices =
"BPHY15JpsiCandidates",
334 CascadeVertexCollections = [
"BcJpsiDpCascadeSV2",
"BcJpsiDpCascadeSV1"],
335 DxVertices =
"BPHY15Dh3Candidates")
337 BcJpsiDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDst", CascadeCnstPrecision = 1e-6))
338 acc.addPublicTool(BcJpsiDstVertexFit)
340 BPHY15JpsiDpst = CompFactory.DerivationFramework.JpsiPlusDpstCascade(
341 name =
"BPHY15JpsiDpst",
342 HypothesisName =
"Bc",
344 TrkVertexFitterTool = BcJpsiDstVertexFit,
345 PVRefitter = PVrefit,
347 ApplyD0MassConstraint =
True,
348 ApplyJpsiMassConstraint =
True,
349 JpsiMassLowerCut = 2600.,
350 JpsiMassUpperCut = 3600.,
351 JpsipiMassLowerCut = 2600.,
352 JpsipiMassUpperCut = 6800.,
353 D0MassLowerCut = 1864.83 - 200.,
354 D0MassUpperCut = 1864.83 + 200.,
355 DstMassLowerCut = 2010.26 - 300.,
356 DstMassUpperCut = 2010.26 + 300.,
358 MassUpperCut = 6274.90 + 600.,
361 RefPVContainerName =
"BPHY15RefittedPrimaryVertices4",
362 JpsipiVertices =
"BPHY15JpsipiCandidates",
363 CascadeVertexCollections = [
"BcJpsiDpstCascadeSV2",
"BcJpsiDpstCascadeSV1"],
364 D0Vertices =
"BPHY15DiTrkCandidates")
366 from TrkConfig.TrkV0FitterConfig
import TrkV0VertexFitter_InDetExtrCfg
367 v0Vertexfit = acc.popToolsAndMerge(TrkV0VertexFitter_InDetExtrCfg(flags))
368 acc.addPublicTool(v0Vertexfit)
369 BPHY15K0Finder = CompFactory.Analysis.JpsiFinder(
370 name =
"BPHY15K0Finder",
373 TrackAndTrack =
True,
374 assumeDiMuons =
False,
375 trackThresholdPt = 400,
376 invMassUpper = 600.0,
377 invMassLower = 400.0,
379 oppChargesOnly =
True,
380 atLeastOneComb =
False,
381 useCombinedMeasurement =
False,
382 muonCollectionKey =
"Muons",
383 TrackParticleCollection =
"InDetTrackParticles",
384 TrkVertexFitterTool = v0Vertexfit,
385 TrackSelectorTool = trackselect,
386 VertexPointEstimator = vpest,
388 track1Mass = 139.571,
389 track2Mass = 139.571)
390 acc.addPublicTool(BPHY15K0Finder)
391 BPHY15K0SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
392 name =
"BPHY15K0SelectAndWrite",
393 VertexSearchTool = BPHY15K0Finder,
394 OutputVtxContainerName =
"BPHY15K0Candidates",
395 PVContainerName =
"PrimaryVertices",
396 RefPVContainerName =
"SHOULDNOTBEUSED",
398 PVRefitter = PVrefit,
399 CheckCollections =
True,
400 CheckVertexContainers = [
'BPHY15JpsipiCandidates',
'BPHY15DiTrkCandidates',
'BcJpsiDpstCascadeSV1'],
403 BPHY15_Select_K0 = CompFactory.DerivationFramework.Select_onia2mumu(
404 name =
"BPHY15_Select_K0",
405 HypothesisName =
"K0",
406 InputVtxContainerName =
"BPHY15K0Candidates",
408 TrkMasses = [139.571, 139.571],
409 VtxMassHypo = 497.672,
415 BcJpsiDs1VertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDs1", CascadeCnstPrecision = 1e-6))
416 acc.addPublicTool(BcJpsiDs1VertexFit)
418 BPHY15JpsiDps1 = CompFactory.DerivationFramework.JpsiPlusDs1Cascade(
419 name =
"BPHY15JpsiDps1",
420 HypothesisName =
"Bc",
421 TrkVertexFitterTool = BcJpsiDs1VertexFit,
422 PVRefitter = PVrefit,
425 ApplyD0MassConstraint =
True,
426 ApplyK0MassConstraint =
True,
427 ApplyJpsiMassConstraint =
True,
428 JpsiMassLowerCut = 2600.,
429 JpsiMassUpperCut = 3600.,
430 JpsipiMassLowerCut = 2600.,
431 JpsipiMassUpperCut = 6800.,
432 D0MassLowerCut = 1864.83 - 180.,
433 D0MassUpperCut = 1864.83 + 180.,
434 K0MassLowerCut = 400.,
435 K0MassUpperCut = 600.,
436 DstMassLowerCut = 2010.26 - 300.,
437 DstMassUpperCut = 2010.26 + 300.,
438 MassLowerCut = 6274.90 - 600,
439 MassUpperCut = 6274.90 + 600.,
442 RefPVContainerName =
"BPHY15RefittedPrimaryVertices5",
443 JpsipiVertices =
"BPHY15JpsipiCandidates",
444 CascadeVertexCollections = [
"BcJpsiDps1CascadeSV3",
"BcJpsiDps1CascadeSV2",
"BcJpsiDps1CascadeSV1"],
445 K0Vertices =
"BPHY15K0Candidates",
446 D0Vertices =
"BPHY15DiTrkCandidates")
450 CascadeCollections = []
452 CascadeCollections += BPHY15JpsiDs.CascadeVertexCollections
453 CascadeCollections += BPHY15JpsiDp.CascadeVertexCollections
455 CascadeCollections += BPHY15JpsiDpst.CascadeVertexCollections
456 CascadeCollections += BPHY15JpsiDps1.CascadeVertexCollections
458 BPHY15_AugOriginalCounts = acc.popToolsAndMerge(
459 AugOriginalCountsCfg(flags, name =
"BPHY15_AugOriginalCounts"))
463 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
464 xAODStringSkimmingToolCfg)
465 BPHY15_SelectBcJpsipiEvent = acc.getPrimaryAndMerge(
466 xAODStringSkimmingToolCfg(
467 flags, name =
"BPHY15_SelectBcJpsipiEvent",
468 expression =
"( count(BPHY15BcJpsipiCandidates.passed_Bc) > 0)"))
470 BPHY15_AnyVertexSkimmingTool = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY15_AnyVertexSkimmingTool",
471 VertexContainerNames =CascadeCollections )
472 acc.addPublicTool(BPHY15_AnyVertexSkimmingTool)
477 BPHY15SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
479 FilterList = [BPHY15_SelectBcJpsipiEvent, BPHY15_AnyVertexSkimmingTool] )
480 acc.addPublicTool(BPHY15SkimmingOR)
482 augTools = [BPHY15JpsiSelectAndWrite, BPHY15_Select_Jpsi2mumu,
483 BPHY15BcJpsipiSelectAndWrite, BPHY15_Select_Bc2Jpsipi,
484 BPHY15JpsipiSelectAndWrite, BPHY15_Select_Jpsipi,
485 BPHY15DiTrkSelectAndWrite, BPHY15_Select_D0, BPHY15_Select_D0b,
486 BPHY15Dh3SelectAndWrite, BPHY15_Select_Ds, BPHY15_Select_Dp, BPHY15_Select_Dm,
487 BPHY15JpsiDs, BPHY15JpsiDp, BPHY15JpsiDpst,
488 BPHY15K0SelectAndWrite, BPHY15_Select_K0,
490 BPHY15_AugOriginalCounts]
491 for t
in augTools : acc.addPublicTool(t)
493 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY15Kernel",
494 AugmentationTools = augTools,
496 SkimmingTools = [BPHY15SkimmingOR]
if not isSimulation
else [],
499 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
500 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
501 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
502 BPHY15SlimmingHelper =
SlimmingHelper(
"BPHY15SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
503 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
504 AllVariables = getDefaultAllVariables()
508 BPHY15SlimmingHelper.IncludeMuonTriggerContent =
True
509 BPHY15SlimmingHelper.IncludeBPhysTriggerContent =
True
512 AllVariables += [
"PrimaryVertices"]
514 StaticContent += [
"xAOD::VertexContainer#BPHY15RefittedPrimaryVertices%s" % str(x)]
515 StaticContent += [
"xAOD::VertexAuxContainer#BPHY15RefittedPrimaryVertices%sAux." % str(x)]
518 AllVariables += [
"InDetTrackParticles"]
523 AllVariables += [
"CombinedMuonTrackParticles"]
524 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
527 AllVariables += [
"Muons"]
531 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
533 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
536 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
537 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
541 for cascades
in CascadeCollections:
542 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
543 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
546 AllVariables += [
"GSFTrackParticles",
"MuonSpectrometerTrackParticles" ]
550 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
552 AllVariables = list(
set(AllVariables))
554 BPHY15SlimmingHelper.AllVariables = AllVariables
555 BPHY15SlimmingHelper.StaticContent = StaticContent
557 BPHY15ItemList = BPHY15SlimmingHelper.GetItemList()
558 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY15", ItemList=BPHY15ItemList, AcceptAlgs=[
"BPHY15Kernel"]))
559 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY15", AcceptAlgs=[
"BPHY15Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
560 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)