ATLAS Offline Software
Loading...
Searching...
No Matches
PHYSLITE.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2#====================================================================
3# DAOD_PHYSLITE.py
4# This defines DAOD_PHYSLITE, an unskimmed 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 PHYSLITE in Derivation_tf.py
8#====================================================================
9
10from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaConfiguration.Enums import MetadataCategory
13from GoodRunsLists.GoodRunsListsDictionary import getGoodRunsLists
14
15
16
17def CPAlgorithmsCfg(flags):
18 """do the CP algorithm configuration for PHYSLITE"""
19
20 from AthenaCommon.Logging import logging
21 logPLCPAlgCfg = logging.getLogger('PLCPAlgCfg')
22 logPLCPAlgCfg.info('****************** STARTING PHYSLITE CPAlgorithmsCfg *****************')
23
24 forceEGammaFullSimConfig = False
25 if not flags.Sim.ISF.Simulator.isFullSim():
26 logPLCPAlgCfg.warning("Forcing full simulation configuration for EGamma algorithms. This is not recommended for fast simulation but no recommendations available yet.")
27 forceEGammaFullSimConfig = True
28
29 from AnalysisAlgorithmsConfig.ConfigFactory import ConfigFactory
30 from AnalysisAlgorithmsConfig.ConfigSequence import ConfigSequence
31 configSeq = ConfigSequence ()
32
33 # create factory object to build block configurations
34 factory = ConfigFactory()
35
36 # Set up the systematics loader/handler algorithm:
37 subConfig = factory.makeConfig ('CommonServices')
38 subConfig.setOptionValue ('.runSystematics', False)
39 subConfig.setOptionValue ('.fixDAODTruthRecord', False)
40 configSeq += subConfig
41
42 # Disable expert-mode warnings
43 import warnings
44 from AnalysisAlgorithmsConfig.ConfigAccumulator import ExpertModeWarning
45 warnings.simplefilter('ignore', ExpertModeWarning)
46
47 # Create a pile-up analysis config
48 if flags.Input.isMC:
49 # setup config and lumicalc files for pile-up tool
50 configSeq += factory.makeConfig ('PileupReweighting')
51
52 # Set up the GRL decoration analysis config
53 configSeq += factory.makeConfig ('EventCleaning')
54 configSeq.setOptionValue ('.noFilter', True)
55 configSeq.setOptionValue ('.GRLDict', getGoodRunsLists())
56
57 # set up the muon analysis algorithm config (must come before electrons and photons to allow FSR collection):
58
59 logPLCPAlgCfg.info('Do Muons')
60
61 subConfig = factory.makeConfig ('Muons')
62 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
63 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
64 configSeq += subConfig
65 subConfig = factory.makeConfig ('Muons.WorkingPoint')
66 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
67 subConfig.setOptionValue ('.selectionName', 'loose')
68 subConfig.setOptionValue ('.trackSelection', False)
69 subConfig.setOptionValue ('.quality', 'Loose')
70 subConfig.setOptionValue ('.isolation', 'NonIso')
71 configSeq += subConfig
72 subConfig = factory.makeConfig ('Thinning')
73 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
74 subConfig.setOptionValue ('.selectionName', 'loose')
75 subConfig.setOptionValue ('.deepCopy', True)
76 subConfig.setOptionValue ('.sortPt', True)
77 subConfig.setOptionValue ('.noUniformSelection', True)
78 subConfig.setOptionValue ('.containerType', 'xAOD::MuonContainer')
79 configSeq += subConfig
80
81 # set up the electron analysis config (For SiHits electrons, use: LooseLHElectronSiHits.NonIso):
82
83 logPLCPAlgCfg.info('Do Electrons')
84
85 subConfig = factory.makeConfig ('Electrons')
86 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
87 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
88 subConfig.setOptionValue ('.isolationCorrection', True)
89 subConfig.setOptionValue ('.minPt', 0.)
90 subConfig.setOptionValue ('.decorateSamplingPattern', True)
91 subConfig.setOptionValue ('.decorateEmva', True)
92 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
93 configSeq += subConfig
94 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
95 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
96 subConfig.setOptionValue ('.selectionName', 'looseLH')
97 subConfig.setOptionValue ('.trackSelection', False)
98 subConfig.setOptionValue ('.identificationWP', 'LooseLH')
99 subConfig.setOptionValue ('.addSelectionToPreselection', False)
100 subConfig.setOptionValue ('.isolationWP', 'NonIso')
101 subConfig.setOptionValue ('.doFSRSelection', True)
102 subConfig.setOptionValue ('.noEffSF', True)
103 configSeq += subConfig
104 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
105 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
106 subConfig.setOptionValue ('.selectionName', 'looseDNN')
107 subConfig.setOptionValue ('.trackSelection', False)
108 subConfig.setOptionValue ('.identificationWP', 'LooseDNN')
109 subConfig.setOptionValue ('.addSelectionToPreselection', False)
110 subConfig.setOptionValue ('.isolationWP', 'NonIso')
111 subConfig.setOptionValue ('.doFSRSelection', True)
112 subConfig.setOptionValue ('.noEffSF', True)
113 configSeq += subConfig
114 subConfig = factory.makeConfig ('Thinning')
115 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
116 subConfig.setOptionValue ('.selectionName', 'looseLH||looseDNN')
117 subConfig.setOptionValue ('.deepCopy', True)
118 subConfig.setOptionValue ('.sortPt', True)
119 subConfig.setOptionValue ('.noUniformSelection', True)
120 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
121 configSeq += subConfig
122
123 # So SiHit electrons - should come after the standard selection in order to avoid keeping the same electrons twice
124 subConfig = factory.makeConfig ('Electrons')
125 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
126 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
127 subConfig.setOptionValue ('.isolationCorrection', True)
128 subConfig.setOptionValue ('.minPt', 0.)
129 subConfig.setOptionValue ('.postfix', 'SiHit')
130 subConfig.setOptionValue ('.decorateEmva', True)
131 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
132 configSeq += subConfig
133 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
134 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
135 subConfig.setOptionValue ('.selectionName', 'SiHits')
136 subConfig.setOptionValue ('.trackSelection', False)
137 subConfig.setOptionValue ('.identificationWP', 'SiHitElectron')
138 subConfig.setOptionValue ('.isolationWP', 'NonIso')
139 subConfig.setOptionValue ('.doFSRSelection', True) # needed to veto FSR electrons
140 subConfig.setOptionValue ('.noEffSF', True)
141 subConfig.setOptionValue ('.postfix', 'SiHit')
142 configSeq += subConfig
143 subConfig = factory.makeConfig ('Thinning')
144 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
145 subConfig.setOptionValue ('.selectionName', 'SiHits')
146 subConfig.setOptionValue ('.deepCopy', True)
147 subConfig.setOptionValue ('.sortPt', True)
148 subConfig.setOptionValue ('.noUniformSelection', True)
149 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
150 configSeq += subConfig
151
152 # set up the photon analysis config:
153
154 logPLCPAlgCfg.info('Do Photons')
155
156 subConfig = factory.makeConfig ('Photons')
157 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
158 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
159 subConfig.setOptionValue ('.recomputeIsEM', False)
160 subConfig.setOptionValue ('.minPt', 0.)
161 subConfig.setOptionValue ('.decorateEmva', True)
162 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
163 configSeq += subConfig
164 subConfig = factory.makeConfig ('Photons.WorkingPoint')
165 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
166 subConfig.setOptionValue ('.selectionName', 'loose')
167 subConfig.setOptionValue ('.qualityWP', 'Loose')
168 subConfig.setOptionValue ('.isolationWP', 'NonIso')
169 subConfig.setOptionValue ('.doFSRSelection', True)
170 subConfig.setOptionValue ('.recomputeIsEM', False)
171 subConfig.setOptionValue ('.noEffSFForID', True)
172 subConfig.setOptionValue ('.noEffSFForIso', True)
173 configSeq += subConfig
174 subConfig = factory.makeConfig ('Thinning')
175 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
176 subConfig.setOptionValue ('.selectionName', 'loose')
177 subConfig.setOptionValue ('.deepCopy', True)
178 subConfig.setOptionValue ('.sortPt', True)
179 subConfig.setOptionValue ('.noUniformSelection', True)
180 subConfig.setOptionValue ('.containerType', 'xAOD::PhotonContainer')
181 configSeq += subConfig
182
183
184
185 # set up the tau analysis algorithm config:
186 # Commented for now due to use of public tools
187 subConfig = factory.makeConfig ('TauJets')
188 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
189 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
190 configSeq += subConfig
191 subConfig = factory.makeConfig ('TauJets.WorkingPoint')
192 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
193 subConfig.setOptionValue ('.selectionName', 'baseline')
194 subConfig.setOptionValue ('.quality', 'Baseline')
195 configSeq += subConfig
196 subConfig = factory.makeConfig ('Thinning')
197 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
198 subConfig.setOptionValue ('.selectionName', 'baseline')
199 subConfig.setOptionValue ('.deepCopy', True)
200 subConfig.setOptionValue ('.sortPt', True)
201 subConfig.setOptionValue ('.noUniformSelection', True)
202 subConfig.setOptionValue ('.containerType', 'xAOD::TauJetContainer')
203 configSeq += subConfig
204
205 # set up the jet analysis algorithm config:
206 jetContainer = 'AntiKt4EMPFlowJets'
207 subConfig = factory.makeConfig ('Jets')
208 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
209 subConfig.setOptionValue ('.jetCollection', jetContainer)
210 subConfig.setOptionValue ('.runFJvtSelection', False)
211 subConfig.setOptionValue ('.runJvtSelection', False)
212 subConfig.setOptionValue ('.runUncertainties', False)
213 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
214 configSeq += subConfig
215 subConfig = factory.makeConfig ('Thinning')
216 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
217 subConfig.setOptionValue ('.deepCopy', True)
218 subConfig.setOptionValue ('.sortPt', True)
219 subConfig.setOptionValue ('.noUniformSelection', True)
220 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
221 configSeq += subConfig
222
223 largeRjetContainer='AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets'
224 subConfig = factory.makeConfig ('Jets')
225 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
226 subConfig.setOptionValue ('.jetCollection', largeRjetContainer)
227 subConfig.setOptionValue ('.runGhostMuonAssociation', False)
228 # Disable kinematic selections on large-R jets
229 subConfig.setOptionValue ('.minPt', 0.)
230 subConfig.setOptionValue ('.maxPt', 0.)
231 subConfig.setOptionValue ('.maxRapidity', 0.)
232 subConfig.setOptionValue ('.minMass', 0.)
233 subConfig.setOptionValue ('.maxMass', 0.)
234 subConfig.setOptionValue ('.runUncertainties', False)
235 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
236 configSeq += subConfig
237 subConfig = factory.makeConfig ('Thinning')
238 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
239 subConfig.setOptionValue ('.deepCopy', True)
240 subConfig.setOptionValue ('.sortPt', True)
241 subConfig.setOptionValue ('.noUniformSelection', True)
242 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
243 configSeq += subConfig
244
245 from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
246 configAccumulator = ConfigAccumulator (dataType=None, algSeq=None,
247 autoconfigFromFlags=flags, noSysSuffix=True, noSystematics=True)
248 configSeq.fullConfigure (configAccumulator)
249 return configAccumulator.CA
250
251
252
253# Main algorithm config
254def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs):
255 """Configure the derivation framework driving algorithm (kernel) for PHYSLITE"""
256 acc = ComponentAccumulator()
257
258 # This block does the common physics augmentation which isn't needed (or possible) for PHYS->PHYSLITE
259 # Ensure block only runs for AOD input
260 if 'StreamAOD' in flags.Input.ProcessingTags:
261 # Common augmentations
262 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
263 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
264
265 # Thinning tools
266 # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
267 # This differs depending on whether the input is AOD or PHYS
268 # These are needed whatever the input since they are not applied in PHYS
269 thinningToolsArgs = {
270 'ElectronCaloClusterThinningToolName' : "PHYSLITEElectronCaloClusterThinningTool",
271 'PhotonCaloClusterThinningToolName' : "PHYSLITEPhotonCaloClusterThinningTool",
272 'ElectronGSFTPThinningToolName' : "PHYSLITEElectronGSFTPThinningTool",
273 'PhotonGSFTPThinningToolName' : "PHYSLITEPhotonGSFTPThinningTool"
274 }
275 # whereas these are only needed if the input is AOD since they are applied already in PHYS
276 if 'StreamAOD' in flags.Input.ProcessingTags:
277 thinningToolsArgs.update({
278 'TrackParticleThinningToolName' : "PHYSLITETrackParticleThinningTool",
279 'MuonTPThinningToolName' : "PHYSLITEMuonTPThinningTool",
280 'TauJetThinningToolName' : "PHYSLITETauJetThinningTool",
281 'TauJets_MuonRMThinningToolName' : "PHYSLITETauJets_MuonRMThinningTool",
282 'DiTauTPThinningToolName' : "PHYSLITEDiTauTPThinningTool",
283 'DiTauLowPtThinningToolName' : "PHYSLITEDiTauLowPtThinningTool",
284 'DiTauLowPtTPThinningToolName' : "PHYSLITEDiTauLowPtTPThinningTool",
285 })
286 # Configure the thinning tools
287 from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
288 acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
289 # Get them from the CA so they can be added to the kernel
290 thinningTools = []
291 for key in thinningToolsArgs:
292 thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
293
294
295 # Higgs augmentations - 4l vertex, Higgs STXS truth variables, CloseBy isolation correction (for all analyses)
296 # For PhysLite, must run CloseBy BEFORE running analysis sequences to be able to 'pass through' to the shallow copy the added isolation values
297 # Here we only run the augmentation algs
298 # These do not need to be run if PhysLite is run from Phys (i.e. not from 'StreamAOD')
299 if 'StreamAOD' in flags.Input.ProcessingTags:
300 # running from AOD
301
302 from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
303 acc.merge(HiggsAugmentationAlgsCfg(flags))
304
305
306 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
307 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = True))
308
309 #==============================================================================
310 # Analysis-level variables
311 #==============================================================================
312
313 # Needed in principle to support MET association when running PHYS->PHYSLITE,
314 # but since this doesn't work for PHYS->PHYSLITE anyway, commenting for now
315 #if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags
316 # from AtlasGeoModel.GeoModelConfig import GeoModelCfg
317 # acc.merge(GeoModelCfg(flags))
318
319 # add CP algorithms to job
320 acc.merge(CPAlgorithmsCfg(flags))
321
322 # Build MET from our analysis objects
323 if 'StreamAOD' in flags.Input.ProcessingTags:
324 from METReconstruction.METAssocCfg import AssocConfig, METAssocConfig
325 from METReconstruction.METAssociatorCfg import getAssocCA
326 associators = [AssocConfig('PFlowJet', 'AnalysisJets'),
327 AssocConfig('Muon', 'AnalysisMuons'),
328 AssocConfig('Ele', 'AnalysisElectrons'),
329 AssocConfig('Gamma', 'AnalysisPhotons'),
330 AssocConfig('Tau', 'AnalysisTauJets'),
331 AssocConfig('Soft', '')]
332 PHYSLITE_cfg = METAssocConfig('AnalysisMET',
333 flags,
334 associators,
335 doPFlow=True,
336 usePFOLinks=True)
337 components_PHYSLITE_cfg = getAssocCA(PHYSLITE_cfg,METName='AnalysisMET')
338 acc.merge(components_PHYSLITE_cfg)
339 elif 'StreamDAOD_PHYS' in flags.Input.ProcessingTags:
340 from DerivationFrameworkJetEtMiss.METCommonConfig import METRemappingCfg
341
342 METRemap_cfg = METRemappingCfg(flags)
343 acc.merge(METRemap_cfg)
344
345 # The derivation kernel itself
346 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
347 acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
348
349 return acc
350
351
352def PHYSLITECfg(flags):
353
354 acc = ComponentAccumulator()
355
356 # Get the lists of triggers needed for trigger matching.
357 # This is needed at this scope (for the slimming) and further down in the config chain
358 # for actually configuring the matching, so we create it here and pass it down
359 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
360 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
361 PHYSLITETriggerListsHelper = TriggerListsHelper(flags)
362
363 # Set the stream name - varies depending on whether the input is AOD or DAOD_PHYS
364 streamName = 'StreamDAOD_PHYSLITE' if 'StreamAOD' in flags.Input.ProcessingTags else 'StreamD2AOD_PHYSLITE'
365
366 # Common augmentations
367 acc.merge(PHYSLITEKernelCfg(flags, name="PHYSLITEKernel", StreamName = streamName, TriggerListsHelper = PHYSLITETriggerListsHelper))
368
369 # ============================
370 # Define contents of the format
371 # =============================
372 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
373 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
374 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
375
376 PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
377 PHYSLITESlimmingHelper.ExtraVariables = []
378 # Trigger content
379 PHYSLITESlimmingHelper.IncludeTriggerNavigation = False
380 PHYSLITESlimmingHelper.IncludeJetTriggerContent = False
381 PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False
382 PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False
383 PHYSLITESlimmingHelper.IncludeTauTriggerContent = False
384 PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False
385 PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False
386 PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False
387 PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False
388
389 # Trigger matching
390 # Run 2
391 if flags.Trigger.EDMVersion == 2:
392 # Need to re-run matching so that new Analysis<X> containers are matched to triggers
393 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
394 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
395 name = "PHYSLITETrigMatchNoTau",
396 OutputContainerPrefix = "AnalysisTrigMatch_",
397 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau,
398 InputElectrons = "AnalysisElectrons",
399 InputPhotons = "AnalysisPhotons",
400 InputMuons = "AnalysisMuons",
401 InputTaus = "AnalysisTauJets"))
402 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
403 name = "PHYSLITETrigMatchTau",
404 OutputContainerPrefix = "AnalysisTrigMatch_",
405 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesTau,
406 DRThreshold = 0.2,
407 InputElectrons = "AnalysisElectrons",
408 InputPhotons = "AnalysisPhotons",
409 InputMuons = "AnalysisMuons",
410 InputTaus = "AnalysisTauJets"))
411 # Now add the resulting decorations to the output
412 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
413 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
414 OutputContainerPrefix = "AnalysisTrigMatch_",
415 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesTau)
416 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
417 OutputContainerPrefix = "AnalysisTrigMatch_",
418 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
419
420 # Run 3, or Run 2 with navigation conversion
421 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
422 # No need to run matching: just keep navigation so matching can be done by analysts
423 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
424 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper)
425
426 # Event content
427 PHYSLITESlimmingHelper.AppendToDictionary.update({
428 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
429 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
430 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
431 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
432 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
433 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
434 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
435 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
436 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
437 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
438 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
439 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
440 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
441 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
442 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
443 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
444 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer',
445 'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer',
446 'AnalysisSiHitElectrons':'xAOD::ElectronContainer', 'AnalysisSiHitElectronsAux':'xAOD::ElectronAuxContainer',
447 'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer',
448 'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase',
449 'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer',
450 'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer',
451 'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer',
452 'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap',
453 'AnalysisLargeRJets':'xAOD::JetContainer','AnalysisLargeRJetsAux':'xAOD::AuxContainerBase'
454 })
455
456 PHYSLITESlimmingHelper.SmartCollections = [
457 'EventInfo',
458 'InDetTrackParticles',
459 'PrimaryVertices',
460 ]
461
462 from DerivationFrameworkMuons.MuonsCommonConfig import MuonVariablesCfg
463
464 # add in extra values for Higgs
465 from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
466 setupHiggsSlimmingVariables(flags, PHYSLITESlimmingHelper)
467
468 if flags.Input.isMC:
469 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
470 addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper, reduced=True)
471 # This block is only needed if input is AOD, as it is already done for PHYS->PHYSLITE
472 if 'StreamAOD' in flags.Input.ProcessingTags:
473 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
474 acc.merge(HFClassificationCommonCfg(flags))
475
476 # Save the extra variables which aren't included by other means
477 btag_variables = [f'{flags.BTagging.AK4TaggerName}_p{x}' for x in ['b', 'c', 'u', 'tau']]
478 PHYSLITESlimmingHelper.ExtraVariables += [
479 'AnalysisElectrons.trackParticleLinks.f1.pt.eta.phi.charge.author.DFCommonElectronsLHVeryLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHLooseBL.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsLHVeryLooseIsEMValue.DFCommonElectronsLHLooseIsEMValue.DFCommonElectronsLHLooseBLIsEMValue.DFCommonElectronsLHMediumIsEMValue.DFCommonElectronsLHTightIsEMValue.DFCommonElectronsDNNLoose.DFCommonElectronsDNNMedium.DFCommonElectronsDNNTight.DFCommonElectronsDNNVeryLooseNoCF97.DFCommonElectronsDNNMediumNoCF.DFCommonElectronsDNNTightNoCF.DFCommonElectronsECIDS.DFCommonElectronsECIDSResult.topoetcone20.topoetcone20ptCorrection.neflowisol20.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.topoetcone20_CloseByCorr.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.caloClusterLinks.ambiguityLink.TruthLink.truthOrigin.truthType.truthPdgId.firstEgMotherTruthType.firstEgMotherTruthOrigin.firstEgMotherTruthParticleLink.firstEgMotherPdgId.ambiguityType.OQ.Eadded_Lr2.Eadded_Lr3.E_mva_only.DFCommonAddAmbiguity',
480 'AnalysisSiHitElectrons.pt.eta.phi.charge.author.topoetcone20_CloseByCorr.DFCommonElectronsLHVeryLoose.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.OQ.truthOrigin.truthType.firstEgMotherTruthType.firstEgMotherTruthOrigin.z0stheta.d0Normalized.nInnerExpPix.clEta.clPhi.E_mva_only',
481 'AnalysisPhotons.f1.pt.eta.phi.author.OQ.DFCommonPhotonsIsEMLoose.DFCommonPhotonsIsEMMedium.DFCommonPhotonsIsEMTight.DFCommonPhotonsIsEMTightIsEMValue.DFCommonPhotonsCleaning.DFCommonPhotonsCleaningNoTime.ptcone20.topoetcone20.topoetcone40.topoetcone20ptCorrection.topoetcone40ptCorrection.topoetcone20_CloseByCorr.topoetcone40_CloseByCorr.ptcone20_CloseByCorr.caloClusterLinks.vertexLinks.ambiguityLink.TruthLink.truthOrigin.truthType.Eadded_Lr2.Eadded_Lr3.E_mva_only.DFCommonPhotonsIsEMTightNF.DFCommonPhotonsIsEMTightNFIsEMValue.DFCommonPhotonsNFBDTTight.DFCommonPhotonsNFBDTTightIsEMValue.DFCommonPhotonsNFBDTScore',
482 'GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.z0.vz.charge.vertexLink.numberOfPixelHits.numberOfSCTHits.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.originalTrackParticle',
483 'GSFConversionVertices.trackParticleLinks.x.y.z.px.py.pz.pt1.pt2.neutralParticleLinks.minRfirstHit',
484 'egammaClusters.calE.calEta.calPhi.calM.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks.samplingPattern',
485 "AnalysisMuons.{var_string}".format(var_string = ".".join(MuonVariablesCfg(flags))),
486 'CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF',
487 'ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi',
488 'MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP',
489 'InDetForwardTrackParticles.vz.truthType.truthOrigin.numberDoF.numberOfTRTHits.numberOfSCTHoles.theta.numberOfTRTOutliers.numberOfPrecisionLayers.numberOfSCTDeadSensors.numberOfPixelHoles.numberOfSCTHits.numberOfPrecisionHoleLayers.numberOfPixelDeadSensors.phi.numberOfPixelHits.z0.d0.qOverP.chiSquared.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag',
490 'AnalysisTauJets.pt.eta.phi.m.ptFinalCalib.etaFinalCalib.ptTauEnergyScale.etaTauEnergyScale.charge.nChargedTracks.isTauFlags.PanTau_DecayMode.NNDecayMode.RNNJetScoreSigTrans.GNTauScoreSigTrans_v0prune.GNTauVL_v0prune.GNTauL_v0prune.GNTauM_v0prune.GNTauT_v0prune.RNNEleScoreSigTrans_v1.EleRNNLoose_v1.EleRNNMedium_v1.EleRNNTight_v1.trackWidth.passTATTauMuonOLR.tauTrackLinks.vertexLink.truthParticleLink.truthJetLink.IsTruthMatched.truthOrigin.truthType.TESCompatibility',
491 'AnalysisJets.pt.eta.phi.m.numConstit.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.DetectorY.JVFCorr.NNJvtPass.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.PartonTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.PSFrac.JetAccessorMap.EMFrac.Width.ActiveArea4vec_pt.ActiveArea4vec_eta.ActiveArea4vec_m.ActiveArea4vec_phi.EnergyPerSampling.SumPtChargedPFOPt500.isJvtHS.QGTransformer_ConstScore.{btag_var_string}'.format(btag_var_string = ".".join(btag_variables)),
492 'TruthPrimaryVertices.t.x.y.z',
493 'MET_Core_AnalysisMET.name.mpx.mpy.sumet.source',
494 'METAssoc_AnalysisMET.',
495 'InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.numberOfTRTHits.numberOfTRTOutliers',
496 'EventInfo.RandomRunNumber.PileupWeight_NOSYS.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification.{GRL_Deco_names}'.format(GRL_Deco_names='.'.join(str(key) for key in (getGoodRunsLists()).keys())),
497 'Kt4EMPFlowEventShape.Density',
498 'Kt4EMPFlowNeutEventShape.Density',
499 'TauTracks.flagSet.trackLinks',
500 'AnalysisLargeRJets.pt.eta.phi.m.numConstit.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.DetectorEta.DetectorY.ECF1.ECF2.ECF3.Tau1_wta.Tau2_wta.Tau3_wta.Split12.Split23.Qw.D2.C2.R10TruthLabel_R22v1.R10TruthLabel_R21Precision_2022v1.GhostBHadronsFinalCount.GhostCHadronsFinalCount.GN2Xv01_phbb.GN2Xv01_phcc.GN2Xv01_ptop.GN2Xv01_pqcd',
501 ]
502
503 # Output stream
504 PHYSLITEItemList = PHYSLITESlimmingHelper.GetItemList()
505
506 formatString = 'D2AOD_PHYSLITE' if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags else 'DAOD_PHYSLITE'
507 acc.merge(OutputStreamCfg(flags, formatString, ItemList=PHYSLITEItemList, AcceptAlgs=["PHYSLITEKernel"]))
508 acc.merge(SetupMetaDataForStreamCfg(flags, formatString, AcceptAlgs=["PHYSLITEKernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
509
510 return acc
511
PHYSLITECfg(flags)
Definition PHYSLITE.py:352
PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs)
Definition PHYSLITE.py:254
CPAlgorithmsCfg(flags)
Definition PHYSLITE.py:17