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
23 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
24 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
25 acc.addPublicTool(vkalvrt)
26 acc.addPublicTool(V0Tools)
27 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
28 acc.addPublicTool(trackselect)
29 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
30 acc.addPublicTool(vpest)
31 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
32 acc.addPublicTool(PVrefit)
34 BPHY22MuPiFinder = CompFactory.Analysis.JpsiFinder(
35 name =
"BPHY22MuPiFinder",
38 TrackAndTrack =
False,
39 assumeDiMuons =
False,
40 muonThresholdPt = 2700,
41 trackThresholdPt = 250.0,
42 invMassUpper = 8200.0,
45 oppChargesOnly =
False,
46 allChargeCombinations =
True,
47 atLeastOneComb =
False,
48 useCombinedMeasurement =
False,
49 muonCollectionKey =
"Muons",
50 TrackParticleCollection =
"InDetTrackParticles",
51 TrkVertexFitterTool = vkalvrt,
52 TrackSelectorTool = trackselect,
53 VertexPointEstimator = vpest,
56 forceTagAndProbe =
True)
58 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
59 name =
"BPHY22MuPiSelectAndWrite",
60 VertexSearchTool = BPHY22MuPiFinder,
61 OutputVtxContainerName =
"BPHY22MuPiCandidates",
64 PVContainerName =
"PrimaryVertices",
65 RefPVContainerName =
"SHOULDNOTBEUSED")
68 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
69 name =
"BPHY22DiTrkFinder",
73 assumeDiMuons =
False,
74 trackThresholdPt = 900,
75 invMassUpper = 2100.0,
78 oppChargesOnly =
True,
79 atLeastOneComb =
False,
80 useCombinedMeasurement =
False,
81 muonCollectionKey =
"Muons",
82 TrackParticleCollection =
"InDetTrackParticles",
83 TrkVertexFitterTool = vkalvrt,
84 TrackSelectorTool = trackselect,
85 VertexPointEstimator = vpest,
90 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
91 name =
"BPHY22DiTrkSelectAndWrite",
92 VertexSearchTool = BPHY22DiTrkFinder,
93 OutputVtxContainerName =
"BPHY22DiTrkCandidates",
94 PVContainerName =
"PrimaryVertices",
97 RefPVContainerName =
"SHOULDNOTBEUSED",
98 CheckCollections =
True,
99 CheckVertexContainers = [
'BPHY22MuPiCandidates'])
102 BMuDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
104 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
105 name =
"BPHY22MuDpst",
106 HypothesisName =
"B",
107 TrkVertexFitterTool = BMuDstVertexFit,
109 ApplyD0MassConstraint =
True,
110 MuPiMassLowerCut = 200.,
111 MuPiMassUpperCut = 8200.,
113 PVRefitter = PVrefit,
114 D0MassLowerCut = 1864.83 - 200.,
115 D0MassUpperCut = 1864.83 + 200.,
116 DstMassLowerCut = 2010.26 - 300.,
117 DstMassUpperCut = 2010.26 + 300.,
118 DstMassUpperCutAft = 2010.26 + 25.,
120 MassUpperCut = 12500.,
123 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
124 MuPiVertices =
"BPHY22MuPiCandidates",
125 CascadeVertexCollections = [
"BMuDpstCascadeSV2",
"BMuDpstCascadeSV1"],
126 D0Vertices =
"BPHY22DiTrkCandidates",
129 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
130 name =
"BPHY22Dh3Finder",
131 pionHypothesis =
True,
132 kaonHypothesis =
False,
133 trkThresholdPt = 900.0,
135 BThresholdPt = 2000.0,
139 TrkTrippletMassUpper = 2200,
140 TrkTrippletMassLower = 500,
141 TrkQuadrupletPt = 2000,
142 JpsiContainerKey =
"BPHY22DiTrkCandidates",
143 TrackParticleCollection =
"InDetTrackParticles",
144 MuonsUsedInJpsi =
"NONE",
145 ExcludeCrossJpsiTracks =
False,
146 TrkVertexFitterTool = vkalvrt,
147 TrackSelectorTool = trackselect,
148 UseMassConstraint =
False,
151 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
152 name =
"BPHY22Dh3SelectAndWrite",
153 VertexSearchTool = BPHY22Dh3Finder,
155 PVRefitter = PVrefit,
156 OutputVtxContainerName =
"BPHY22Dh3Candidates",
157 PVContainerName =
"PrimaryVertices",
158 RefPVContainerName =
"SHOULDNOTBEUSED",
161 BMuDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+
"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
163 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
165 HypothesisName =
"B",
166 TrkVertexFitterTool = BMuDxVertexFit,
168 PVRefitter = PVrefit,
170 ApplyDxMassConstraint =
False,
171 DxMassLowerCut = 1968.28 - 300.,
172 DxMassUpperCut = 1968.28 + 200.,
174 MassUpperCut = 12500,
178 TrackSelectorTool = trackselect,
180 muonThresholdPt = 2700,
181 muonCollectionKey =
"Muons",
182 useCombinedMeasurement =
False,
183 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
184 CascadeVertexCollections = [
"BMuDsCascadeSV2",
"BMuDsCascadeSV1"],
185 DxVertices =
"BPHY22Dh3Candidates")
187 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
189 HypothesisName =
"B",
190 TrkVertexFitterTool = BMuDxVertexFit,
192 PVRefitter = PVrefit,
194 ApplyDxMassConstraint =
False,
195 DxMassLowerCut = 1869.59 - 180.,
196 DxMassUpperCut = 1869.59 + 250.,
198 MassUpperCut = 12500,
202 TrackSelectorTool = trackselect,
204 muonThresholdPt = 2700,
205 muonCollectionKey =
"Muons",
206 useCombinedMeasurement =
False,
207 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
208 CascadeVertexCollections = [
"BMuDpCascadeSV2",
"BMuDpCascadeSV1"],
209 DxVertices =
"BPHY22Dh3Candidates")
211 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
212 name =
"BPHY22MuLambdaC",
213 HypothesisName =
"B",
214 TrkVertexFitterTool = BMuDxVertexFit,
216 PVRefitter = PVrefit,
218 ApplyDxMassConstraint =
False,
219 DxMassLowerCut = 2286.46 - 200,
220 DxMassUpperCut = 2286.46 + 220,
222 MassUpperCut = 12500,
226 TrackSelectorTool = trackselect,
228 muonThresholdPt = 2700,
229 muonCollectionKey =
"Muons",
230 useCombinedMeasurement =
False,
231 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
232 CascadeVertexCollections = [
"BMuLambdaCCascadeSV2",
"BMuLambdaCCascadeSV1"],
233 DxVertices =
"BPHY22Dh3Candidates")
235 CascadeCollections = []
236 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
237 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
238 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
239 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
241 BPHY22_AugOriginalCounts = acc.popToolsAndMerge(
242 AugOriginalCountsCfg(flags, name =
"BPHY22_AugOriginalCounts"))
245 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY22_AnyVertexSkimmingTool",
246 VertexContainerNames =CascadeCollections )
247 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
253 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
255 FilterList = [BPHY22_SelectBMuDxEvent] )
256 acc.addPublicTool(BPHY22SkimmingOR)
258 augTools = [BPHY22MuPiSelectAndWrite,
259 BPHY22DiTrkSelectAndWrite,
260 BPHY22Dh3SelectAndWrite,
265 BPHY22_AugOriginalCounts]
266 for t
in augTools : acc.addPublicTool(t)
267 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY22Kernel",
268 AugmentationTools = augTools,
270 SkimmingTools = [BPHY22SkimmingOR]
if not isSimulation
else [],
273 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
274 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
275 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
276 BPHY22SlimmingHelper =
SlimmingHelper(
"BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
279 BPHY22SlimmingHelper.IncludeMuonTriggerContent =
True
280 BPHY22SlimmingHelper.IncludeBPhysTriggerContent =
True
281 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
282 AllVariables = getDefaultAllVariables()
285 AllVariables += [
"PrimaryVertices"]
286 StaticContent += [
"xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
287 StaticContent += [
"xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
290 AllVariables += [
"InDetTrackParticles"]
295 AllVariables += [
"CombinedMuonTrackParticles"]
296 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
299 AllVariables += [
"Muons"]
302 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
304 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
307 for cascades
in CascadeCollections:
308 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
309 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
312 AllVariables += [
"MuonSpectrometerTrackParticles" ]
316 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
318 AllVariables = list(
set(AllVariables))
319 BPHY22SlimmingHelper.AllVariables = AllVariables
320 BPHY22SlimmingHelper.StaticContent = StaticContent
321 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
322 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=[
"BPHY22Kernel"]))
323 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY22", AcceptAlgs=[
"BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
324 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)