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