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",
30 assumeDiMuons =
False,
31 invMassUpper = 10000.0,
34 oppChargesOnly =
True,
35 atLeastOneComb =
False,
36 useCombinedMeasurement =
False,
37 muonCollectionKey =
"Muons",
38 TrackParticleCollection =
"InDetTrackParticles",
39 V0VertexFitterTool =
None,
41 TrkVertexFitterTool = vkalvrt,
42 TrackSelectorTool = trackselect,
43 VertexPointEstimator = vpest,
48 BPHY3_Reco_diTrk = CompFactory.DerivationFramework.Reco_Vertex(
49 name =
"BPHY3_Reco_diTrk",
50 VertexSearchTool = BPHY3JpsiFinder,
51 OutputVtxContainerName =
"BPHY3VertexCandidates",
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",
61 TrkMasses = [139.57,139.57],
62 VtxMassHypo = 497.614,
66 BPHY3_Select_PiK = CompFactory.DerivationFramework.Select_onia2mumu(
67 name =
"BPHY3_Select_PiK",
68 HypothesisName =
"PiK",
69 InputVtxContainerName =
"BPHY3VertexCandidates",
71 TrkMasses = [139.57,493.677],
76 BPHY3_Select_KPi = CompFactory.DerivationFramework.Select_onia2mumu(
77 name =
"BPHY3_Select_KPi",
78 HypothesisName =
"KPi",
79 InputVtxContainerName =
"BPHY3VertexCandidates",
81 TrkMasses = [493.677,139.57],
86 BPHY3_Select_KK = CompFactory.DerivationFramework.Select_onia2mumu(
87 name =
"BPHY3_Select_KK",
88 HypothesisName =
"KK",
89 InputVtxContainerName =
"BPHY3VertexCandidates",
91 TrkMasses = [493.677,493.677],
92 VtxMassHypo = 1019.461,
96 BPHY3_Select_PP = CompFactory.DerivationFramework.Select_onia2mumu(
97 name =
"BPHY3_Select_PP",
98 HypothesisName =
"PP",
99 InputVtxContainerName =
"BPHY3VertexCandidates",
101 TrkMasses = [938.272,938.272],
102 VtxMassHypo = 3096.916,
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))
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(
124 AugmentationTools = augCollections,
125 SkimmingTools = skimCollections,
126 ThinningTools = BPHY3ThinningTools))
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()
138 AllVariables += [
"PrimaryVertices"]
141 AllVariables += [
"InDetTrackParticles"]
144 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY3_Reco_diTrk.OutputVtxContainerName]
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)