15 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
16 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
19 isSimulation = flags.Input.isMC
20 BPHY10_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
21 name =
"BPHY10_AugOriginalCounts",
22 VertexContainer =
"PrimaryVertices",
23 TrackContainer =
"InDetTrackParticles" )
24 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
26 acc.addPublicTool(vkalvrt)
27 acc.addPublicTool(V0Tools)
29 acc.addPublicTool(trackselect)
31 acc.addPublicTool(vpest)
32 BPHY10JpsiFinder = CompFactory.Analysis.JpsiFinder(
33 name =
"BPHY10JpsiFinder",
36 TrackAndTrack =
False,
38 invMassUpper = 4000.0,
39 invMassLower = 2600.0,
41 oppChargesOnly =
True,
43 atLeastOneComb =
False,
44 useCombinedMeasurement =
False,
45 muonCollectionKey =
"Muons",
46 TrackParticleCollection =
"InDetTrackParticles",
47 V0VertexFitterTool =
None,
49 TrkVertexFitterTool = vkalvrt,
50 TrackSelectorTool = trackselect,
51 VertexPointEstimator = vpest,
54 BPHY10JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
55 name =
"BPHY10JpsiSelectAndWrite",
56 VertexSearchTool = BPHY10JpsiFinder,
57 OutputVtxContainerName =
"BPHY10JpsiCandidates",
58 PVContainerName =
"PrimaryVertices",
61 RefPVContainerName =
"SHOULDNOTBEUSED",
63 BPHY10_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
64 name =
"BPHY10_Select_Jpsi2mumu",
65 HypothesisName =
"Jpsi",
66 InputVtxContainerName =
"BPHY10JpsiCandidates",
68 VtxMassHypo = 3096.916,
74 BPHY10BdJpsiKst = CompFactory.Analysis.JpsiPlus2Tracks(
75 name =
"BPHY10BdJpsiKst",
76 kaonkaonHypothesis =
False,
77 pionpionHypothesis =
False,
78 kaonpionHypothesis =
True,
79 trkThresholdPt = 500.0,
84 JpsiContainerKey =
"BPHY10JpsiCandidates",
85 TrackParticleCollection =
"InDetTrackParticles",
86 ExcludeCrossJpsiTracks =
False,
87 TrkVertexFitterTool = vkalvrt,
88 TrackSelectorTool = trackselect,
89 UseMassConstraint =
True,
92 TrkQuadrupletMassLower = 3500.0,
93 TrkQuadrupletMassUpper = 6800.0,
96 BPHY10V0ContainerName =
"BPHY10RecoV0Candidates"
97 BPHY10KshortContainerName =
"BPHY10RecoKshortCandidates"
98 BPHY10LambdaContainerName =
"BPHY10RecoLambdaCandidates"
99 BPHY10LambdabarContainerName =
"BPHY10RecoLambdabarCandidates"
101 BPHY10BdKstSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
102 name =
"BPHY10BdKstSelectAndWrite",
103 VertexSearchTool = BPHY10BdJpsiKst,
104 OutputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
105 PVContainerName =
"PrimaryVertices",
108 RefPVContainerName =
"BPHY10RefittedPrimaryVertices1",
113 BPHY10_Select_Bd2JpsiKst = CompFactory.DerivationFramework.Select_onia2mumu(
114 name =
"BPHY10_Select_Bd2JpsiKst",
115 HypothesisName =
"Bd",
116 InputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
118 TrkMasses = [105.658, 105.658, 493.677, 139.570],
119 VtxMassHypo = 5279.6,
124 BPHY10_Select_Bd2JpsiKstbar = CompFactory.DerivationFramework.Select_onia2mumu(
125 name =
"BPHY10_Select_Bd2JpsiKstbar",
126 HypothesisName =
"Bdbar",
127 InputVtxContainerName =
"BPHY10BdJpsiKstCandidates",
129 TrkMasses = [105.658, 105.658, 139.570, 493.677],
130 VtxMassHypo = 5279.6,
135 from DerivationFrameworkBPhys.V0ToolConfig
import BPHY_Reco_V0FinderCfg
137 flags, derivation = BPHYDerivationName,
138 V0ContainerName = BPHY10V0ContainerName,
139 KshortContainerName = BPHY10KshortContainerName,
140 LambdaContainerName = BPHY10LambdaContainerName,
141 LambdabarContainerName = BPHY10LambdabarContainerName,
142 CheckVertexContainers = [
'BPHY10JpsiCandidates']))
144 from TrkConfig.TrkVKalVrtFitterConfig
import JpsiV0VertexFitCfg
146 acc.addPublicTool(JpsiV0VertexFit)
148 BPHY10JpsiKshort = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
149 name =
"BPHY10JpsiKshort",
151 HypothesisName =
"Bd",
152 TrkVertexFitterTool = JpsiV0VertexFit,
155 JpsiMassLowerCut = 2800.,
156 JpsiMassUpperCut = 4000.,
157 V0MassLowerCut = 400.,
158 V0MassUpperCut = 600.,
159 MassLowerCut = 4300.,
160 MassUpperCut = 6300.,
162 RefPVContainerName =
"BPHY10RefittedPrimaryVertices2",
163 JpsiVertices =
"BPHY10JpsiCandidates",
164 CascadeVertexCollections= [
"BPHY10JpsiKshortCascadeSV2",
"BPHY10JpsiKshortCascadeSV1"],
165 V0Vertices = BPHY10V0ContainerName)
167 BPHY10JpsiLambda = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
168 name =
"BPHY10JpsiLambda",
170 HypothesisName =
"Lambda_b",
171 TrkVertexFitterTool = JpsiV0VertexFit,
174 JpsiMassLowerCut = 2800.,
175 JpsiMassUpperCut = 4000.,
176 V0MassLowerCut = 1050.,
177 V0MassUpperCut = 1250.,
178 MassLowerCut = 4600.,
179 MassUpperCut = 6600.,
181 RefPVContainerName =
"BPHY10RefittedPrimaryVertices3",
182 JpsiVertices =
"BPHY10JpsiCandidates",
183 CascadeVertexCollections= [
"BPHY10JpsiLambdaCascadeSV2",
"BPHY10JpsiLambdaCascadeSV1"],
184 V0Vertices = BPHY10V0ContainerName)
186 BPHY10JpsiLambdabar = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
187 name =
"BPHY10JpsiLambdabar",
188 HypothesisName =
"Lambda_bbar",
190 TrkVertexFitterTool = JpsiV0VertexFit,
192 V0Hypothesis = -3122,
193 JpsiMassLowerCut = 2800.,
194 JpsiMassUpperCut = 4000.,
195 V0MassLowerCut = 1050.,
196 V0MassUpperCut = 1250.,
197 MassLowerCut = 4600.,
198 MassUpperCut = 6600.,
200 RefPVContainerName =
"BPHY10RefittedPrimaryVertices4",
201 JpsiVertices =
"BPHY10JpsiCandidates",
202 CascadeVertexCollections= [
"BPHY10JpsiLambdabarCascadeSV2",
"BPHY10JpsiLambdabarCascadeSV1"],
203 V0Vertices = BPHY10V0ContainerName)
205 CascadeCollections = []
206 CascadeCollections += BPHY10JpsiKshort.CascadeVertexCollections
207 CascadeCollections += BPHY10JpsiLambda.CascadeVertexCollections
208 CascadeCollections += BPHY10JpsiLambdabar.CascadeVertexCollections
211 BPHY10_SelectBdJpsiKstEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
212 name =
"BPHY10_SelectBdJpsiKstEvent",
213 expression =
"(count(BPHY10BdJpsiKstCandidates.passed_Bd > 0) + count(BPHY10BdJpsiKstCandidates.passed_Bdbar > 0)) >0")
215 BPHY10_cascadeCheck = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY10_AnyVertexSkimmingTool",
216 VertexContainerNames =CascadeCollections,
218 BPHY10SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
220 FilterList = [BPHY10_cascadeCheck, BPHY10_SelectBdJpsiKstEvent])
221 acc.addPublicTool(BPHY10_cascadeCheck)
222 acc.addPublicTool(BPHY10_SelectBdJpsiKstEvent)
223 acc.addPublicTool(BPHY10SkimmingOR)
226 augTools = [BPHY10JpsiSelectAndWrite, BPHY10_Select_Jpsi2mumu,
227 BPHY10BdKstSelectAndWrite, BPHY10_Select_Bd2JpsiKst, BPHY10_Select_Bd2JpsiKstbar,
228 BPHY10_Reco_V0Finder, BPHY10JpsiKshort, BPHY10JpsiLambda, BPHY10JpsiLambdabar,
229 BPHY10_AugOriginalCounts]
230 for t
in augTools : acc.addPublicTool(t)
232 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY10Kernel",
233 AugmentationTools = augTools,
236 SkimmingTools = [BPHY10SkimmingOR]
if not isSimulation
else [],
238 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
239 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
240 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
241 BPHY10SlimmingHelper =
SlimmingHelper(
"BPHY10SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
242 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
247 BPHY10SlimmingHelper.IncludeMuonTriggerContent =
True
248 BPHY10SlimmingHelper.IncludeBPhysTriggerContent =
True
251 AllVariables += [
"PrimaryVertices"]
254 StaticContent += [
"xAOD::VertexContainer#BPHY10RefittedPrimaryVertices%s" %
str(x)]
255 StaticContent += [
"xAOD::VertexAuxContainer#BPHY10RefittedPrimaryVertices%sAux." %
str(x)]
258 AllVariables += [
"InDetTrackParticles"]
263 AllVariables += [
"CombinedMuonTrackParticles"]
264 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
267 AllVariables += [
"Muons",
"MuonsLRT"]
271 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10JpsiSelectAndWrite.OutputVtxContainerName]
273 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10JpsiSelectAndWrite.OutputVtxContainerName]
275 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10BdKstSelectAndWrite.OutputVtxContainerName]
276 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10BdKstSelectAndWrite.OutputVtxContainerName]
278 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10V0ContainerName]
279 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10V0ContainerName]
280 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10KshortContainerName]
281 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10KshortContainerName]
282 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10LambdaContainerName]
283 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10LambdaContainerName]
284 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY10LambdabarContainerName]
285 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY10LambdabarContainerName]
287 for cascades
in CascadeCollections:
288 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
289 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
292 AllVariables += [
"GSFTrackParticles",
"MuonSpectrometerTrackParticles" ]
296 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
298 AllVariables =
list(
set(AllVariables))
300 BPHY10SlimmingHelper.AllVariables = AllVariables
301 BPHY10SlimmingHelper.StaticContent = StaticContent
302 BPHY10SlimmingHelper.SmartCollections = []
303 BPHY10ItemList = BPHY10SlimmingHelper.GetItemList()
304 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY10", ItemList=BPHY10ItemList, AcceptAlgs=[
"BPHY10Kernel"]))
305 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY10", AcceptAlgs=[
"BPHY10Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
306 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)