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 V0VertexFitterTool =
None,
55 TrkVertexFitterTool = vkalvrt,
56 TrackSelectorTool = trackselect,
57 VertexPointEstimator = vpest,
60 forceTagAndProbe =
True)
62 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
63 name =
"BPHY22MuPiSelectAndWrite",
64 VertexSearchTool = BPHY22MuPiFinder,
65 OutputVtxContainerName =
"BPHY22MuPiCandidates",
67 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
68 PVContainerName =
"PrimaryVertices",
69 RefPVContainerName =
"SHOULDNOTBEUSED")
72 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
73 name =
"BPHY22DiTrkFinder",
77 assumeDiMuons =
False,
78 trackThresholdPt = 900,
79 invMassUpper = 2100.0,
82 oppChargesOnly =
True,
83 atLeastOneComb =
False,
84 useCombinedMeasurement =
False,
85 muonCollectionKey =
"Muons",
86 TrackParticleCollection =
"InDetTrackParticles",
87 V0VertexFitterTool =
None,
89 TrkVertexFitterTool = vkalvrt,
90 TrackSelectorTool = trackselect,
91 VertexPointEstimator = vpest,
96 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
97 name =
"BPHY22DiTrkSelectAndWrite",
98 VertexSearchTool = BPHY22DiTrkFinder,
99 OutputVtxContainerName =
"BPHY22DiTrkCandidates",
100 PVContainerName =
"PrimaryVertices",
102 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
103 RefPVContainerName =
"SHOULDNOTBEUSED",
104 CheckCollections =
True,
105 CheckVertexContainers = [
'BPHY22MuPiCandidates'])
108 BMuDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
110 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
111 name =
"BPHY22MuDpst",
112 HypothesisName =
"B",
113 TrkVertexFitterTool = BMuDstVertexFit,
115 ApplyD0MassConstraint =
True,
116 MuPiMassLowerCut = 200.,
117 MuPiMassUpperCut = 8200.,
119 PVRefitter = PVrefit,
120 D0MassLowerCut = 1864.83 - 200.,
121 D0MassUpperCut = 1864.83 + 200.,
122 DstMassLowerCut = 2010.26 - 300.,
123 DstMassUpperCut = 2010.26 + 300.,
124 DstMassUpperCutAft = 2010.26 + 25.,
126 MassUpperCut = 12500.,
129 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
130 MuPiVertices =
"BPHY22MuPiCandidates",
131 CascadeVertexCollections = [
"BMuDpstCascadeSV2",
"BMuDpstCascadeSV1"],
132 D0Vertices =
"BPHY22DiTrkCandidates",
135 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
136 name =
"BPHY22Dh3Finder",
137 pionHypothesis =
True,
138 kaonHypothesis =
False,
139 trkThresholdPt = 900.0,
141 BThresholdPt = 2000.0,
145 TrkTrippletMassUpper = 2200,
146 TrkTrippletMassLower = 500,
147 TrkQuadrupletPt = 2000,
148 JpsiContainerKey =
"BPHY22DiTrkCandidates",
149 TrackParticleCollection =
"InDetTrackParticles",
150 MuonsUsedInJpsi =
"NONE",
151 ExcludeCrossJpsiTracks =
False,
152 TrkVertexFitterTool = vkalvrt,
153 TrackSelectorTool = trackselect,
154 UseMassConstraint =
False,
157 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
158 name =
"BPHY22Dh3SelectAndWrite",
159 VertexSearchTool = BPHY22Dh3Finder,
161 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
162 OutputVtxContainerName =
"BPHY22Dh3Candidates",
163 PVContainerName =
"PrimaryVertices",
164 RefPVContainerName =
"SHOULDNOTBEUSED",
167 BMuDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+
"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
169 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
171 HypothesisName =
"B",
172 TrkVertexFitterTool = BMuDxVertexFit,
174 PVRefitter = PVrefit,
176 ApplyDxMassConstraint =
False,
177 DxMassLowerCut = 1968.28 - 300.,
178 DxMassUpperCut = 1968.28 + 200.,
180 MassUpperCut = 12500,
184 TrackSelectorTool = trackselect,
186 muonThresholdPt = 2700,
187 muonCollectionKey =
"Muons",
188 useCombinedMeasurement =
False,
189 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
190 CascadeVertexCollections = [
"BMuDsCascadeSV2",
"BMuDsCascadeSV1"],
191 DxVertices =
"BPHY22Dh3Candidates")
193 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
195 HypothesisName =
"B",
196 TrkVertexFitterTool = BMuDxVertexFit,
198 PVRefitter = PVrefit,
200 ApplyDxMassConstraint =
False,
201 DxMassLowerCut = 1869.59 - 180.,
202 DxMassUpperCut = 1869.59 + 250.,
204 MassUpperCut = 12500,
208 TrackSelectorTool = trackselect,
210 muonThresholdPt = 2700,
211 muonCollectionKey =
"Muons",
212 useCombinedMeasurement =
False,
213 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
214 CascadeVertexCollections = [
"BMuDpCascadeSV2",
"BMuDpCascadeSV1"],
215 DxVertices =
"BPHY22Dh3Candidates")
217 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
218 name =
"BPHY22MuLambdaC",
219 HypothesisName =
"B",
220 TrkVertexFitterTool = BMuDxVertexFit,
222 PVRefitter = PVrefit,
224 ApplyDxMassConstraint =
False,
225 DxMassLowerCut = 2286.46 - 200,
226 DxMassUpperCut = 2286.46 + 220,
228 MassUpperCut = 12500,
232 TrackSelectorTool = trackselect,
234 muonThresholdPt = 2700,
235 muonCollectionKey =
"Muons",
236 useCombinedMeasurement =
False,
237 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
238 CascadeVertexCollections = [
"BMuLambdaCCascadeSV2",
"BMuLambdaCCascadeSV1"],
239 DxVertices =
"BPHY22Dh3Candidates")
241 CascadeCollections = []
242 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
243 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
244 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
245 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
247 BPHY22_AugOriginalCounts = acc.popToolsAndMerge(
248 AugOriginalCountsCfg(flags, name =
"BPHY22_AugOriginalCounts"))
251 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY22_AnyVertexSkimmingTool",
252 VertexContainerNames =CascadeCollections,
254 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
260 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
262 FilterList = [BPHY22_SelectBMuDxEvent] )
263 acc.addPublicTool(BPHY22SkimmingOR)
265 augTools = [BPHY22MuPiSelectAndWrite,
266 BPHY22DiTrkSelectAndWrite,
267 BPHY22Dh3SelectAndWrite,
272 BPHY22_AugOriginalCounts]
273 for t
in augTools : acc.addPublicTool(t)
274 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY22Kernel",
275 AugmentationTools = augTools,
277 SkimmingTools = [BPHY22SkimmingOR]
if not isSimulation
else [],
280 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
281 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
282 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
283 BPHY22SlimmingHelper =
SlimmingHelper(
"BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
286 BPHY22SlimmingHelper.IncludeMuonTriggerContent =
True
287 BPHY22SlimmingHelper.IncludeBPhysTriggerContent =
True
288 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
289 AllVariables = getDefaultAllVariables()
292 AllVariables += [
"PrimaryVertices"]
293 StaticContent += [
"xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
294 StaticContent += [
"xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
297 AllVariables += [
"InDetTrackParticles"]
302 AllVariables += [
"CombinedMuonTrackParticles"]
303 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
306 AllVariables += [
"Muons"]
309 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
311 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
314 for cascades
in CascadeCollections:
315 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
316 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
319 AllVariables += [
"MuonSpectrometerTrackParticles" ]
323 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
325 AllVariables = list(
set(AllVariables))
326 BPHY22SlimmingHelper.AllVariables = AllVariables
327 BPHY22SlimmingHelper.StaticContent = StaticContent
328 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
329 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=[
"BPHY22Kernel"]))
330 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY22", AcceptAlgs=[
"BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
331 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)