ATLAS Offline Software
Loading...
Searching...
No Matches
LLP1.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2# ====================================================================
3# DAOD_LLP1.py
4# This defines DAOD_LLP1, skimmed DAOD format for Run 3.
5# It contains the variables and objects needed for the large majority
6# of physics analyses in ATLAS.
7# It requires the flag LLP1 in Derivation_tf.py
8# ====================================================================
9
10from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaConfiguration.Enums import LHCPeriod, MetadataCategory
13
14LLP1VrtSecInclusiveSuffixes = []
15LLP1NewVSISuffixes = []
16
17
18# Main algorithm config
19def LLP1KernelCfg(flags, name='LLP1Kernel', **kwargs):
20 """Configure the derivation framework driving algorithm (kernel) for LLP1"""
21 acc = ComponentAccumulator()
22
23 # Augmentations
24
25 # LRT track merge
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 # LRT muons merge
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 # LRT electrons merge
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 # Max Cell sum decoration tool
74 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
75 MaxCellDecoratorCfg, MaxCellDecoratorKernelCfg)
76
77 # Default configuration
78 acc.merge(MaxCellDecoratorKernelCfg(flags))
79
80 # Track isolation tools
81 import ROOT
82 isoPar = ROOT.xAOD.Iso.IsolationType
83 deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20]
84 deco_ptcones_suffix = ["ptcone40", "ptcone30", "ptcone20"]
85 deco_prefix = 'LLP1_'
86
87 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
88 InDetTrackSelectionTool_Loose_Cfg)
89 TrackSelectionToolStd = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
90 name="TrackSelectionToolStd",
91 maxZ0SinTheta=3.0,
92 minPt=1000.))
93
94 TrackSelectionToolPdEdx = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
95 name="TrackSelectionToolPdEdx",
96 maxD0=0.5,
97 maxZ0SinTheta=3.0,
98 minPt=1000.))
99
100 TrackSelectionToolPdEdxTight = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
101 name="TrackSelectionToolPdEdxTight",
102 maxD0=0.5,
103 maxZ0SinTheta=0.5,
104 minPt=1000.))
105
106 from IsolationAlgs.IsoToolsConfig import TrackIsolationToolCfg, CaloIsolationToolCfg
107 TrackIsoToolStd = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
108 name="TrackIsoToolStd",
109 TrackSelectionTool=TrackSelectionToolStd))
110 acc.addPublicTool(TrackIsoToolStd)
111
112 TrackIsoToolPdEdx = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
113 name="TrackIsoToolPdEdx",
114 TrackSelectionTool=TrackSelectionToolPdEdx))
115 acc.addPublicTool(TrackIsoToolPdEdx)
116
117 TrackIsoToolPdEdxTight = acc.popToolsAndMerge(TrackIsolationToolCfg(flags,
118 name="TrackIsoToolPdEdxTight",
119 TrackSelectionTool=TrackSelectionToolPdEdxTight))
120 acc.addPublicTool(TrackIsoToolPdEdxTight)
121
122 augmentationTools = []
123
124 from CaloIdentifier import SUBCALO
125 CaloIsoTool = acc.popToolsAndMerge(CaloIsolationToolCfg(flags,
126 name="CaloIsoTool",
127 EMCaloNums=[SUBCALO.LAREM],
128 HadCaloNums=[SUBCALO.LARHEC, SUBCALO.TILE],
129 UseEMScale=True,
130 UseCaloExtensionCaching=False,
131 saveOnlyRequestedCorrections=True))
132 acc.addPublicTool(CaloIsoTool)
133
134 from DerivationFrameworkInDet.InDetToolsConfig import IsolationTrackDecoratorCfg
135 augmentationTools.append(acc.getPrimaryAndMerge(
136 IsolationTrackDecoratorCfg(flags,
137 name="LLP1IsolationTrackDecorator",
138 TrackIsolationTool=TrackIsoToolStd,
139 CaloIsolationTool=CaloIsoTool,
140 TargetContainer="InDetTrackParticles",
141 SelectionString="InDetTrackParticles.pt>10*GeV",
142 iso=[isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20, isoPar.ptvarcone40, isoPar.ptvarcone30, isoPar.ptvarcone20, isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
143 isoSuffix=["ptcone40", "ptcone30", "ptcone20", "ptvarcone40", "ptvarcone30", "ptvarcone20", "topoetcone40", "topoetcone30", "topoetcone20"],
144 Prefix=deco_prefix)
145 ))
146
147 augmentationTools.append(acc.getPrimaryAndMerge(
148 IsolationTrackDecoratorCfg(flags,
149 name="LLP1IsolationTrackDecoratorPdEdx",
150 TrackIsolationTool=TrackIsoToolPdEdx,
151 CaloIsolationTool=CaloIsoTool,
152 TargetContainer="InDetTrackParticles",
153 iso=deco_ptcones,
154 Prefix='TrkIsoPtPdEdx_',
155 isoSuffix=deco_ptcones_suffix)
156 ))
157
158 augmentationTools.append(acc.getPrimaryAndMerge(
159 IsolationTrackDecoratorCfg(flags,
160 name="LLP1IsolationTrackDecoratorPdEdxTight",
161 TrackIsolationTool=TrackIsoToolPdEdxTight,
162 CaloIsolationTool=CaloIsoTool,
163 TargetContainer="InDetTrackParticles",
164 iso=deco_ptcones,
165 Prefix='TrkIsoPtTightPdEdx_',
166 isoSuffix=deco_ptcones_suffix)
167 ))
168
169 from DerivationFrameworkLLP.LLPToolsConfig import TrackParticleCaloCellDecoratorCfg
170 augmentationTools.append(acc.getPrimaryAndMerge(
171 TrackParticleCaloCellDecoratorCfg(flags,
172 name="LLP1TrackParticleCaloCellDecorator",
173 DecorationPrefix="LLP1",
174 ContainerName="InDetTrackParticles")
175 ))
176
177 # Di-lepton invariant masses, used to gate the photon-cone track thinning
178 from DerivationFrameworkLLP.LLPToolsConfig import (
179 LLP1eeMassToolCfg, LLP1mumuMassToolCfg)
180 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
181 LLP1eeMassToolCfg(flags)
182 )))
183 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
184 LLP1mumuMassToolCfg(flags)
185 )))
186
187 # Specific for LRTElectrons
188 if flags.Tracking.doLargeD0:
189 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
190 MaxCellDecoratorCfg(
191 flags, name="LLP1LRTMaxCellDecoratorTool",
192 SGKey_electrons="LRTElectrons",
193 SGKey_egammaClusters=("" if flags.GeoModel.Run >= LHCPeriod.Run3
194 else "egammaClusters"),
195 SGKey_photons='')
196 )))
197
198 if flags.Tracking.doTrackSegmentsDisappearing:
199 # Vertex constraint tools
200 from DerivationFrameworkLLP.LLPToolsConfig import TrackParametersKVUCfg
201 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
202 TrackParametersKVUCfg(
203 flags, name="LLP1TrackParametersKVU")
204 )))
205
206 augmentationTools.append(acc.getPrimaryAndMerge(
207 IsolationTrackDecoratorCfg(
208 flags, name="LLP1IsolationTrackDecoratorDT",
209 TrackIsolationTool=TrackIsoToolStd,
210 CaloIsolationTool=CaloIsoTool,
211 TargetContainer="InDetDisappearingTrackParticles",
212 SelectionString="InDetDisappearingTrackParticles.pt>10*GeV",
213 iso=[isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20,
214 isoPar.ptvarcone40, isoPar.ptvarcone30, isoPar.ptvarcone20,
215 isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
216 isoSuffix=["ptcone40", "ptcone30", "ptcone20",
217 "ptvarcone40", "ptvarcone30", "ptvarcone20",
218 "topoetcone40", "topoetcone30", "topoetcone20"],
219 Prefix=deco_prefix)
220 ))
221
222 augmentationTools.append(acc.getPrimaryAndMerge(
223 IsolationTrackDecoratorCfg(
224 flags, name="LLP1IsolationTrackDecoratorPdEdxDT",
225 TrackIsolationTool=TrackIsoToolPdEdx,
226 CaloIsolationTool=CaloIsoTool,
227 TargetContainer="InDetDisappearingTrackParticles",
228 iso=deco_ptcones,
229 Prefix='TrkIsoPtPdEdx_',
230 isoSuffix=deco_ptcones_suffix)
231 ))
232
233 augmentationTools.append(acc.getPrimaryAndMerge(
234 IsolationTrackDecoratorCfg(
235 flags, name="LLP1IsolationTrackDecoratorPdEdxTightDT",
236 TrackIsolationTool=TrackIsoToolPdEdxTight,
237 CaloIsolationTool=CaloIsoTool,
238 TargetContainer="InDetDisappearingTrackParticles",
239 iso=deco_ptcones,
240 Prefix='TrkIsoPtTightPdEdx_',
241 isoSuffix=deco_ptcones_suffix)
242 ))
243
244 # Specific for Taus
245 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
246 MaxCellDecoratorCfg(
247 flags,
248 name="LLP1TauMaxCellDecoratorTool",
249 SGKey_taus='TauJets',
250 SGKey_electrons='',
251 SGKey_photons='')
252 )))
253
254 # Specific for Jets: AntiKt4EMTopoJets
255 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
256 MaxCellDecoratorCfg(
257 flags,
258 name="LLP1AntiKt4EMTopoJetMaxCellDecoratorTool",
259 SGKey_jets='AntiKt4EMTopoJets',
260 SGKey_taus='',
261 SGKey_electrons='',
262 SGKey_photons='')
263 )))
264
265 # Specific for Jets: AntiKt4EMPFlowJets
266 augmentationTools.append(acc.addPublicTool(acc.popToolsAndMerge(
267 MaxCellDecoratorCfg(
268 flags,
269 name="LLP1AntiKt4EMPFlowJetMaxCellDecoratorTool",
270 SGKey_jets='AntiKt4EMPFlowJets',
271 SGKey_taus='',
272 SGKey_electrons='',
273 SGKey_photons='')
274 )))
275
276 # Reclustered jets definitions
277 from JetRecConfig.JetRecConfig import registerAsInputConstit, JetRecCfg
278 from JetRecConfig.StandardSmallRJets import AntiKt4EMTopo_deriv
279 from JetRecConfig.JetDefinition import JetDefinition
280 from JetRecConfig.StandardJetConstits import stdConstitDic as cst
281
282 # Register explicitly the derivation AntiKt4EMTopo, now with unassoc muon segment ghosts
283 registerAsInputConstit(AntiKt4EMTopo_deriv)
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 # Do the dedicated LRT-aware tau reconstruction
302 if flags.Tracking.doLargeD0:
303 from JetRecConfig.StandardSmallRJets import AntiKt4LCTopo
304 acc.merge(JetRecCfg(flags, AntiKt4LCTopo))
305
306 # Run tau reconstruction config.
307 from tauRec.TauConfig import TauLRTReconstructionCfg
308 acc.merge(TauLRTReconstructionCfg(flags))
309
310 # Run displaced tau ID decoration.
311 from DerivationFrameworkTau.TauCommonConfig import AddTauIDDisplacedDecorationCfg
312 acc.merge(AddTauIDDisplacedDecorationCfg(flags))
313
314 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
315 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper=kwargs['TriggerListsHelper']))
316 acc.merge(JetRecCfg(flags, AntiKt10RCEMTopo))
317 if flags.Input.isMC:
318 acc.merge(JetRecCfg(flags, AntiKt10RCTruth))
319
320 if flags.Tracking.doLargeD0:
321 # MET with LRT in association map
322 from DerivationFrameworkJetEtMiss.METCommonConfig import METLRTCfg
323 acc.merge(METLRTCfg(flags, "AntiKt4EMTopo"))
324 acc.merge(METLRTCfg(flags, "AntiKt4EMPFlow"))
325
326 # LRT Egamma
327 from DerivationFrameworkEGamma.EGammaLRTConfig import EGammaLRTCfg
328 acc.merge(EGammaLRTCfg(flags))
329
330 from DerivationFrameworkLLP.LLPToolsConfig import LRTElectronLHSelectorsCfg
331 acc.merge(LRTElectronLHSelectorsCfg(flags))
332
333 # LRT Muons
334 from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
335 acc.merge(MuonsCommonCfg(flags, suff="LRT"))
336
337 # Photon ID Selector
338 from DerivationFrameworkLLP.LLPToolsConfig import PhotonIsEMSelectorsCfg
339 acc.merge(PhotonIsEMSelectorsCfg(flags))
340
341 # Recover Zero Pixel Hit Muons
342 from DerivationFrameworkLLP.LLPToolsConfig import RecoverZeroPixelHitMuonsCfg
343 acc.merge(RecoverZeroPixelHitMuonsCfg(flags))
344
345 # flavor tagging
346 from BTagging.FlavorTaggingConfig import FlavorTaggingCfg
347 acc.merge(FlavorTaggingCfg(flags, 'AntiKt4EMTopoJets'))
348
349 # VrtSecInclusive
350 from VrtSecInclusive.VrtSecInclusiveConfig import VrtSecInclusiveCfg
351
352 # MuSAVtxFitter
353 from MuSAVtxFitter.MuSAVtxFitterConfig import MuSAVtxFitterConfig, MuSAVtxJPsiValidationAlgCfg, MuSAVtxFitterValidationConfig
354
355 acc.merge(VrtSecInclusiveCfg(flags,
356 name="VrtSecInclusive",
357 AugmentingVersionString="",
358 FillIntermediateVertices=False,
359 TrackLocation=MergedTrackCollection))
360 LLP1VrtSecInclusiveSuffixes.append("")
361
362 # short-lifetime VSI
363 shortLifetimeSuffix = "_shortLifetime"
364 acc.merge(VrtSecInclusiveCfg(flags,
365 name="VrtSecInclusive_InDet" + shortLifetimeSuffix,
366 AugmentingVersionString=shortLifetimeSuffix,
367 FillIntermediateVertices=False,
368 TrackLocation=MergedTrackCollection,
369 twoTrkVtxFormingD0Cut=1.0))
370 LLP1VrtSecInclusiveSuffixes.append(shortLifetimeSuffix)
371
372 # short-lifetime VSI, nod0 for LRSM dHNL analysis
373 shortLifetimeNod0Suffix = "_shortLifetime_nod0"
374 acc.merge(VrtSecInclusiveCfg(flags,
375 name="VrtSecInclusive_InDet" + shortLifetimeNod0Suffix,
376 AugmentingVersionString=shortLifetimeNod0Suffix,
377 FillIntermediateVertices=False,
378 TrackLocation=MergedTrackCollection,
379 twoTrkVtxFormingD0Cut=0))
380 LLP1VrtSecInclusiveSuffixes.append(shortLifetimeNod0Suffix)
381
382 # disappearing track + LRT VSI
383 if flags.Tracking.doTrackSegmentsDisappearing:
384 dissapearingSuffix = "_disappearing"
385 acc.merge(VrtSecInclusiveCfg(
386 flags, name="VrtSecInclusive_" + dissapearingSuffix,
387 AugmentingVersionString=dissapearingSuffix,
388 FillIntermediateVertices=False,
389 TrackLocation=MergedTrackletCollection,
390 doReassembleVertices=True,
391 doMergeByShuffling=False,
392 doMergeFinalVerticesDistance=False,
393 doAssociateNonSelectedTracks=False,
394 DoPVcompatibility=True,
395 RemoveFake2TrkVrt=False,
396 PassThroughTrackSelection=True,
397 TruncateListOfWorkingVertices=False,
398 twoTrkVtxFormingD0Cut=0.0,
399 SelVrtChi2Cut=1000000.0,
400 twoTrVrtMaxPerigeeDist=50.0,
401 twoTrVrtMinRadius=50.0,
402 doDisappearingTrackVertexing=True))
403 LLP1VrtSecInclusiveSuffixes.append(dissapearingSuffix)
404
405 if flags.Input.isMC and flags.Derivation.LLP.doTrackSystematics:
406 from InDetTrackSystematicsTools.InDetTrackSystematicsToolsConfig import TrackSystematicsAlgCfg
407 # Variation also applies TRK_EFF_LOOSE_COMBINED to standard tracks (suffix kept for DAOD compatibility)
408 TrackSystSuffix = "_TRK_EFF_LARGED0_GLOBAL__1down"
409 acc.merge(TrackSystematicsAlgCfg(
410 flags,
411 name=f"InDetTrackSystematicsAlg{TrackSystSuffix}",
412 InputTrackContainer=MergedTrackCollection,
413 OutputTrackContainer=f"{MergedTrackCollection}{TrackSystSuffix}",
414 SystematicVariationSTD="TRK_EFF_LOOSE_COMBINED",
415 SystematicVariationLRT="TRK_EFF_LARGED0_GLOBAL"))
416 acc.merge(VrtSecInclusiveCfg(flags,
417 name=f"VrtSecInclusive{TrackSystSuffix}",
418 AugmentingVersionString=TrackSystSuffix,
419 FillIntermediateVertices=False,
420 TrackLocation=f"{MergedTrackCollection}{TrackSystSuffix}"))
421 LLP1VrtSecInclusiveSuffixes.append(TrackSystSuffix)
422
423 TrackSystSuffixShortLifetime = "_TRK_EFF_LARGED0_GLOBAL__1down_shortLifetime"
424 acc.merge(TrackSystematicsAlgCfg(
425 flags,
426 name=f"InDetTrackSystematicsAlg{TrackSystSuffixShortLifetime}",
427 InputTrackContainer=MergedTrackCollection,
428 OutputTrackContainer=f"{MergedTrackCollection}{TrackSystSuffixShortLifetime}",
429 SystematicVariationSTD="TRK_EFF_LOOSE_COMBINED",
430 SystematicVariationLRT="TRK_EFF_LARGED0_GLOBAL"))
431 acc.merge(VrtSecInclusiveCfg(flags,
432 name=f"VrtSecInclusive{TrackSystSuffixShortLifetime}",
433 AugmentingVersionString=TrackSystSuffixShortLifetime,
434 FillIntermediateVertices=False,
435 TrackLocation=f"{MergedTrackCollection}{TrackSystSuffixShortLifetime}",
436 twoTrkVtxFormingD0Cut=1.0))
437 LLP1VrtSecInclusiveSuffixes.append(TrackSystSuffixShortLifetime)
438
439 # LRT muons merge
440 MergedMuonContainer_wZPH = (
441 "StdWithLRTMuons_wZPH" if flags.Tracking.doLargeD0 else "Muons_wZPH")
442 from DerivationFrameworkLLP.LLPToolsConfig import ZeroPixelHitMuonMergerAlgCfg
443 acc.merge(ZeroPixelHitMuonMergerAlgCfg(flags,
444 InputMuonContainers=[MergedMuonContainer, "ZeroPixelHitMuons"],
445 OutputMuonLocation=MergedMuonContainer_wZPH))
446
447 # leptons-only VSI
448 LeptonsSuffix = "_Leptons"
449 acc.merge(VrtSecInclusiveCfg(flags,
450 name="VrtSecInclusive_InDet" + LeptonsSuffix,
451 AugmentingVersionString=LeptonsSuffix,
452 FillIntermediateVertices=False,
453 TrackLocation=MergedTrackCollection,
454 twoTrkVtxFormingD0Cut=1.0,
455 doSelectTracksFromMuons=True,
456 doRemoveCaloTaggedMuons=True,
457 doSelectTracksFromElectrons=True,
458 MuonLocation=MergedMuonContainer,
459 ElectronLocation=MergedElectronContainer))
460 LLP1VrtSecInclusiveSuffixes.append(LeptonsSuffix)
461
462 # track VSI
463 LepTrackSuffix = "_LepTrack"
464 acc.merge(VrtSecInclusiveCfg(flags,
465 name="VrtSecInclusive_InDet" + LepTrackSuffix,
466 AugmentingVersionString=LepTrackSuffix,
467 FillIntermediateVertices=False,
468 TrackLocation=MergedTrackCollection,
469 MuonLocation=MergedMuonContainer,
470 ElectronLocation=MergedElectronContainer,
471 twoTrkVtxFormingD0Cut=1.0,
472 doSelectIDAndGSFTracks=True,
473 doRemoveCaloTaggedMuons=True,
474 doRemoveNonLeptonVertices=True,
475 doAssociateNonSelectedTracks=False))
476 LLP1VrtSecInclusiveSuffixes.append(LepTrackSuffix)
477
478 # Small-d0 Muons VSI
479 BoostedMuonsSuffix = "_BoostedMuons"
480 acc.merge(VrtSecInclusiveCfg(flags,
481 name="VrtSecInclusive_InDet" + BoostedMuonsSuffix,
482 AugmentingVersionString=BoostedMuonsSuffix,
483 FillIntermediateVertices=False,
484 TrackLocation=MergedTrackCollection,
485 twoTrkVtxFormingD0Cut=0.0,
486 doSelectTracksFromMuons=True,
487 doRemoveCaloTaggedMuons=True,
488 doSelectTracksFromElectrons=False,
489 MuonLocation=MergedMuonContainer_wZPH,
490 do_PVvetoCut=False,
491 DoTwoTrSoftBtag=True,
492 TwoTrVrtMinDistFromPVCut=0.5,
493 associatePtCut=500.))
494 LLP1VrtSecInclusiveSuffixes.append(BoostedMuonsSuffix)
495
496 # Small-d0 Electrons VSI
497 BoostedElectronsSuffix = "_BoostedElectrons"
498 acc.merge(VrtSecInclusiveCfg(flags,
499 name="VrtSecInclusive_InDet" + BoostedElectronsSuffix,
500 AugmentingVersionString=BoostedElectronsSuffix,
501 FillIntermediateVertices=False,
502 TrackLocation=MergedTrackCollection,
503 twoTrkVtxFormingD0Cut=0.0,
504 doSelectTracksFromMuons=False,
505 doSelectTracksFromElectrons=True,
506 ElectronLocation=MergedElectronContainer,
507 do_PVvetoCut=False,
508 DoTwoTrSoftBtag=True,
509 TwoTrVrtMinDistFromPVCut=0.5,
510 associatePtCut=500.))
511 LLP1VrtSecInclusiveSuffixes.append(BoostedElectronsSuffix)
512
513 # MuSA Vertices
514 acc.merge(MuSAVtxFitterConfig(flags,
515 MuonContainerName=MergedMuonContainer))
516
517 if flags.Derivation.LLP.doMuSAValidation:
518 # Create JPsi tagged muon container
519 acc.merge(MuSAVtxJPsiValidationAlgCfg(flags,
520 MuonContainer=MergedMuonContainer,
521 JPsiMuonContainer="JPsiMuons"))
522
523 # JPsi validation MuSA Vertices
524 acc.merge(MuSAVtxFitterValidationConfig(flags,
525 name="MuSAVtxFitterValidationJPsi",
526 MuonContainerName="JPsiMuons"))
527 # all MSTPs validation MuSA Vertices
528 acc.merge(MuSAVtxFitterValidationConfig(flags,
529 MuonContainerName=MergedMuonContainer,
530 MuSAVtxContainerName="ValidationMuSAVertices",
531 MuSAExtrapolatedTracksName="ValidationMuSAExtrapolatedTrackParticles",
532 MSTPContainerName="MuonSpectrometerTrackParticles"))
533
534 # NewVSI: LepTrack variation
535 from NewVrtSecInclusiveTool.NewVrtSecInclusiveAlgConfig import NewVrtSecInclusiveAlgLLPCfg
536 from NewVrtSecInclusiveTool.NewVrtSecInclusiveConfig import DVFinderToolCfg
537 IDAndGSFSuffix = "_IDAndGSF_LepTrack"
538
539 NVSILepTrack_Tool = acc.popToolsAndMerge(DVFinderToolCfg(flags, FillHist=False, AugmentingVersionString=IDAndGSFSuffix, MaxZVrt=1000., AntiPileupSigRCut=2.,
540 do2TrkIBLChecks=False, TwoTrkVtxFormingD0Cut=1.0))
541 acc.merge(NewVrtSecInclusiveAlgLLPCfg(flags,
542 algname="NVSI" + IDAndGSFSuffix,
543 AugmentingVersionString=IDAndGSFSuffix,
544 ElectronContainer=MergedElectronContainer,
545 MuonContainer=MergedMuonContainer,
546 TrackParticleContainer=MergedTrackCollection,
547 GSFTrackParticleContainer=MergedGSFTrackCollection,
548 BVertexContainerName="NewVrtSecInclusive_SecondaryVertices" + IDAndGSFSuffix,
549 AddIDTracks=True,
550 AddGSFTracks=True,
551 RemoveNonLepVertices=True,
552 BVertexTool=NVSILepTrack_Tool))
553 LLP1NewVSISuffixes.append(IDAndGSFSuffix)
554
555 # bad jet cleaning
556 jet_clean_prefix = "DFCommonJets_"
557 jet_clean_container = "AntiKt4EMTopoJets"
558 jet_clean_level = "SuperLooseBadLLP"
559 from JetSelectorTools.JetSelectorToolsConfig import EventCleaningToolCfg, JetCleaningToolCfg
560 LLP1JetCleanSuperLLPTool = acc.popToolsAndMerge(JetCleaningToolCfg(flags,
561 "LLP1JetCleanSuperLLP",
562 jet_clean_container,
563 jet_clean_level,
564 False))
565 acc.addPublicTool(LLP1JetCleanSuperLLPTool)
566
567 LLP1EventCleanSuperLLPTool = acc.popToolsAndMerge(EventCleaningToolCfg(flags,
568 "LLP1EventCleanSuperLLP",
569 jet_clean_level))
570 LLP1EventCleanSuperLLPTool.JetCleanPrefix = jet_clean_prefix
571 LLP1EventCleanSuperLLPTool.OrDecorator = "passOR_EMTopo"
572 LLP1EventCleanSuperLLPTool.JetContainer = jet_clean_container
573 LLP1EventCleanSuperLLPTool.JetCleaningTool = LLP1JetCleanSuperLLPTool
574 acc.addPublicTool(LLP1EventCleanSuperLLPTool)
575
576 LLP1EventCleanAlg = CompFactory.EventCleaningTestAlg(
577 "LLP1JetCleanDecoratorSuperLLP",
578 EventCleaningTool=LLP1EventCleanSuperLLPTool,
579 JetCollectionName=jet_clean_container,
580 EventCleanPrefix=jet_clean_prefix,
581 CleaningLevel=jet_clean_level,
582 doEvent=True)
583
584 acc.addEventAlgo(LLP1EventCleanAlg)
585
586 from DerivationFrameworkLLP.LLPToolsConfig import AugmentationToolLeadingJetsCfg
587 augmentationToolLeadingJets = acc.getPrimaryAndMerge(AugmentationToolLeadingJetsCfg(flags))
588 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, AugmentationTools=[augmentationToolLeadingJets]))
589
590 # Thinning tools...
591 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, EgammaTrackParticleThinningCfg, MuonTrackParticleThinningCfg, TauTrackParticleThinningCfg, DiTauTrackParticleThinningCfg
592 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
593 from DerivationFrameworkTau.TauCommonConfig import TauThinningCfg
594
595 # Inner detector tracks need to have greater than 10 GeV of pT
596 LLP1TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
597 flags,
598 name="LLP1TrackParticleThinningTool",
599 StreamName=kwargs['StreamName'],
600 SelectionString="InDetTrackParticles.pt>10*GeV",
601 InDetTrackParticlesKey="InDetTrackParticles"))
602
603 # Keep all GSF LRT Tracks
604 if flags.Tracking.doLargeD0:
605 LLP1LRTGSFTrackParticleThinningTool = acc.getPrimaryAndMerge(
606 TrackParticleThinningCfg(
607 flags, name="LLP1LRTGSFTrackParticleThinningTool",
608 StreamName=kwargs['StreamName'],
609 SelectionString="LRTGSFTrackParticles.pt>0*GeV",
610 InDetTrackParticlesKey="LRTGSFTrackParticles"))
611
612 # Pixel tracklets need to have greater than 5 GeV of pT
613 if flags.Tracking.doTrackSegmentsDisappearing:
614 LLP1DTTrackParticleThinningTool = acc.getPrimaryAndMerge(
615 TrackParticleThinningCfg(
616 flags, name="LLP1DTTrackParticleThinningTool",
617 StreamName=kwargs['StreamName'],
618 SelectionString="InDetDisappearingTrackParticles.pt>5*GeV",
619 InDetTrackParticlesKey="InDetDisappearingTrackParticles"))
620
621 # Include inner detector tracks associated with electrons
622 LLP1ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
623 flags,
624 name="LLP1ElectronTPThinningTool",
625 StreamName=kwargs['StreamName'],
626 SGKey="Electrons",
627 InDetTrackParticlesKey="InDetTrackParticles"))
628
629 # Include inner detector tracks associated with LRT electrons
630 if flags.Tracking.doLargeD0:
631 LLP1LRTElectronTPThinningTool = acc.getPrimaryAndMerge(
632 EgammaTrackParticleThinningCfg(
633 flags, name="LLP1LRTElectronTPThinningTool",
634 StreamName=kwargs['StreamName'],
635 SGKey="LRTElectrons",
636 InDetTrackParticlesKey="InDetLargeD0TrackParticles",
637 GSFTrackParticlesKey="LRTGSFTrackParticles"))
638
639 # Include inner detector tracks associated with muons
640 LLP1MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
641 flags,
642 name="LLP1MuonTPThinningTool",
643 StreamName=kwargs['StreamName'],
644 MuonKey="Muons",
645 InDetTrackParticlesKey="InDetTrackParticles"))
646
647 # Include LRT inner detector tracks associated with LRT muons
648 if flags.Tracking.doLargeD0:
649 LLP1LRTMuonTPThinningTool = acc.getPrimaryAndMerge(
650 MuonTrackParticleThinningCfg(
651 flags, name="LLP1LRTMuonTPThinningTool",
652 StreamName=kwargs['StreamName'],
653 MuonKey="MuonsLRT",
654 InDetTrackParticlesKey="InDetLargeD0TrackParticles"))
655
656 # GSF tracks associated to photons
657 LLP1PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
658 flags,
659 name="LLP1PhotonTPThinningTool",
660 StreamName=kwargs['StreamName'],
661 SGKey="Photons",
662 InDetTrackParticlesKey="",
663 GSFConversionVerticesKey="GSFConversionVertices",
664 GSFTrackParticlesKey="GSFTrackParticles",
665 BestMatchOnly=True,
666 BestVtxMatchOnly=True))
667
668 # Keep ALL inner-detector / GSF tracks within dR < 0.6 of photons (no pt
669 # cut on the tracks)
670 LLP1PhotonLowPtTPThinningTool = (
671 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
672 name="LLP1PhotonLowPtTPThinningTool",
673 StreamName=kwargs['StreamName'],
674 SGKey="Photons",
675 GSFTrackParticlesKey="GSFTrackParticles",
676 InDetTrackParticlesKey="InDetTrackParticles",
677 GSFConversionVerticesKey="GSFConversionVertices",
678 SelectionString=("(Photons.pt > 9*GeV) && ( "
679 "(count(LLP1_DiElectronMass > 40.0*GeV) >= 1) || "
680 "(count(LLP1_DiMuonMass > 40.0*GeV) >= 1) )"),
681 BestMatchOnly=False,
682 ConeSize=0.6,
683 )
684 )
685 acc.addPublicTool(LLP1PhotonLowPtTPThinningTool)
686
687 # Tau-related containers: taus, tau tracks and associated ID tracks, neutral PFOs, secondary vertices
688 tau_thinning_expression = f"TauJets.pt >= {flags.Tau.MinPtDAOD}"
689 LLP1TauJetsThinningTool = acc.getPrimaryAndMerge(TauThinningCfg(
690 flags,
691 name="LLP1TauJetThinningTool",
692 StreamName=kwargs['StreamName'],
693 Taus="TauJets",
694 TauTracks="TauTracks",
695 TrackParticles="InDetTrackParticles",
696 TauNeutralPFOs="TauNeutralParticleFlowObjects",
697 TauSecondaryVertices="TauSecondaryVertices",
698 SelectionString=tau_thinning_expression))
699
700 # Only keep tau tracks (and associated ID tracks) classified as charged tracks
701 LLP1TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
702 flags,
703 name="LLP1TauTPThinningTool",
704 StreamName=kwargs['StreamName'],
705 TauKey="TauJets",
706 InDetTrackParticlesKey="InDetTrackParticles",
707 DoTauTracksThinning=True,
708 TauTracksKey="TauTracks"))
709
710 tau_murm_thinning_expression = tau_thinning_expression.replace('TauJets', 'TauJets_MuonRM')
711 LLP1TauJetMuonRMParticleThinningTool = acc.getPrimaryAndMerge(TauThinningCfg(
712 flags,
713 name="LLP1TauJets_MuonRMThinningTool",
714 StreamName=kwargs['StreamName'],
715 Taus="TauJets_MuonRM",
716 TauTracks="TauTracks_MuonRM",
717 TrackParticles="InDetTrackParticles",
718 TauNeutralPFOs="TauNeutralParticleFlowObjects_MuonRM",
719 TauSecondaryVertices="TauSecondaryVertices_MuonRM",
720 SelectionString=tau_murm_thinning_expression))
721
722 # ID tracks associated with high-pt di-tau
723 LLP1DiTauTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(
724 flags,
725 name="LLP1DiTauTPThinningTool",
726 StreamName=kwargs['StreamName'],
727 DiTauKey="DiTauJets",
728 InDetTrackParticlesKey="InDetTrackParticles"))
729
730 # Low-pt di-tau thinning
731 LLP1DiTauLowPtThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(
732 flags,
733 name="LLP1DiTauLowPtThinningTool",
734 StreamName=kwargs['StreamName'],
735 ContainerName="DiTauJetsLowPt",
736 SelectionString="DiTauJetsLowPt.nSubjets > 1"))
737
738 # ID tracks associated with low-pt ditau
739 LLP1DiTauLowPtTPThinningTool = acc.getPrimaryAndMerge(DiTauTrackParticleThinningCfg(
740 flags,
741 name="LLP1DiTauLowPtTPThinningTool",
742 StreamName=kwargs['StreamName'],
743 DiTauKey="DiTauJetsLowPt",
744 InDetTrackParticlesKey="InDetTrackParticles",
745 SelectionString="DiTauJetsLowPt.nSubjets > 1"))
746
747 if flags.Tracking.doLargeD0:
748 from DerivationFrameworkLLP.LLPToolsConfig import TauLRTThinningCfg
749 tau_lrt_thinning_expression = f"TauJetsLRT.pt >= {flags.Tau.MinPtDAOD}"
750 LLP1TauJetsLRTThinningTool = acc.getPrimaryAndMerge(TauLRTThinningCfg(
751 flags,
752 name="LLP1TauJetLRTThinningTool",
753 StreamName=kwargs['StreamName'],
754 Taus="TauJetsLRT",
755 TauTracks="TauTracksLRT",
756 TrackParticles="InDetTrackParticles",
757 TrackLargeD0Particles="InDetLargeD0TrackParticles",
758 TauNeutralPFOs="TauNeutralParticleFlowObjectsLRT",
759 TauSecondaryVertices="TauSecondaryVerticesLRT",
760 SelectionString=tau_lrt_thinning_expression))
761
762 # ID Tracks associated with secondary vertices
763 LLP1VSIVertexContainers = (["VrtSecInclusive_SecondaryVertices" + s for s in LLP1VrtSecInclusiveSuffixes]
764 + ["NewVrtSecInclusive_SecondaryVertices" + s for s in LLP1NewVSISuffixes])
765 from DerivationFrameworkLLP.LLPToolsConfig import VSITrackParticleThinningCfg
766 LLP1VSITPThinningTool = acc.getPrimaryAndMerge(VSITrackParticleThinningCfg(flags,
767 name="LLP1VSITPThinningTool",
768 StreamName=kwargs['StreamName'],
769 InDetTrackParticlesKey ="InDetTrackParticles",
770 AugVerStrings=LLP1VrtSecInclusiveSuffixes + LLP1NewVSISuffixes,
771 VertexContainerKeys=LLP1VSIVertexContainers))
772
773 if flags.Tracking.doLargeD0:
774 LLP1LRTVSITPThinningTool = acc.getPrimaryAndMerge(
775 VSITrackParticleThinningCfg(
776 flags, name="LLP1LRTVSITPThinningTool",
777 StreamName=kwargs['StreamName'],
778 InDetTrackParticlesKey="InDetLargeD0TrackParticles",
779 AugVerStrings=LLP1VrtSecInclusiveSuffixes + LLP1NewVSISuffixes,
780 VertexContainerKeys=LLP1VSIVertexContainers))
781
782 LLP1GSFVSITPThinningTool = acc.getPrimaryAndMerge(VSITrackParticleThinningCfg(flags,
783 name="LLP1GSFVSITPThinningTool",
784 StreamName=kwargs['StreamName'],
785 InDetTrackParticlesKey="GSFTrackParticles",
786 AugVerStrings=[IDAndGSFSuffix],
787 VertexContainerKeys=["NewVrtSecInclusive_SecondaryVertices" + IDAndGSFSuffix]))
788
789 # ID Tracks associated with jets
790 from DerivationFrameworkLLP.LLPToolsConfig import JetTrackParticleThinningCfg, JetLargeD0TrackParticleThinningCfg
791 LLP1JetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
792 name="LLP1JetTPThinningTool",
793 StreamName=kwargs['StreamName'],
794 JetKey="AntiKt4EMTopoJets",
795 SelectionString="(AntiKt4EMTopoJets.pt > 20.*GeV) && (abs(AntiKt4EMTopoJets.eta) < 2.5)",
796 InDetTrackParticlesKey="InDetTrackParticles"))
797
798 LLP1FatJetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
799 name="LLP1FatJetTPThinningTool",
800 StreamName=kwargs['StreamName'],
801 JetKey="AntiKt10EMTopoRCJets",
802 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
803 InDetTrackParticlesKey="InDetTrackParticles",
804 ))
805
806 # LRT Tracks associated with jets
807 if flags.Tracking.doLargeD0:
808 LLP1LRTJetTPThinningTool = acc.getPrimaryAndMerge(
809 JetLargeD0TrackParticleThinningCfg(
810 flags, name="LLP1LRTJetTPThinningTool",
811 StreamName=kwargs['StreamName'],
812 JetKey="AntiKt4EMTopoJets",
813 SelectionString="(AntiKt4EMTopoJets.pt > 20.*GeV) && (abs(AntiKt4EMTopoJets.eta) < 2.5)",
814 InDetTrackParticlesKey="InDetLargeD0TrackParticles"))
815
816 LLP1LRTFatJetTPThinningTool = acc.getPrimaryAndMerge(
817 JetLargeD0TrackParticleThinningCfg(
818 flags, name="LLP1LRTFatJetTPThinningTool",
819 StreamName=kwargs['StreamName'],
820 JetKey="AntiKt10EMTopoRCJets",
821 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
822 InDetTrackParticlesKey="InDetLargeD0TrackParticles"))
823
824 # high dE/dx and low pT tracks
825 from DerivationFrameworkLLP.LLPToolsConfig import PixeldEdxTrackParticleThinningCfg
826 LLP1PixeldEdxTrackParticleThinningTool = acc.getPrimaryAndMerge(PixeldEdxTrackParticleThinningCfg(
827 flags,
828 name="LLP1PixeldEdxTrackParticleThinningTool",
829 StreamName=kwargs['StreamName'],
830 InDetTrackParticlesKey="InDetTrackParticles"))
831
832 # Thinning CaloCalTopoClusters associated to AntiKt4EMTopoJets
833 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import JetCaloClusterThinningCfg
834
835 LLP1CCThinningTool = acc.getPrimaryAndMerge(JetCaloClusterThinningCfg(
836 flags,
837 name="LLP1CCTool",
838 StreamName=kwargs['StreamName'],
839 SGKey="AntiKt4EMTopoJets",
840 TopoClCollectionSGKey="CaloCalTopoClusters",
841 AdditionalClustersKey=["EMOriginTopoClusters", "LCOriginTopoClusters"]
842 ))
843
844 # Finally the kernel itself
845 thinningTools = [LLP1TrackParticleThinningTool,
846 LLP1ElectronTPThinningTool,
847 LLP1MuonTPThinningTool,
848 LLP1PhotonTPThinningTool,
849 LLP1PhotonLowPtTPThinningTool,
850 LLP1TauJetsThinningTool,
851 LLP1TauTPThinningTool,
852 LLP1TauJetMuonRMParticleThinningTool,
853 LLP1DiTauTPThinningTool,
854 LLP1DiTauLowPtThinningTool,
855 LLP1DiTauLowPtTPThinningTool,
856 LLP1VSITPThinningTool,
857 LLP1GSFVSITPThinningTool,
858 LLP1JetTPThinningTool,
859 LLP1FatJetTPThinningTool,
860 LLP1PixeldEdxTrackParticleThinningTool,
861 LLP1CCThinningTool]
862
863 if flags.Tracking.doLargeD0:
864 thinningTools += [LLP1LRTJetTPThinningTool,
865 LLP1LRTFatJetTPThinningTool,
866 LLP1LRTGSFTrackParticleThinningTool,
867 LLP1LRTElectronTPThinningTool,
868 LLP1LRTMuonTPThinningTool,
869 LLP1TauJetsLRTThinningTool,
870 LLP1LRTVSITPThinningTool]
871
872 if flags.Tracking.doTrackSegmentsDisappearing:
873 thinningTools += [LLP1DTTrackParticleThinningTool]
874
875 # Additionnal augmentations
876
877 # Compute RC substructure variables from energy clusters
878 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
879 LLP1RCJetSubstructureClustTrimAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
880 name="LLP1RCJetSubstructureClustTrimAugTool",
881 StreamName=kwargs['StreamName'],
882 JetContainerKey="AntiKt10EMTopoRCJets",
883 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
884 GhostConstitNames=["GhostLCTopoOrigin"],
885 Suffix="clusterTrim",
886 Grooming="Trimming",
887 RClusTrim=0.2,
888 PtFracTrim=0.05
889 ))
890 RCSubstructureClusterTrimAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureClusterTrimAug", AugmentationTools=[LLP1RCJetSubstructureClustTrimAugTool])
891 acc.addEventAlgo(RCSubstructureClusterTrimAug)
892
893 LLP1RCJetSubstructureClustSDAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
894 name="LLP1RCJetSubstructureClustSDAugTool",
895 StreamName=kwargs['StreamName'],
896 JetContainerKey="AntiKt10EMTopoRCJets",
897 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
898 GhostConstitNames=["GhostLCTopoOrigin"],
899 Suffix="clusterSoftDrop",
900 Grooming="SoftDrop",
901 BetaSoft=1.0,
902 ZcutSoft=0.1
903 ))
904 RCSubstructureClusterSDAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureClusterSDAug", AugmentationTools=[LLP1RCJetSubstructureClustSDAugTool])
905 acc.addEventAlgo(RCSubstructureClusterSDAug)
906
907 # Compute RC substructure variables from tracks
908 ghostConstitNames = ["GhostTrack"]
909 if flags.Tracking.doLargeD0:
910 ghostConstitNames += ["GhostTrackLRT"]
911
912 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
913 LLP1RCJetSubstructureTrackTrimAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
914 name="LLP1RCJetSubstructureTrackTrimAugTool",
915 StreamName=kwargs['StreamName'],
916 JetContainerKey="AntiKt10EMTopoRCJets",
917 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
918 GhostConstitNames=ghostConstitNames,
919 Suffix="trackTrim",
920 Grooming="Trimming",
921 RClusTrim=0.2,
922 PtFracTrim=0.05
923 ))
924 RCSubstructureTrackTrimAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureTrackTrimAug", AugmentationTools=[LLP1RCJetSubstructureTrackTrimAugTool])
925 acc.addEventAlgo(RCSubstructureTrackTrimAug)
926
927 from DerivationFrameworkLLP.LLPToolsConfig import RCJetSubstructureAugCfg
928 LLP1RCJetSubstructureTrackSDAugTool = acc.getPrimaryAndMerge(RCJetSubstructureAugCfg(flags,
929 name="LLP1RCJetSubstructureTrackSDAugTool",
930 StreamName=kwargs['StreamName'],
931 JetContainerKey="AntiKt10EMTopoRCJets",
932 SelectionString="(AntiKt10EMTopoRCJets.pt > 200.*GeV) && (abs(AntiKt10EMTopoRCJets.eta) < 2.5)",
933 GhostConstitNames=ghostConstitNames,
934 Suffix="trackSoftDrop",
935 Grooming="SoftDrop",
936 BetaSoft=1.0,
937 ZcutSoft=0.1
938 ))
939 RCSubstructureTrackSDAug = CompFactory.DerivationFramework.CommonAugmentation("RCSubstructureTrackSDAug", AugmentationTools=[LLP1RCJetSubstructureTrackSDAugTool])
940 acc.addEventAlgo(RCSubstructureTrackSDAug)
941
942 # Skimming
943 skimmingTools = []
944
945 if flags.Trigger.EDMVersion >= 0:
946 from DerivationFrameworkLLP.LLPToolsConfig import LLP1TriggerSkimmingToolCfg
947 LLP1TriggerSkimmingTool = acc.getPrimaryAndMerge(LLP1TriggerSkimmingToolCfg(
948 flags, name="LLP1TriggerSkimmingTool",
949 TriggerListsHelper=kwargs['TriggerListsHelper']))
950
951 skimmingTools.append(LLP1TriggerSkimmingTool)
952
953 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
954 acc.addEventAlgo(DerivationKernel(name,
955 SkimmingTools=skimmingTools,
956 ThinningTools=thinningTools,
957 AugmentationTools=augmentationTools))
958
959 return acc
960
961
962def LLP1Cfg(flags):
963 acc = ComponentAccumulator()
964
965 MergedElectronContainer = (
966 "StdWithLRTElectrons" if flags.Tracking.doLargeD0 else "Electrons")
967 MergedMuonContainer = "StdWithLRTMuons" if flags.Tracking.doLargeD0 else "Muons"
968 MergedMuonContainer_wZPH = (
969 "StdWithLRTMuons_wZPH" if flags.Tracking.doLargeD0 else "Muons_wZPH")
970
971 # Get the lists of triggers needed for trigger matching.
972 # This is needed at this scope (for the slimming) and further down in the config chain
973 # for actually configuring the matching, so we create it here and pass it down
974 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
975 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
976 LLP1TriggerListsHelper = TriggerListsHelper(flags)
977
978 # Common augmentations
979 acc.merge(LLP1KernelCfg(flags, name="LLP1Kernel", StreamName='StreamDAOD_LLP1', TriggerListsHelper=LLP1TriggerListsHelper))
980
981 # CloseByIsolation correction augmentation
982 # For the moment, run BOTH CloseByIsoCorrection on AOD AND add in augmentation variables to be able to also run on derivation (the latter part will eventually be suppressed)
983 # Must set useSelTools to set elLHVLoose and phIsEMLoose with tools - not already set in LLP1 derivation
984 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
985 # We can't pass non-LRT containers to the LLP algorithm.
986 # Otherwise, if this is run in conjunction with PHYS, the decorations
987 # produced by the PHYS algorithm will be overwritten. To get those
988 # decorations produced when LLP1 is run alone, we schedule a separate
989 # algorithm for those but make it the same as the one in PHYS so that
990 # they'll be merged when both formats are used together.
991 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite=False,
992 stream_name='StreamDAOD_LLP1'))
993
994 contNames = [MergedMuonContainer, MergedElectronContainer, "Photons"]
995 acc.merge(IsoCloseByAlgsCfg(flags, suff="_LLP1_LRTMerged",
996 isPhysLite=False, containerNames=contNames,
997 depContainerNames=["Muons", "MuonsLRT", "Electrons", "LRTElectrons", "Photons"],
998 useSelTools=True, stream_name='StreamDAOD_LLP1',
999 isoDecSuffix="CloseByCorr_LRT",
1000 caloDecSuffix='_LRT',
1001 hasLRT=flags.Tracking.doLargeD0))
1002 contNames = ["ZeroPixelHitMuons"]
1003 acc.merge(IsoCloseByAlgsCfg(flags, suff="_LLP1_ZeroPixelHitsMuons",
1004 isPhysLite=False, containerNames=contNames,
1005 depContainerNames=["Muons"],
1006 stream_name='StreamDAOD_LLP1',
1007 isoDecSuffix="CloseByCorr_ZPH"))
1008
1009 if flags.Tracking.doLargeD0:
1010 contNames = ["LRTElectrons", "MuonsLRT"]
1011 acc.merge(IsoCloseByAlgsCfg(flags, suff="_LLP1",
1012 isPhysLite=False, containerNames=contNames,
1013 useSelTools=True,
1014 stream_name='StreamDAOD_LLP1', hasLRT=True))
1015
1016 # ============================
1017 # Define contents of the format
1018 # =============================
1019 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
1020 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
1021 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
1022
1023 LLP1SlimmingHelper = SlimmingHelper("LLP1SlimmingHelper", NamesAndTypes=flags.Input.TypedCollections, flags=flags)
1024
1025 LLP1SlimmingHelper.SmartCollections = ["EventInfo",
1026 "Electrons",
1027 "Photons",
1028 "Muons",
1029 "PrimaryVertices",
1030 "InDetTrackParticles",
1031 "AntiKt4EMTopoJets",
1032 "AntiKt4EMPFlowJets",
1033 "MET_Baseline_AntiKt4EMTopo",
1034 "MET_Baseline_AntiKt4EMPFlow",
1035 "TauJets",
1036 "TauJets_MuonRM",
1037 "DiTauJets",
1038 "DiTauJetsLowPt",
1039 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"]
1040 if flags.Tracking.doLargeD0:
1041 LLP1SlimmingHelper.SmartCollections += ["LRTElectrons", "MuonsLRT", "TauJetsLRT",
1042 "InDetLargeD0TrackParticles"]
1043
1044 LLP1SlimmingHelper.AllVariables = ["InDetDisappearingTrackParticles",
1045 "MSDisplacedVertex",
1046 "MuonSpectrometerTrackParticles",
1047 "UnAssocMuonSegments",
1048 "MuonSegments",
1049 "MSonlyTracklets",
1050 "CombinedMuonTrackParticles",
1051 "ExtrapolatedMuonTrackParticles",
1052 "CombinedStauTrackParticles",
1053 "AntiKt4EMTopoJets",
1054 "egammaClusters",
1055 "ElectronRingSets",
1056 "ElectronCaloRings",
1057 "JetRingSets",
1058 "JetCaloRings",
1059 "SlowMuons",
1060 "EMOriginTopoClusters",
1061 "Staus",
1062 "METAssoc_AntiKt4EMTopo",
1063 "MET_Core_AntiKt4EMTopo",
1064 "METAssoc_AntiKt4EMPFlow",
1065 "MET_Core_AntiKt4EMPFlow",
1066 "InDetLowPtRoITrackParticles",
1067 "PixelClusters",
1068 "PixelMSOSs",
1069 "DisappearingPixelMSOSs",
1070 "LowPtRoIPixelMSOSs",
1071 "SCT_Clusters",
1072 "SCT_MSOSs",
1073 "DisappearingSCT_MSOSs",
1074 "LowPtRoISCT_MSOSs",
1075 "LVL1MuonRoIs",
1076 "LVL1MuonRoIsBCm2",
1077 "LVL1MuonRoIsBCm1",
1078 "LVL1MuonRoIsBCp1",
1079 "LVL1MuonRoIsBCp2",
1080 "NCB_MuonSegments",
1081 "HLT_MuRoICluster_Composites"]
1082 if flags.Tracking.doLargeD0:
1083 LLP1SlimmingHelper.AllVariables += ["MuonSegments_LRT",
1084 "CombinedMuonsLRTTrackParticles",
1085 "ExtraPolatedMuonsLRTTrackParticles",
1086 "MSOnlyExtraPolatedMuonsLRTTrackParticles"]
1087
1088 excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV"
1089 StaticContent = []
1090 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"]
1091 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData]
1092 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"]
1093 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData]
1094 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"]
1095 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData]
1096 StaticContent += ["xAOD::JetContainer#AntiKt10EMTopoRCJets", "xAOD::JetAuxContainer#AntiKt10EMTopoRCJetsAux.-PseudoJet"]
1097
1098 for wp in LLP1VrtSecInclusiveSuffixes:
1099 StaticContent += ["xAOD::VertexContainer#VrtSecInclusive_SecondaryVertices" + wp]
1100 StaticContent += ["xAOD::VertexAuxContainer#VrtSecInclusive_SecondaryVertices" + wp + "Aux."]
1101
1102 for wp in LLP1NewVSISuffixes:
1103 StaticContent += ["xAOD::VertexContainer#NewVrtSecInclusive_SecondaryVertices" + wp]
1104 StaticContent += ["xAOD::VertexAuxContainer#NewVrtSecInclusive_SecondaryVertices" + wp + "Aux." + excludedVertexAuxData]
1105
1106 StaticContent += ["xAOD::VertexContainer#MuSAVertices"]
1107 StaticContent += ["xAOD::VertexAuxContainer#MuSAVerticesAux."]
1108 StaticContent += ["xAOD::TrackParticleContainer#MuSAExtrapolatedTrackParticles"]
1109 StaticContent += ["xAOD::TrackParticleAuxContainer#MuSAExtrapolatedTrackParticlesAux."]
1110
1111 if flags.Derivation.LLP.doMuSAValidation:
1112 StaticContent += ["xAOD::VertexContainer#JPsiMuSAVertices"]
1113 StaticContent += ["xAOD::VertexAuxContainer#JPsiMuSAVerticesAux."]
1114 StaticContent += ["xAOD::VertexContainer#JPsiVertices"]
1115 StaticContent += ["xAOD::VertexAuxContainer#JPsiVerticesAux."]
1116 StaticContent += ["xAOD::TrackParticleContainer#JPsiVerticesTracks"]
1117 StaticContent += ["xAOD::TrackParticleAuxContainer#JPsiVerticesTracksAux."]
1118 StaticContent += ["xAOD::TrackParticleContainer#JPsiMuSAExtrapolatedTrackParticles"]
1119 StaticContent += ["xAOD::TrackParticleAuxContainer#JPsiMuSAExtrapolatedTrackParticlesAux."]
1120 StaticContent += ["xAOD::VertexContainer#ValidationMuSAVertices"]
1121 StaticContent += ["xAOD::VertexAuxContainer#ValidationMuSAVerticesAux."]
1122 StaticContent += ["xAOD::TrackParticleContainer#ValidationMuSAExtrapolatedTrackParticles"]
1123 StaticContent += ["xAOD::TrackParticleAuxContainer#ValidationMuSAExtrapolatedTrackParticlesAux."]
1124
1125 LLP1SlimmingHelper.ExtraVariables += ["Electrons.LHValue.DFCommonElectronsLHVeryLooseNoPixResult.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z.f3",
1126 "Photons.DFCommonPhotonsIsEMMedium.DFCommonPhotonsIsEMMediumIsEMValue.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z.f3",
1127 "Muons.meanDeltaADCCountsMDT",
1128 "egammaClusters.phi_sampl.eta0.phi0",
1129 "AntiKt4EMTopoJets.PartonTruthLabelID.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.GhostBHadronsFinal.GhostCHadronsFinal.GhostTrack.GhostTrackCount.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z.constituentLinks",
1130 "AntiKt4EMPFlowJets.PartonTruthLabelID.DFCommonJets_fJvt.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.GhostBHadronsFinal.GhostCHadronsFinal.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z.constituentLinks",
1131 "TruthPrimaryVertices.t.x.y.z.sumPt2",
1132 "PrimaryVertices.t.x.y.z.sumPt2.covariance",
1133 "InDetTrackParticles.d0.z0.vz.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.hitPattern.patternRecoInfo",
1134 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
1135 "InDetTrackParticles.numberOfIBLOverflowsdEdx.numberOfUsedHitsdEdx.pixeldEdx",
1136 "InDetTrackParticles.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfNextToInnermostPixelLayerHits.numberOfContribPixelLayers.numberOfGangedFlaggedFakes.numberOfPixelOutliers.numberOfPixelSplitHits.numberOfPixelSpoiltHits",
1137 "InDetTrackParticles.numberOfSCTOutliers.numberOfSCTSpoiltHits",
1138 "InDetTrackParticles.numberOfTRTHoles.numberOfTRTDeadStraws.numberOfTRTSharedHits.numberOfTRTHighThresholdHits.numberOfTRTHighThresholdHitsTotal.numberOfTRTHighThresholdOutliers.TRTdEdx.TRTdEdxUsedHits.hitPattern",
1139 "InDetTrackParticles.truthMatchProbability.truthClassification.truthOrigin.truthType",
1140 "InDetTrackParticles.TrkIsoPtPdEdx_ptcone20.TrkIsoPtPdEdx_ptcone30.TrkIsoPtPdEdx_ptcone40.TrkIsoPtTightPdEdx_ptcone20.TrkIsoPtTightPdEdx_ptcone30.TrkIsoPtTightPdEdx_ptcone40",
1141 "InDetTrackParticles.LLP1_ptcone20.LLP1_ptcone30.LLP1_ptcone40.LLP1_ptvarcone20.LLP1_ptvarcone30.LLP1_ptvarcone40.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag",
1142 "InDetTrackParticles.LLP1_topoetcone20.LLP1_topoetcone30.LLP1_topoetcone40.LLP1_topoetcone20NonCoreCone.LLP1_topoetcone30NonCoreCone.LLP1_topoetcone40NonCoreCone",
1143 "InDetTrackParticles.LLP1_CaloCelldEta.LLP1_CaloCelldPhi.LLP1_CaloCelldR.LLP1_CaloCelldX.LLP1_CaloCelldY.LLP1_CaloCelldZ.LLP1_CaloCellE.LLP1_CaloCellEta.LLP1_CaloCellGain.LLP1_CaloCellID.LLP1_CaloCellPhi.LLP1_CaloCellProvenance.LLP1_CaloCellQuality.LLP1_CaloCellR.LLP1_CaloCellSampling.LLP1_CaloCellTime.LLP1_CaloCellX.LLP1_CaloCellY.LLP1_CaloCellZ.LLP1_CaloCellEneDiff.LLP1_CaloCellTimeDiff",
1144 "InDetTrackParticles.Reco_msosLink",
1145
1146 "InDetLargeD0TrackParticles.d0.z0.vz.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.hitPattern.patternRecoInfo",
1147 "GSFTrackParticles.d0.z0.vz.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.hitPattern.truthClassification.truthOrigin.truthType",
1148 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
1149 "EventInfo.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ",
1150 "EventInfo.hardScatterVertexLink.timeStampNSOffset",
1151 "EventInfo.DFCommonJets_eventClean_SuperLooseBadLLP.DFCommonJets_eventClean_SuperLooseBadLLP_EMTopo.DFCommonJets_eventClean_LooseBadLLP_EMTopo",
1152 "TauJets.dRmax.etOverPtLeadTrk.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z",
1153 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey",
1154 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey"]
1155 if flags.Tracking.doLargeD0:
1156 LLP1SlimmingHelper.ExtraVariables += [
1157 "LRTElectrons.LHValue.DFCommonElectronsLHVeryLooseNoPixResult.maxEcell_time.maxEcell_energy.maxEcell_gain.maxEcell_onlId.maxEcell_x.maxEcell_y.maxEcell_z.f3",
1158 "LRTegammaClusters.phi_sampl.eta0.phi0",
1159 "LRTGSFTrackParticles.d0.z0.vz.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.hitPattern.truthOrigin.truthType",
1160 "AntiKt4EMTopoJets.GhostTrackLRT.GhostTrackLRTCount",
1161 ]
1162
1163 # Isolation close by correction content for the LRT included corrections
1164 LLP1SlimmingHelper.ExtraVariables += ["Muons.topoetcone20_CloseByCorr_LRT.neflowisol20_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000_CloseByCorr_LRT",
1165 "Electrons.topoetcone20_CloseByCorr_LRT.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr_LRT",
1166 "Photons.topoetcone20_CloseByCorr_LRT.topoetcone40_CloseByCorr_LRT.ptcone20_CloseByCorr_LRT"]
1167 if flags.Tracking.doLargeD0:
1168 LLP1SlimmingHelper.ExtraVariables += [
1169 "MuonsLRT.topoetcone20_CloseByCorr_LRT.neflowisol20_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000_CloseByCorr_LRT",
1170 "LRTElectrons.topoetcone20_CloseByCorr_LRT.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr_LRT.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr_LRT",
1171 "TauJetsLRT.GNdTauScore.GNdTauProbTau.GNdTauProbJet"]
1172
1173 VSITrackAuxVars = [
1174 "is_selected", "is_associated", "is_svtrk_final", "pt_wrtSV", "eta_wrtSV",
1175 "phi_wrtSV", "d0_wrtSV", "z0_wrtSV", "errP_wrtSV", "errd0_wrtSV",
1176 "errz0_wrtSV", "chi2_toSV"
1177 ]
1178
1179 for suffix in LLP1VrtSecInclusiveSuffixes + LLP1NewVSISuffixes:
1180 LLP1SlimmingHelper.ExtraVariables += ["InDetTrackParticles." + '.'.join([var + suffix for var in VSITrackAuxVars])]
1181 LLP1SlimmingHelper.ExtraVariables += ["GSFTrackParticles." + '.'.join([var + suffix for var in VSITrackAuxVars])]
1182 if flags.Tracking.doLargeD0:
1183 LLP1SlimmingHelper.ExtraVariables += ["InDetLargeD0TrackParticles." + '.'.join([var + suffix for var in VSITrackAuxVars])]
1184 LLP1SlimmingHelper.ExtraVariables += ["LRTGSFTrackParticles." + '.'.join([var + suffix for var in VSITrackAuxVars])]
1185
1186 LLP1SlimmingHelper.ExtraVariables.append('CaloCalTopoClusters.e_sampl.calM.calE.calEta.calPhi.CENTER_MAG.SECOND_TIME.time.CENTER_LAMBDA.rawE.rawM.rawPhi.rawEta.clusterSize.eta0.phi0.altE.altEta.altPhi.altM.AVG_LAR_Q.AVG_TILE_Q.BADLARQ_FRAC.EM_PROBABILITY.ENG_BAD_CELLS.ENG_POS.ISOLATION.N_BAD_CELLS.SECOND_LAMBDA.SECOND_R')
1187 LLP1SlimmingHelper.AppendToDictionary["EMOriginTopoClusters"] = 'xAOD::CaloClusterContainer'
1188 LLP1SlimmingHelper.AppendToDictionary["EMOriginTopoClustersAux"] = 'xAOD::ShallowAuxContainer'
1189 LLP1SlimmingHelper.ExtraVariables.append('EMOriginTopoClusters.e_sampl.calM.calE.calEta.calPhi.CENTER_MAG.SECOND_TIME.time.CENTER_LAMBDA.rawE.rawM.rawPhi.rawEta.clusterSize.eta0.phi0.altE.altEta.altPhi.altM.AVG_LAR_Q.AVG_TILE_Q.BADLARQ_FRAC.EM_PROBABILITY.ENG_BAD_CELLS.ENG_POS.ISOLATION.N_BAD_CELLS.SECOND_LAMBDA.SECOND_R')
1190
1191 # Truth containers
1192 if flags.Input.isMC:
1193
1194 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
1195 addTruth3ContentToSlimmerTool(LLP1SlimmingHelper)
1196 LLP1SlimmingHelper.AllVariables += ['TruthHFWithDecayParticles', 'TruthHFWithDecayVertices', 'TruthCharm', 'TruthPileupParticles', 'InTimeAntiKt4TruthJets', 'OutOfTimeAntiKt4TruthJets', 'AntiKt4TruthJets']
1197 LLP1SlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
1198 "Muons.TruthLink",
1199 "Photons.TruthLink"]
1200 if flags.Tracking.doLargeD0:
1201 LLP1SlimmingHelper.ExtraVariables += ["LRTElectrons.TruthLink",
1202 "MuonsLRT.TruthLink"]
1203
1204 if flags.Derivation.LLP.saveFullTruth:
1205 LLP1SlimmingHelper.ExtraVariables += ['TruthParticles', 'TruthVertices',
1206 'AntiKt10TruthSoftDropBeta100Zcut10Jets.constituentLinks',
1207 'AntiKt4TruthDressedWZJets.constituentLinks']
1208 StaticContent += ["xAOD::JetContainer#AntiKt10TruthRCJets", "xAOD::JetAuxContainer#AntiKt10TruthRCJetsAux.-PseudoJet"]
1209
1210 # ZeroPixelHitMuons container
1211 StaticContent += ["xAOD::MuonContainer#ZeroPixelHitMuons", "xAOD::MuonAuxContainer#ZeroPixelHitMuonsAux."]
1212
1213 from DerivationFrameworkEGamma.PhotonsCPDetailedContent import (
1214 PhotonsCPDetailedContent,
1215 )
1216 LLP1SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent
1217
1218 from DerivationFrameworkJetEtMiss.JetCommonConfig import addOriginCorrectedClustersToSlimmingTool
1219 addOriginCorrectedClustersToSlimmingTool(LLP1SlimmingHelper, writeLC=True, writeEM=True)
1220 LLP1SlimmingHelper.StaticContent = StaticContent
1221
1222 # Trigger content
1223 LLP1SlimmingHelper.IncludeTriggerNavigation = False
1224 LLP1SlimmingHelper.IncludeJetTriggerContent = False
1225 LLP1SlimmingHelper.IncludeMuonTriggerContent = False
1226 LLP1SlimmingHelper.IncludeEGammaTriggerContent = False
1227 LLP1SlimmingHelper.IncludeTauTriggerContent = False
1228 LLP1SlimmingHelper.IncludeEtMissTriggerContent = False
1229 LLP1SlimmingHelper.IncludeBJetTriggerContent = False
1230 LLP1SlimmingHelper.IncludeBPhysTriggerContent = False
1231 LLP1SlimmingHelper.IncludeMinBiasTriggerContent = False
1232
1233 # Trigger matching
1234 # Run 2
1235 if flags.Trigger.EDMVersion == 2:
1236 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
1237 from DerivationFrameworkLLP.LLPToolsConfig import LLP1TriggerMatchingToolRun2Cfg
1238 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper=LLP1SlimmingHelper,
1239 OutputContainerPrefix="TrigMatch_",
1240 TriggerList=LLP1TriggerListsHelper.Run2TriggerNamesTau)
1241 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper=LLP1SlimmingHelper,
1242 OutputContainerPrefix="TrigMatch_",
1243 TriggerList=LLP1TriggerListsHelper.Run2TriggerNamesNoTau)
1244 # Schedule additional pre-matching against LLP offline muons and electrons
1245 acc.merge(LLP1TriggerMatchingToolRun2Cfg(flags,
1246 name="LRTTriggerMatchingTool_LLP1",
1247 OutputContainerPrefix="LRTTrigMatch_LLP1_",
1248 TriggerList=LLP1TriggerListsHelper.Run2TriggerNamesNoTau,
1249 InputElectrons=MergedElectronContainer,
1250 InputMuons=MergedMuonContainer_wZPH
1251 ))
1252 # And add the additional LLP trigger matching branches to the slimming helper
1253 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper=LLP1SlimmingHelper,
1254 OutputContainerPrefix="LRTTrigMatch_LLP1_",
1255 TriggerList=LLP1TriggerListsHelper.Run2TriggerNamesNoTau,
1256 InputElectrons=MergedElectronContainer,
1257 InputMuons=MergedMuonContainer_wZPH
1258 )
1259 # Run 3, or Run 2 with navigation conversion
1260 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
1261 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
1262 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(LLP1SlimmingHelper)
1263
1264 # Output stream
1265 LLP1ItemList = LLP1SlimmingHelper.GetItemList()
1266 acc.merge(OutputStreamCfg(flags, "DAOD_LLP1", ItemList=LLP1ItemList, AcceptAlgs=["LLP1Kernel"]))
1267 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_LLP1", AcceptAlgs=["LLP1Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
1268
1269 return acc
LLP1KernelCfg(flags, name='LLP1Kernel', **kwargs)
Definition LLP1.py:19
LLP1Cfg(flags)
Definition LLP1.py:962