16 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
17 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
18 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
21 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
23 acc.addPublicTool(vkalvrt)
24 acc.addPublicTool(V0Tools)
26 acc.addPublicTool(trackselect)
28 acc.addPublicTool(vpest)
30 acc.addPublicTool(PVrefit)
31 isSimulation = flags.Input.isMC
32 BPHY15_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
33 name =
"BPHY15_AugOriginalCounts",
34 VertexContainer =
"PrimaryVertices",
35 TrackContainer =
"InDetTrackParticles" )
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 V0VertexFitterTool =
None,
55 TrkVertexFitterTool = vkalvrt,
56 TrackSelectorTool = trackselect,
57 VertexPointEstimator = vpest,
59 acc.addPublicTool(BPHY15JpsiFinder)
60 BPHY15JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
61 name =
"BPHY15JpsiSelectAndWrite",
62 VertexSearchTool = BPHY15JpsiFinder,
63 OutputVtxContainerName =
"BPHY15JpsiCandidates",
66 PVContainerName =
"PrimaryVertices",
67 RefPVContainerName =
"SHOULDNOTBEUSED",
70 BPHY15_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
71 name =
"BPHY15_Select_Jpsi2mumu",
72 HypothesisName =
"Jpsi",
73 InputVtxContainerName =
"BPHY15JpsiCandidates",
75 VtxMassHypo = 3096.900,
82 BPHY15BcJpsipi = CompFactory.Analysis.JpsiPlus1Track(
83 name =
"BPHY15BcJpsipi",
84 pionHypothesis =
True,
85 kaonHypothesis =
False,
86 trkThresholdPt = 2700,
91 JpsiContainerKey =
"BPHY15JpsiCandidates",
92 TrackParticleCollection =
"InDetTrackParticles",
93 MuonsUsedInJpsi =
"Muons",
94 TrkVertexFitterTool = vkalvrt,
95 TrackSelectorTool = trackselect,
96 UseMassConstraint =
True,
98 TrkTrippletMassUpper = 6900,
99 TrkTrippletMassLower = 5600)
100 acc.addPublicTool(BPHY15BcJpsipi)
101 BPHY15BcJpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
102 name =
"BPHY15BcJpsipiSelectAndWrite",
103 VertexSearchTool = BPHY15BcJpsipi,
105 PVRefitter = PVrefit,
106 OutputVtxContainerName =
"BPHY15BcJpsipiCandidates",
107 PVContainerName =
"PrimaryVertices",
108 RefPVContainerName =
"BPHY15RefittedPrimaryVertices1",
111 BPHY15_Select_Bc2Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
112 name =
"BPHY15_Select_Bc2Jpsipi",
113 HypothesisName =
"Bc",
114 InputVtxContainerName =
"BPHY15BcJpsipiCandidates",
116 TrkMasses = [105.658, 105.658, 139.571],
117 VtxMassHypo = 6274.9,
121 BPHY15JpsipiFinder = CompFactory.Analysis.JpsiPlus1Track(
122 name =
"BPHY15JpsipiFinder",
123 pionHypothesis =
True,
124 kaonHypothesis =
False,
125 trkThresholdPt = 350.0,
127 BThresholdPt = 5000.0,
131 TrkQuadrupletPt = 5000,
132 JpsiContainerKey =
"BPHY15JpsiCandidates",
133 TrackParticleCollection =
"InDetTrackParticles",
134 MuonsUsedInJpsi =
"Muons",
135 TrkVertexFitterTool = vkalvrt,
136 TrackSelectorTool = trackselect,
137 UseMassConstraint =
True,
139 TrkTrippletMassUpper = 3600,
140 TrkTrippletMassLower = 3200)
141 acc.addPublicTool(BPHY15JpsipiFinder)
143 BPHY15JpsipiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
144 name =
"BPHY15JpsipiSelectAndWrite",
145 VertexSearchTool = BPHY15JpsipiFinder,
146 PVRefitter = PVrefit,
148 OutputVtxContainerName =
"BPHY15JpsipiCandidates",
149 PVContainerName =
"PrimaryVertices",
150 RefPVContainerName =
"SHOULDNOTBEUSED",
153 BPHY15_Select_Jpsipi = CompFactory.DerivationFramework.Select_onia2mumu(
154 name =
"BPHY15_Select_Jpsipi",
155 HypothesisName =
"Jpsipi",
157 TrkMasses = [105.658, 105.658, 139.571],
158 InputVtxContainerName =
"BPHY15JpsipiCandidates",
159 VtxMassHypo = 3396.900,
166 BPHY15DiTrkFinder = CompFactory.Analysis.JpsiFinder(
167 name =
"BPHY15DiTrkFinder",
170 TrackAndTrack =
True,
171 assumeDiMuons =
False,
172 trackThresholdPt = 900,
173 invMassUpper = 1900.0,
174 invMassLower = 280.0,
176 oppChargesOnly =
True,
177 atLeastOneComb =
False,
178 useCombinedMeasurement =
False,
179 muonCollectionKey =
"Muons",
180 TrackParticleCollection =
"InDetTrackParticles",
181 V0VertexFitterTool =
None,
183 TrkVertexFitterTool = vkalvrt,
184 TrackSelectorTool = trackselect,
185 VertexPointEstimator = vpest,
187 track1Mass = 139.571,
188 track2Mass = 139.571)
189 acc.addPublicTool(BPHY15DiTrkFinder)
190 BPHY15DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
191 name =
"BPHY15DiTrkSelectAndWrite",
192 VertexSearchTool = BPHY15DiTrkFinder,
193 OutputVtxContainerName =
"BPHY15DiTrkCandidates",
194 PVContainerName =
"PrimaryVertices",
196 PVRefitter = PVrefit,
197 RefPVContainerName =
"SHOULDNOTBEUSED",
198 CheckCollections =
True,
199 CheckVertexContainers = [
'BPHY15JpsiCandidates'],
202 BPHY15_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
203 name =
"BPHY15_Select_D0",
204 HypothesisName =
"D0",
205 InputVtxContainerName =
"BPHY15DiTrkCandidates",
207 TrkMasses = [139.571, 493.677],
208 VtxMassHypo = 1864.83,
209 MassMin = 1864.83-170,
210 MassMax = 1864.83+170,
214 BPHY15_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
215 name =
"BPHY15_Select_D0b",
216 HypothesisName =
"D0b",
217 InputVtxContainerName =
"BPHY15DiTrkCandidates",
219 TrkMasses = [493.677, 139.571],
220 VtxMassHypo = 1864.83,
221 MassMin = 1864.83-170,
222 MassMax = 1864.83+170,
226 BPHY15Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
227 name =
"BPHY15Dh3Finder",
228 pionHypothesis =
True,
229 kaonHypothesis =
False,
230 trkThresholdPt = 900.0,
232 BThresholdPt = 2000.0,
236 TrkTrippletMassUpper = 1800,
237 TrkTrippletMassLower = 500,
238 TrkQuadrupletPt = 2000,
239 JpsiContainerKey =
"BPHY15DiTrkCandidates",
240 TrackParticleCollection =
"InDetTrackParticles",
241 MuonsUsedInJpsi =
"NONE",
242 ExcludeCrossJpsiTracks =
False,
243 TrkVertexFitterTool = vkalvrt,
244 TrackSelectorTool = trackselect,
245 UseMassConstraint =
False,
247 acc.addPublicTool(BPHY15Dh3Finder)
248 BPHY15Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
249 name =
"BPHY15Dh3SelectAndWrite",
250 VertexSearchTool = BPHY15Dh3Finder,
252 PVRefitter = PVrefit,
253 OutputVtxContainerName =
"BPHY15Dh3Candidates",
254 PVContainerName =
"PrimaryVertices",
255 RefPVContainerName =
"SHOULDNOTBEUSED",
258 BPHY15_Select_Ds = CompFactory.DerivationFramework.Select_onia2mumu(
259 name =
"BPHY15_Select_Ds",
260 HypothesisName =
"Ds",
262 TrkMasses = [493.677, 493.677, 139.571],
263 InputVtxContainerName =
"BPHY15Dh3Candidates",
264 VtxMassHypo = 1968.28,
265 MassMin = 1968.28-200,
266 MassMax = 1968.28+200,
271 BPHY15_Select_Dp = CompFactory.DerivationFramework.Select_onia2mumu(
272 name =
"BPHY15_Select_Dp",
273 HypothesisName =
"Dp",
275 TrkMasses = [139.571, 493.677, 139.571],
276 InputVtxContainerName =
"BPHY15Dh3Candidates",
277 VtxMassHypo = 1869.59,
278 MassMin = 1869.59-200,
279 MassMax = 1869.59+200,
284 BPHY15_Select_Dm = CompFactory.DerivationFramework.Select_onia2mumu(
285 name =
"BPHY15_Select_Dm",
286 HypothesisName =
"Dm",
288 TrkMasses = [493.677, 139.571, 139.571],
289 InputVtxContainerName =
"BPHY15Dh3Candidates",
290 VtxMassHypo = 1869.59,
291 MassMin = 1869.59-200,
292 MassMax = 1869.59+200,
297 BcJpsiDxVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDx", CascadeCnstPrecision = 1e-6))
298 acc.addPublicTool(BcJpsiDxVertexFit)
299 BPHY15JpsiDs = CompFactory.DerivationFramework.JpsiPlusDsCascade(
300 name =
"BPHY15JpsiDs",
301 HypothesisName =
"Bc",
303 TrkVertexFitterTool = BcJpsiDxVertexFit,
304 PVRefitter = PVrefit,
306 ApplyDxMassConstraint =
True,
307 ApplyJpsiMassConstraint =
True,
308 JpsiMassLowerCut = 2600.,
309 JpsiMassUpperCut = 3600.,
310 DxMassLowerCut = 1968.28 - 200.,
311 DxMassUpperCut = 1968.28 + 200.,
312 MassLowerCut = 6274.90 - 600.,
313 MassUpperCut = 6274.90 + 600.,
316 RefPVContainerName =
"BPHY15RefittedPrimaryVertices2",
317 JpsiVertices =
"BPHY15JpsiCandidates",
318 CascadeVertexCollections = [
"BcJpsiDsCascadeSV2",
"BcJpsiDsCascadeSV1"],
319 DxVertices =
"BPHY15Dh3Candidates")
321 BPHY15JpsiDp = CompFactory.DerivationFramework.JpsiPlusDsCascade(
322 name =
"BPHY15JpsiDp",
323 HypothesisName =
"Bc",
325 TrkVertexFitterTool = BcJpsiDxVertexFit,
326 PVRefitter = PVrefit,
328 ApplyDxMassConstraint =
True,
329 ApplyJpsiMassConstraint =
True,
330 JpsiMassLowerCut = 2600.,
331 JpsiMassUpperCut = 3600.,
332 DxMassLowerCut = 1869.59 - 180.,
333 DxMassUpperCut = 1869.59 + 180.,
334 MassLowerCut = 6274.90 - 600.,
335 MassUpperCut = 6274.90 + 600.,
338 RefPVContainerName =
"BPHY15RefittedPrimaryVertices3",
339 JpsiVertices =
"BPHY15JpsiCandidates",
340 CascadeVertexCollections = [
"BcJpsiDpCascadeSV2",
"BcJpsiDpCascadeSV1"],
341 DxVertices =
"BPHY15Dh3Candidates")
343 BcJpsiDstVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDst", CascadeCnstPrecision = 1e-6))
344 acc.addPublicTool(BcJpsiDstVertexFit)
346 BPHY15JpsiDpst = CompFactory.DerivationFramework.JpsiPlusDpstCascade(
347 name =
"BPHY15JpsiDpst",
348 HypothesisName =
"Bc",
350 TrkVertexFitterTool = BcJpsiDstVertexFit,
351 PVRefitter = PVrefit,
353 ApplyD0MassConstraint =
True,
354 ApplyJpsiMassConstraint =
True,
355 JpsiMassLowerCut = 2600.,
356 JpsiMassUpperCut = 3600.,
357 JpsipiMassLowerCut = 2600.,
358 JpsipiMassUpperCut = 6800.,
359 D0MassLowerCut = 1864.83 - 200.,
360 D0MassUpperCut = 1864.83 + 200.,
361 DstMassLowerCut = 2010.26 - 300.,
362 DstMassUpperCut = 2010.26 + 300.,
364 MassUpperCut = 6274.90 + 600.,
367 RefPVContainerName =
"BPHY15RefittedPrimaryVertices4",
368 JpsipiVertices =
"BPHY15JpsipiCandidates",
369 CascadeVertexCollections = [
"BcJpsiDpstCascadeSV2",
"BcJpsiDpstCascadeSV1"],
370 D0Vertices =
"BPHY15DiTrkCandidates")
372 from TrkConfig.TrkV0FitterConfig
import TrkV0VertexFitter_InDetExtrCfg
374 acc.addPublicTool(v0Vertexfit)
375 BPHY15K0Finder = CompFactory.Analysis.JpsiFinder(
376 name =
"BPHY15K0Finder",
379 TrackAndTrack =
True,
380 assumeDiMuons =
False,
381 trackThresholdPt = 400,
382 invMassUpper = 600.0,
383 invMassLower = 400.0,
385 oppChargesOnly =
True,
386 atLeastOneComb =
False,
387 useCombinedMeasurement =
False,
388 muonCollectionKey =
"Muons",
389 TrackParticleCollection =
"InDetTrackParticles",
390 V0VertexFitterTool = v0Vertexfit,
392 TrkVertexFitterTool = vkalvrt,
393 TrackSelectorTool = trackselect,
394 VertexPointEstimator = vpest,
396 track1Mass = 139.571,
397 track2Mass = 139.571)
398 acc.addPublicTool(BPHY15K0Finder)
399 BPHY15K0SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
400 name =
"BPHY15K0SelectAndWrite",
401 VertexSearchTool = BPHY15K0Finder,
402 OutputVtxContainerName =
"BPHY15K0Candidates",
403 PVContainerName =
"PrimaryVertices",
404 RefPVContainerName =
"SHOULDNOTBEUSED",
406 PVRefitter = PVrefit,
407 CheckCollections =
True,
408 CheckVertexContainers = [
'BPHY15JpsipiCandidates',
'BPHY15DiTrkCandidates',
'BcJpsiDpstCascadeSV1'],
411 BPHY15_Select_K0 = CompFactory.DerivationFramework.Select_onia2mumu(
412 name =
"BPHY15_Select_K0",
413 HypothesisName =
"K0",
414 InputVtxContainerName =
"BPHY15K0Candidates",
416 TrkMasses = [139.571, 139.571],
417 VtxMassHypo = 497.672,
423 BcJpsiDs1VertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName +
"BcJpsiDs1", CascadeCnstPrecision = 1e-6))
424 acc.addPublicTool(BcJpsiDs1VertexFit)
426 BPHY15JpsiDps1 = CompFactory.DerivationFramework.JpsiPlusDs1Cascade(
427 name =
"BPHY15JpsiDps1",
428 HypothesisName =
"Bc",
429 TrkVertexFitterTool = BcJpsiDs1VertexFit,
430 PVRefitter = PVrefit,
433 ApplyD0MassConstraint =
True,
434 ApplyK0MassConstraint =
True,
435 ApplyJpsiMassConstraint =
True,
436 JpsiMassLowerCut = 2600.,
437 JpsiMassUpperCut = 3600.,
438 JpsipiMassLowerCut = 2600.,
439 JpsipiMassUpperCut = 6800.,
440 D0MassLowerCut = 1864.83 - 180.,
441 D0MassUpperCut = 1864.83 + 180.,
442 K0MassLowerCut = 400.,
443 K0MassUpperCut = 600.,
444 DstMassLowerCut = 2010.26 - 300.,
445 DstMassUpperCut = 2010.26 + 300.,
446 MassLowerCut = 6274.90 - 600,
447 MassUpperCut = 6274.90 + 600.,
450 RefPVContainerName =
"BPHY15RefittedPrimaryVertices5",
451 JpsipiVertices =
"BPHY15JpsipiCandidates",
452 CascadeVertexCollections = [
"BcJpsiDps1CascadeSV3",
"BcJpsiDps1CascadeSV2",
"BcJpsiDps1CascadeSV1"],
453 K0Vertices =
"BPHY15K0Candidates",
454 D0Vertices =
"BPHY15DiTrkCandidates")
458 CascadeCollections = []
460 CascadeCollections += BPHY15JpsiDs.CascadeVertexCollections
461 CascadeCollections += BPHY15JpsiDp.CascadeVertexCollections
463 CascadeCollections += BPHY15JpsiDpst.CascadeVertexCollections
464 CascadeCollections += BPHY15JpsiDps1.CascadeVertexCollections
468 BPHY15_SelectBcJpsipiEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
469 name =
"BPHY15_SelectBcJpsipiEvent",
470 expression =
"( count(BPHY15BcJpsipiCandidates.passed_Bc) > 0)")
471 acc.addPublicTool(BPHY15_SelectBcJpsipiEvent)
472 BPHY15_AnyVertexSkimmingTool = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY15_AnyVertexSkimmingTool", UseHandles =
True,
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,
492 BPHY15K0SelectAndWrite, BPHY15_Select_K0,
494 BPHY15_AugOriginalCounts]
495 for t
in augTools : acc.addPublicTool(t)
496 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY15Kernel",
497 AugmentationTools = augTools,
499 SkimmingTools = [BPHY15SkimmingOR]
if not isSimulation
else [],
502 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
503 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
504 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
505 BPHY15SlimmingHelper =
SlimmingHelper(
"BPHY15SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
506 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
511 BPHY15SlimmingHelper.IncludeMuonTriggerContent =
True
512 BPHY15SlimmingHelper.IncludeBPhysTriggerContent =
True
515 AllVariables += [
"PrimaryVertices"]
517 StaticContent += [
"xAOD::VertexContainer#BPHY15RefittedPrimaryVertices%s" %
str(x)]
518 StaticContent += [
"xAOD::VertexAuxContainer#BPHY15RefittedPrimaryVertices%sAux." %
str(x)]
521 AllVariables += [
"InDetTrackParticles"]
526 AllVariables += [
"CombinedMuonTrackParticles"]
527 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
530 AllVariables += [
"Muons"]
534 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
536 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15JpsiSelectAndWrite.OutputVtxContainerName]
539 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
540 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY15BcJpsipiSelectAndWrite.OutputVtxContainerName]
544 for cascades
in CascadeCollections:
545 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
546 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
549 AllVariables += [
"GSFTrackParticles",
"MuonSpectrometerTrackParticles" ]
553 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
555 AllVariables =
list(
set(AllVariables))
557 BPHY15SlimmingHelper.AllVariables = AllVariables
558 BPHY15SlimmingHelper.StaticContent = StaticContent
560 BPHY15ItemList = BPHY15SlimmingHelper.GetItemList()
561 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY15", ItemList=BPHY15ItemList, AcceptAlgs=[
"BPHY15Kernel"]))
562 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY15", AcceptAlgs=[
"BPHY15Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
563 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)