16 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
17 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (
18 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
19 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
21 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
22 acc = ComponentAccumulator()
23 acc.getPrimaryAndMerge(PartPropSvcCfg(flags))
24 isSimulation = flags.Input.isMC
25 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
26 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
27 acc.addPublicTool(vkalvrt)
28 acc.addPublicTool(V0Tools)
29 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
30 acc.addPublicTool(trackselect)
31 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
32 acc.addPublicTool(vpest)
33 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
34 acc.addPublicTool(PVrefit)
36 BPHY22MuPiFinder = CompFactory.Analysis.JpsiFinder(
37 name =
"BPHY22MuPiFinder",
40 TrackAndTrack =
False,
41 assumeDiMuons =
False,
42 muonThresholdPt = 2700,
43 trackThresholdPt = 250.0,
44 invMassUpper = 8200.0,
47 oppChargesOnly =
False,
48 allChargeCombinations =
True,
49 atLeastOneComb =
False,
50 useCombinedMeasurement =
False,
51 muonCollectionKey =
"Muons",
52 TrackParticleCollection =
"InDetTrackParticles",
53 TrkVertexFitterTool = vkalvrt,
54 TrackSelectorTool = trackselect,
55 VertexPointEstimator = vpest,
58 forceTagAndProbe =
True)
60 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
61 name =
"BPHY22MuPiSelectAndWrite",
62 VertexSearchTool = BPHY22MuPiFinder,
63 OutputVtxContainerName =
"BPHY22MuPiCandidates",
66 PVContainerName =
"PrimaryVertices",
67 RefPVContainerName =
"SHOULDNOTBEUSED")
70 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
71 name =
"BPHY22DiTrkFinder",
75 assumeDiMuons =
False,
76 trackThresholdPt = 900,
77 invMassUpper = 2100.0,
80 oppChargesOnly =
True,
81 atLeastOneComb =
False,
82 useCombinedMeasurement =
False,
83 muonCollectionKey =
"Muons",
84 TrackParticleCollection =
"InDetTrackParticles",
85 TrkVertexFitterTool = vkalvrt,
86 TrackSelectorTool = trackselect,
87 VertexPointEstimator = vpest,
92 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
93 name =
"BPHY22DiTrkSelectAndWrite",
94 VertexSearchTool = BPHY22DiTrkFinder,
95 OutputVtxContainerName =
"BPHY22DiTrkCandidates",
96 PVContainerName =
"PrimaryVertices",
99 RefPVContainerName =
"SHOULDNOTBEUSED",
100 CheckCollections =
True,
101 CheckVertexContainers = [
'BPHY22MuPiCandidates'])
104 BMuDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
106 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
107 name =
"BPHY22MuDpst",
108 HypothesisName =
"B",
109 TrkVertexFitterTool = BMuDstVertexFit,
111 ApplyD0MassConstraint =
True,
112 MuPiMassLowerCut = 200.,
113 MuPiMassUpperCut = 8200.,
115 PVRefitter = PVrefit,
116 D0MassLowerCut = 1864.83 - 200.,
117 D0MassUpperCut = 1864.83 + 200.,
118 DstMassLowerCut = 2010.26 - 300.,
119 DstMassUpperCut = 2010.26 + 300.,
120 DstMassUpperCutAft = 2010.26 + 25.,
122 MassUpperCut = 12500.,
125 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
126 MuPiVertices =
"BPHY22MuPiCandidates",
127 CascadeVertexCollections = [
"BMuDpstCascadeSV2",
"BMuDpstCascadeSV1"],
128 D0Vertices =
"BPHY22DiTrkCandidates",
131 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
132 name =
"BPHY22Dh3Finder",
133 pionHypothesis =
True,
134 kaonHypothesis =
False,
135 trkThresholdPt = 900.0,
137 BThresholdPt = 2000.0,
141 TrkTrippletMassUpper = 2200,
142 TrkTrippletMassLower = 500,
143 TrkQuadrupletPt = 2000,
144 JpsiContainerKey =
"BPHY22DiTrkCandidates",
145 TrackParticleCollection =
"InDetTrackParticles",
146 MuonsUsedInJpsi =
"NONE",
147 ExcludeCrossJpsiTracks =
False,
148 TrkVertexFitterTool = vkalvrt,
149 TrackSelectorTool = trackselect,
150 UseMassConstraint =
False,
153 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
154 name =
"BPHY22Dh3SelectAndWrite",
155 VertexSearchTool = BPHY22Dh3Finder,
157 PVRefitter = PVrefit,
158 OutputVtxContainerName =
"BPHY22Dh3Candidates",
159 PVContainerName =
"PrimaryVertices",
160 RefPVContainerName =
"SHOULDNOTBEUSED",
163 BMuDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+
"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
165 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
167 HypothesisName =
"B",
168 TrkVertexFitterTool = BMuDxVertexFit,
170 PVRefitter = PVrefit,
172 ApplyDxMassConstraint =
False,
173 DxMassLowerCut = 1968.28 - 300.,
174 DxMassUpperCut = 1968.28 + 200.,
176 MassUpperCut = 12500,
180 TrackSelectorTool = trackselect,
182 muonThresholdPt = 2700,
183 muonCollectionKey =
"Muons",
184 useCombinedMeasurement =
False,
185 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
186 CascadeVertexCollections = [
"BMuDsCascadeSV2",
"BMuDsCascadeSV1"],
187 DxVertices =
"BPHY22Dh3Candidates")
189 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
191 HypothesisName =
"B",
192 TrkVertexFitterTool = BMuDxVertexFit,
194 PVRefitter = PVrefit,
196 ApplyDxMassConstraint =
False,
197 DxMassLowerCut = 1869.59 - 180.,
198 DxMassUpperCut = 1869.59 + 250.,
200 MassUpperCut = 12500,
204 TrackSelectorTool = trackselect,
206 muonThresholdPt = 2700,
207 muonCollectionKey =
"Muons",
208 useCombinedMeasurement =
False,
209 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
210 CascadeVertexCollections = [
"BMuDpCascadeSV2",
"BMuDpCascadeSV1"],
211 DxVertices =
"BPHY22Dh3Candidates")
213 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
214 name =
"BPHY22MuLambdaC",
215 HypothesisName =
"B",
216 TrkVertexFitterTool = BMuDxVertexFit,
218 PVRefitter = PVrefit,
220 ApplyDxMassConstraint =
False,
221 DxMassLowerCut = 2286.46 - 200,
222 DxMassUpperCut = 2286.46 + 220,
224 MassUpperCut = 12500,
228 TrackSelectorTool = trackselect,
230 muonThresholdPt = 2700,
231 muonCollectionKey =
"Muons",
232 useCombinedMeasurement =
False,
233 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
234 CascadeVertexCollections = [
"BMuLambdaCCascadeSV2",
"BMuLambdaCCascadeSV1"],
235 DxVertices =
"BPHY22Dh3Candidates")
237 CascadeCollections = []
238 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
239 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
240 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
241 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
243 BPHY22_AugOriginalCounts = acc.popToolsAndMerge(
244 AugOriginalCountsCfg(flags, name =
"BPHY22_AugOriginalCounts"))
247 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY22_AnyVertexSkimmingTool",
248 VertexContainerNames =CascadeCollections )
249 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
255 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
257 FilterList = [BPHY22_SelectBMuDxEvent] )
258 acc.addPublicTool(BPHY22SkimmingOR)
260 augTools = [BPHY22MuPiSelectAndWrite,
261 BPHY22DiTrkSelectAndWrite,
262 BPHY22Dh3SelectAndWrite,
267 BPHY22_AugOriginalCounts]
268 for t
in augTools : acc.addPublicTool(t)
269 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY22Kernel",
270 AugmentationTools = augTools,
272 SkimmingTools = [BPHY22SkimmingOR]
if not isSimulation
else [],
275 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
276 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
277 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
278 BPHY22SlimmingHelper =
SlimmingHelper(
"BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
281 BPHY22SlimmingHelper.IncludeMuonTriggerContent =
True
282 BPHY22SlimmingHelper.IncludeBPhysTriggerContent =
True
283 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
284 AllVariables = getDefaultAllVariables()
287 AllVariables += [
"PrimaryVertices"]
288 StaticContent += [
"xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
289 StaticContent += [
"xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
292 AllVariables += [
"InDetTrackParticles"]
297 AllVariables += [
"CombinedMuonTrackParticles"]
298 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
301 AllVariables += [
"Muons"]
304 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
306 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
309 for cascades
in CascadeCollections:
310 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
311 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
314 AllVariables += [
"MuonSpectrometerTrackParticles" ]
318 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
320 AllVariables = list(
set(AllVariables))
321 BPHY22SlimmingHelper.AllVariables = AllVariables
322 BPHY22SlimmingHelper.StaticContent = StaticContent
323 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
324 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=[
"BPHY22Kernel"]))
325 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY22", AcceptAlgs=[
"BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
326 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)