7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.Enums
import MetadataCategory
12 BPHYDerivationName =
"BPHY22"
13 streamName =
"StreamDAOD_BPHY22"
16 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
17 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
19 isSimulation = flags.Input.isMC
20 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
22 acc.addPublicTool(vkalvrt)
23 acc.addPublicTool(V0Tools)
25 acc.addPublicTool(trackselect)
27 acc.addPublicTool(vpest)
29 acc.addPublicTool(PVrefit)
30 BPHY22_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
31 name =
"BPHY22_AugOriginalCounts",
32 VertexContainer =
"PrimaryVertices",
33 TrackContainer =
"InDetTrackParticles" )
35 BPHY22MuPiFinder = CompFactory.Analysis.JpsiFinder(
36 name =
"BPHY22MuPiFinder",
39 TrackAndTrack =
False,
40 assumeDiMuons =
False,
41 muonThresholdPt = 2700,
42 trackThresholdPt = 250.0,
43 invMassUpper = 8200.0,
46 oppChargesOnly =
False,
47 allChargeCombinations =
True,
48 atLeastOneComb =
False,
49 useCombinedMeasurement =
False,
50 muonCollectionKey =
"Muons",
51 TrackParticleCollection =
"InDetTrackParticles",
52 V0VertexFitterTool =
None,
54 TrkVertexFitterTool = vkalvrt,
55 TrackSelectorTool = trackselect,
56 VertexPointEstimator = vpest,
59 forceTagAndProbe =
True)
61 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
62 name =
"BPHY22MuPiSelectAndWrite",
63 VertexSearchTool = BPHY22MuPiFinder,
64 OutputVtxContainerName =
"BPHY22MuPiCandidates",
67 PVContainerName =
"PrimaryVertices",
68 RefPVContainerName =
"SHOULDNOTBEUSED")
71 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
72 name =
"BPHY22DiTrkFinder",
76 assumeDiMuons =
False,
77 trackThresholdPt = 900,
78 invMassUpper = 2100.0,
81 oppChargesOnly =
True,
82 atLeastOneComb =
False,
83 useCombinedMeasurement =
False,
84 muonCollectionKey =
"Muons",
85 TrackParticleCollection =
"InDetTrackParticles",
86 V0VertexFitterTool =
None,
88 TrkVertexFitterTool = vkalvrt,
89 TrackSelectorTool = trackselect,
90 VertexPointEstimator = vpest,
95 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
96 name =
"BPHY22DiTrkSelectAndWrite",
97 VertexSearchTool = BPHY22DiTrkFinder,
98 OutputVtxContainerName =
"BPHY22DiTrkCandidates",
99 PVContainerName =
"PrimaryVertices",
102 RefPVContainerName =
"SHOULDNOTBEUSED",
103 CheckCollections =
True,
104 CheckVertexContainers = [
'BPHY22MuPiCandidates'])
107 BMuDstVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
109 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
110 name =
"BPHY22MuDpst",
111 HypothesisName =
"B",
112 TrkVertexFitterTool = BMuDstVertexFit,
114 ApplyD0MassConstraint =
True,
115 MuPiMassLowerCut = 200.,
116 MuPiMassUpperCut = 8200.,
118 PVRefitter = PVrefit,
119 D0MassLowerCut = 1864.83 - 200.,
120 D0MassUpperCut = 1864.83 + 200.,
121 DstMassLowerCut = 2010.26 - 300.,
122 DstMassUpperCut = 2010.26 + 300.,
123 DstMassUpperCutAft = 2010.26 + 25.,
125 MassUpperCut = 12500.,
128 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
129 MuPiVertices =
"BPHY22MuPiCandidates",
130 CascadeVertexCollections = [
"BMuDpstCascadeSV2",
"BMuDpstCascadeSV1"],
131 D0Vertices =
"BPHY22DiTrkCandidates",
134 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
135 name =
"BPHY22Dh3Finder",
136 pionHypothesis =
True,
137 kaonHypothesis =
False,
138 trkThresholdPt = 900.0,
140 BThresholdPt = 2000.0,
144 TrkTrippletMassUpper = 2200,
145 TrkTrippletMassLower = 500,
146 TrkQuadrupletPt = 2000,
147 JpsiContainerKey =
"BPHY22DiTrkCandidates",
148 TrackParticleCollection =
"InDetTrackParticles",
149 MuonsUsedInJpsi =
"NONE",
150 ExcludeCrossJpsiTracks =
False,
151 TrkVertexFitterTool = vkalvrt,
152 TrackSelectorTool = trackselect,
153 UseMassConstraint =
False,
156 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
157 name =
"BPHY22Dh3SelectAndWrite",
158 VertexSearchTool = BPHY22Dh3Finder,
161 OutputVtxContainerName =
"BPHY22Dh3Candidates",
162 PVContainerName =
"PrimaryVertices",
163 RefPVContainerName =
"SHOULDNOTBEUSED",
166 BMuDxVertexFit = acc.popToolsAndMerge(
BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+
"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
168 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
170 HypothesisName =
"B",
171 TrkVertexFitterTool = BMuDxVertexFit,
173 PVRefitter = PVrefit,
175 ApplyDxMassConstraint =
False,
176 DxMassLowerCut = 1968.28 - 300.,
177 DxMassUpperCut = 1968.28 + 200.,
179 MassUpperCut = 12500,
183 TrackSelectorTool = trackselect,
185 muonThresholdPt = 2700,
186 muonCollectionKey =
"Muons",
187 useCombinedMeasurement =
False,
188 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
189 CascadeVertexCollections = [
"BMuDsCascadeSV2",
"BMuDsCascadeSV1"],
190 DxVertices =
"BPHY22Dh3Candidates")
192 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
194 HypothesisName =
"B",
195 TrkVertexFitterTool = BMuDxVertexFit,
197 PVRefitter = PVrefit,
199 ApplyDxMassConstraint =
False,
200 DxMassLowerCut = 1869.59 - 180.,
201 DxMassUpperCut = 1869.59 + 250.,
203 MassUpperCut = 12500,
207 TrackSelectorTool = trackselect,
209 muonThresholdPt = 2700,
210 muonCollectionKey =
"Muons",
211 useCombinedMeasurement =
False,
212 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
213 CascadeVertexCollections = [
"BMuDpCascadeSV2",
"BMuDpCascadeSV1"],
214 DxVertices =
"BPHY22Dh3Candidates")
216 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
217 name =
"BPHY22MuLambdaC",
218 HypothesisName =
"B",
219 TrkVertexFitterTool = BMuDxVertexFit,
221 PVRefitter = PVrefit,
223 ApplyDxMassConstraint =
False,
224 DxMassLowerCut = 2286.46 - 200,
225 DxMassUpperCut = 2286.46 + 220,
227 MassUpperCut = 12500,
231 TrackSelectorTool = trackselect,
233 muonThresholdPt = 2700,
234 muonCollectionKey =
"Muons",
235 useCombinedMeasurement =
False,
236 RefPVContainerName =
"BPHY22RefittedPrimaryVertices",
237 CascadeVertexCollections = [
"BMuLambdaCCascadeSV2",
"BMuLambdaCCascadeSV1"],
238 DxVertices =
"BPHY22Dh3Candidates")
240 CascadeCollections = []
241 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
242 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
243 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
244 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
247 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool(
"BPHY22_AnyVertexSkimmingTool",
248 VertexContainerNames =CascadeCollections,
250 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
256 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
258 FilterList = [BPHY22_SelectBMuDxEvent] )
259 acc.addPublicTool(BPHY22SkimmingOR)
261 augTools = [BPHY22MuPiSelectAndWrite,
262 BPHY22DiTrkSelectAndWrite,
263 BPHY22Dh3SelectAndWrite,
268 BPHY22_AugOriginalCounts]
269 for t
in augTools : acc.addPublicTool(t)
270 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY22Kernel",
271 AugmentationTools = augTools,
273 SkimmingTools = [BPHY22SkimmingOR]
if not isSimulation
else [],
276 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
277 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
278 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
279 BPHY22SlimmingHelper =
SlimmingHelper(
"BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
282 BPHY22SlimmingHelper.IncludeMuonTriggerContent =
True
283 BPHY22SlimmingHelper.IncludeBPhysTriggerContent =
True
284 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
288 AllVariables += [
"PrimaryVertices"]
289 StaticContent += [
"xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
290 StaticContent += [
"xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
293 AllVariables += [
"InDetTrackParticles"]
298 AllVariables += [
"CombinedMuonTrackParticles"]
299 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
302 AllVariables += [
"Muons"]
305 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
307 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
310 for cascades
in CascadeCollections:
311 StaticContent += [
"xAOD::VertexContainer#%s" % cascades]
312 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
315 AllVariables += [
"MuonSpectrometerTrackParticles" ]
319 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
321 AllVariables =
list(
set(AllVariables))
322 BPHY22SlimmingHelper.AllVariables = AllVariables
323 BPHY22SlimmingHelper.StaticContent = StaticContent
324 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
325 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=[
"BPHY22Kernel"]))
326 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY22", AcceptAlgs=[
"BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
327 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)