18def LLP1KernelCfg(flags, name='LLP1Kernel', **kwargs):
19
20 """Configure the derivation framework driving algorithm (kernel) for LLP1"""
21 acc = ComponentAccumulator()
22
23
24
25
26 MergedElectronContainer = "Electrons"
27 MergedGSFTrackCollection = "GSFTrackParticles"
28 MergedMuonContainer = "Muons"
29 MergedTrackCollection = "InDetTrackParticles"
30 MergedTrackletCollection = "InDetDisappearingTrackParticles"
31
32 if flags.Tracking.doLargeD0:
33 MergedTrackCollection = "InDetWithLRTTrackParticles"
34 from DerivationFrameworkInDet.InDetToolsConfig import InDetLRTMergeCfg
35 acc.merge(InDetLRTMergeCfg(flags))
36
37 MergedGSFTrackCollection = "InDetWithLRTGSFTrackParticles"
38 acc.merge(InDetLRTMergeCfg(
39 flags, name="GSFTrackMergerAlg",
40 InputTrackParticleLocations = ["GSFTrackParticles",
41 "LRTGSFTrackParticles"],
42 OutputTrackParticleLocation = MergedGSFTrackCollection,
43 OutputTrackParticleLocationCopy = MergedGSFTrackCollection))
44
45 if flags.Tracking.doTrackSegmentsDisappearing:
46 MergedTrackletCollection = "InDetDisappearingWithLRTTrackParticles"
47 acc.merge(InDetLRTMergeCfg(
48 flags, name="InDetDisappearingLRTMerge",
49 InputTrackParticleLocations = ["InDetDisappearingTrackParticles",
50 "InDetLargeD0TrackParticles"],
51 OutputTrackParticleLocation = MergedTrackletCollection))
52
53
54 MergedMuonContainer = "StdWithLRTMuons"
55 from DerivationFrameworkLLP.LLPToolsConfig import LRTMuonMergerAlg
56 acc.merge(LRTMuonMergerAlg(flags,
57 PromptMuonLocation = "Muons",
58 LRTMuonLocation = "MuonsLRT",
59 OutputMuonLocation = MergedMuonContainer,
60 CreateViewCollection = True,
61 UseRun3WP = flags.GeoModel.Run >= LHCPeriod.Run3))
62
63
64 MergedElectronContainer = "StdWithLRTElectrons"
65 from DerivationFrameworkLLP.LLPToolsConfig import LRTElectronMergerAlg
66 acc.merge(LRTElectronMergerAlg(flags,
67 PromptElectronLocation = "Electrons",
68 LRTElectronLocation = "LRTElectrons",
69 OutputCollectionName = MergedElectronContainer,
70 isDAOD = False,
71 CreateViewCollection = True))
72
73
74
75 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
76 MaxCellDecoratorCfg, MaxCellDecoratorKernelCfg)
77
78
79 acc.merge(MaxCellDecoratorKernelCfg(flags))
80
81
82 if flags.Tracking.doLargeD0:
83 LLP1LRTMaxCellDecoratorTool = acc.popToolsAndMerge(MaxCellDecoratorCfg(
84 flags, name = "LLP1LRTMaxCellDecoratorTool",
85 SGKey_electrons = "LRTElectrons",
86 SGKey_egammaClusters = ("" if flags.GeoModel.Run >= LHCPeriod.Run3
87 else "egammaClusters"),
88 SGKey_photons = ''))
89 acc.addPublicTool(LLP1LRTMaxCellDecoratorTool)
90
91
92 if flags.Tracking.doTrackSegmentsDisappearing:
93 from DerivationFrameworkLLP.LLPToolsConfig import TrackParametersKVUCfg
94 LLP1TrackParametersKVUTool = acc.popToolsAndMerge(TrackParametersKVUCfg(
95 flags, name = "LLP1TrackParametersKVU"))
96 acc.addPublicTool(LLP1TrackParametersKVUTool)
97
98
99 import ROOT
100 isoPar = ROOT.xAOD.Iso.IsolationType
101 deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20]
102 deco_ptcones_suffix = ["ptcone40", "ptcone30", "ptcone20"]
103 deco_prefix = 'LLP1_'
104
105 from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_Loose_Cfg
106 TrackSelectionToolStd = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
107 name = "TrackSelectionToolStd",
108 maxZ0SinTheta = 3.0,
109 minPt = 1000.))
110
111 TrackSelectionToolPdEdx = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
112 name = "TrackSelectionToolPdEdx",
113 maxD0 = 0.5,
114 maxZ0SinTheta = 3.0,
115 minPt = 1000.))
116
117 TrackSelectionToolPdEdxTight = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
118 name = "TrackSelectionToolPdEdxTight",
119 maxD0 = 0.5,
120 maxZ0SinTheta = 0.5,
121 minPt = 1000.))
122
123 from IsolationAlgs.IsoToolsConfig import TrackIsolationToolCfg, CaloIsolationToolCfg
124 TrackIsoToolStd = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
125 name = "TrackIsoToolStd",
126 TrackSelectionTool = TrackSelectionToolStd))
127 acc.addPublicTool(TrackIsoToolStd)
128
129 TrackIsoToolPdEdx = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
130 name = "TrackIsoToolPdEdx",
131 TrackSelectionTool = TrackSelectionToolPdEdx))
132 acc.addPublicTool(TrackIsoToolPdEdx)
133
134 TrackIsoToolPdEdxTight = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
135 name = "TrackIsoToolPdEdxTight",
136 TrackSelectionTool = TrackSelectionToolPdEdxTight))
137 acc.addPublicTool(TrackIsoToolPdEdxTight)
138
139 from CaloIdentifier import SUBCALO
140 CaloIsoTool = acc.popToolsAndMerge(CaloIsolationToolCfg(flags,
141 name = "CaloIsoTool",
142 EMCaloNums = [SUBCALO.LAREM],
143 HadCaloNums = [SUBCALO.LARHEC, SUBCALO.TILE],
144 UseEMScale = True,
145 UseCaloExtensionCaching = False,
146 saveOnlyRequestedCorrections = True))
147 acc.addPublicTool(CaloIsoTool)
148
149 from DerivationFrameworkInDet.InDetToolsConfig import IsolationTrackDecoratorCfg
150 LLP1IsolationTrackDecoratorTool = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(flags,
151 name = "LLP1IsolationTrackDecorator",
152 TrackIsolationTool = TrackIsoToolStd,
153 CaloIsolationTool = CaloIsoTool,
154 TargetContainer = "InDetTrackParticles",
155 SelectionString = "InDetTrackParticles.pt>10*GeV",
156 iso = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20, isoPar.ptvarcone40, isoPar.ptvarcone30, isoPar.ptvarcone20, isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
157 isoSuffix = ["ptcone40", "ptcone30", "ptcone20", "ptvarcone40", "ptvarcone30", "ptvarcone20", "topoetcone40", "topoetcone30", "topoetcone20"],
158 Prefix = deco_prefix))
159 acc.addPublicTool(LLP1IsolationTrackDecoratorTool)
160
161 if flags.Tracking.doTrackSegmentsDisappearing:
162 LLP1IsolationTrackDecoratorDTTool = acc.getPrimaryAndMerge(
163 IsolationTrackDecoratorCfg(
164 flags, name = "LLP1IsolationTrackDecoratorDT",
165 TrackIsolationTool = TrackIsoToolStd,
166 CaloIsolationTool = CaloIsoTool,
167 TargetContainer = "InDetDisappearingTrackParticles",
168 SelectionString = "InDetDisappearingTrackParticles.pt>10*GeV",
169 iso = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20,
170 isoPar.ptvarcone40, isoPar.ptvarcone30, isoPar.ptvarcone20,
171 isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
172 isoSuffix = ["ptcone40", "ptcone30", "ptcone20",
173 "ptvarcone40", "ptvarcone30", "ptvarcone20",
174 "topoetcone40", "topoetcone30", "topoetcone20"],
175 Prefix = deco_prefix))
176 acc.addPublicTool(LLP1IsolationTrackDecoratorDTTool)
177
178 LLP1IsolationTrackDecoratorPdEdxTool = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(flags,
179 name = "LLP1IsolationTrackDecoratorPdEdx",
180 TrackIsolationTool = TrackIsoToolPdEdx,
181 CaloIsolationTool = CaloIsoTool,
182 TargetContainer = "InDetTrackParticles",
183 iso = deco_ptcones,
184 Prefix = 'TrkIsoPtPdEdx_',
185 isoSuffix = deco_ptcones_suffix))
186 acc.addPublicTool(LLP1IsolationTrackDecoratorPdEdxTool)
187
188 if flags.Tracking.doTrackSegmentsDisappearing:
189 LLP1IsolationTrackDecoratorPdEdxDTTool = acc.getPrimaryAndMerge(
190 IsolationTrackDecoratorCfg(
191 flags, name = "LLP1IsolationTrackDecoratorPdEdxDT",
192 TrackIsolationTool = TrackIsoToolPdEdx,
193 CaloIsolationTool = CaloIsoTool,
194 TargetContainer = "InDetDisappearingTrackParticles",
195 iso = deco_ptcones,
196 Prefix = 'TrkIsoPtPdEdx_',
197 isoSuffix = deco_ptcones_suffix))
198 acc.addPublicTool(LLP1IsolationTrackDecoratorPdEdxDTTool)
199
200 LLP1IsolationTrackDecoratorPdEdxTightTool = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(flags,
201 name = "LLP1IsolationTrackDecoratorPdEdxTight",
202 TrackIsolationTool = TrackIsoToolPdEdxTight,
203 CaloIsolationTool = CaloIsoTool,
204 TargetContainer = "InDetTrackParticles",
205 iso = deco_ptcones,
206 Prefix = 'TrkIsoPtTightPdEdx_',
207 isoSuffix = deco_ptcones_suffix))
208 acc.addPublicTool(LLP1IsolationTrackDecoratorPdEdxTightTool)
209
210 if flags.Tracking.doTrackSegmentsDisappearing:
211 LLP1IsolationTrackDecoratorPdEdxTightDTTool = acc.getPrimaryAndMerge(
212 IsolationTrackDecoratorCfg(
213 flags, name = "LLP1IsolationTrackDecoratorPdEdxTightDT",
214 TrackIsolationTool = TrackIsoToolPdEdxTight,
215 CaloIsolationTool = CaloIsoTool,
216 TargetContainer = "InDetDisappearingTrackParticles",
217 iso = deco_ptcones,
218 Prefix = 'TrkIsoPtTightPdEdx_',
219 isoSuffix = deco_ptcones_suffix))
220 acc.addPublicTool(LLP1IsolationTrackDecoratorPdEdxTightDTTool)
221
222 from DerivationFrameworkLLP.LLPToolsConfig import TrackParticleCaloCellDecoratorCfg
223 LLP1TrackParticleCaloCellDecoratorTool = acc.getPrimaryAndMerge(TrackParticleCaloCellDecoratorCfg(flags,
224 name = "LLP1TrackParticleCaloCellDecorator",
225 DecorationPrefix = "LLP1",
226 ContainerName = "InDetTrackParticles"))
227 acc.addPublicTool(LLP1TrackParticleCaloCellDecoratorTool)
228
229 augmentationTools = [ LLP1IsolationTrackDecoratorTool,
230 LLP1IsolationTrackDecoratorPdEdxTool,
231 LLP1IsolationTrackDecoratorPdEdxTightTool,
232 LLP1TrackParticleCaloCellDecoratorTool ]
233 if flags.Tracking.doLargeD0:
234 augmentationTools += [ LLP1LRTMaxCellDecoratorTool ]
235 if flags.Tracking.doTrackSegmentsDisappearing:
236 augmentationTools += [ LLP1TrackParametersKVUTool,
237 LLP1IsolationTrackDecoratorDTTool,
238 LLP1IsolationTrackDecoratorPdEdxDTTool,
239 LLP1IsolationTrackDecoratorPdEdxTightDTTool ]
240
241
242 LLP1TauMaxCellDecoratorTool = acc.popToolsAndMerge(MaxCellDecoratorCfg(
243 flags,
244 name = "LLP1TauMaxCellDecoratorTool",
245 SGKey_taus = 'TauJets',
246 SGKey_electrons = '',
247 SGKey_photons = ''))
248 acc.addPublicTool(LLP1TauMaxCellDecoratorTool)
249
250 augmentationTools += [ LLP1TauMaxCellDecoratorTool ]
251
252
253 LLP1AntiKt4EMTopoJetMaxCellDecoratorTool = acc.popToolsAndMerge(MaxCellDecoratorCfg(
254 flags,
255 name = "LLP1AntiKt4EMTopoJetMaxCellDecoratorTool",
256 SGKey_jets = 'AntiKt4EMTopoJets',
257 SGKey_taus = '',
258 SGKey_electrons = '',
259 SGKey_photons = ''))
260 acc.addPublicTool(LLP1AntiKt4EMTopoJetMaxCellDecoratorTool)
261
262 augmentationTools += [ LLP1AntiKt4EMTopoJetMaxCellDecoratorTool ]
263
264
265 LLP1AntiKt4EMPFlowJetMaxCellDecoratorTool = acc.popToolsAndMerge(MaxCellDecoratorCfg(
266 flags,
267 name = "LLP1AntiKt4EMPFlowJetMaxCellDecoratorTool",
268 SGKey_jets = 'AntiKt4EMPFlowJets',
269 SGKey_taus = '',
270 SGKey_electrons = '',
271 SGKey_photons = ''))
272 acc.addPublicTool(LLP1AntiKt4EMPFlowJetMaxCellDecoratorTool)
273
274 augmentationTools += [ LLP1AntiKt4EMPFlowJetMaxCellDecoratorTool ]
275
276
277 from JetRecConfig.JetRecConfig import registerAsInputConstit, JetRecCfg
278 from JetRecConfig.StandardSmallRJets import AntiKt4Truth, AntiKt4EMTopo
279 from JetRecConfig.JetDefinition import JetDefinition
280 from JetRecConfig.StandardJetConstits import stdConstitDic as cst
281
282 registerAsInputConstit(AntiKt4EMTopo)
283 registerAsInputConstit(AntiKt4Truth)
284 cst.AntiKt4EMTopoJets.label = "EMTopoRC"
285 cst.AntiKt4TruthJets.label = "TruthRC"
286
287 AntiKt10RCEMTopo = JetDefinition( "AntiKt",1.0,cst.AntiKt4EMTopoJets,
288 ghostdefs = ["Track", "TrackLRT", "LCTopoOrigin"],
289 modifiers = ("Sort", "Filter:200000",),
290 standardRecoMode = True,
291 lock = True,
292 )
293 if flags.Input.isMC:
294 AntiKt10RCTruth = JetDefinition("AntiKt",1.0,cst.AntiKt4TruthJets,
295 ghostdefs = [],
296 modifiers = ("Sort", "Filter:200000",),
297 standardRecoMode = True,
298 lock = True
299 )
300
301 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
302 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
303 acc.merge(JetRecCfg(flags,AntiKt10RCEMTopo))
304 if flags.Input.isMC: acc.merge(JetRecCfg(flags,AntiKt10RCTruth))
305
306 if flags.Tracking.doLargeD0:
307
308 from DerivationFrameworkJetEtMiss.METCommonConfig import METLRTCfg
309 acc.merge(METLRTCfg(flags, "AntiKt4EMTopo"))
310 acc.merge(METLRTCfg(flags, "AntiKt4EMPFlow"))
311
312
313 from DerivationFrameworkEGamma.EGammaLRTConfig import EGammaLRTCfg
314 acc.merge(EGammaLRTCfg(flags))
315
316 from DerivationFrameworkLLP.LLPToolsConfig import LRTElectronLHSelectorsCfg
317 acc.merge(LRTElectronLHSelectorsCfg(flags))
318
319
320 from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
321 acc.merge(MuonsCommonCfg(flags, suff="LRT"))
322
323
324 from DerivationFrameworkLLP.LLPToolsConfig import PhotonIsEMSelectorsCfg
325 acc.merge(PhotonIsEMSelectorsCfg(flags))
326
327
328 from DerivationFrameworkLLP.LLPToolsConfig import RecoverZeroPixelHitMuonsCfg
329 acc.merge(RecoverZeroPixelHitMuonsCfg(flags))
330
331
332 from BTagging.FlavorTaggingConfig import FlavorTaggingCfg
333 acc.merge(FlavorTaggingCfg(flags, 'AntiKt4EMTopoJets'))
334
335
336 from VrtSecInclusive.VrtSecInclusiveConfig import VrtSecInclusiveCfg
337
338
339 from MuSAVtxFitter.MuSAVtxFitterConfig import MuSAVtxFitterConfig, MuSAVtxJPsiValidationAlgCfg, MuSAVtxFitterValidationConfig
340
341 acc.merge(VrtSecInclusiveCfg(flags,
342 name = "VrtSecInclusive",
343 AugmentingVersionString = "",
344 FillIntermediateVertices = False,
345 TrackLocation = MergedTrackCollection))
346 LLP1VrtSecInclusiveSuffixes.append("")
347
348
349 shortLifetimeSuffix = "_shortLifetime"
350 acc.merge(VrtSecInclusiveCfg(flags,
351 name = "VrtSecInclusive_InDet"+shortLifetimeSuffix,
352 AugmentingVersionString = shortLifetimeSuffix,
353 FillIntermediateVertices = False,
354 TrackLocation = MergedTrackCollection,
355 twoTrkVtxFormingD0Cut = 1.0))
356 LLP1VrtSecInclusiveSuffixes.append(shortLifetimeSuffix)
357
358
359 shortLifetimeNod0Suffix = "_shortLifetime_nod0"
360 acc.merge(VrtSecInclusiveCfg(flags,
361 name = "VrtSecInclusive_InDet"+shortLifetimeNod0Suffix,
362 AugmentingVersionString = shortLifetimeNod0Suffix,
363 FillIntermediateVertices = False,
364 TrackLocation = MergedTrackCollection,
365 twoTrkVtxFormingD0Cut = 0))
366 LLP1VrtSecInclusiveSuffixes.append(shortLifetimeNod0Suffix)
367
368
369 if flags.Tracking.doTrackSegmentsDisappearing:
370 dissapearingSuffix = "_disappearing"
371 acc.merge(VrtSecInclusiveCfg(
372 flags, name = "VrtSecInclusive_"+dissapearingSuffix,
373 AugmentingVersionString = dissapearingSuffix,
374 FillIntermediateVertices = False,
375 TrackLocation = MergedTrackletCollection,
376 doReassembleVertices = True,
377 doMergeByShuffling = False,
378 doMergeFinalVerticesDistance= False,
379 doAssociateNonSelectedTracks= False,
380 DoPVcompatibility = True,
381 RemoveFake2TrkVrt = False,
382 PassThroughTrackSelection = True,
383 TruncateListOfWorkingVertices = False,
384 twoTrkVtxFormingD0Cut = 0.0,
385 SelVrtChi2Cut = 1000000.0,
386 twoTrVrtMaxPerigeeDist = 50.0,
387 twoTrVrtMinRadius = 50.0,
388 doDisappearingTrackVertexing= True))
389 LLP1VrtSecInclusiveSuffixes.append(dissapearingSuffix)
390
391 if flags.Input.isMC and flags.Derivation.LLP.doTrackSystematics:
392 from InDetTrackSystematicsTools.InDetTrackSystematicsToolsConfig import TrackSystematicsAlgCfg
393 TrackSystSuffix = "_TRK_EFF_LARGED0_GLOBAL__1down"
394 acc.merge(TrackSystematicsAlgCfg(
395 flags,
396 name=f"InDetTrackSystematicsAlg{TrackSystSuffix}",
397 InputTrackContainer = MergedTrackCollection,
398 OutputTrackContainer = f"{MergedTrackCollection}{TrackSystSuffix}"))
399 acc.merge(VrtSecInclusiveCfg(flags,
400 name = f"VrtSecInclusive{TrackSystSuffix}",
401 AugmentingVersionString = TrackSystSuffix,
402 FillIntermediateVertices = False,
403 TrackLocation = f"{MergedTrackCollection}{TrackSystSuffix}"))
404 LLP1VrtSecInclusiveSuffixes.append(TrackSystSuffix)
405
406 TrackSystSuffixShortLifetime = "_TRK_EFF_LARGED0_GLOBAL__1down_shortLifetime"
407 acc.merge(TrackSystematicsAlgCfg(
408 flags,
409 name=f"InDetTrackSystematicsAlg{TrackSystSuffixShortLifetime}",
410 InputTrackContainer = MergedTrackCollection,
411 OutputTrackContainer = f"{MergedTrackCollection}{TrackSystSuffixShortLifetime}"))
412 acc.merge(VrtSecInclusiveCfg(flags,
413 name = f"VrtSecInclusive{TrackSystSuffixShortLifetime}",
414 AugmentingVersionString = TrackSystSuffixShortLifetime,
415 FillIntermediateVertices = False,
416 TrackLocation = f"{MergedTrackCollection}{TrackSystSuffixShortLifetime}",
417 twoTrkVtxFormingD0Cut = 1.0))
418 LLP1VrtSecInclusiveSuffixes.append(TrackSystSuffixShortLifetime)
419
420
421 MergedMuonContainer_wZPH = (
422 "StdWithLRTMuons_wZPH" if flags.Tracking.doLargeD0 else "Muons_wZPH")
423 from DerivationFrameworkLLP.LLPToolsConfig import ZeroPixelHitMuonMergerAlgCfg
424 acc.merge(ZeroPixelHitMuonMergerAlgCfg(flags,
425 InputMuonContainers = [MergedMuonContainer, "ZeroPixelHitMuons"],
426 OutputMuonLocation = MergedMuonContainer_wZPH))
427
428
429
430 LeptonsSuffix = "_Leptons"
431 acc.merge(VrtSecInclusiveCfg(flags,
432 name = "VrtSecInclusive_InDet"+LeptonsSuffix,
433 AugmentingVersionString = LeptonsSuffix,
434 FillIntermediateVertices = False,
435 TrackLocation = MergedTrackCollection,
436 twoTrkVtxFormingD0Cut = 1.0,
437 doSelectTracksFromMuons = True,
438 doRemoveCaloTaggedMuons = True,
439 doSelectTracksFromElectrons = True,
440 MuonLocation = MergedMuonContainer,
441 ElectronLocation = MergedElectronContainer))
442 LLP1VrtSecInclusiveSuffixes.append(LeptonsSuffix)
443
444
445 LepTrackSuffix = "_LepTrack"
446 acc.merge(VrtSecInclusiveCfg(flags,
447 name = "VrtSecInclusive_InDet"+LepTrackSuffix,
448 AugmentingVersionString = LepTrackSuffix,
449 FillIntermediateVertices = False,
450 TrackLocation = MergedTrackCollection,
451 MuonLocation = MergedMuonContainer,
452 ElectronLocation = MergedElectronContainer,
453 twoTrkVtxFormingD0Cut = 1.0,
454 doSelectIDAndGSFTracks = True,
455 doRemoveCaloTaggedMuons = True,
456 doRemoveNonLeptonVertices = True,
457 doAssociateNonSelectedTracks= False))
458 LLP1VrtSecInclusiveSuffixes.append(LepTrackSuffix)
459
460
461 BoostedMuonsSuffix = "_BoostedMuons"
462 acc.merge(VrtSecInclusiveCfg(flags,
463 name = "VrtSecInclusive_InDet"+BoostedMuonsSuffix,
464 AugmentingVersionString = BoostedMuonsSuffix,
465 FillIntermediateVertices = False,
466 TrackLocation = MergedTrackCollection,
467 twoTrkVtxFormingD0Cut = 0.0,
468 doSelectTracksFromMuons = True,
469 doRemoveCaloTaggedMuons = True,
470 doSelectTracksFromElectrons = False,
471 MuonLocation = MergedMuonContainer_wZPH,
472 do_PVvetoCut = False,
473 DoTwoTrSoftBtag = True,
474 TwoTrVrtMinDistFromPVCut = 0.5,
475 associatePtCut = 500.))
476 LLP1VrtSecInclusiveSuffixes.append(BoostedMuonsSuffix)
477
478
479
480 BoostedElectronsSuffix = "_BoostedElectrons"
481 acc.merge(VrtSecInclusiveCfg(flags,
482 name = "VrtSecInclusive_InDet"+BoostedElectronsSuffix,
483 AugmentingVersionString = BoostedElectronsSuffix,
484 FillIntermediateVertices = False,
485 TrackLocation = MergedTrackCollection,
486 twoTrkVtxFormingD0Cut = 0.0,
487 doSelectTracksFromMuons = False,
488 doSelectTracksFromElectrons = True,
489 ElectronLocation = MergedElectronContainer,
490 do_PVvetoCut = False,
491 DoTwoTrSoftBtag = True,
492 TwoTrVrtMinDistFromPVCut = 0.5,
493 associatePtCut = 500.))
494 LLP1VrtSecInclusiveSuffixes.append(BoostedElectronsSuffix)
495
496
497
499 MuonContainerName=MergedMuonContainer))
500
501 if flags.Derivation.LLP.doMuSAValidation:
502
503 acc.merge(MuSAVtxJPsiValidationAlgCfg(flags,
504 MuonContainer=MergedMuonContainer,
505 JPsiMuonContainer="JPsiMuons"))
506
507
508 acc.merge(MuSAVtxFitterValidationConfig(flags,
509 name="MuSAVtxFitterValidationJPsi",
510 MuonContainerName="JPsiMuons"))
511
512 acc.merge(MuSAVtxFitterValidationConfig(flags,
513 MuonContainerName=MergedMuonContainer,
514 MuSAVtxContainerName="ValidationMuSAVertices",
515 MuSAExtrapolatedTracksName="ValidationMuSAExtrapolatedTrackParticles",
516 MSTPContainerName="MuonSpectrometerTrackParticles"))
517
518
519
520 from NewVrtSecInclusiveTool.NewVrtSecInclusiveAlgConfig import NewVrtSecInclusiveAlgLLPCfg
521 from NewVrtSecInclusiveTool.NewVrtSecInclusiveConfig import DVFinderToolCfg
522 IDAndGSFSuffix = "_IDAndGSF_LepTrack"
523
524 NVSILepTrack_Tool = acc.popToolsAndMerge(DVFinderToolCfg(flags,FillHist=False,AugmentingVersionString=IDAndGSFSuffix,MaxZVrt=1000.,AntiPileupSigRCut=2.))
525 acc.merge(NewVrtSecInclusiveAlgLLPCfg(flags,
526 algname = "NVSI"+IDAndGSFSuffix,
527 AugmentingVersionString = IDAndGSFSuffix,
528 ElectronContainer = MergedElectronContainer,
529 MuonContainer = MergedMuonContainer,
530 TrackParticleContainer = MergedTrackCollection,
531 GSFTrackParticleContainer = MergedGSFTrackCollection,
532 BVertexContainerName = "NewVrtSecInclusive_SecondaryVertices"+IDAndGSFSuffix,
533 AddIDTracks = True,
534 AddGSFTracks = True,
535 RemoveNonLepVertices = True,
536 BVertexTool = NVSILepTrack_Tool))
537 LLP1NewVSISuffixes.append(IDAndGSFSuffix)
538
539
540 jet_clean_prefix="DFCommonJets_"
541 jet_clean_container="AntiKt4EMTopoJets"
542 jet_clean_level="SuperLooseBadLLP"
543 from JetSelectorTools.JetSelectorToolsConfig import EventCleaningToolCfg, JetCleaningToolCfg
544 LLP1JetCleanSuperLLPTool = acc.popToolsAndMerge(JetCleaningToolCfg(flags,
545 "LLP1JetCleanSuperLLP",
546 jet_clean_container,
547 jet_clean_level,
548 False))
549 acc.addPublicTool(LLP1JetCleanSuperLLPTool)
550
551 LLP1EventCleanSuperLLPTool = acc.popToolsAndMerge(EventCleaningToolCfg(flags,
552 "LLP1EventCleanSuperLLP",
553 jet_clean_level))
554 LLP1EventCleanSuperLLPTool.JetCleanPrefix = jet_clean_prefix
555 LLP1EventCleanSuperLLPTool.OrDecorator = "passOR_EMTopo"
556 LLP1EventCleanSuperLLPTool.JetContainer = jet_clean_container
557 LLP1EventCleanSuperLLPTool.JetCleaningTool = LLP1JetCleanSuperLLPTool
558 acc.addPublicTool(LLP1EventCleanSuperLLPTool)
559
560 LLP1EventCleanAlg = CompFactory.EventCleaningTestAlg(
561 "LLP1JetCleanDecoratorSuperLLP",
562 EventCleaningTool = LLP1EventCleanSuperLLPTool,
563 JetCollectionName = jet_clean_container,
564 EventCleanPrefix = jet_clean_prefix,
565 CleaningLevel = jet_clean_level,
566 doEvent = True)
567
568
569
570 acc.addSequence(CompFactory.AthSequencer('EventCleanSeq', Sequential=True))
571 acc.addEventAlgo(LLP1EventCleanAlg, 'EventCleanSeq')
572
573
574
575 from DerivationFrameworkLLP.LLPToolsConfig import AugmentationToolLeadingJetsCfg
576 augmentationToolLeadingJets = acc.getPrimaryAndMerge(AugmentationToolLeadingJetsCfg(flags))
577 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, AugmentationTools = [augmentationToolLeadingJets]))
578
579
580 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, EgammaTrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg
581 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
582 from DerivationFrameworkTau.TauCommonConfig import TauThinningCfg
583
584
585 LLP1TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
586 flags,
587 name = "LLP1TrackParticleThinningTool",
588 StreamName = kwargs['StreamName'],
589 SelectionString = "InDetTrackParticles.pt>10*GeV",
590 InDetTrackParticlesKey = "InDetTrackParticles"))
591
592
593 if flags.Tracking.doLargeD0:
594 LLP1LRTGSFTrackParticleThinningTool = acc.getPrimaryAndMerge(
595 TrackParticleThinningCfg(
596 flags, name = "LLP1LRTGSFTrackParticleThinningTool",
597 StreamName = kwargs['StreamName'],
598 SelectionString = "LRTGSFTrackParticles.pt>0*GeV",
599 InDetTrackParticlesKey = "LRTGSFTrackParticles"))
600
601
602 if flags.Tracking.doTrackSegmentsDisappearing:
603 LLP1DTTrackParticleThinningTool = acc.getPrimaryAndMerge(
604 TrackParticleThinningCfg(
605 flags, name = "LLP1DTTrackParticleThinningTool",
606 StreamName = kwargs['StreamName'],
607 SelectionString = "InDetDisappearingTrackParticles.pt>5*GeV",
608 InDetTrackParticlesKey = "InDetDisappearingTrackParticles"))
609
610
611 LLP1ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
612 flags,
613 name = "LLP1ElectronTPThinningTool",
614 StreamName = kwargs['StreamName'],
615 SGKey = "Electrons",
616 InDetTrackParticlesKey = "InDetTrackParticles"))
617
618
619 if flags.Tracking.doLargeD0:
620 LLP1LRTElectronTPThinningTool = acc.getPrimaryAndMerge(
621 EgammaTrackParticleThinningCfg(
622 flags, name = "LLP1LRTElectronTPThinningTool",
623 StreamName = kwargs['StreamName'],
624 SGKey = "LRTElectrons",
625 InDetTrackParticlesKey = "InDetLargeD0TrackParticles",
626 GSFTrackParticlesKey = "LRTGSFTrackParticles"))
627
628
629 LLP1MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
630 flags,
631 name = "LLP1MuonTPThinningTool",
632 StreamName = kwargs['StreamName'],
633 MuonKey = "Muons",
634 InDetTrackParticlesKey = "InDetTrackParticles"))
635
636
637 if flags.Tracking.doLargeD0:
638 LLP1LRTMuonTPThinningTool = acc.getPrimaryAndMerge(
639 MuonTrackParticleThinningCfg(
640 flags, name = "LLP1LRTMuonTPThinningTool",
641 StreamName = kwargs['StreamName'],
642 MuonKey = "MuonsLRT",
643 InDetTrackParticlesKey = "InDetLargeD0TrackParticles"))
644
645
646 LLP1PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
647 flags,
648 name = "LLP1PhotonTPThinningTool",
649 StreamName = kwargs['StreamName'],
650 SGKey = "Photons",
651 InDetTrackParticlesKey = "",
652 GSFConversionVerticesKey = "GSFConversionVertices",
653 GSFTrackParticlesKey = "GSFTrackParticles",
654 BestMatchOnly = True,
655 BestVtxMatchOnly = True))
656
657
658 tau_thinning_expression = f"TauJets.pt >= {flags.Tau.MinPtDAOD}"
659 LLP1TauJetsThinningTool = acc.getPrimaryAndMerge(TauThinningCfg(
660 flags,
661 name = "LLP1TauJetThinningTool",
662 StreamName = kwargs['StreamName'],
663 Taus = "TauJets",
664 TauTracks = "TauTracks",
665 TrackParticles = "InDetTrackParticles",
666 TauNeutralPFOs = "TauNeutralParticleFlowObjects",
667 TauSecondaryVertices = "TauSecondaryVertices",
668 SelectionString = tau_thinning_expression))
669
670
671 LLP1TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
672 flags,
673 name = "LLP1TauTPThinningTool",
674 StreamName = kwargs['StreamName'],
675 TauKey = "TauJets",
676 InDetTrackParticlesKey = "InDetTrackParticles",
677 DoTauTracksThinning = True,
678 TauTracksKey = "TauTracks"))
679
680 tau_murm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_MuonRM')
681 LLP1TauJetMuonRMParticleThinningTool = acc.getPrimaryAndMerge(TauThinningCfg(
682 flags,
683 name = "LLP1TauJets_MuonRMThinningTool",
684 StreamName = kwargs['StreamName'],
685 Taus = "TauJets_MuonRM",
686 TauTracks = "TauTracks_MuonRM",
687 TrackParticles = "InDetTrackParticles",
688 TauNeutralPFOs = "TauNeutralParticleFlowObjects_MuonRM",
689 TauSecondaryVertices = "TauSecondaryVertices_MuonRM",
690 SelectionString = tau_murm_thinning_expression))
691
692
693 LLP1DiTauTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(
694 flags,
695 name = "LLP1DiTauTPThinningTool",
696 StreamName = kwargs['StreamName'],
697 DiTauKey = "DiTauJets",
698 InDetTrackParticlesKey = "InDetTrackParticles"))
699
700
701 LLP1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(
702 flags,
703 name = "LLP1DiTauLowPtThinningTool",
704 StreamName = kwargs['StreamName'],
705 ContainerName = "DiTauJetsLowPt",
706 SelectionString = "DiTauJetsLowPt.nSubjets > 1"))
707
708
709 LLP1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(
710 flags,
711 name = "LLP1DiTauLowPtTPThinningTool",
712 StreamName = kwargs['StreamName'],
713 DiTauKey = "DiTauJetsLowPt",
714 InDetTrackParticlesKey = "InDetTrackParticles",
715 SelectionString = "DiTauJetsLowPt.nSubjets > 1"))
716
717
718
719 from DerivationFrameworkLLP.LLPToolsConfig import VSITrackParticleThinningCfg
720 LLP1VSITPThinningTool = acc.getPrimaryAndMerge(VSITrackParticleThinningCfg(flags,
721 name = "LLP1VSITPThinningTool",
722 StreamName = kwargs['StreamName'],
723 InDetTrackParticlesKey = "InDetTrackParticles",
724 AugVerStrings = LLP1VrtSecInclusiveSuffixes + LLP1NewVSISuffixes))
725
726 if flags.Tracking.doLargeD0:
727 LLP1LRTVSITPThinningTool = acc.getPrimaryAndMerge(
728 VSITrackParticleThinningCfg(
729 flags, name = "LLP1LRTVSITPThinningTool",
730 StreamName = kwargs['StreamName'],
731 InDetTrackParticlesKey = "InDetLargeD0TrackParticles",
732 AugVerStrings = LLP1VrtSecInclusiveSuffixes + LLP1NewVSISuffixes))
733
734 LLP1GSFVSITPThinningTool = acc.getPrimaryAndMerge(VSITrackParticleThinningCfg(flags,
735 name = "LLP1GSFVSITPThinningTool",
736 StreamName = kwargs['StreamName'],
737 InDetTrackParticlesKey = "GSFTrackParticles",
738 AugVerStrings = [IDAndGSFSuffix]))
739
740
741 from DerivationFrameworkLLP.LLPToolsConfig import JetTrackParticleThinningCfg, JetLargeD0TrackParticleThinningCfg
742 LLP1JetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
743 name = "LLP1JetTPThinningTool",
744 StreamName = kwargs['StreamName'],
745 JetKey = "AntiKt4EMTopoJets",
746 SelectionString = "(AntiKt4EMTopoJets.pt > 20.*GeV) && (abs(AntiKt4EMTopoJets.eta) < 2.5)",
747 InDetTrackParticlesKey = "InDetTrackParticles"))
748
749 LLP1FatJetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg( flags,
750 name = "LLP1FatJetTPThinningTool",
751 StreamName = kwargs['StreamName'],
752 JetKey = "AntiKt10EMTopoRCJets",
753 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
754 InDetTrackParticlesKey = "InDetTrackParticles",
755 ))
756
757
758 if flags.Tracking.doLargeD0:
759 LLP1LRTJetTPThinningTool = acc.getPrimaryAndMerge(
760 JetLargeD0TrackParticleThinningCfg(
761 flags, name = "LLP1LRTJetTPThinningTool",
762 StreamName = kwargs['StreamName'],
763 JetKey = "AntiKt4EMTopoJets",
764 SelectionString = "(AntiKt4EMTopoJets.pt > 20.*GeV) && (abs(AntiKt4EMTopoJets.eta) < 2.5)",
765 InDetTrackParticlesKey = "InDetLargeD0TrackParticles"))
766
767 LLP1LRTFatJetTPThinningTool = acc.getPrimaryAndMerge(
768 JetLargeD0TrackParticleThinningCfg(
769 flags, name = "LLP1LRTFatJetTPThinningTool",
770 StreamName = kwargs['StreamName'],
771 JetKey = "AntiKt10EMTopoRCJets",
772 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
773 InDetTrackParticlesKey = "InDetLargeD0TrackParticles"))
774
775
776 from DerivationFrameworkLLP.LLPToolsConfig import PixeldEdxTrackParticleThinningCfg
777 LLP1PixeldEdxTrackParticleThinningTool = acc.getPrimaryAndMerge(PixeldEdxTrackParticleThinningCfg(
778 flags,
779 name = "LLP1PixeldEdxTrackParticleThinningTool",
780 StreamName = kwargs['StreamName'],
781 InDetTrackParticlesKey = "InDetTrackParticles"))
782
783
784
785 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import JetCaloClusterThinningCfg
786
787 LLP1CCThinningTool = acc.getPrimaryAndMerge(JetCaloClusterThinningCfg(
788 flags,
789 name = "LLP1CCTool",
790 StreamName = kwargs['StreamName'],
791 SGKey = "AntiKt4EMTopoJets",
792 TopoClCollectionSGKey = "CaloCalTopoClusters",
793 AdditionalClustersKey = ["EMOriginTopoClusters","LCOriginTopoClusters"]
794 ))
795
796
797
798 thinningTools = [LLP1TrackParticleThinningTool,
799 LLP1ElectronTPThinningTool,
800 LLP1MuonTPThinningTool,
801 LLP1PhotonTPThinningTool,
802 LLP1TauJetsThinningTool,
803 LLP1TauTPThinningTool,
804 LLP1TauJetMuonRMParticleThinningTool,
805 LLP1DiTauTPThinningTool,
806 LLP1DiTauLowPtThinningTool,
807 LLP1DiTauLowPtTPThinningTool,
808 LLP1VSITPThinningTool,
809 LLP1GSFVSITPThinningTool,
810 LLP1JetTPThinningTool,
811 LLP1FatJetTPThinningTool,
812 LLP1PixeldEdxTrackParticleThinningTool,
813 LLP1CCThinningTool]
814
815 if flags.Tracking.doLargeD0:
816 thinningTools += [ LLP1LRTJetTPThinningTool,
817 LLP1LRTFatJetTPThinningTool,
818 LLP1LRTGSFTrackParticleThinningTool,
819 LLP1LRTElectronTPThinningTool,
820 LLP1LRTMuonTPThinningTool,
821 LLP1LRTVSITPThinningTool ]
822
823 if flags.Tracking.doTrackSegmentsDisappearing:
824 thinningTools += [ LLP1DTTrackParticleThinningTool ]
825
826
827
828
829
830 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
831 LLP1RCJetSubstructureClustTrimAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
832 name = "LLP1RCJetSubstructureClustTrimAugTool",
833 StreamName = kwargs['StreamName'],
834 JetContainerKey = "AntiKt10EMTopoRCJets",
835 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
836 GhostConstitNames = ["GhostLCTopoOrigin"],
837 Suffix = "clusterTrim",
838 Grooming = "Trimming",
839 RClusTrim = 0.2,
840 PtFracTrim = 0.05
841 ))
842 RCSubstructureClusterTrimAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureClusterTrimAug", AugmentationTools = [LLP1RCJetSubstructureClustTrimAugTool])
843 acc.addEventAlgo(RCSubstructureClusterTrimAug)
844
845 LLP1RCJetSubstructureClustSDAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
846 name = "LLP1RCJetSubstructureClustSDAugTool",
847 StreamName = kwargs['StreamName'],
848 JetContainerKey = "AntiKt10EMTopoRCJets",
849 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
850 GhostConstitNames = ["GhostLCTopoOrigin"],
851 Suffix = "clusterSoftDrop",
852 Grooming = "SoftDrop",
853 BetaSoft = 1.0,
854 ZcutSoft = 0.1
855 ))
856 RCSubstructureClusterSDAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureClusterSDAug", AugmentationTools = [LLP1RCJetSubstructureClustSDAugTool])
857 acc.addEventAlgo(RCSubstructureClusterSDAug)
858
859
860 ghostConstitNames = ["GhostTrack"]
861 if flags.Tracking.doLargeD0:
862 ghostConstitNames = ["GhostTrackLRT"]
863
864 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
865 LLP1RCJetSubstructureTrackTrimAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg( flags,
866 name = "LLP1RCJetSubstructureTrackTrimAugTool",
867 StreamName = kwargs['StreamName'],
868 JetContainerKey = "AntiKt10EMTopoRCJets",
869 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
870 GhostConstitNames = ghostConstitNames,
871 Suffix = "trackTrim",
872 Grooming = "Trimming",
873 RClusTrim = 0.2,
874 PtFracTrim = 0.05
875 ))
876 RCSubstructureTrackTrimAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureTrackTrimAug", AugmentationTools = [LLP1RCJetSubstructureTrackTrimAugTool])
877 acc.addEventAlgo(RCSubstructureTrackTrimAug)
878
879 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
880 LLP1RCJetSubstructureTrackSDAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg( flags,
881 name = "LLP1RCJetSubstructureTrackSDAugTool",
882 StreamName = kwargs['StreamName'],
883 JetContainerKey = "AntiKt10EMTopoRCJets",
884 SelectionString = "(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
885 GhostConstitNames = ghostConstitNames,
886 Suffix = "trackSoftDrop",
887 Grooming = "SoftDrop",
888 BetaSoft = 1.0,
889 ZcutSoft = 0.1
890 ))
891 RCSubstructureTrackSDAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureTrackSDAug", AugmentationTools = [LLP1RCJetSubstructureTrackSDAugTool])
892 acc.addEventAlgo(RCSubstructureTrackSDAug)
893
894
895
896
897 skimmingTools = []
898
899 if flags.Trigger.EDMVersion >= 0:
900 from DerivationFrameworkLLP.LLPToolsConfig import LLP1TriggerSkimmingToolCfg
901 LLP1TriggerSkimmingTool = acc.getPrimaryAndMerge(LLP1TriggerSkimmingToolCfg(
902 flags, name = "LLP1TriggerSkimmingTool",
903 TriggerListsHelper = kwargs['TriggerListsHelper']))
904
905 skimmingTools.append(LLP1TriggerSkimmingTool)
906
907 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
908 acc.addEventAlgo(DerivationKernel(name,
909 SkimmingTools = skimmingTools,
910 ThinningTools = thinningTools,
911 AugmentationTools = augmentationTools))
912
913 return acc
914
915
916
917
918
919