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 TrkVertexFitterTool = vkalvrt,
85 TrackSelectorTool = trackselect,
86 VertexPointEstimator = vpest,
87 useMCPCuts = False )
88
89
90 BPHY24_SelectAndWrite_DiMuon = CompFactory.DerivationFramework.Reco_mumu( name = "BPHY24_SelectAndWrite_DiMuon",
91 JpsiFinder = BPHY24_Finder_DiMuon,
92 V0Tools = V0Tools,
93 PVRefitter = PVrefit,
94 OutputVtxContainerName = "BPHY24_DiMuon_Candidates",
95 PVContainerName = "PrimaryVertices",
96 RefPVContainerName = "SHOULDNOTBEUSED", # The container would be created if PV refit was requested (not needed at this point)
97 DoVertexType = 7 ) # Vertex type marking our own reconstruced secondary candidates
98
99 augsList += [ BPHY24_SelectAndWrite_DiMuon ]
100 # Final selection of the di-muon candidates
101 thinTrkVtxList += [ "BPHY24_DiMuon_Candidates" ]
102 outVtxList += [ "BPHY24_DiMuon_Candidates" ]
103 thinPassFlagsList += [ "passed_Jpsi" ] # TODO: is this really needed?
104
105 BPHY24_Select_DiMuons = CompFactory.DerivationFramework.Select_onia2mumu( name = "BPHY24_Select_DiMuons",
106 HypothesisName = "Jpsi",
107 InputVtxContainerName = "BPHY24_DiMuon_Candidates",
108 V0Tools = V0Tools,
109 VtxMassHypo = 3096.916, # used only for pseudo-proper decay time etc. calculations
110 MassMax = 10000., # loose cut to keep selection from BPHY24_Finder_DiMuon
111 MassMin = 0., # loose cut to keep selection from BPHY24_Finder_DiMuon
112 Chi2Max = 1000., # loose cut to keep selection from BPHY24_Finder_DiMuon (chi2, not chi2/NDF)
113 DoVertexType = 7 ) # Vertex type marking our own reconstruced secondary candidates
114
115 augsList += [ BPHY24_Select_DiMuons ]
116
117 ElectronLHSelectorLHvloose = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloose",
118 primaryVertexContainer = "PrimaryVertices",
119 ConfigFile="ElectronPhotonSelectorTools/offline/mc20_20210514/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf")
120
121
122
123 ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloosenod0", primaryVertexContainer = "PrimaryVertices",
124 ConfigFile="ElectronPhotonSelectorTools/offline/mc16_20190328_nod0/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_nod0.conf") # Still OK to use in Run3?
125
126
127 # decorate electrons with the output of LH vloose (nod0)
128 from DerivationFrameworkEGamma.EGammaToolsConfig import EGElectronLikelihoodToolWrapperCfg
129 ElectronPassLHvloose = acc.addPublicTool(acc.popToolsAndMerge(EGElectronLikelihoodToolWrapperCfg(flags, name = "ElectronPassLHvloose",
130 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose,
131 EGammaFudgeMCTool = "",
132 CutType = "",
133 StoreGateEntryName = "DFCommonElectronsLHVeryLoose",
134 ContainerName = "Electrons",
135 StoreTResult=False)))
136
137 ElectronPassLHvloosenod0 = acc.addPublicTool(acc.popToolsAndMerge(EGElectronLikelihoodToolWrapperCfg(flags, name = "ElectronPassLHvloosenod0",
138 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
139 EGammaFudgeMCTool = "",
140 CutType = "",
141 StoreGateEntryName = "DFCommonElectronsLHVeryLoosenod0",
142 ContainerName = "Electrons",
143 StoreTResult=False)))
144 augsList += [ElectronPassLHvloose, ElectronPassLHvloosenod0]
145
146 BPHY24DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
147 name = "BPHY24DiElectronFinder",
148 elAndEl = True,
149 elAndTrack = False,
150 TrackAndTrack = False,
151 assumeDiElectrons = True,
152 elThresholdPt = 4000.0,
153 invMassUpper = 7000.0,
154 invMassLower = 200.0,
155 Chi2Cut = 30.,
156 oppChargesOnly = False,
157 allChargeCombinations = True,
158 useElectronTrackMeasurement = True,
159 electronCollectionKey = "Electrons",
160 TrackParticleCollection = "GSFTrackParticles",
161 useEgammaCuts = True,
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 += [ "" ] # TODO: is this really needed?
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 InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
324 isoTrackSelectionToolCfg)
325 TrackSelTool = acc.popToolsAndMerge(isoTrackSelectionToolCfg(flags,
326 maxZ0SinTheta= 2,
327 minPt= 1000,
328 CutLevel= "Loose"))
329 acc.addPublicTool(TrackSelTool)
330
331 from IsolationAlgs.IsoToolsConfig import TrackIsolationToolCfg
332 TrackIsoTool = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
333 TrackSelectionTool = TrackSelTool,
334 TTVATool = TTVATool))
335 acc.addPublicTool(TrackIsoTool)
336 BPHY24TrackIsolationDecoratorBtoKee = CompFactory.DerivationFramework.VertexTrackIsolation(
337 name = "BPHY24TrackIsolationDecoratorBtoKee",
338 TrackIsoTool = TrackIsoTool,
339 TrackContainer = "InDetTrackParticles",
340 InputVertexContainer = "BPHY24JpsieeKshortCascadeSV1",
341 FixElecExclusion = True,
342 IncludeV0 = True)
343 BPHY24TrackIsolationDecoratorBtoKmumu = CompFactory.DerivationFramework.VertexTrackIsolation(
344 name = "BPHY24TrackIsolationDecoratorBtoKmumu ",
345 TrackIsoTool = TrackIsoTool,
346 TrackContainer = "InDetTrackParticles",
347 InputVertexContainer = "BPHY24JpsimmKshortCascadeSV1",
348 FixElecExclusion = False,
349 IncludeV0 = True)
350
351 BPHY24TrackIsolationDecoratorJpsiee = CompFactory.DerivationFramework.VertexTrackIsolation(
352 name = "BPHY24TrackIsolationDecoratorJpsiee",
353 TrackIsoTool = TrackIsoTool,
354 TrackContainer = "InDetTrackParticles",
355 InputVertexContainer = "BPHY24_DiElectron_Candidates",
356 FixElecExclusion = True,
357 IncludeV0 = False)
358
359 BPHY24TrackIsolationDecoratorJpsimumu = CompFactory.DerivationFramework.VertexTrackIsolation(
360 name = "BPHY24TrackIsolationDecoratorJpsimumu",
361 TrackIsoTool = TrackIsoTool,
362 TrackContainer = "InDetTrackParticles",
363 InputVertexContainer = "BPHY24_DiMuon_Candidates",
364 FixElecExclusion = False,
365 IncludeV0 = False)
366
367 augsList += [ BPHY24TrackIsolationDecoratorBtoKee,
368 BPHY24TrackIsolationDecoratorBtoKmumu,
369 BPHY24TrackIsolationDecoratorJpsiee,
370 BPHY24TrackIsolationDecoratorJpsimumu]
371
372 if flags.Trigger.EDMVersion >= 0:
373 trigger_list = [ # Pure muon triggers
374 "HLT_mu11_mu6_bDimu",
375 "HLT_mu11_mu6_bDimu2700",
376 "HLT_mu11_mu6_bDimu_L1LFV-MU11",
377 "HLT_mu11_mu6_bDimu2700_L1LFV-MU11",
378 "HLT_mu11_mu6_bBmumuxv2",
379 "HLT_mu10_mu6_bBmumuxv2",
380 "HLT_mu10_mu6_bBmumuxv2_delayed",
381 "HLT_2mu6_bBmumuxv2",
382 "HLT_2mu6_bBmumuxv2_delayed",
383 "HLT_2mu6_bBmumuxv2_L1LFV-MU6",
384 "HLT_mu6_mu4_bBmumuxv2",
385 "HLT_mu6_mu4_bBmumuxv2_delayed",
386 "HLT_2mu4_bBmumuxv2",
387 "HLT_mu11_mu6_bJpsimumu",
388 "HLT_2mu10_bJpsimumu",
389 "HLT_mu11_mu6_bJpsimumu_L1LFV-MU11",
390 "HLT_2mu6_bJpsimumu_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
391 "HLT_2mu6_bJpsimumu_delayed_L1BPH-2M9-2MU6_BPH-2DR15-2MU6",
392 "HLT_2mu10_bJpsimumu_noL2",
393 "HLT_mu10_mu6_bJpsimumu",
394 "HLT_mu10_mu6_bJpsimumu_delayed",
395 "HLT_2mu6_bJpsimumu",
396 "HLT_2mu6_bJpsimumu_delayed",
397 "HLT_mu6_mu4_bJpsimumu",
398 "HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4",
399 "HLT_2mu4_bJpsimumu",
400 "HLT_mu6_2mu4_bJpsi",
401 "HLT_mu6_2mu4_bJpsi_delayed",
402 "HLT_2mu14",
403 "HLT_2mu10",
404 # dielectron triggers
405 "HLT_2e5_lhvloose_nod0_bBeexM6000t", #37,143,877 inb
406 "HLT_e5_lhvloose_nod0_bBeexM6000t", #37,143,877
407 "HLT_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4", #37,312,506
408 "HLT_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6", #27,041,892
409 "HLT_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6", #149,100
410 "HLT_e9_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4", #2,681,764
411 "HLT_e9_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6", #1,979,362
412 "HLT_e9_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0DR3-EM7J15_2MU4", #3,359,105
413 "HLT_e9_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0DR3-EM7J15_MU6", #2,426,663
414 "HLT_e9_lhloose_e5_lhloose_bBeexM2700_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4", #2,950,935
415 "HLT_e9_lhloose_e5_lhloose_bBeexM2700_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6", #2,928,030
416 "HLT_e9_lhloose_e5_lhloose_bBeexM6000_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4", #3,647,507
417 "HLT_e9_lhloose_e5_lhloose_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6", #3,605,371
418 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_2mu4_nomucomb_L1BPH-0M9-EM7-EM5_2MU4", #40,169,436
419 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000t_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6", #37,312,506
420 "HLT_e9_lhvloose_nod0_e5_lhvloose_nod0_bBeexM6000_mu6_nomucomb_L1BPH-0M9-EM7-EM5_MU6", #677,340
421 ]
422
423 BPHY24TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool(
424 name = "BPHY24TrigSkimmingTool",
425 TriggerListOR = trigger_list,
426 TriggerListORHLTOnly = ["HLT_2e5_lhvloose_nod0_bBeexM6000t","HLT_e5_lhvloose_nod0_bBeexM6000t"] )
427 acc.addPublicTool(BPHY24TrigSkimmingTool)
428 skimList += [BPHY24TrigSkimmingTool]
429
430 # ID tracks
431 BPHY24_Thin_VtxTracks = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY24_Thin_VtxTracks",
432 StreamName = streamName,
433 TrackParticleContainerName = "InDetTrackParticles",
434 VertexContainerNames = finalCandidateList,
435 IgnoreFlags = True )
436 # PassFlags = thinPassFlagsList )
437 thinList += [ BPHY24_Thin_VtxTracks ]
438
439 # LRT ID tracks
440 if flags.Tracking.doLargeD0:
441 BPHY24_Thin_VtxTracks_LRT = CompFactory.DerivationFramework.Thin_vtxTrk(
442 name = "BPHY24_Thin_VtxTracks_LRT",
443 StreamName = streamName,
444 TrackParticleContainerName = "InDetLargeD0TrackParticles",
445 VertexContainerNames = finalCandidateList,
446 IgnoreFlags = True )
447 thinList += [ BPHY24_Thin_VtxTracks_LRT ]
448
449 # GSF tracks
450 BPHY24_Thin_VtxTracks_GSF = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY24_Thin_VtxTracks_GSF",
451 StreamName = streamName,
452 TrackParticleContainerName = "GSFTrackParticles",
453 VertexContainerNames = finalCandidateList,
454 IgnoreFlags = True )
455 thinList += [ BPHY24_Thin_VtxTracks_GSF ]
456
457 # Muons (TODO: thinning not used muons or something else ?)
458 BPHY24_Thin_Muons = CompFactory.DerivationFramework.MuonTrackParticleThinning( name = "BPHY24_Thin_Muons",
459 MuonKey = "Muons",
460 StreamName = streamName,
461 InDetTrackParticlesKey = "InDetTrackParticles" )
462 thinList += [ BPHY24_Thin_Muons ]
463
464 # Electrons
465 BPHY24_Thin_Egamma = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
466 name = "BPHY24_Thin_Egamma",
467 SGKey = "Electrons",
468 StreamName = streamName,
469 InDetTrackParticlesKey = mainIDInput)
470 thinList += [BPHY24_Thin_Egamma]
471
472 # Primary vertices
473 BPHY24_Thin_PV = CompFactory.DerivationFramework.BPhysPVThinningTool( name = "BPHY24_Thin_PV",
474 CandidateCollections = finalCandidateList,
475 StreamName = streamName,
476 KeepPVTracks = True )
477 thinList += [ BPHY24_Thin_PV ]
478
479 if isSimulation:
480
481 #Decorate Truth Particles with track parameters
482 from InDetPhysValMonitoring.InDetPhysValDecorationConfig import InDetPhysValTruthDecoratorAlgCfg
483 acc.merge(InDetPhysValTruthDecoratorAlgCfg(flags, BPHYDerivationName))
484
485 # Keep all muons and electrons
486 keepParticles = ('abs(TruthParticles.pdgId) == 11 || ' # mu
487 'abs(TruthParticles.pdgId) == 13') # e
488 # Keep only the potentially signal b-hadrons
489
490 keepParticles += (' || '
491 'abs(TruthParticles.pdgId) == 511 || ' # B0
492 'abs(TruthParticles.pdgId) == 513 || ' # B0*
493 'abs(TruthParticles.pdgId) == 515') # B0**
494
495
496 BPHY24_Thin_TruthHadrons = CompFactory.DerivationFramework.GenericTruthThinning( name = "BPHY24_Thin_TruthHadrons",
497 ParticleSelectionString = keepParticles,
498 PreserveDescendants = True,
499 StreamName = streamName,
500 PreserveAncestors = True)
501 thinList += [ BPHY24_Thin_TruthHadrons ]
502
503 # Save also neutrinos and b-quarks, without their decay trees
504 BPHY24_Thin_TruthQuarks = CompFactory.DerivationFramework.GenericTruthThinning( name = "BPHY24_Thin_TruthQuarks",
505 ParticleSelectionString = ('abs(TruthParticles.pdgId) == 5 || '
506 'abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14' ),
507 PreserveDescendants = False,
508 StreamName = streamName,
509 PreserveAncestors = False)
510 thinList += [ BPHY24_Thin_TruthQuarks ]
511
512 for t in augsList + skimList + thinList: acc.addPublicTool(t)
513 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY24Kernel",
514 AugmentationTools = augsList,
515 #OutputLevel = DEBUG,
516 #Only skim if not MC
517 SkimmingTools = skimList,
518 ThinningTools = thinList))
519
520
521 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
522 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
523 BPHY24SlimmingHelper = SlimmingHelper("BPHY24SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
524 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
525 from AthenaConfiguration.Enums import MetadataCategory
526 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
527 AllVariables = getDefaultAllVariables()
528 StaticContent = []
529 ExtraVariables = []
530
531 # Smart collections
532 # What is the difference w.r.t. adding them into AllVariables?
533 # AB Answer: SmarCollections trims commonly unused variables.
534 BPHY24SlimmingHelper.SmartCollections = [ "Electrons", "Muons", "InDetTrackParticles", "InDetLargeD0TrackParticles" ]
535
536 # Full combined muon-ID tracks
537 AllVariables += ["InDetLargeD0TrackParticles"]
538 AllVariables += [ "CombinedMuonTrackParticles" ]
539 AllVariables += [ "ExtrapolatedMuonTrackParticles" ]
540 ExtraVariables += [ "Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
541 "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
542 "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
543 "InDetLargeD0TrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz",
544 "PrimaryVertices.chiSquared.covariance", "Electrons.deltaEta1.DFCommonElectronsLHVeryLoosenod0",
545 "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
546 "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge" ]
547
548 # Include also trigger objects
549 # DONE: Test it works (HLT objects appear/not-present)
550
551 BPHY24SlimmingHelper.IncludeMuonTriggerContent = True
552 BPHY24SlimmingHelper.IncludeEgammaTriggerContent = True
553 BPHY24SlimmingHelper.IncludeBPhysTriggerContent = True
554
555 # Include primary vertices
556 AllVariables += [ "PrimaryVertices" ]
557 print("BPHY24: List of refitted-PV output: ", outRePVList)
558 for i in outRePVList:
559 StaticContent += [ "xAOD::VertexContainer#%s" % i ]
560 StaticContent += [ "xAOD::VertexAuxContainer#%sAux." % i ]
561
562 # B-vertexing output
563 print("BPHY24: List of B-vertexing output: ", outVtxList)
564 for i in outVtxList:
565 StaticContent += [ "xAOD::VertexContainer#%s" % i ]
566 StaticContent += [ "xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % i ]
567
568 print("BPHY24: Full list of B-augmentation: ", StaticContent)
569
570 # Truth information for MC only
571 if isSimulation:
572 AllVariables += [ "TruthEvents",
573 "TruthParticles",
574 "TruthVertices",
575 "MuonTruthParticles" ]
576 AllVariables = list(set(AllVariables)) # remove duplicates
577
578 BPHY24SlimmingHelper.AllVariables = AllVariables
579 BPHY24SlimmingHelper.StaticContent = StaticContent
580 BPHY24SlimmingHelper.ExtraVariables = ExtraVariables
581 BPHY24ItemList = BPHY24SlimmingHelper.GetItemList()
582 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY24", ItemList=BPHY24ItemList, AcceptAlgs=["BPHY24Kernel"]))
583 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY24", AcceptAlgs=["BPHY24Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
584 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
585 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.