16 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (
17 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
18 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
20 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
21 acc = ComponentAccumulator()
22 isSimulation = flags.Input.isMC
24 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
25 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
26 acc.addPublicTool(vkalvrt)
27 acc.addPublicTool(V0Tools)
28 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
29 acc.addPublicTool(trackselect)
30 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
31 acc.addPublicTool(vpest)
32 BPHY2JpsiFinder = CompFactory.Analysis.JpsiFinder(name =
"BPHY2JpsiFinder",
35 TrackAndTrack =
False,
37 invMassUpper = 4700.0,
38 invMassLower = 2600.0,
40 oppChargesOnly =
True,
42 atLeastOneComb =
False,
43 useCombinedMeasurement =
False,
44 muonCollectionKey =
"Muons",
45 TrackParticleCollection =
"InDetTrackParticles",
46 V0VertexFitterTool =
None,
48 TrkVertexFitterTool = vkalvrt,
49 TrackSelectorTool = trackselect,
50 VertexPointEstimator = vpest,
53 BPHY2JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(name =
"BPHY2JpsiSelectAndWrite",
54 VertexSearchTool = BPHY2JpsiFinder,
55 OutputVtxContainerName =
"BPHY2JpsiCandidates",
56 PVContainerName =
"PrimaryVertices",
57 RefPVContainerName =
"SHOULDNOTBEUSED",
59 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
62 BPHY2BsJpsiKK = CompFactory.Analysis.JpsiPlus2Tracks(name =
"BPHY2BsJpsiKK",
63 kaonkaonHypothesis =
True,
64 pionpionHypothesis =
False,
65 kaonpionHypothesis =
False,
66 trkThresholdPt = 800.0,
70 DiTrackMassUpper = 1019.445 + 100.,
71 DiTrackMassLower = 1019.445 - 100.,
73 TrkQuadrupletMassUpper = 6000.0,
74 TrkQuadrupletMassLower = 4800.0,
75 JpsiContainerKey =
"BPHY2JpsiCandidates",
76 TrackParticleCollection =
"InDetTrackParticles",
77 MuonsUsedInJpsi =
"Muons",
78 TrkVertexFitterTool = vkalvrt,
79 TrackSelectorTool = trackselect,
80 UseMassConstraint =
False)
82 BPHY2BsKKSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(name =
"BPHY2BsKKSelectAndWrite",
83 VertexSearchTool = BPHY2BsJpsiKK,
84 OutputVtxContainerName =
"BPHY2BsJpsiKKCandidates",
85 PVContainerName =
"PrimaryVertices",
86 RefPVContainerName =
"BPHY2RefittedPrimaryVertices",
89 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
90 MaxPVrefit = 10000, DoVertexType = 7)
92 BPHY2_Select_Psi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
93 name =
"BPHY2_Select_Psi2mumu",
94 HypothesisName =
"Psi",
95 InputVtxContainerName =
"BPHY2JpsiCandidates",
97 VtxMassHypo = 3686.09,
103 BPHY2_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
104 name =
"BPHY2_Select_Jpsi2mumu",
105 HypothesisName =
"Jpsi",
106 InputVtxContainerName =
"BPHY2JpsiCandidates",
108 VtxMassHypo = 3096.916,
114 BPHY2_Select_Bs2JpsiKK = CompFactory.DerivationFramework.Select_onia2mumu(
115 name =
"BPHY2_Select_Bs2JpsiKK",
116 HypothesisName =
"Bs",
117 InputVtxContainerName =
"BPHY2BsJpsiKKCandidates",
119 TrkMasses = [105.658, 105.658, 493.677, 493.677],
120 VtxMassHypo = 5366.3,
125 BPHY2_AugOriginalCounts = acc.popToolsAndMerge(
126 AugOriginalCountsCfg(flags, name =
"BPHY2_AugOriginalCounts"))
130 BPHY2_thinningTool_Tracks = CompFactory.DerivationFramework.Thin_vtxTrk(
131 name =
"BPHY2_thinningTool_Tracks",
132 TrackParticleContainerName =
"InDetTrackParticles",
133 StreamName = streamName,
134 VertexContainerNames = [
"BPHY2BsJpsiKKCandidates"],
135 PassFlags = [
"passed_Bs"] )
138 BPHY2_thinningTool_TracksPsi = CompFactory.DerivationFramework.Thin_vtxTrk(
139 name =
"BPHY2_thinningTool_TracksPsi",
140 TrackParticleContainerName =
"InDetTrackParticles",
141 StreamName = streamName,
142 VertexContainerNames = [
"BPHY2JpsiCandidates"],
143 PassFlags = [
"passed_Psi",
"passed_Jpsi"] )
145 BPHY2_thinningTool_PV = CompFactory.DerivationFramework.BPhysPVThinningTool(
146 name =
"BPHY2_thinningTool_PV",
147 CandidateCollections = [
"BPHY2BsJpsiKKCandidates"],
148 StreamName = streamName,
151 BPHY2MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name =
"BPHY2MuonTPThinningTool",
153 StreamName = streamName,
154 InDetTrackParticlesKey =
"InDetTrackParticles")
157 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
158 xAODStringSkimmingToolCfg)
159 BPHY2_SelectBsJpsiKKEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
160 flags, name =
"BPHY2_SelectBsJpsiKKEvent",
161 expression =
"count(BPHY2BsJpsiKKCandidates.passed_Bs > 0) > 0"))
166 BPHY2SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
168 FilterList = [BPHY2_SelectBsJpsiKKEvent ])
169 acc.addPublicTool(BPHY2SkimmingOR)
172 thiningCollection = [BPHY2_thinningTool_Tracks, BPHY2_thinningTool_TracksPsi, BPHY2_thinningTool_PV, BPHY2MuonTPThinningTool]
173 augCollection = [BPHY2JpsiSelectAndWrite, BPHY2BsKKSelectAndWrite,
174 BPHY2_Select_Psi2mumu, BPHY2_Select_Jpsi2mumu,
175 BPHY2_Select_Bs2JpsiKK, BPHY2_AugOriginalCounts]
176 for t
in augCollection + thiningCollection : acc.addPublicTool(t)
178 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY2Kernel",
179 AugmentationTools = augCollection,
181 SkimmingTools = [BPHY2SkimmingOR]
if not isSimulation
else [],
182 ThinningTools = thiningCollection))
184 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
185 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
186 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
187 BPHY2SlimmingHelper =
SlimmingHelper(
"BPHY2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
188 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
189 AllVariables = getDefaultAllVariables()
193 BPHY2SlimmingHelper.IncludeMuonTriggerContent =
True
194 BPHY2SlimmingHelper.IncludeBPhysTriggerContent =
True
197 SmartVar += [
"PrimaryVertices"]
198 StaticContent += [
"xAOD::VertexContainer#BPHY2RefittedPrimaryVertices"]
199 StaticContent += [
"xAOD::VertexAuxContainer#BPHY2RefittedPrimaryVerticesAux."]
202 AllVariables += [
"InDetTrackParticles"]
207 AllVariables += [
"CombinedMuonTrackParticles"]
210 SmartVar += [
"Muons"]
213 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY2JpsiSelectAndWrite.OutputVtxContainerName]
215 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY2JpsiSelectAndWrite.OutputVtxContainerName]
217 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY2BsKKSelectAndWrite.OutputVtxContainerName]
218 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY2BsKKSelectAndWrite.OutputVtxContainerName]
221 AllVariables += [
"MuonSpectrometerTrackParticles" ]
225 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles" ]
227 BPHY2SlimmingHelper.AllVariables = AllVariables
228 BPHY2SlimmingHelper.StaticContent = StaticContent
229 BPHY2SlimmingHelper.SmartCollections = SmartVar
230 BPHY2ItemList = BPHY2SlimmingHelper.GetItemList()
231 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY2", ItemList=BPHY2ItemList, AcceptAlgs=[
"BPHY2Kernel"]))
232 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY2", AcceptAlgs=[
"BPHY2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
233 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)