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