16 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
17 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
18 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
21 isSimulation = flags.Input.isMC
22 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
24 acc.addPublicTool(vkalvrt)
25 acc.addPublicTool(V0Tools)
27 acc.addPublicTool(trackselect)
29 acc.addPublicTool(vpest)
31 acc.addPublicTool(PVrefit)
32 BPHY22_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
33 name =
"BPHY22_AugOriginalCounts",
34 VertexContainer =
"PrimaryVertices",
35 TrackContainer =
"InDetTrackParticles" )
37 BPHY22MuPiFinder = CompFactory.Analysis.JpsiFinder(
38 name =
"BPHY22MuPiFinder",
41 TrackAndTrack =
False,
42 assumeDiMuons =
False,
43 muonThresholdPt = 2700,
44 trackThresholdPt = 250.0,
45 invMassUpper = 8200.0,
48 oppChargesOnly =
False,
49 allChargeCombinations =
True,
50 atLeastOneComb =
False,
51 useCombinedMeasurement =
False,
52 muonCollectionKey =
"Muons",
53 TrackParticleCollection =
"InDetTrackParticles",
54 V0VertexFitterTool =
None,
56 TrkVertexFitterTool = vkalvrt,
57 TrackSelectorTool = trackselect,
58 VertexPointEstimator = vpest,
61 forceTagAndProbe =
True)
63 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
64 name =
"BPHY22MuPiSelectAndWrite",
65 VertexSearchTool = BPHY22MuPiFinder,
66 OutputVtxContainerName =
"BPHY22MuPiCandidates",
69 PVContainerName =
"PrimaryVertices",
70 RefPVContainerName =
"SHOULDNOTBEUSED")
73 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
74 name =
"BPHY22DiTrkFinder",
78 assumeDiMuons =
False,
79 trackThresholdPt = 900,
80 invMassUpper = 2100.0,
83 oppChargesOnly =
True,
84 atLeastOneComb =
False,
85 useCombinedMeasurement =
False,
86 muonCollectionKey =
"Muons",
87 TrackParticleCollection =
"InDetTrackParticles",
88 V0VertexFitterTool =
None,
90 TrkVertexFitterTool = vkalvrt,
91 TrackSelectorTool = trackselect,
92 VertexPointEstimator = vpest,
97 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
98 name =
"BPHY22DiTrkSelectAndWrite",
99 VertexSearchTool = BPHY22DiTrkFinder,
100 OutputVtxContainerName =
"BPHY22DiTrkCandidates",
101 PVContainerName =
"PrimaryVertices",
104 RefPVContainerName =
"SHOULDNOTBEUSED",
105 CheckCollections =
True,
106 CheckVertexContainers = [
'BPHY22MuPiCandidates'])
109 BMuDstVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
111 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
112 name =
"BPHY22MuDpst",
113 HypothesisName =
"B",
114 TrkVertexFitterTool = BMuDstVertexFit,
116 ApplyD0MassConstraint =
True,
117 MuPiMassLowerCut = 200.,
118 MuPiMassUpperCut = 8200.,
120 PVRefitter = PVrefit,
121 D0MassLowerCut = 1864.83 - 200.,
122 D0MassUpperCut = 1864.83 + 200.,
123 DstMassLowerCut = 2010.26 - 300.,
124 DstMassUpperCut = 2010.26 + 300.,
125 DstMassUpperCutAft = 2010.26 + 25.,
127 MassUpperCut = 12500.,
130 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
131 MuPiVertices =
"BPHY22MuPiCandidates",
132 CascadeVertexCollections = [
"BMuDpstCascadeSV2",
"BMuDpstCascadeSV1"],
133 D0Vertices =
"BPHY22DiTrkCandidates",
136 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
137 name =
"BPHY22Dh3Finder",
138 pionHypothesis =
True,
139 kaonHypothesis =
False,
140 trkThresholdPt = 900.0,
142 BThresholdPt = 2000.0,
146 TrkTrippletMassUpper = 2200,
147 TrkTrippletMassLower = 500,
148 TrkQuadrupletPt = 2000,
149 JpsiContainerKey =
"BPHY22DiTrkCandidates",
150 TrackParticleCollection =
"InDetTrackParticles",
151 MuonsUsedInJpsi =
"NONE",
152 ExcludeCrossJpsiTracks =
False,
153 TrkVertexFitterTool = vkalvrt,
154 TrackSelectorTool = trackselect,
155 UseMassConstraint =
False,
158 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
159 name =
"BPHY22Dh3SelectAndWrite",
160 VertexSearchTool = BPHY22Dh3Finder,
163 OutputVtxContainerName =
"BPHY22Dh3Candidates",
164 PVContainerName =
"PrimaryVertices",
165 RefPVContainerName =
"SHOULDNOTBEUSED",
168 BMuDxVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+
"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
170 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
172 HypothesisName =
"B",
173 TrkVertexFitterTool = BMuDxVertexFit,
175 PVRefitter = PVrefit,
177 ApplyDxMassConstraint =
False,
178 DxMassLowerCut = 1968.28 - 300.,
179 DxMassUpperCut = 1968.28 + 200.,
181 MassUpperCut = 12500,
185 TrackSelectorTool = trackselect,
187 muonThresholdPt = 2700,
188 muonCollectionKey =
"Muons",
189 useCombinedMeasurement =
False,
190 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
191 CascadeVertexCollections = [
"BMuDsCascadeSV2",
"BMuDsCascadeSV1"],
192 DxVertices =
"BPHY22Dh3Candidates")
194 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
196 HypothesisName =
"B",
197 TrkVertexFitterTool = BMuDxVertexFit,
199 PVRefitter = PVrefit,
201 ApplyDxMassConstraint =
False,
202 DxMassLowerCut = 1869.59 - 180.,
203 DxMassUpperCut = 1869.59 + 250.,
205 MassUpperCut = 12500,
209 TrackSelectorTool = trackselect,
211 muonThresholdPt = 2700,
212 muonCollectionKey =
"Muons",
213 useCombinedMeasurement =
False,
214 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
215 CascadeVertexCollections = [
"BMuDpCascadeSV2",
"BMuDpCascadeSV1"],
216 DxVertices =
"BPHY22Dh3Candidates")
218 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
219 name =
"BPHY22MuLambdaC",
220 HypothesisName =
"B",
221 TrkVertexFitterTool = BMuDxVertexFit,
223 PVRefitter = PVrefit,
225 ApplyDxMassConstraint =
False,
226 DxMassLowerCut = 2286.46 - 200,
227 DxMassUpperCut = 2286.46 + 220,
229 MassUpperCut = 12500,
233 TrackSelectorTool = trackselect,
235 muonThresholdPt = 2700,
236 muonCollectionKey =
"Muons",
237 useCombinedMeasurement =
False,
238 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
239 CascadeVertexCollections = [
"BMuLambdaCCascadeSV2",
"BMuLambdaCCascadeSV1"],
240 DxVertices =
"BPHY22Dh3Candidates")
242 CascadeCollections = []
243 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
244 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
245 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
246 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
249 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY22_AnyVertexSkimmingTool",
250 VertexContainerNames =CascadeCollections,
252 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
258 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
260 FilterList = [BPHY22_SelectBMuDxEvent] )
261 acc.addPublicTool(BPHY22SkimmingOR)
263 augTools = [BPHY22MuPiSelectAndWrite,
264 BPHY22DiTrkSelectAndWrite,
265 BPHY22Dh3SelectAndWrite,
270 BPHY22_AugOriginalCounts]
271 for t
in augTools : acc.addPublicTool(t)
272 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY22Kernel",
273 AugmentationTools = augTools,
275 SkimmingTools = [BPHY22SkimmingOR]
if not isSimulation
else [],
278 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
279 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
280 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
281 BPHY22SlimmingHelper =
SlimmingHelper(
"BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
284 BPHY22SlimmingHelper.IncludeMuonTriggerContent =
True
285 BPHY22SlimmingHelper.IncludeBPhysTriggerContent =
True
286 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
290 AllVariables += [
"PrimaryVertices"]
291 StaticContent += [
"xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
292 StaticContent += [
"xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
295 AllVariables += [
"InDetTrackParticles"]
300 AllVariables += [
"CombinedMuonTrackParticles"]
301 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
304 AllVariables += [
"Muons"]
307 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
309 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
312 for cascades
in CascadeCollections:
313 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
314 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
317 AllVariables += [
"MuonSpectrometerTrackParticles" ]
321 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
323 AllVariables =
list(
set(AllVariables))
324 BPHY22SlimmingHelper.AllVariables = AllVariables
325 BPHY22SlimmingHelper.StaticContent = StaticContent
326 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
327 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=[
"BPHY22Kernel"]))
328 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY22", AcceptAlgs=[
"BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
329 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)