22 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
23 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
25 isSimulation = flags.Input.isMC
27 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
29 acc.addPublicTool(vkalvrt)
30 acc.addPublicTool(V0Tools)
32 acc.addPublicTool(trackselect)
34 acc.addPublicTool(vpest)
35 BPHY12_Finder_DiMuon = CompFactory.Analysis.JpsiFinder(
36 name =
"BPHY12_Finder_DiMuon",
39 TrackAndTrack =
False,
41 muonThresholdPt = 3000.,
46 oppChargesOnly =
False,
47 allChargeCombinations =
True,
48 atLeastOneComb =
True,
49 useCombinedMeasurement =
False,
50 muonCollectionKey =
"Muons",
51 TrackParticleCollection =
"InDetTrackParticles",
52 V0VertexFitterTool =
None,
54 TrkVertexFitterTool = vkalvrt,
55 TrackSelectorTool = trackselect,
56 VertexPointEstimator = vpest,
59 extraTools = [BPHY12_Finder_DiMuon]
63 BPHY12_SelectAndWrite_DiMuon = CompFactory.DerivationFramework.Reco_Vertex(
64 name =
"BPHY12_SelectAndWrite_DiMuon",
65 VertexSearchTool = BPHY12_Finder_DiMuon,
66 OutputVtxContainerName =
"BPHY12_DiMuon_Candidates",
67 PVContainerName =
"PrimaryVertices",
70 RefPVContainerName =
"SHOULDNOTBEUSED",
73 BPHY12_Select_DiMuons = CompFactory.DerivationFramework.Select_onia2mumu(
74 name =
"BPHY12_Select_DiMuons",
75 HypothesisName =
"Jpsi",
77 InputVtxContainerName =
"BPHY12_DiMuon_Candidates",
78 VtxMassHypo = 3096.916,
85 BPHY12_Finder_BdKstarKpiMuMu = CompFactory.Analysis.JpsiPlus2Tracks(
86 name =
"BPHY12_Finder_BdKstarKpiMuMu",
87 kaonkaonHypothesis =
False,
88 pionpionHypothesis =
False,
89 kaonpionHypothesis =
True,
90 oppChargesOnly =
False,
91 SameChargesOnly =
False,
92 trkThresholdPt = 500.0,
94 DiTrackMassUpper = 1110.,
95 DiTrackMassLower = 690.,
97 FinalDiTrackPt = 500.,
98 TrkQuadrupletMassUpper = 10000.0,
99 TrkQuadrupletMassLower = 1000.0,
102 BThresholdPt = 1000.,
104 JpsiContainerKey =
"BPHY12_DiMuon_Candidates",
105 TrackParticleCollection =
"InDetTrackParticles",
106 ExcludeCrossJpsiTracks =
False,
107 TrkVertexFitterTool = vkalvrt,
108 TrackSelectorTool = trackselect,
109 UseMassConstraint =
False,
110 CandidateLimit = 5000
113 BPHY12_SelectAndWrite_BdKstarKpiMuMu = CompFactory.DerivationFramework.Reco_Vertex(
114 name =
"BPHY12_SelectAndWrite_BdKstarKpiMuMu",
115 VertexSearchTool = BPHY12_Finder_BdKstarKpiMuMu,
116 OutputVtxContainerName =
"BPHY12_BdKstarKpiMuMu_Candidates",
117 PVContainerName =
"PrimaryVertices",
118 RefPVContainerName =
"BPHY12_BdKstarKpiMuMu_refitPV",
126 BPHY12_Select_BdKstarKpiMuMu = CompFactory.DerivationFramework.Select_onia2mumu(
127 name =
"BPHY12_Select_BdKstarKpiMuMu",
129 HypothesisName =
"Bd",
130 InputVtxContainerName =
"BPHY12_BdKstarKpiMuMu_Candidates",
131 TrkMasses = [105.658, 105.658, 493.677, 139.570],
132 VtxMassHypo = 5279.6,
137 BPHY12_Select_BdKstarKpiMuMu_anti = CompFactory.DerivationFramework.Select_onia2mumu(
138 name =
"BPHY12_Select_BdKstarKpiMuMu_anti",
140 HypothesisName =
"Bdbar",
141 InputVtxContainerName =
"BPHY12_BdKstarKpiMuMu_Candidates",
142 TrkMasses = [105.658, 105.658, 139.570, 493.677],
143 VtxMassHypo = 5279.6,
148 BPHY12_ReVertex_Kstar = CompFactory.DerivationFramework.ReVertex(
149 name =
"BPHY12_ReVertex_Kstar",
150 InputVtxContainerName =
"BPHY12_BdKstarKpiMuMu_Candidates",
153 TrackIndices = [ 2, 3 ],
154 TrkVertexFitterTool = vkalvrt,
155 OutputVtxContainerName =
"BPHY12_Kstar_ReVertexCandidates"
158 BPHY12_Select_KstarKpi = CompFactory.DerivationFramework.Select_onia2mumu(
159 name =
"BPHY12_Select_KstarKpi",
160 HypothesisName =
"Kstar",
161 InputVtxContainerName =
"BPHY12_Kstar_ReVertexCandidates",
163 TrkMasses = [ 493.677, 139.570 ],
164 VtxMassHypo = 891.66,
170 BPHY12_Select_KstarKpi_anti = CompFactory.DerivationFramework.Select_onia2mumu(
171 name =
"BPHY12_Select_KstarKpi_anti",
172 HypothesisName =
"Kstarbar",
173 InputVtxContainerName =
"BPHY12_Kstar_ReVertexCandidates",
175 TrkMasses = [ 139.570, 493.677 ],
176 VtxMassHypo = 891.66,
183 BPHY12_SelectBmumuKstEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
184 name =
"BPHY12_SelectBmumuKstEvent",
185 expression =
"(count(BPHY12_BdKstarKpiMuMu_Candidates.passed_Bd > 0) + count(BPHY12_BdKstarKpiMuMu_Candidates.passed_Bdbar > 0)) > 0")
187 extraTools += [BPHY12_SelectBmumuKstEvent]
189 if skimTruth
or not isSimulation:
190 filterlist = [BPHY12_SelectBmumuKstEvent]
191 for t
in filterlist : acc.addPublicTool(t)
195 BPHY12SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
196 name =
"BPHY12SkimmingOR",
197 FilterList = filterlist)
199 BPHY12Thin_vtxTrk = CompFactory.DerivationFramework.Thin_vtxTrk(
200 name =
"BPHY12Thin_vtxTrk",
201 TrackParticleContainerName =
"InDetTrackParticles",
202 StreamName = streamName,
203 VertexContainerNames = [
"BPHY12_BdKstarKpiMuMu_Candidates"],
204 PassFlags = [
"passed_Bd",
"passed_Bdbar"] )
206 BPHY12MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name =
"BPHY12MuonTPThinningTool",
207 StreamName = streamName,
209 InDetTrackParticlesKey =
"InDetTrackParticles")
211 BPHY12_thinningTool_PV = CompFactory.DerivationFramework.BPhysPVThinningTool(
212 name =
"BPHY12_thinningTool_PV",
213 StreamName = streamName,
214 CandidateCollections = [
"BPHY12_BdKstarKpiMuMu_Candidates"],
218 BPHY12TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name =
"BPHY12TruthThinTool",
219 ParticleSelectionString =
"TruthParticles.pdgId == 511 || TruthParticles.pdgId == -511 || TruthParticles.pdgId == 531 || TruthParticles.pdgId == -531",
220 PreserveDescendants =
True,
221 PreserveAncestors =
True)
223 BPHY12ThinningTools = [BPHY12Thin_vtxTrk, BPHY12_thinningTool_PV, BPHY12MuonTPThinningTool]
225 BPHY12ThinningTools.append(BPHY12TruthThinTool)
227 augTools = [BPHY12_SelectAndWrite_DiMuon, BPHY12_Select_DiMuons,
228 BPHY12_SelectAndWrite_BdKstarKpiMuMu, BPHY12_Select_BdKstarKpiMuMu, BPHY12_Select_BdKstarKpiMuMu_anti,
229 BPHY12_ReVertex_Kstar, BPHY12_Select_KstarKpi, BPHY12_Select_KstarKpi_anti]
230 skimTools = [BPHY12SkimmingOR]
if skimTruth
or not isSimulation
else []
233 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
235 AugmentationTools = augTools,
236 SkimmingTools = skimTools,
237 ThinningTools = BPHY12ThinningTools
240 for t
in augTools + skimTools + BPHY12ThinningTools + extraTools: acc.addPublicTool(t)
241 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
242 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
243 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
244 BPHY12SlimmingHelper =
SlimmingHelper(
"BPHY12SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
245 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
250 BPHY12SlimmingHelper.IncludeMuonTriggerContent =
True
251 BPHY12SlimmingHelper.IncludeBPhysTriggerContent =
True
254 AllVariables += [
"PrimaryVertices"]
255 StaticContent += [
"xAOD::VertexContainer#BPHY12_BdKstarKpiMuMu_refitPV"]
256 StaticContent += [
"xAOD::VertexAuxContainer#BPHY12_BdKstarKpiMuMu_refitPVAux."]
259 AllVariables += [
"InDetTrackParticles"]
264 AllVariables += [
"CombinedMuonTrackParticles"]
265 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
268 AllVariables += [
"Muons"]
271 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY12_SelectAndWrite_DiMuon.OutputVtxContainerName]
272 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY12_SelectAndWrite_DiMuon.OutputVtxContainerName]
273 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY12_SelectAndWrite_BdKstarKpiMuMu.OutputVtxContainerName]
274 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY12_SelectAndWrite_BdKstarKpiMuMu.OutputVtxContainerName]
275 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY12_ReVertex_Kstar.OutputVtxContainerName]
276 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY12_ReVertex_Kstar.OutputVtxContainerName]
281 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
283 BPHY12SlimmingHelper.AllVariables = AllVariables
284 BPHY12SlimmingHelper.StaticContent = StaticContent
285 BPHY12ItemList = BPHY12SlimmingHelper.GetItemList()
286 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY12", ItemList=BPHY12ItemList, AcceptAlgs=[
"BPHY12Kernel"]))
287 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY12", AcceptAlgs=[
"BPHY12Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
288 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)