13def BPHY3Cfg(flags):
14 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
15 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
16 acc = ComponentAccumulator()
17 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
18 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
19 acc.addPublicTool(vkalvrt)
20 acc.addPublicTool(V0Tools)
21 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
22 acc.addPublicTool(trackselect)
23 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
24 acc.addPublicTool(vpest)
25 BPHY3JpsiFinder = CompFactory.Analysis.JpsiFinder(
26 name = "BPHY3JpsiFinder",
27 muAndMu = False,
28 muAndTrack = False,
29 TrackAndTrack = True,
30 assumeDiMuons = False,
31 invMassUpper = 10000.0,
32 invMassLower = 0.0,
33 Chi2Cut = 100.,
34 oppChargesOnly = True,
35 atLeastOneComb = False,
36 useCombinedMeasurement = False,
37 muonCollectionKey = "Muons",
38 TrackParticleCollection = "InDetTrackParticles",
39 V0VertexFitterTool = None,
40 useV0Fitter = False,
41 TrkVertexFitterTool = vkalvrt,
42 TrackSelectorTool = trackselect,
43 VertexPointEstimator = vpest,
44 useMCPCuts = False,
45 track1Mass = 139.57,
46 track2Mass = 139.57)
47
48 BPHY3_Reco_diTrk = CompFactory.DerivationFramework.Reco_Vertex(
49 name = "BPHY3_Reco_diTrk",
50 VertexSearchTool = BPHY3JpsiFinder,
51 OutputVtxContainerName = "BPHY3VertexCandidates",
52 V0Tools = V0Tools,
53 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
54 PVContainerName = "PrimaryVertices",
55 RefPVContainerName = "BPHY3RefittedPrimaryVertices")
56 BPHY3_Select_PiPi = CompFactory.DerivationFramework.Select_onia2mumu(
57 name = "BPHY3_Select_PiPi",
58 HypothesisName = "PiPi",
59 InputVtxContainerName = "BPHY3VertexCandidates",
60 V0Tools = V0Tools,
61 TrkMasses = [139.57,139.57],
62 VtxMassHypo = 497.614,
63 MassMin = 300.0,
64 MassMax = 700.0,
65 Chi2Max = 20)
66 BPHY3_Select_PiK = CompFactory.DerivationFramework.Select_onia2mumu(
67 name = "BPHY3_Select_PiK",
68 HypothesisName = "PiK",
69 InputVtxContainerName = "BPHY3VertexCandidates",
70 V0Tools = V0Tools,
71 TrkMasses = [139.57,493.677],
72 VtxMassHypo = 892.,
73 MassMin = 0.0,
74 MassMax = 3500.0,
75 Chi2Max = 10)
76 BPHY3_Select_KPi = CompFactory.DerivationFramework.Select_onia2mumu(
77 name = "BPHY3_Select_KPi",
78 HypothesisName = "KPi",
79 InputVtxContainerName = "BPHY3VertexCandidates",
80 V0Tools = V0Tools,
81 TrkMasses = [493.677,139.57],
82 VtxMassHypo = 892.,
83 MassMin = 0.0,
84 MassMax = 3500.0,
85 Chi2Max = 10)
86 BPHY3_Select_KK = CompFactory.DerivationFramework.Select_onia2mumu(
87 name = "BPHY3_Select_KK",
88 HypothesisName = "KK",
89 InputVtxContainerName = "BPHY3VertexCandidates",
90 V0Tools = V0Tools,
91 TrkMasses = [493.677,493.677],
92 VtxMassHypo = 1019.461,
93 MassMin = 0.0,
94 MassMax = 1100.0,
95 Chi2Max = 20)
96 BPHY3_Select_PP = CompFactory.DerivationFramework.Select_onia2mumu(
97 name = "BPHY3_Select_PP",
98 HypothesisName = "PP",
99 InputVtxContainerName = "BPHY3VertexCandidates",
100 V0Tools = V0Tools,
101 TrkMasses = [938.272,938.272],
102 VtxMassHypo = 3096.916,
103 MassMin = 2800.0,
104 MassMax = 3600.0,
105 Chi2Max = 1)
106
107 expression = "count(BPHY3VertexCandidates.passed_PiPi) > 0 || count(BPHY3VertexCandidates.passed_KPi) > 0 || count(BPHY3VertexCandidates.passed_PiK) > 0 || count(BPHY3VertexCandidates.passed_KK) > 0 || count(BPHY3VertexCandidates.passed_PP) > 0"
108 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
109 xAODStringSkimmingToolCfg)
110 BPHY3_SelectEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
111 flags, name = "BPHY3_SelectEvent", expression = expression))
112
113 BPHY3Thin_vtxTrk = CompFactory.DerivationFramework.Thin_vtxTrk(
114 name = "BPHY3Thin_vtxTrk",
115 TrackParticleContainerName = "InDetTrackParticles",
116 VertexContainerNames = ["BPHY3VertexCandidates"],
117 StreamName = streamName,
118 PassFlags = ["passed_PiPi","passed_KPi","passed_PiK","passed_KK","passed_PP"])
119 augCollections=[BPHY3_Reco_diTrk,BPHY3_Select_PiPi,BPHY3_Select_KPi,BPHY3_Select_PiK,BPHY3_Select_KK,BPHY3_Select_PP]
120 skimCollections = [BPHY3_SelectEvent]
121 BPHY3ThinningTools = [BPHY3Thin_vtxTrk]
122 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
123 "BPHY3Kernel",
124 AugmentationTools = augCollections,
125 SkimmingTools = skimCollections,
126 ThinningTools = BPHY3ThinningTools))
127
128 for t in augCollections +BPHY3ThinningTools +skimCollections : acc.addPublicTool(t)
129 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
130 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
131 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
132 BPHY3SlimmingHelper =
SlimmingHelper(
"BPHY3SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
133 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
134 AllVariables = getDefaultAllVariables()
135 StaticContent = []
136
137
138 AllVariables += ["PrimaryVertices"]
139
140
141 AllVariables += ["InDetTrackParticles"]
142
143
144 StaticContent += ["xAOD::VertexContainer#%s" % BPHY3_Reco_diTrk.OutputVtxContainerName]
145
146 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY3_Reco_diTrk.OutputVtxContainerName]
147 BPHY3SlimmingHelper.AllVariables = AllVariables
148 BPHY3SlimmingHelper.StaticContent = StaticContent
149 BPHY3ItemList = BPHY3SlimmingHelper.GetItemList()
150 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY3", ItemList=BPHY3ItemList, AcceptAlgs=["BPHY3Kernel"]))
151 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY3", AcceptAlgs=["BPHY3Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
152 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
153 return acc