16 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
17 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (
18 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
19 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
21 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
22 acc = ComponentAccumulator()
23 acc.getPrimaryAndMerge(PartPropSvcCfg(flags))
24 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
25 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
26 acc.addPublicTool(vkalvrt)
27 acc.addPublicTool(V0Tools)
28 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
29 acc.addPublicTool(trackselect)
30 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
31 acc.addPublicTool(vpest)
32 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
33 acc.addPublicTool(PVrefit)
34 isSimulation = flags.Input.isMC
36 BPHY15JpsiFinder = CompFactory.Analysis.JpsiFinder(
37 name =
"BPHY15JpsiFinder",
40 TrackAndTrack =
False,
42 muonThresholdPt = 2700,
43 invMassUpper = 3400.0,
44 invMassLower = 2800.0,
46 oppChargesOnly =
True,
49 atLeastOneComb =
False,
50 useCombinedMeasurement =
False,
51 muonCollectionKey =
"Muons",
52 TrackParticleCollection =
"InDetTrackParticles",
53 TrkVertexFitterTool = vkalvrt,
54 TrackSelectorTool = trackselect,
55 VertexPointEstimator = vpest,
57 acc.addPublicTool(BPHY15JpsiFinder)
58 BPHY15JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
59 name =
"BPHY15JpsiSelectAndWrite",
60 VertexSearchTool = BPHY15JpsiFinder,
61 OutputVtxContainerName =
"BPHY15JpsiCandidates",
64 PVContainerName =
"PrimaryVertices",
65 RefPVContainerName =
"SHOULDNOTBEUSED",
68 BPHY15_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
69 name =
"BPHY15_Select_Jpsi2mumu",
70 HypothesisName =
"Jpsi",
71 InputVtxContainerName =
"BPHY15JpsiCandidates",
73 VtxMassHypo = 3096.900,
80 BPHY15BcJpsipi = CompFactory.Analysis.JpsiPlus1Track(
81 name =
"BPHY15BcJpsipi",
82 pionHypothesis =
True,
83 kaonHypothesis =
False,
84 trkThresholdPt = 2700,
89 JpsiContainerKey =
"BPHY15JpsiCandidates",
90 TrackParticleCollection =
"InDetTrackParticles",
91 MuonsUsedInJpsi =
"Muons",
92 TrkVertexFitterTool = vkalvrt,
93 TrackSelectorTool = trackselect,
94 UseMassConstraint =
True,
96 TrkTrippletMassUpper = 6900,
97 TrkTrippletMassLower = 5600)
98 acc.addPublicTool(BPHY15BcJpsipi)
99 BPHY15BcJpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
100 name =
"BPHY15BcJpsipiSelectAndWrite",
101 VertexSearchTool = BPHY15BcJpsipi,
103 PVRefitter = PVrefit,
104 OutputVtxContainerName =
"BPHY15BcJpsipiCandidates",
105 PVContainerName =
"PrimaryVertices",
106 RefPVContainerName =
"BPHY15RefittedPrimaryVertices1",
109 BPHY15_Select_Bc2Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
110 name =
"BPHY15_Select_Bc2Jpsipi",
111 HypothesisName =
"Bc",
112 InputVtxContainerName =
"BPHY15BcJpsipiCandidates",
114 TrkMasses = [105.658, 105.658, 139.571],
115 VtxMassHypo = 6274.9,
119 BPHY15JpsipiFinder = CompFactory.Analysis.JpsiPlus1Track(
120 name =
"BPHY15JpsipiFinder",
121 pionHypothesis =
True,
122 kaonHypothesis =
False,
123 trkThresholdPt = 350.0,
125 BThresholdPt = 5000.0,
129 TrkQuadrupletPt = 5000,
130 JpsiContainerKey =
"BPHY15JpsiCandidates",
131 TrackParticleCollection =
"InDetTrackParticles",
132 MuonsUsedInJpsi =
"Muons",
133 TrkVertexFitterTool = vkalvrt,
134 TrackSelectorTool = trackselect,
135 UseMassConstraint =
True,
137 TrkTrippletMassUpper = 3600,
138 TrkTrippletMassLower = 3200)
139 acc.addPublicTool(BPHY15JpsipiFinder)
141 BPHY15JpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
142 name =
"BPHY15JpsipiSelectAndWrite",
143 VertexSearchTool = BPHY15JpsipiFinder,
144 PVRefitter = PVrefit,
146 OutputVtxContainerName =
"BPHY15JpsipiCandidates",
147 PVContainerName =
"PrimaryVertices",
148 RefPVContainerName =
"SHOULDNOTBEUSED",
151 BPHY15_Select_Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
152 name =
"BPHY15_Select_Jpsipi",
153 HypothesisName =
"Jpsipi",
155 TrkMasses = [105.658, 105.658, 139.571],
156 InputVtxContainerName =
"BPHY15JpsipiCandidates",
157 VtxMassHypo = 3396.900,
164 BPHY15DiTrkFinder = CompFactory.Analysis.JpsiFinder(
165 name =
"BPHY15DiTrkFinder",
168 TrackAndTrack =
True,
169 assumeDiMuons =
False,
170 trackThresholdPt = 900,
171 invMassUpper = 1900.0,
172 invMassLower = 280.0,
174 oppChargesOnly =
True,
175 atLeastOneComb =
False,
176 useCombinedMeasurement =
False,
177 muonCollectionKey =
"Muons",
178 TrackParticleCollection =
"InDetTrackParticles",
179 TrkVertexFitterTool = vkalvrt,
180 TrackSelectorTool = trackselect,
181 VertexPointEstimator = vpest,
183 track1Mass = 139.571,
184 track2Mass = 139.571)
185 acc.addPublicTool(BPHY15DiTrkFinder)
186 BPHY15DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
187 name =
"BPHY15DiTrkSelectAndWrite",
188 VertexSearchTool = BPHY15DiTrkFinder,
189 OutputVtxContainerName =
"BPHY15DiTrkCandidates",
190 PVContainerName =
"PrimaryVertices",
192 PVRefitter = PVrefit,
193 RefPVContainerName =
"SHOULDNOTBEUSED",
194 CheckCollections =
True,
195 CheckVertexContainers = [
'BPHY15JpsiCandidates'],
198 BPHY15_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
199 name =
"BPHY15_Select_D0",
200 HypothesisName =
"D0",
201 InputVtxContainerName =
"BPHY15DiTrkCandidates",
203 TrkMasses = [139.571, 493.677],
204 VtxMassHypo = 1864.83,
205 MassMin = 1864.83-170,
206 MassMax = 1864.83+170,
210 BPHY15_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
211 name =
"BPHY15_Select_D0b",
212 HypothesisName =
"D0b",
213 InputVtxContainerName =
"BPHY15DiTrkCandidates",
215 TrkMasses = [493.677, 139.571],
216 VtxMassHypo = 1864.83,
217 MassMin = 1864.83-170,
218 MassMax = 1864.83+170,
222 BPHY15Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
223 name =
"BPHY15Dh3Finder",
224 pionHypothesis =
True,
225 kaonHypothesis =
False,
226 trkThresholdPt = 900.0,
228 BThresholdPt = 2000.0,
232 TrkTrippletMassUpper = 1800,
233 TrkTrippletMassLower = 500,
234 TrkQuadrupletPt = 2000,
235 JpsiContainerKey =
"BPHY15DiTrkCandidates",
236 TrackParticleCollection =
"InDetTrackParticles",
237 MuonsUsedInJpsi =
"NONE",
238 ExcludeCrossJpsiTracks =
False,
239 TrkVertexFitterTool = vkalvrt,
240 TrackSelectorTool = trackselect,
241 UseMassConstraint =
False,
243 acc.addPublicTool(BPHY15Dh3Finder)
244 BPHY15Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
245 name =
"BPHY15Dh3SelectAndWrite",
246 VertexSearchTool = BPHY15Dh3Finder,
248 PVRefitter = PVrefit,
249 OutputVtxContainerName =
"BPHY15Dh3Candidates",
250 PVContainerName =
"PrimaryVertices",
251 RefPVContainerName =
"SHOULDNOTBEUSED",
254 BPHY15_Select_Ds = CompFactory.DerivationFramework.Select_onia2mumu(
255 name =
"BPHY15_Select_Ds",
256 HypothesisName =
"Ds",
258 TrkMasses = [493.677, 493.677, 139.571],
259 InputVtxContainerName =
"BPHY15Dh3Candidates",
260 VtxMassHypo = 1968.28,
261 MassMin = 1968.28-200,
262 MassMax = 1968.28+200,
267 BPHY15_Select_Dp = CompFactory.DerivationFramework.Select_onia2mumu(
268 name =
"BPHY15_Select_Dp",
269 HypothesisName =
"Dp",
271 TrkMasses = [139.571, 493.677, 139.571],
272 InputVtxContainerName =
"BPHY15Dh3Candidates",
273 VtxMassHypo = 1869.59,
274 MassMin = 1869.59-200,
275 MassMax = 1869.59+200,
280 BPHY15_Select_Dm = CompFactory.DerivationFramework.Select_onia2mumu(
281 name =
"BPHY15_Select_Dm",
282 HypothesisName =
"Dm",
284 TrkMasses = [493.677, 139.571, 139.571],
285 InputVtxContainerName =
"BPHY15Dh3Candidates",
286 VtxMassHypo = 1869.59,
287 MassMin = 1869.59-200,
288 MassMax = 1869.59+200,
293 BcJpsiDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDx", CascadeCnstPrecision = 1e-6))
294 acc.addPublicTool(BcJpsiDxVertexFit)
295 BPHY15JpsiDs = CompFactory.DerivationFramework.JpsiPlusDsCascade(
296 name =
"BPHY15JpsiDs",
297 HypothesisName =
"Bc",
299 TrkVertexFitterTool = BcJpsiDxVertexFit,
300 PVRefitter = PVrefit,
302 ApplyDxMassConstraint =
True,
303 ApplyJpsiMassConstraint =
True,
304 JpsiMassLowerCut = 2600.,
305 JpsiMassUpperCut = 3600.,
306 DxMassLowerCut = 1968.28 - 200.,
307 DxMassUpperCut = 1968.28 + 200.,
308 MassLowerCut = 6274.90 - 600.,
309 MassUpperCut = 6274.90 + 600.,
312 RefPVContainerName =
"BPHY15RefittedPrimaryVertices2",
313 JpsiVertices =
"BPHY15JpsiCandidates",
314 CascadeVertexCollections = [
"BcJpsiDsCascadeSV2",
"BcJpsiDsCascadeSV1"],
315 DxVertices =
"BPHY15Dh3Candidates")
317 BPHY15JpsiDp = CompFactory.DerivationFramework.JpsiPlusDsCascade(
318 name =
"BPHY15JpsiDp",
319 HypothesisName =
"Bc",
321 TrkVertexFitterTool = BcJpsiDxVertexFit,
322 PVRefitter = PVrefit,
324 ApplyDxMassConstraint =
True,
325 ApplyJpsiMassConstraint =
True,
326 JpsiMassLowerCut = 2600.,
327 JpsiMassUpperCut = 3600.,
328 DxMassLowerCut = 1869.59 - 180.,
329 DxMassUpperCut = 1869.59 + 180.,
330 MassLowerCut = 6274.90 - 600.,
331 MassUpperCut = 6274.90 + 600.,
334 RefPVContainerName =
"BPHY15RefittedPrimaryVertices3",
335 JpsiVertices =
"BPHY15JpsiCandidates",
336 CascadeVertexCollections = [
"BcJpsiDpCascadeSV2",
"BcJpsiDpCascadeSV1"],
337 DxVertices =
"BPHY15Dh3Candidates")
339 BcJpsiDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDst", CascadeCnstPrecision = 1e-6))
340 acc.addPublicTool(BcJpsiDstVertexFit)
342 BPHY15JpsiDpst = CompFactory.DerivationFramework.JpsiPlusDpstCascade(
343 name =
"BPHY15JpsiDpst",
344 HypothesisName =
"Bc",
346 TrkVertexFitterTool = BcJpsiDstVertexFit,
347 PVRefitter = PVrefit,
349 ApplyD0MassConstraint =
True,
350 ApplyJpsiMassConstraint =
True,
351 JpsiMassLowerCut = 2600.,
352 JpsiMassUpperCut = 3600.,
353 JpsipiMassLowerCut = 2600.,
354 JpsipiMassUpperCut = 6800.,
355 D0MassLowerCut = 1864.83 - 200.,
356 D0MassUpperCut = 1864.83 + 200.,
357 DstMassLowerCut = 2010.26 - 300.,
358 DstMassUpperCut = 2010.26 + 300.,
360 MassUpperCut = 6274.90 + 600.,
363 RefPVContainerName =
"BPHY15RefittedPrimaryVertices4",
364 JpsipiVertices =
"BPHY15JpsipiCandidates",
365 CascadeVertexCollections = [
"BcJpsiDpstCascadeSV2",
"BcJpsiDpstCascadeSV1"],
366 D0Vertices =
"BPHY15DiTrkCandidates")
368 from TrkConfig.TrkV0FitterConfig
import TrkV0VertexFitter_InDetExtrCfg
369 v0Vertexfit = acc.popToolsAndMerge(TrkV0VertexFitter_InDetExtrCfg(flags))
370 acc.addPublicTool(v0Vertexfit)
371 BPHY15K0Finder = CompFactory.Analysis.JpsiFinder(
372 name =
"BPHY15K0Finder",
375 TrackAndTrack =
True,
376 assumeDiMuons =
False,
377 trackThresholdPt = 400,
378 invMassUpper = 600.0,
379 invMassLower = 400.0,
381 oppChargesOnly =
True,
382 atLeastOneComb =
False,
383 useCombinedMeasurement =
False,
384 muonCollectionKey =
"Muons",
385 TrackParticleCollection =
"InDetTrackParticles",
386 TrkVertexFitterTool = v0Vertexfit,
387 TrackSelectorTool = trackselect,
388 VertexPointEstimator = vpest,
390 track1Mass = 139.571,
391 track2Mass = 139.571)
392 acc.addPublicTool(BPHY15K0Finder)
393 BPHY15K0SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
394 name =
"BPHY15K0SelectAndWrite",
395 VertexSearchTool = BPHY15K0Finder,
396 OutputVtxContainerName =
"BPHY15K0Candidates",
397 PVContainerName =
"PrimaryVertices",
398 RefPVContainerName =
"SHOULDNOTBEUSED",
400 PVRefitter = PVrefit,
401 CheckCollections =
True,
402 CheckVertexContainers = [
'BPHY15JpsipiCandidates',
'BPHY15DiTrkCandidates',
'BcJpsiDpstCascadeSV1'],
405 BPHY15_Select_K0 = CompFactory.DerivationFramework.Select_onia2mumu(
406 name =
"BPHY15_Select_K0",
407 HypothesisName =
"K0",
408 InputVtxContainerName =
"BPHY15K0Candidates",
410 TrkMasses = [139.571, 139.571],
411 VtxMassHypo = 497.672,
417 BcJpsiDs1VertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDs1", CascadeCnstPrecision = 1e-6))
418 acc.addPublicTool(BcJpsiDs1VertexFit)
420 BPHY15JpsiDps1 = CompFactory.DerivationFramework.JpsiPlusDs1Cascade(
421 name =
"BPHY15JpsiDps1",
422 HypothesisName =
"Bc",
423 TrkVertexFitterTool = BcJpsiDs1VertexFit,
424 PVRefitter = PVrefit,
427 ApplyD0MassConstraint =
True,
428 ApplyK0MassConstraint =
True,
429 ApplyJpsiMassConstraint =
True,
430 JpsiMassLowerCut = 2600.,
431 JpsiMassUpperCut = 3600.,
432 JpsipiMassLowerCut = 2600.,
433 JpsipiMassUpperCut = 6800.,
434 D0MassLowerCut = 1864.83 - 180.,
435 D0MassUpperCut = 1864.83 + 180.,
436 K0MassLowerCut = 400.,
437 K0MassUpperCut = 600.,
438 DstMassLowerCut = 2010.26 - 300.,
439 DstMassUpperCut = 2010.26 + 300.,
440 MassLowerCut = 6274.90 - 600,
441 MassUpperCut = 6274.90 + 600.,
444 RefPVContainerName =
"BPHY15RefittedPrimaryVertices5",
445 JpsipiVertices =
"BPHY15JpsipiCandidates",
446 CascadeVertexCollections = [
"BcJpsiDps1CascadeSV3",
"BcJpsiDps1CascadeSV2",
"BcJpsiDps1CascadeSV1"],
447 K0Vertices =
"BPHY15K0Candidates",
448 D0Vertices =
"BPHY15DiTrkCandidates")
452 CascadeCollections = []
454 CascadeCollections += BPHY15JpsiDs.CascadeVertexCollections
455 CascadeCollections += BPHY15JpsiDp.CascadeVertexCollections
457 CascadeCollections += BPHY15JpsiDpst.CascadeVertexCollections
458 CascadeCollections += BPHY15JpsiDps1.CascadeVertexCollections
460 BPHY15_AugOriginalCounts = acc.popToolsAndMerge(
461 AugOriginalCountsCfg(flags, name =
"BPHY15_AugOriginalCounts"))
465 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
466 xAODStringSkimmingToolCfg)
467 BPHY15_SelectBcJpsipiEvent = acc.getPrimaryAndMerge(
468 xAODStringSkimmingToolCfg(
469 flags, name =
"BPHY15_SelectBcJpsipiEvent",
470 expression =
"( count(BPHY15BcJpsipiCandidates.passed_Bc) > 0)"))
472 BPHY15_AnyVertexSkimmingTool = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY15_AnyVertexSkimmingTool",
473 VertexContainerNames =CascadeCollections )
474 acc.addPublicTool(BPHY15_AnyVertexSkimmingTool)
479 BPHY15SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
481 FilterList = [BPHY15_SelectBcJpsipiEvent, BPHY15_AnyVertexSkimmingTool] )
482 acc.addPublicTool(BPHY15SkimmingOR)
484 augTools = [BPHY15JpsiSelectAndWrite, BPHY15_Select_Jpsi2mumu,
485 BPHY15BcJpsipiSelectAndWrite, BPHY15_Select_Bc2Jpsipi,
486 BPHY15JpsipiSelectAndWrite, BPHY15_Select_Jpsipi,
487 BPHY15DiTrkSelectAndWrite, BPHY15_Select_D0, BPHY15_Select_D0b,
488 BPHY15Dh3SelectAndWrite, BPHY15_Select_Ds, BPHY15_Select_Dp, BPHY15_Select_Dm,
489 BPHY15JpsiDs, BPHY15JpsiDp, BPHY15JpsiDpst,
490 BPHY15K0SelectAndWrite, BPHY15_Select_K0,
492 BPHY15_AugOriginalCounts]
493 for t
in augTools : acc.addPublicTool(t)
495 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY15Kernel",
496 AugmentationTools = augTools,
498 SkimmingTools = [BPHY15SkimmingOR]
if not isSimulation
else [],
501 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
502 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
503 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
504 BPHY15SlimmingHelper =
SlimmingHelper(
"BPHY15SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
505 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
506 AllVariables = getDefaultAllVariables()
510 BPHY15SlimmingHelper.IncludeMuonTriggerContent =
True
511 BPHY15SlimmingHelper.IncludeBPhysTriggerContent =
True
514 AllVariables += [
"PrimaryVertices"]
516 StaticContent += [
"xAOD::VertexContainer#BPHY15RefittedPrimaryVertices%s" % str(x)]
517 StaticContent += [
"xAOD::VertexAuxContainer#BPHY15RefittedPrimaryVertices%sAux." % str(x)]
520 AllVariables += [
"InDetTrackParticles"]
525 AllVariables += [
"CombinedMuonTrackParticles"]
526 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
529 AllVariables += [
"Muons"]
533 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
535 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
538 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
539 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
543 for cascades
in CascadeCollections:
544 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
545 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
548 AllVariables += [
"GSFTrackParticles",
"MuonSpectrometerTrackParticles" ]
552 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
554 AllVariables = list(
set(AllVariables))
556 BPHY15SlimmingHelper.AllVariables = AllVariables
557 BPHY15SlimmingHelper.StaticContent = StaticContent
559 BPHY15ItemList = BPHY15SlimmingHelper.GetItemList()
560 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY15", ItemList=BPHY15ItemList, AcceptAlgs=[
"BPHY15Kernel"]))
561 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY15", AcceptAlgs=[
"BPHY15Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
562 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)