14def BPHY24Cfg(flags):
15
16
17 augsList = []
18 skimList = []
19 thinList = []
20 outVtxList = []
21 outRePVList = []
22 thinTrkVtxList = []
23 thinPassFlagsList = []
24 finalCandidateList = []
25
26 from AthenaServices.PartPropSvcConfig import PartPropSvcCfg
27 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (
28 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
29 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
30 AugOriginalCountsCfg)
31 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
32 acc = ComponentAccumulator()
33 PartPropSvcName = acc.getPrimaryAndMerge(PartPropSvcCfg(flags))
34 isSimulation = flags.Input.isMC
35 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
36 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
37 acc.addPublicTool(vkalvrt)
38 acc.addPublicTool(V0Tools)
39 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
40 acc.addPublicTool(trackselect)
41 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
42 acc.addPublicTool(vpest)
43 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
44 acc.addPublicTool(PVrefit)
45
46 bSkim = "(count(BPHY24JpsimmKshortCascadeSV1.Bd_mass) + count(BPHY24JpsieeKshortCascadeSV1.Bd_mass)) > 0"
47
48 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
49 xAODStringSkimmingToolCfg)
50 BPHY24_Skim_Bcandidates = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
51 flags, name = "BPHY24_Skim_Bcandidates", expression = bSkim ))
52 skimList += [ BPHY24_Skim_Bcandidates ]
53
54 BPHY24_AugOriginalCounts = acc.popToolsAndMerge(
55 AugOriginalCountsCfg(flags, name = "BPHY24_AugOriginalCounts"))
56 augsList += [ BPHY24_AugOriginalCounts ]
57
58
59 from DerivationFrameworkInDet.InDetToolsConfig import InDetLRTMergeCfg
60 acc.merge(InDetLRTMergeCfg(flags))
61
62 mainIDInput = "InDetWithLRTTrackParticles"
63 originalTrackCond = ["InDetTrackParticles", "InDetLargeD0TrackParticles","GSFTrackParticles"]
64 BPHY24_Finder_DiMuon = CompFactory.Analysis.JpsiFinder( name = "BPHY24_Finder_DiMuon",
65 muAndMu = True,
66 muAndTrack = False,
67 TrackAndTrack = False,
68 assumeDiMuons = True,
69 muonThresholdPt = 3000.,
70 higherPt = 3500.,
71 invMassUpper = 7000.,
72 invMassLower = 1.,
73 Chi2Cut = 30.,
74 oppChargesOnly = False,
75 allChargeCombinations = True,
76 atLeastOneComb = True,
77 useCombinedMeasurement = False,
78 muonCollectionKey = "Muons",
79 TrackParticleCollection = "InDetTrackParticles",
80 V0VertexFitterTool = None,
81 useV0Fitter = False,
82 TrkVertexFitterTool = vkalvrt,
83 TrackSelectorTool = trackselect,
84 VertexPointEstimator = vpest,
85 useMCPCuts = False )
86
87
88 BPHY24_SelectAndWrite_DiMuon = CompFactory.DerivationFramework.Reco_mumu( name = "BPHY24_SelectAndWrite_DiMuon",
89 JpsiFinder = BPHY24_Finder_DiMuon,
90 V0Tools = V0Tools,
91 PVRefitter = PVrefit,
92 OutputVtxContainerName = "BPHY24_DiMuon_Candidates",
93 PVContainerName = "PrimaryVertices",
94 RefPVContainerName = "SHOULDNOTBEUSED",
95 DoVertexType = 7 )
96
97 augsList += [ BPHY24_SelectAndWrite_DiMuon ]
98
99 thinTrkVtxList += [ "BPHY24_DiMuon_Candidates" ]
100 outVtxList += [ "BPHY24_DiMuon_Candidates" ]
101 thinPassFlagsList += [ "passed_Jpsi" ]
102
103 BPHY24_Select_DiMuons = CompFactory.DerivationFramework.Select_onia2mumu( name = "BPHY24_Select_DiMuons",
104 HypothesisName = "Jpsi",
105 InputVtxContainerName = "BPHY24_DiMuon_Candidates",
106 V0Tools = V0Tools,
107 VtxMassHypo = 3096.916,
108 MassMax = 10000.,
109 MassMin = 0.,
110 Chi2Max = 1000.,
111 DoVertexType = 7 )
112
113 augsList += [ BPHY24_Select_DiMuons ]
114
115 ElectronLHSelectorLHvloose = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloose",
116 primaryVertexContainer = "PrimaryVertices",
117 ConfigFile="ElectronPhotonSelectorTools/offline/mc20_20210514/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf")
118
119
120
121 ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloosenod0", primaryVertexContainer = "PrimaryVertices",
122 ConfigFile="ElectronPhotonSelectorTools/offline/mc16_20190328_nod0/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_nod0.conf")
123
124
125
126 from DerivationFrameworkEGamma.EGammaToolsConfig import EGElectronLikelihoodToolWrapperCfg
127 ElectronPassLHvloose = acc.addPublicTool(acc.popToolsAndMerge(EGElectronLikelihoodToolWrapperCfg(flags, name = "ElectronPassLHvloose",
128 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose,
129 EGammaFudgeMCTool = "",
130 CutType = "",
131 StoreGateEntryName = "DFCommonElectronsLHVeryLoose",
132 ContainerName = "Electrons",
133 StoreTResult=False)))
134
135 ElectronPassLHvloosenod0 = acc.addPublicTool(acc.popToolsAndMerge(EGElectronLikelihoodToolWrapperCfg(flags, name = "ElectronPassLHvloosenod0",
136 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
137 EGammaFudgeMCTool = "",
138 CutType = "",
139 StoreGateEntryName = "DFCommonElectronsLHVeryLoosenod0",
140 ContainerName = "Electrons",
141 StoreTResult=False)))
142 augsList += [ElectronPassLHvloose, ElectronPassLHvloosenod0]
143
144 BPHY24DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
145 name = "BPHY24DiElectronFinder",
146 elAndEl = True,
147 elAndTrack = False,
148 TrackAndTrack = False,
149 assumeDiElectrons = True,
150 elThresholdPt = 4000.0,
151 invMassUpper = 7000.0,
152 invMassLower = 200.0,
153 Chi2Cut = 30.,
154 oppChargesOnly = False,
155 allChargeCombinations = True,
156 useElectronTrackMeasurement = True,
157 electronCollectionKey = "Electrons",
158 TrackParticleCollection = "GSFTrackParticles",
159 useEgammaCuts = True,
160 V0VertexFitterTool = None,
161 useV0Fitter = False,
162 TrkVertexFitterTool = vkalvrt,
163 TrackSelectorTool = trackselect,
164 VertexPointEstimator = vpest,
165 ElectronSelection = "d0_or_nod0",
166 PartPropSvc = PartPropSvcName
167 )
168
169 BPHY24_SelectAndWrite_DiElectron = CompFactory.DerivationFramework.Reco_mumu(
170 name = "BPHY24_SelectAndWrite_DiElectron",
171 JpsiFinder = BPHY24DiElectronFinder,
172 V0Tools = V0Tools,
173 PVRefitter = PVrefit,
174 OutputVtxContainerName = "BPHY24_DiElectron_Candidates",
175 PVContainerName = "PrimaryVertices",
176 RefPVContainerName = "SHOULDNOTBEUSED",
177 DoVertexType = 7
178 )
179
180 augsList += [ BPHY24_SelectAndWrite_DiElectron ]
181
182 BPHY24_Select_DiElectrons = CompFactory.DerivationFramework.Select_onia2mumu(
183 name = "BPHY24_Select_DiElectrons",
184 HypothesisName = "Jpsi",
185 InputVtxContainerName = "BPHY24_DiElectron_Candidates",
186 V0Tools = V0Tools,
187 VtxMassHypo = 3096.916,
188 MassMin = 400.0,
189 MassMax = 7000.0,
190 Chi2Max = 30,
191 DoVertexType = 7
192 )
193
194 thinTrkVtxList += [ "BPHY24_DiElectron_Candidates" ]
195 outVtxList += [ "BPHY24_DiElectron_Candidates" ]
196
197 augsList += [ BPHY24_Select_DiElectrons ]
198
199 V0ContainerName = "BPHY24RecoV0Candidates"
200 KshortContainerName = "BPHY24RecoKshortCandidates"
201 LambdaContainerName = "BPHY24RecoLambdaCandidates"
202 LambdabarContainerName = "BPHY24RecoLambdabarCandidates"
203
204 from DerivationFrameworkBPhys.V0ToolConfig import (
205 BPHY_InDetV0FinderToolCfg, BPHY_Reco_V0FinderCfg)
206
207 BPHY24_V0FinderTool = acc.popToolsAndMerge(BPHY_InDetV0FinderToolCfg(
208 flags, BPHYDerivationName,
209 TrackParticleCollection = mainIDInput,
210 V0ContainerName = V0ContainerName,
211 KshortContainerName = KshortContainerName,
212 LambdaContainerName = LambdaContainerName,
213 LambdabarContainerName = LambdabarContainerName,
214 RelinkTracks = originalTrackCond,
215 use_innerPixHits = True,
216 errmass = 99999,
217 uksmin = 400,
218 uksmax = 600,
219 ksmin = 400,
220 ksmax = 600,
221 ulamin = -1,
222 ulamax = -1,
223 lamin = -1,
224 lamax = -1,
225 d0_cut = -1,
226 max_d0_cut = 50,
227 max_z0_cut = 250,
228 ptTRT = 0,
229 minConstrVertProb = 0.000001,
230 useBDT = True,
231 BDTCut = 0.1,
232 use_TrackSelector = False))
233
234 BPHY24_Reco_V0Finder = acc.popToolsAndMerge(BPHY_Reco_V0FinderCfg(
235 flags, derivation = BPHYDerivationName,
236 V0ContainerName = V0ContainerName,
237 KshortContainerName = KshortContainerName,
238 LambdaContainerName = LambdaContainerName,
239 LambdabarContainerName = LambdabarContainerName,
240 VxPrimaryCandidateName = "BPHY24_DiMuon_Candidates",
241 CheckVertexContainers = ['BPHY24_DiMuon_Candidates',
242 'BPHY24_DiElectron_Candidates'],
243 V0FinderTool = BPHY24_V0FinderTool))
244
245 augsList += [BPHY24_Reco_V0Finder]
246 outVtxList += ['BPHY24RecoKshortCandidates']
247 outVtxList += ["BPHY24RecoV0Candidates"]
248 thinTrkVtxList += ['BPHY24RecoKshortCandidates']
249 thinPassFlagsList += [ "" ]
250 finalCandidateList += ["BPHY24RecoKshortCandidates"]
251 finalCandidateList += ["BPHY24RecoV0Candidates"]
252 from TrkConfig.TrkVKalVrtFitterConfig import JpsiV0VertexFitCfg
253 JpsiV0VertexFit = acc.popToolsAndMerge(JpsiV0VertexFitCfg(flags))
254 acc.addPublicTool(JpsiV0VertexFit)
255
256 BPHY24JpsimmKshort = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
257 name = "BPHY24mmKshort",
258 V0Tools = V0Tools,
259 HypothesisName = "Bd",
260 TrkVertexFitterTool = JpsiV0VertexFit,
261 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
262 V0Hypothesis = 310,
263 JpsiMassLowerCut = 1.,
264 JpsiMassUpperCut = 7000.,
265 ApplyJpsiMassConstraint = False,
266 V0MassLowerCut = 400.,
267 V0MassUpperCut = 600.,
268 MassLowerCut = 4300.,
269 MassUpperCut = 6300.,
270 RefitPV = True,
271 RefPVContainerName = "BPHY24RefittedPrimaryVertices_mm",
272 JpsiVertices = "BPHY24_DiMuon_Candidates",
273 CascadeVertexCollections= ["BPHY24JpsimmKshortCascadeSV2", "BPHY24JpsimmKshortCascadeSV1"],
274 V0Vertices = "BPHY24RecoV0Candidates",
275 V0TrackContainerName = mainIDInput,
276 RelinkTracks = originalTrackCond)
277
278 augsList += [BPHY24JpsimmKshort]
279 outVtxList += BPHY24JpsimmKshort.CascadeVertexCollections
280 outVtxList += ["BPHY24RefittedPrimaryVertices_mm"]
281 thinTrkVtxList += BPHY24JpsimmKshort.CascadeVertexCollections
282 finalCandidateList += BPHY24JpsimmKshort.CascadeVertexCollections
283
284 BPHY24JpsieeKshort = CompFactory.DerivationFramework.JpsiPlusV0Cascade(
285 name = "BPHY24eeKshort",
286 V0Tools = V0Tools,
287 HypothesisName = "Bd",
288 TrkVertexFitterTool = JpsiV0VertexFit,
289 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
290 V0Hypothesis = 310,
291 JpsiMassLowerCut = 100.,
292 JpsiMassUpperCut = 7000.,
293 ApplyJpsiMassConstraint = False,
294 V0MassLowerCut = 400.,
295 V0MassUpperCut = 600.,
296 MassLowerCut = 4300.,
297 MassUpperCut = 6300.,
298 JpsiTrackPDGID = 11,
299 JpsiTrackContainerName = "GSFTrackParticles",
300 RefitPV = True,
301 RefPVContainerName = "BPHY24RefittedPrimaryVertices_ee",
302 JpsiVertices = "BPHY24_DiElectron_Candidates",
303 CascadeVertexCollections= ["BPHY24JpsieeKshortCascadeSV2", "BPHY24JpsieeKshortCascadeSV1"],
304 V0Vertices = "BPHY24RecoV0Candidates",
305 V0TrackContainerName = mainIDInput,
306 RelinkTracks = originalTrackCond)
307
308 augsList += [BPHY24JpsieeKshort]
309 finalCandidateList += BPHY24JpsieeKshort.CascadeVertexCollections
310 outVtxList += BPHY24JpsieeKshort.CascadeVertexCollections
311 outVtxList += ["BPHY24RefittedPrimaryVertices_ee"]
312 thinTrkVtxList += BPHY24JpsieeKshort.CascadeVertexCollections
313
314 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import isoTTVAToolCfg
315 TTVATool = acc.popToolsAndMerge(isoTTVAToolCfg(flags,
316 WorkingPoint = "Custom",
317 d0_cut = -1,
318 d0sig_cut = -1,
319 dzSinTheta_cut = -1,
320 doUsedInFit = False))
321 acc.addPublicTool(TTVATool)
322
323 from InDetConfig.InDetTrackSelectionToolConfig import isoTrackSelectionToolCfg
324 TrackSelTool = acc.popToolsAndMerge(isoTrackSelectionToolCfg(flags,
325 maxZ0SinTheta= 2,
326 minPt= 1000,
327 CutLevel= "Loose"))
328 acc.addPublicTool(TrackSelTool)
329
330 from IsolationAlgs.IsoToolsConfig import TrackIsolationToolCfg
331 TrackIsoTool = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
332 TrackSelectionTool = TrackSelTool,
333 TTVATool = TTVATool))
334 acc.addPublicTool(TrackIsoTool)
335 BPHY24TrackIsolationDecoratorBtoKee = CompFactory.DerivationFramework.VertexTrackIsolation(
336 name = "BPHY24TrackIsolationDecoratorBtoKee",
337 TrackIsoTool = TrackIsoTool,
338 TrackContainer = "InDetTrackParticles",
339 InputVertexContainer = "BPHY24JpsieeKshortCascadeSV1",
340 FixElecExclusion = True,
341 IncludeV0 = True)
342 BPHY24TrackIsolationDecoratorBtoKmumu = CompFactory.DerivationFramework.VertexTrackIsolation(
343 name = "BPHY24TrackIsolationDecoratorBtoKmumu ",
344 TrackIsoTool = TrackIsoTool,
345 TrackContainer = "InDetTrackParticles",
346 InputVertexContainer = "BPHY24JpsimmKshortCascadeSV1",
347 FixElecExclusion = False,
348 IncludeV0 = True)
349
350 BPHY24TrackIsolationDecoratorJpsiee = CompFactory.DerivationFramework.VertexTrackIsolation(
351 name = "BPHY24TrackIsolationDecoratorJpsiee",
352 TrackIsoTool = TrackIsoTool,
353 TrackContainer = "InDetTrackParticles",
354 InputVertexContainer = "BPHY24_DiElectron_Candidates",
355 FixElecExclusion = True,
356 IncludeV0 = False)
357
358 BPHY24TrackIsolationDecoratorJpsimumu = CompFactory.DerivationFramework.VertexTrackIsolation(
359 name = "BPHY24TrackIsolationDecoratorJpsimumu",
360 TrackIsoTool = TrackIsoTool,
361 TrackContainer = "InDetTrackParticles",
362 InputVertexContainer = "BPHY24_DiMuon_Candidates",
363 FixElecExclusion = False,
364 IncludeV0 = False)
365
366 augsList += [ BPHY24TrackIsolationDecoratorBtoKee,
367 BPHY24TrackIsolationDecoratorBtoKmumu,
368 BPHY24TrackIsolationDecoratorJpsiee,
369 BPHY24TrackIsolationDecoratorJpsimumu]
370
371 if flags.Trigger.EDMVersion >= 0:
372 trigger_list = [
373 "HLT_mu11_mu6_bDimu",
374 "HLT_mu11_mu6_bDimu2700",
375 "HLT_mu11_mu6_bDimu_L1LFV-MU11",
376 "HLT_mu11_mu6_bDimu2700_L1LFV-MU11",
377 "HLT_mu11_mu6_bBmumuxv2",
378 "HLT_mu10_mu6_bBmumuxv2",
379 "HLT_mu10_mu6_bBmumuxv2_delayed",
380 "HLT_2mu6_bBmumuxv2",
381 "HLT_2mu6_bBmumuxv2_delayed",
382 "HLT_2mu6_bBmumuxv2_L1LFV-MU6",
383 "HLT_mu6_mu4_bBmumuxv2",
384 "HLT_mu6_mu4_bBmumuxv2_delayed",
385 "HLT_2mu4_bBmumuxv2",
386 "HLT_mu11_mu6_bJpsimumu",
387 "HLT_2mu10_bJpsimumu",
388 "HLT_mu11_mu6_bJpsimumu_L1LFV-MU11",
389 "HLT_2mu6_bJpsimumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
390 "HLT_2mu6_bJpsimumu_delayed_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
391 "HLT_2mu10_bJpsimumu_noL2",
392 "HLT_mu10_mu6_bJpsimumu",
393 "HLT_mu10_mu6_bJpsimumu_delayed",
394 "HLT_2mu6_bJpsimumu",
395 "HLT_2mu6_bJpsimumu_delayed",
396 "HLT_mu6_mu4_bJpsimumu",
397 "HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4",
398 "HLT_2mu4_bJpsimumu",
399 "HLT_mu6_2mu4_bJpsi",
400 "HLT_mu6_2mu4_bJpsi_delayed",
401 "HLT_2mu14",
402 "HLT_2mu10",
403
404 "HLT_2e5_lhvloose_nod0_bBeexM6000t",
405 "HLT_e5_lhvloose_nod0_bBeexM6000t",
406 "HLT_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",
407 "HLT_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",
408 "HLT_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",
409 "HLT_e9_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",
410 "HLT_e9_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",
411 "HLT_e9_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4",
412 "HLT_e9_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6",
413 "HLT_e9_lhloose_e5_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",
414 "HLT_e9_lhloose_e5_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",
415 "HLT_e9_lhloose_e5_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",
416 "HLT_e9_lhloose_e5_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",
417 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4",
418 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",
419 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6",
420 ]
421
422 BPHY24TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(
423 name = "BPHY24TrigSkimmingTool",
424 TriggerListOR = trigger_list,
425 TriggerListORHLTOnly = ["HLT_2e5_lhvloose_nod0_bBeexM6000t","HLT_e5_lhvloose_nod0_bBeexM6000t"] )
426 acc.addPublicTool(BPHY24TrigSkimmingTool)
427 skimList += [BPHY24TrigSkimmingTool]
428
429
430 BPHY24_Thin_VtxTracks = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY24_Thin_VtxTracks",
431 StreamName = streamName,
432 TrackParticleContainerName = "InDetTrackParticles",
433 VertexContainerNames = finalCandidateList,
434 IgnoreFlags = True )
435
436 thinList += [ BPHY24_Thin_VtxTracks ]
437
438
439 BPHY24_Thin_VtxTracks_LRT = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY24_Thin_VtxTracks_LRT",
440 StreamName = streamName,
441 TrackParticleContainerName = "InDetLargeD0TrackParticles",
442 VertexContainerNames = finalCandidateList,
443 IgnoreFlags = True )
444
445 thinList += [ BPHY24_Thin_VtxTracks_LRT ]
446
447
448 BPHY24_Thin_VtxTracks_GSF = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY24_Thin_VtxTracks_GSF",
449 StreamName = streamName,
450 TrackParticleContainerName = "GSFTrackParticles",
451 VertexContainerNames = finalCandidateList,
452 IgnoreFlags = True )
453 thinList += [ BPHY24_Thin_VtxTracks_GSF ]
454
455
456 BPHY24_Thin_Muons = CompFactory.DerivationFramework.MuonTrackParticleThinning( name = "BPHY24_Thin_Muons",
457 MuonKey = "Muons",
458 StreamName = streamName,
459 InDetTrackParticlesKey = "InDetTrackParticles" )
460 thinList += [ BPHY24_Thin_Muons ]
461
462
463 BPHY24_Thin_Egamma = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
464 name = "BPHY24_Thin_Egamma",
465 SGKey = "Electrons",
466 StreamName = streamName,
467 InDetTrackParticlesKey = mainIDInput)
468 thinList += [BPHY24_Thin_Egamma]
469
470
471 BPHY24_Thin_PV = CompFactory.DerivationFramework.BPhysPVThinningTool( name = "BPHY24_Thin_PV",
472 CandidateCollections = finalCandidateList,
473 StreamName = streamName,
474 KeepPVTracks = True )
475 thinList += [ BPHY24_Thin_PV ]
476
477 if isSimulation:
478
479
480 from InDetPhysValMonitoring.InDetPhysValDecorationConfig import InDetPhysValTruthDecoratorAlgCfg
481 acc.merge(InDetPhysValTruthDecoratorAlgCfg(flags, BPHYDerivationName))
482
483
484 keepParticles = ('abs(TruthParticles.pdgId) == 11 || '
485 'abs(TruthParticles.pdgId) == 13')
486
487
488 keepParticles += (' || '
489 'abs(TruthParticles.pdgId) == 511 || '
490 'abs(TruthParticles.pdgId) == 513 || '
491 'abs(TruthParticles.pdgId) == 515')
492
493
494 BPHY24_Thin_TruthHadrons = CompFactory.DerivationFramework.GenericTruthThinning( name = "BPHY24_Thin_TruthHadrons",
495 ParticleSelectionString = keepParticles,
496 PreserveDescendants = True,
497 StreamName = streamName,
498 PreserveAncestors = True)
499 thinList += [ BPHY24_Thin_TruthHadrons ]
500
501
502 BPHY24_Thin_TruthQuarks = CompFactory.DerivationFramework.GenericTruthThinning( name = "BPHY24_Thin_TruthQuarks",
503 ParticleSelectionString = ('abs(TruthParticles.pdgId) == 5 || '
504 'abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14' ),
505 PreserveDescendants = False,
506 StreamName = streamName,
507 PreserveAncestors = False)
508 thinList += [ BPHY24_Thin_TruthQuarks ]
509
510 for t in augsList + skimList + thinList: acc.addPublicTool(t)
511 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY24Kernel",
512 AugmentationTools = augsList,
513
514
515 SkimmingTools = skimList,
516 ThinningTools = thinList))
517
518
519 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
520 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
521 BPHY24SlimmingHelper =
SlimmingHelper(
"BPHY24SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
522 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
523 from AthenaConfiguration.Enums import MetadataCategory
524 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
525 AllVariables = getDefaultAllVariables()
526 StaticContent = []
527 ExtraVariables = []
528
529
530
531
532 BPHY24SlimmingHelper.SmartCollections = [ "Electrons", "Muons", "InDetTrackParticles", "InDetLargeD0TrackParticles" ]
533
534
535 AllVariables += ["InDetLargeD0TrackParticles"]
536 AllVariables += [ "CombinedMuonTrackParticles" ]
537 AllVariables += [ "ExtrapolatedMuonTrackParticles" ]
538 ExtraVariables += [ "Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
539 "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
540 "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
541 "InDetLargeD0TrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
542 "PrimaryVertices.chiSquared.covariance", "Electrons.deltaEta1.DFCommonElectronsLHVeryLoosenod0",
543 "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
544 "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge" ]
545
546
547
548
549 BPHY24SlimmingHelper.IncludeMuonTriggerContent = True
550 BPHY24SlimmingHelper.IncludeEgammaTriggerContent = True
551 BPHY24SlimmingHelper.IncludeBPhysTriggerContent = True
552
553
554 AllVariables += [ "PrimaryVertices" ]
555 print(
"BPHY24: List of refitted-PV output: ", outRePVList)
556 for i in outRePVList:
557 StaticContent += [ "xAOD::VertexContainer#%s" % i ]
558 StaticContent += [ "xAOD::VertexAuxContainer#%sAux." % i ]
559
560
561 print(
"BPHY24: List of B-vertexing output: ", outVtxList)
562 for i in outVtxList:
563 StaticContent += [ "xAOD::VertexContainer#%s" % i ]
564 StaticContent += [ "xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % i ]
565
566 print(
"BPHY24: Full list of B-augmentation: ", StaticContent)
567
568
569 if isSimulation:
570 AllVariables += [ "TruthEvents",
571 "TruthParticles",
572 "TruthVertices",
573 "MuonTruthParticles" ]
574 AllVariables = list(
set(AllVariables))
575
576 BPHY24SlimmingHelper.AllVariables = AllVariables
577 BPHY24SlimmingHelper.StaticContent = StaticContent
578 BPHY24SlimmingHelper.ExtraVariables = ExtraVariables
579 BPHY24ItemList = BPHY24SlimmingHelper.GetItemList()
580 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY24", ItemList=BPHY24ItemList, AcceptAlgs=["BPHY24Kernel"]))
581 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY24", AcceptAlgs=["BPHY24Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
582 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
583 return acc
void print(char *figname, TCanvas *c1)