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', containerName='AnalysisJets',
208 jetCollection=jetContainer)
209 subConfig.setOptionValue ('.runFJvtSelection', False)
210 subConfig.setOptionValue ('.runJvtSelection', False)
211 configSeq += subConfig
212 subConfig = factory.makeConfig ('Jets.Uncertainties')
213 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
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', containerName='AnalysisLargeRJets',
225 jetCollection=largeRjetContainer)
226 subConfig.setOptionValue ('.runGhostMuonAssociation', False)
227 # Disable kinematic selections on large-R jets
228 subConfig.setOptionValue ('.minPt', 0.)
229 subConfig.setOptionValue ('.maxPt', 0.)
230 subConfig.setOptionValue ('.maxRapidity', 0.)
231 subConfig.setOptionValue ('.minMass', 0.)
232 subConfig.setOptionValue ('.maxMass', 0.)
233 configSeq += subConfig
234 subConfig = factory.makeConfig ('Thinning')
235 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
236 subConfig.setOptionValue ('.deepCopy', True)
237 subConfig.setOptionValue ('.sortPt', True)
238 subConfig.setOptionValue ('.noUniformSelection', True)
239 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
240 configSeq += subConfig
241
242 from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
243 configAccumulator = ConfigAccumulator (dataType=None, algSeq=None,
244 autoconfigFromFlags=flags, noSysSuffix=True, noSystematics=True)
245 configSeq.fullConfigure (configAccumulator)
246 return configAccumulator.CA
247
248
249
250# Main algorithm config
251def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs):
252 """Configure the derivation framework driving algorithm (kernel) for PHYSLITE"""
253 acc = ComponentAccumulator()
254
255 # This block does the common physics augmentation which isn't needed (or possible) for PHYS->PHYSLITE
256 # Ensure block only runs for AOD input
257 if 'StreamAOD' in flags.Input.ProcessingTags:
258 # Common augmentations
259 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
260 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
261
262 # Thinning tools
263 # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
264 # This differs depending on whether the input is AOD or PHYS
265 # These are needed whatever the input since they are not applied in PHYS
266 thinningToolsArgs = {
267 'ElectronCaloClusterThinningToolName' : "PHYSLITEElectronCaloClusterThinningTool",
268 'PhotonCaloClusterThinningToolName' : "PHYSLITEPhotonCaloClusterThinningTool",
269 'ElectronGSFTPThinningToolName' : "PHYSLITEElectronGSFTPThinningTool",
270 'PhotonGSFTPThinningToolName' : "PHYSLITEPhotonGSFTPThinningTool"
271 }
272 # whereas these are only needed if the input is AOD since they are applied already in PHYS
273 if 'StreamAOD' in flags.Input.ProcessingTags:
274 thinningToolsArgs.update({
275 'TrackParticleThinningToolName' : "PHYSLITETrackParticleThinningTool",
276 'MuonTPThinningToolName' : "PHYSLITEMuonTPThinningTool",
277 'TauJetThinningToolName' : "PHYSLITETauJetThinningTool",
278 'TauJets_MuonRMThinningToolName' : "PHYSLITETauJets_MuonRMThinningTool",
279 'DiTauTPThinningToolName' : "PHYSLITEDiTauTPThinningTool",
280 'DiTauLowPtThinningToolName' : "PHYSLITEDiTauLowPtThinningTool",
281 'DiTauLowPtTPThinningToolName' : "PHYSLITEDiTauLowPtTPThinningTool",
282 })
283 # Configure the thinning tools
284 from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
285 acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
286 # Get them from the CA so they can be added to the kernel
287 thinningTools = []
288 for key in thinningToolsArgs:
289 thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
290
291
292 # Higgs augmentations - 4l vertex, Higgs STXS truth variables, CloseBy isolation correction (for all analyses)
293 # For PhysLite, must run CloseBy BEFORE running analysis sequences to be able to 'pass through' to the shallow copy the added isolation values
294 # Here we only run the augmentation algs
295 # These do not need to be run if PhysLite is run from Phys (i.e. not from 'StreamAOD')
296 if 'StreamAOD' in flags.Input.ProcessingTags:
297 # running from AOD
298
299 from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
300 acc.merge(HiggsAugmentationAlgsCfg(flags))
301
302
303 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
304 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = True))
305
306 #==============================================================================
307 # Analysis-level variables
308 #==============================================================================
309
310 # Needed in principle to support MET association when running PHYS->PHYSLITE,
311 # but since this doesn't work for PHYS->PHYSLITE anyway, commenting for now
312 #if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags
313 # from AtlasGeoModel.GeoModelConfig import GeoModelCfg
314 # acc.merge(GeoModelCfg(flags))
315
316 # add CP algorithms to job
317 acc.merge(CPAlgorithmsCfg(flags))
318
319 # Build MET from our analysis objects
320 if 'StreamAOD' in flags.Input.ProcessingTags:
321 from METReconstruction.METAssocCfg import AssocConfig, METAssocConfig
322 from METReconstruction.METAssociatorCfg import getAssocCA
323 associators = [AssocConfig('PFlowJet', 'AnalysisJets'),
324 AssocConfig('Muon', 'AnalysisMuons'),
325 AssocConfig('Ele', 'AnalysisElectrons'),
326 AssocConfig('Gamma', 'AnalysisPhotons'),
327 AssocConfig('Tau', 'AnalysisTauJets'),
328 AssocConfig('Soft', '')]
329 PHYSLITE_cfg = METAssocConfig('AnalysisMET',
330 flags,
331 associators,
332 doPFlow=True,
333 usePFOLinks=True)
334 components_PHYSLITE_cfg = getAssocCA(PHYSLITE_cfg,METName='AnalysisMET')
335 acc.merge(components_PHYSLITE_cfg)
336 elif 'StreamDAOD_PHYS' in flags.Input.ProcessingTags:
337 from DerivationFrameworkJetEtMiss.METCommonConfig import METRemappingCfg
338
339 METRemap_cfg = METRemappingCfg(flags)
340 acc.merge(METRemap_cfg)
341
342 # The derivation kernel itself
343 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
344 acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
345
346 return acc
347
348
349def PHYSLITECfg(flags):
350
351 acc = ComponentAccumulator()
352
353 # Get the lists of triggers needed for trigger matching.
354 # This is needed at this scope (for the slimming) and further down in the config chain
355 # for actually configuring the matching, so we create it here and pass it down
356 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
357 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
358 PHYSLITETriggerListsHelper = TriggerListsHelper(flags)
359
360 # Set the stream name - varies depending on whether the input is AOD or DAOD_PHYS
361 streamName = 'StreamDAOD_PHYSLITE' if 'StreamAOD' in flags.Input.ProcessingTags else 'StreamD2AOD_PHYSLITE'
362
363 # Common augmentations
364 acc.merge(PHYSLITEKernelCfg(flags, name="PHYSLITEKernel", StreamName = streamName, TriggerListsHelper = PHYSLITETriggerListsHelper))
365
366 # ============================
367 # Define contents of the format
368 # =============================
369 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
370 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
371 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
372
373 PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
374 PHYSLITESlimmingHelper.ExtraVariables = []
375 # Trigger content
376 PHYSLITESlimmingHelper.IncludeTriggerNavigation = False
377 PHYSLITESlimmingHelper.IncludeJetTriggerContent = False
378 PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False
379 PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False
380 PHYSLITESlimmingHelper.IncludeTauTriggerContent = False
381 PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False
382 PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False
383 PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False
384 PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False
385
386 # Trigger matching
387 # Run 2
388 if flags.Trigger.EDMVersion == 2:
389 # Need to re-run matching so that new Analysis<X> containers are matched to triggers
390 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
391 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
392 name = "PHYSLITETrigMatchNoTau",
393 OutputContainerPrefix = "AnalysisTrigMatch_",
394 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau,
395 InputElectrons = "AnalysisElectrons",
396 InputPhotons = "AnalysisPhotons",
397 InputMuons = "AnalysisMuons",
398 InputTaus = "AnalysisTauJets"))
399 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
400 name = "PHYSLITETrigMatchTau",
401 OutputContainerPrefix = "AnalysisTrigMatch_",
402 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesTau,
403 DRThreshold = 0.2,
404 InputElectrons = "AnalysisElectrons",
405 InputPhotons = "AnalysisPhotons",
406 InputMuons = "AnalysisMuons",
407 InputTaus = "AnalysisTauJets"))
408 # Now add the resulting decorations to the output
409 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
410 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
411 OutputContainerPrefix = "AnalysisTrigMatch_",
412 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesTau)
413 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
414 OutputContainerPrefix = "AnalysisTrigMatch_",
415 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
416
417 # Run 3, or Run 2 with navigation conversion
418 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
419 # No need to run matching: just keep navigation so matching can be done by analysts
420 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
421 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper)
422
423 # Event content
424 PHYSLITESlimmingHelper.AppendToDictionary.update({
425 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
426 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
427 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
428 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
429 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
430 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
431 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
432 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
433 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
434 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
435 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
436 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
437 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
438 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
439 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
440 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
441 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer',
442 'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer',
443 'AnalysisSiHitElectrons':'xAOD::ElectronContainer', 'AnalysisSiHitElectronsAux':'xAOD::ElectronAuxContainer',
444 'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer',
445 'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase',
446 'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer',
447 'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer',
448 'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer',
449 'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap',
450 'AnalysisLargeRJets':'xAOD::JetContainer','AnalysisLargeRJetsAux':'xAOD::AuxContainerBase'
451 })
452
453 PHYSLITESlimmingHelper.SmartCollections = [
454 'EventInfo',
455 'InDetTrackParticles',
456 'PrimaryVertices',
457 ]
458
459 from DerivationFrameworkMuons.MuonsCommonConfig import MuonVariablesCfg
460
461 # add in extra values for Higgs
462 from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
463 setupHiggsSlimmingVariables(flags, PHYSLITESlimmingHelper)
464
465 if flags.Input.isMC:
466 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
467 addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper)
468 # This block is only needed if input is AOD, as it is already done for PHYS->PHYSLITE
469 if 'StreamAOD' in flags.Input.ProcessingTags:
470 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
471 acc.merge(HFClassificationCommonCfg(flags))
472
473 # Save the extra variables which aren't included by other means
474 btag_variables = [f'GN2v01_p{x}' for x in ['b', 'c', 'u', 'tau']]
475 PHYSLITESlimmingHelper.ExtraVariables += [
476 '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',
477 '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',
478 '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',
479 'GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.z0.vz.charge.vertexLink.numberOfPixelHits.numberOfSCTHits.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.originalTrackParticle',
480 'GSFConversionVertices.trackParticleLinks.x.y.z.px.py.pz.pt1.pt2.neutralParticleLinks.minRfirstHit',
481 'egammaClusters.calE.calEta.calPhi.calM.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks.samplingPattern',
482 "AnalysisMuons.{var_string}".format(var_string = ".".join(MuonVariablesCfg(flags))),
483 'CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF',
484 'ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi',
485 'MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP',
486 'InDetForwardTrackParticles.vz.truthType.truthOrigin.numberDoF.numberOfTRTHits.numberOfSCTHoles.theta.numberOfTRTOutliers.numberOfPrecisionLayers.numberOfSCTDeadSensors.numberOfPixelHoles.numberOfSCTHits.numberOfPrecisionHoleLayers.numberOfPixelDeadSensors.phi.numberOfPixelHits.z0.d0.qOverP.chiSquared.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag',
487 'AnalysisTauJets.pt.eta.phi.m.ptFinalCalib.etaFinalCalib.ptTauEnergyScale.etaTauEnergyScale.charge.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',
488 'AnalysisJets.pt.eta.phi.m.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.JVFCorr.NNJvtPass.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.PartonTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PSFrac.JetAccessorMap.EMFrac.Width.ActiveArea4vec_pt.ActiveArea4vec_eta.ActiveArea4vec_m.ActiveArea4vec_phi.EnergyPerSampling.SumPtChargedPFOPt500.isJvtHS.{btag_var_string}'.format(btag_var_string = ".".join(btag_variables)),
489 'TruthPrimaryVertices.t.x.y.z',
490 'MET_Core_AnalysisMET.name.mpx.mpy.sumet.source',
491 'METAssoc_AnalysisMET.',
492 'InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.numberOfTRTHits.numberOfTRTOutliers',
493 '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())),
494 'Kt4EMPFlowEventShape.Density',
495 'Kt4EMPFlowNeutEventShape.Density',
496 'TauTracks.flagSet.trackLinks',
497 'AnalysisLargeRJets.pt.eta.phi.m.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.DetectorEta.TrackSumMass.TrackSumPt.constituentLinks.ECF1.ECF2.ECF3.Tau1_wta.Tau2_wta.Tau3_wta.Split12.Split23.Qw.D2.C2.R10TruthLabel_R22v1.R10TruthLabel_R21Precision_2022v1.R10TruthLabel_R21Precision.GhostBHadronsFinalCount.GhostCHadronsFinalCount.Parent.GN2Xv01_phbb.GN2Xv01_phcc.GN2Xv01_ptop.GN2Xv01_pqcd',
498 ]
499
500 # Output stream
501 PHYSLITEItemList = PHYSLITESlimmingHelper.GetItemList()
502
503 formatString = 'D2AOD_PHYSLITE' if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags else 'DAOD_PHYSLITE'
504 acc.merge(OutputStreamCfg(flags, formatString, ItemList=PHYSLITEItemList, AcceptAlgs=["PHYSLITEKernel"]))
505 acc.merge(SetupMetaDataForStreamCfg(flags, formatString, AcceptAlgs=["PHYSLITEKernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
506
507 return acc
508
PHYSLITECfg(flags)
Definition PHYSLITE.py:349
PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs)
Definition PHYSLITE.py:251
CPAlgorithmsCfg(flags)
Definition PHYSLITE.py:17