ATLAS Offline Software
Loading...
Searching...
No Matches
BPHY24 Namespace Reference

Functions

 BPHY24Cfg (flags)

Variables

str BPHYDerivationName = "BPHY24"
str streamName = "StreamDAOD_BPHY24"

Function Documentation

◆ BPHY24Cfg()

BPHY24.BPHY24Cfg ( flags)

Definition at line 14 of file BPHY24.py.

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

Variable Documentation

◆ BPHYDerivationName

str BPHY24.BPHYDerivationName = "BPHY24"

Definition at line 11 of file BPHY24.py.

◆ streamName

str BPHY24.streamName = "StreamDAOD_BPHY24"

Definition at line 12 of file BPHY24.py.