15 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (
16 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
17 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
19 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
20 acc = ComponentAccumulator()
21 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
22 acc.addPublicTool(PVrefit)
23 isSimulation = flags.Input.isMC
25 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
26 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
27 acc.addPublicTool(vkalvrt)
28 acc.addPublicTool(V0Tools)
29 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
30 acc.addPublicTool(trackselect)
31 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
32 acc.addPublicTool(vpest)
33 BPHY10JpsiFinder = CompFactory.Analysis.JpsiFinder(
34 name =
"BPHY10JpsiFinder",
37 TrackAndTrack =
False,
39 invMassUpper = 4000.0,
40 invMassLower = 2600.0,
42 oppChargesOnly =
True,
44 atLeastOneComb =
False,
45 useCombinedMeasurement =
False,
46 muonCollectionKey =
"Muons",
47 TrackParticleCollection =
"InDetTrackParticles",
48 TrkVertexFitterTool = vkalvrt,
49 TrackSelectorTool = trackselect,
50 VertexPointEstimator = vpest,
53 BPHY10JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
54 name =
"BPHY10JpsiSelectAndWrite",
55 VertexSearchTool = BPHY10JpsiFinder,
56 OutputVtxContainerName =
"BPHY10JpsiCandidates",
57 PVContainerName =
"PrimaryVertices",
60 RefPVContainerName =
"SHOULDNOTBEUSED",
62 BPHY10_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
63 name =
"BPHY10_Select_Jpsi2mumu",
64 HypothesisName =
"Jpsi",
65 InputVtxContainerName =
"BPHY10JpsiCandidates",
67 VtxMassHypo = 3096.916,
73 BPHY10BdJpsiKst = CompFactory.Analysis.JpsiPlus2Tracks(
74 name =
"BPHY10BdJpsiKst",
75 kaonkaonHypothesis =
False,
76 pionpionHypothesis =
False,
77 kaonpionHypothesis =
True,
78 trkThresholdPt = 500.0,
83 JpsiContainerKey =
"BPHY10JpsiCandidates",
84 TrackParticleCollection =
"InDetTrackParticles",
85 ExcludeCrossJpsiTracks =
False,
86 TrkVertexFitterTool = vkalvrt,
87 TrackSelectorTool = trackselect,
88 UseMassConstraint =
True,
91 TrkQuadrupletMassLower = 3500.0,
92 TrkQuadrupletMassUpper = 6800.0,
95 BPHY10V0ContainerName =
"BPHY10RecoV0Candidates"
96 BPHY10KshortContainerName =
"BPHY10RecoKshortCandidates"
97 BPHY10LambdaContainerName =
"BPHY10RecoLambdaCandidates"
98 BPHY10LambdabarContainerName =
"BPHY10RecoLambdabarCandidates"
100 BPHY10BdKstSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
101 name =
"BPHY10BdKstSelectAndWrite",
102 VertexSearchTool = BPHY10BdJpsiKst,
103 OutputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
104 PVContainerName =
"PrimaryVertices",
106 PVRefitter = PVrefit,
107 RefPVContainerName =
"BPHY10RefittedPrimaryVertices1",
112 BPHY10_Select_Bd2JpsiKst = CompFactory.DerivationFramework.Select_onia2mumu(
113 name =
"BPHY10_Select_Bd2JpsiKst",
114 HypothesisName =
"Bd",
115 InputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
117 TrkMasses = [105.658, 105.658, 493.677, 139.570],
118 VtxMassHypo = 5279.6,
123 BPHY10_Select_Bd2JpsiKstbar = CompFactory.DerivationFramework.Select_onia2mumu(
124 name =
"BPHY10_Select_Bd2JpsiKstbar",
125 HypothesisName =
"Bdbar",
126 InputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
128 TrkMasses = [105.658, 105.658, 139.570, 493.677],
129 VtxMassHypo = 5279.6,
134 from DerivationFrameworkBPhys.V0ToolConfig
import BPHY_Reco_V0FinderCfg
135 BPHY10_Reco_V0Finder = acc.popToolsAndMerge(BPHY_Reco_V0FinderCfg(
136 flags, derivation = BPHYDerivationName,
137 V0ContainerName = BPHY10V0ContainerName,
138 KshortContainerName = BPHY10KshortContainerName,
139 LambdaContainerName = BPHY10LambdaContainerName,
140 LambdabarContainerName = BPHY10LambdabarContainerName,
141 CheckVertexContainers = [
'BPHY10JpsiCandidates']))
143 from TrkConfig.TrkVKalVrtFitterConfig
import JpsiV0VertexFitCfg
144 JpsiV0VertexFit = acc.popToolsAndMerge(JpsiV0VertexFitCfg(flags))
145 acc.addPublicTool(JpsiV0VertexFit)
147 BPHY10JpsiKshort = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
148 name =
"BPHY10JpsiKshort",
150 HypothesisName =
"Bd",
151 TrkVertexFitterTool = JpsiV0VertexFit,
153 PVRefitter = PVrefit,
154 JpsiMassLowerCut = 2800.,
155 JpsiMassUpperCut = 4000.,
156 V0MassLowerCut = 400.,
157 V0MassUpperCut = 600.,
158 MassLowerCut = 4300.,
159 MassUpperCut = 6300.,
161 RefPVContainerName =
"BPHY10RefittedPrimaryVertices2",
162 JpsiVertices =
"BPHY10JpsiCandidates",
163 CascadeVertexCollections= [
"BPHY10JpsiKshortCascadeSV2",
"BPHY10JpsiKshortCascadeSV1"],
164 V0Vertices = BPHY10V0ContainerName)
166 BPHY10JpsiLambda = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
167 name =
"BPHY10JpsiLambda",
169 HypothesisName =
"Lambda_b",
170 TrkVertexFitterTool = JpsiV0VertexFit,
171 PVRefitter = PVrefit,
173 JpsiMassLowerCut = 2800.,
174 JpsiMassUpperCut = 4000.,
175 V0MassLowerCut = 1050.,
176 V0MassUpperCut = 1250.,
177 MassLowerCut = 4600.,
178 MassUpperCut = 6600.,
180 RefPVContainerName =
"BPHY10RefittedPrimaryVertices3",
181 JpsiVertices =
"BPHY10JpsiCandidates",
182 CascadeVertexCollections= [
"BPHY10JpsiLambdaCascadeSV2",
"BPHY10JpsiLambdaCascadeSV1"],
183 V0Vertices = BPHY10V0ContainerName)
185 BPHY10JpsiLambdabar = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
186 name =
"BPHY10JpsiLambdabar",
187 HypothesisName =
"Lambda_bbar",
189 TrkVertexFitterTool = JpsiV0VertexFit,
190 PVRefitter = PVrefit,
191 V0Hypothesis = -3122,
192 JpsiMassLowerCut = 2800.,
193 JpsiMassUpperCut = 4000.,
194 V0MassLowerCut = 1050.,
195 V0MassUpperCut = 1250.,
196 MassLowerCut = 4600.,
197 MassUpperCut = 6600.,
199 RefPVContainerName =
"BPHY10RefittedPrimaryVertices4",
200 JpsiVertices =
"BPHY10JpsiCandidates",
201 CascadeVertexCollections= [
"BPHY10JpsiLambdabarCascadeSV2",
"BPHY10JpsiLambdabarCascadeSV1"],
202 V0Vertices = BPHY10V0ContainerName)
204 CascadeCollections = []
205 CascadeCollections += BPHY10JpsiKshort.CascadeVertexCollections
206 CascadeCollections += BPHY10JpsiLambda.CascadeVertexCollections
207 CascadeCollections += BPHY10JpsiLambdabar.CascadeVertexCollections
209 BPHY10_AugOriginalCounts = acc.popToolsAndMerge(
210 AugOriginalCountsCfg(flags, name =
"BPHY10_AugOriginalCounts"))
213 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
214 xAODStringSkimmingToolCfg)
215 BPHY10_SelectBdJpsiKstEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
216 flags, name =
"BPHY10_SelectBdJpsiKstEvent",
217 expression =
"(count(BPHY10BdJpsiKstCandidates.passed_Bd > 0) + count(BPHY10BdJpsiKstCandidates.passed_Bdbar > 0)) >0"))
219 BPHY10_cascadeCheck = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
220 "BPHY10_AnyVertexSkimmingTool",
221 VertexContainerNames =CascadeCollections )
222 BPHY10SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
224 FilterList = [BPHY10_cascadeCheck, BPHY10_SelectBdJpsiKstEvent])
225 acc.addPublicTool(BPHY10_cascadeCheck)
226 acc.addPublicTool(BPHY10SkimmingOR)
228 augTools = [BPHY10JpsiSelectAndWrite, BPHY10_Select_Jpsi2mumu,
229 BPHY10BdKstSelectAndWrite, BPHY10_Select_Bd2JpsiKst, BPHY10_Select_Bd2JpsiKstbar,
230 BPHY10_Reco_V0Finder, BPHY10JpsiKshort, BPHY10JpsiLambda, BPHY10JpsiLambdabar,
231 BPHY10_AugOriginalCounts]
232 for t
in augTools : acc.addPublicTool(t)
234 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY10Kernel",
235 AugmentationTools = augTools,
238 SkimmingTools = [BPHY10SkimmingOR]
if not isSimulation
else [],
240 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
241 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
242 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
243 BPHY10SlimmingHelper =
SlimmingHelper(
"BPHY10SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
244 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
245 AllVariables = getDefaultAllVariables()
249 BPHY10SlimmingHelper.IncludeMuonTriggerContent =
True
250 BPHY10SlimmingHelper.IncludeBPhysTriggerContent =
True
253 AllVariables += [
"PrimaryVertices"]
256 StaticContent += [
"xAOD::VertexContainer#BPHY10RefittedPrimaryVertices%s" % str(x)]
257 StaticContent += [
"xAOD::VertexAuxContainer#BPHY10RefittedPrimaryVertices%sAux." % str(x)]
260 AllVariables += [
"InDetTrackParticles"]
265 AllVariables += [
"CombinedMuonTrackParticles"]
266 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
269 AllVariables += [
"Muons",
"MuonsLRT"]
273 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10JpsiSelectAndWrite.OutputVtxContainerName]
275 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10JpsiSelectAndWrite.OutputVtxContainerName]
277 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10BdKstSelectAndWrite.OutputVtxContainerName]
278 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10BdKstSelectAndWrite.OutputVtxContainerName]
280 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10V0ContainerName]
281 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10V0ContainerName]
282 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10KshortContainerName]
283 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10KshortContainerName]
284 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10LambdaContainerName]
285 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10LambdaContainerName]
286 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10LambdabarContainerName]
287 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10LambdabarContainerName]
289 for cascades
in CascadeCollections:
290 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
291 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
294 AllVariables += [
"GSFTrackParticles",
"MuonSpectrometerTrackParticles" ]
298 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
300 AllVariables = list(
set(AllVariables))
302 BPHY10SlimmingHelper.AllVariables = AllVariables
303 BPHY10SlimmingHelper.StaticContent = StaticContent
304 BPHY10SlimmingHelper.SmartCollections = []
305 BPHY10ItemList = BPHY10SlimmingHelper.GetItemList()
306 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY10", ItemList=BPHY10ItemList, AcceptAlgs=[
"BPHY10Kernel"]))
307 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY10", AcceptAlgs=[
"BPHY10Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
308 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)