ATLAS Offline Software
PHYSLITE.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 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 
10 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 from AthenaConfiguration.Enums import MetadataCategory
13 from GoodRunsLists.GoodRunsListsDictionary import getGoodRunsLists
14 
15 
16 
17 def 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  configSeq += subConfig
64  subConfig = factory.makeConfig ('Muons.WorkingPoint')
65  subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
66  subConfig.setOptionValue ('.selectionName', 'loose')
67  subConfig.setOptionValue ('.trackSelection', False)
68  subConfig.setOptionValue ('.quality', 'Loose')
69  subConfig.setOptionValue ('.isolation', 'NonIso')
70  configSeq += subConfig
71  subConfig = factory.makeConfig ('Thinning')
72  subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
73  subConfig.setOptionValue ('.selectionName', 'loose')
74  subConfig.setOptionValue ('.deepCopy', True)
75  subConfig.setOptionValue ('.sortPt', True)
76  subConfig.setOptionValue ('.noUniformSelection', True)
77  configSeq += subConfig
78 
79  # set up the electron analysis config (For SiHits electrons, use: LooseLHElectronSiHits.NonIso):
80 
81  logPLCPAlgCfg.info('Do Electrons')
82 
83  subConfig = factory.makeConfig ('Electrons')
84  subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
85  subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
86  subConfig.setOptionValue ('.isolationCorrection', True)
87  subConfig.setOptionValue ('.minPt', 0.)
88  subConfig.setOptionValue ('.decorateSamplingPattern', True)
89  subConfig.setOptionValue ('.decorateEmva', True)
90  configSeq += subConfig
91  subConfig = factory.makeConfig ('Electrons.WorkingPoint')
92  subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
93  subConfig.setOptionValue ('.selectionName', 'looseLH')
94  subConfig.setOptionValue ('.trackSelection', False)
95  subConfig.setOptionValue ('.identificationWP', 'LooseLH')
96  subConfig.setOptionValue ('.addSelectionToPreselection', False)
97  subConfig.setOptionValue ('.isolationWP', 'NonIso')
98  subConfig.setOptionValue ('.doFSRSelection', True)
99  subConfig.setOptionValue ('.noEffSF', True)
100  configSeq += subConfig
101  subConfig = factory.makeConfig ('Electrons.WorkingPoint')
102  subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
103  subConfig.setOptionValue ('.selectionName', 'looseDNN')
104  subConfig.setOptionValue ('.trackSelection', False)
105  subConfig.setOptionValue ('.identificationWP', 'LooseDNN')
106  subConfig.setOptionValue ('.addSelectionToPreselection', False)
107  subConfig.setOptionValue ('.isolationWP', 'NonIso')
108  subConfig.setOptionValue ('.doFSRSelection', True)
109  subConfig.setOptionValue ('.noEffSF', True)
110  configSeq += subConfig
111  subConfig = factory.makeConfig ('Thinning')
112  subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
113  subConfig.setOptionValue ('.selectionName', 'looseLH||looseDNN')
114  subConfig.setOptionValue ('.deepCopy', True)
115  subConfig.setOptionValue ('.sortPt', True)
116  subConfig.setOptionValue ('.noUniformSelection', True)
117  configSeq += subConfig
118 
119  # So SiHit electrons - should come after the standard selection in order to avoid keeping the same electrons twice
120  subConfig = factory.makeConfig ('Electrons')
121  subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
122  subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
123  subConfig.setOptionValue ('.isolationCorrection', True)
124  subConfig.setOptionValue ('.minPt', 0.)
125  subConfig.setOptionValue ('.postfix', 'SiHit')
126  subConfig.setOptionValue ('.decorateEmva', True)
127  configSeq += subConfig
128  subConfig = factory.makeConfig ('Electrons.WorkingPoint')
129  subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
130  subConfig.setOptionValue ('.selectionName', 'SiHits')
131  subConfig.setOptionValue ('.trackSelection', False)
132  subConfig.setOptionValue ('.identificationWP', 'SiHitElectron')
133  subConfig.setOptionValue ('.isolationWP', 'NonIso')
134  subConfig.setOptionValue ('.doFSRSelection', True) # needed to veto FSR electrons
135  subConfig.setOptionValue ('.noEffSF', True)
136  subConfig.setOptionValue ('.postfix', 'SiHit')
137  configSeq += subConfig
138  subConfig = factory.makeConfig ('Thinning')
139  subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
140  subConfig.setOptionValue ('.selectionName', 'SiHits')
141  subConfig.setOptionValue ('.deepCopy', True)
142  subConfig.setOptionValue ('.sortPt', True)
143  subConfig.setOptionValue ('.noUniformSelection', True)
144  configSeq += subConfig
145 
146  # set up the photon analysis config:
147 
148  logPLCPAlgCfg.info('Do Photons')
149 
150  subConfig = factory.makeConfig ('Photons')
151  subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
152  subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
153  subConfig.setOptionValue ('.recomputeIsEM', False)
154  subConfig.setOptionValue ('.minPt', 0.)
155  subConfig.setOptionValue ('.decorateEmva', True)
156  configSeq += subConfig
157  subConfig = factory.makeConfig ('Photons.WorkingPoint')
158  subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
159  subConfig.setOptionValue ('.selectionName', 'loose')
160  subConfig.setOptionValue ('.qualityWP', 'Loose')
161  subConfig.setOptionValue ('.isolationWP', 'NonIso')
162  subConfig.setOptionValue ('.doFSRSelection', True)
163  subConfig.setOptionValue ('.recomputeIsEM', False)
164  subConfig.setOptionValue ('.noEffSFForID', True)
165  subConfig.setOptionValue ('.noEffSFForIso', True)
166  configSeq += subConfig
167  subConfig = factory.makeConfig ('Thinning')
168  subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
169  subConfig.setOptionValue ('.selectionName', 'loose')
170  subConfig.setOptionValue ('.deepCopy', True)
171  subConfig.setOptionValue ('.sortPt', True)
172  subConfig.setOptionValue ('.noUniformSelection', True)
173  configSeq += subConfig
174 
175 
176 
177  # set up the tau analysis algorithm config:
178  # Commented for now due to use of public tools
179  subConfig = factory.makeConfig ('TauJets')
180  subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
181  configSeq += subConfig
182  subConfig = factory.makeConfig ('TauJets.WorkingPoint')
183  subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
184  subConfig.setOptionValue ('.selectionName', 'baseline')
185  subConfig.setOptionValue ('.quality', 'Baseline')
186  configSeq += subConfig
187  subConfig = factory.makeConfig ('Thinning')
188  subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
189  subConfig.setOptionValue ('.selectionName', 'baseline')
190  subConfig.setOptionValue ('.deepCopy', True)
191  subConfig.setOptionValue ('.sortPt', True)
192  subConfig.setOptionValue ('.noUniformSelection', True)
193  configSeq += subConfig
194 
195  # set up the jet analysis algorithm config:
196  jetContainer = 'AntiKt4EMPFlowJets'
197  subConfig = factory.makeConfig ('Jets', containerName='AnalysisJets',
198  jetCollection=jetContainer)
199  subConfig.setOptionValue ('.runFJvtSelection', False)
200  subConfig.setOptionValue ('.runJvtSelection', False)
201  configSeq += subConfig
202  subConfig = factory.makeConfig ('Jets.Uncertainties')
203  subConfig.setOptionValue ('.containerName', 'AnalysisJets')
204  configSeq += subConfig
205  subConfig = factory.makeConfig ('Thinning')
206  subConfig.setOptionValue ('.containerName', 'AnalysisJets')
207  subConfig.setOptionValue ('.deepCopy', True)
208  subConfig.setOptionValue ('.sortPt', True)
209  subConfig.setOptionValue ('.noUniformSelection', True)
210  configSeq += subConfig
211 
212  largeRjetContainer='AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets'
213  subConfig = factory.makeConfig ('Jets', containerName='AnalysisLargeRJets',
214  jetCollection=largeRjetContainer)
215  subConfig.setOptionValue ('.runGhostMuonAssociation', False)
216  # Disable kinematic selections on large-R jets
217  subConfig.setOptionValue ('.minPt', 0.)
218  subConfig.setOptionValue ('.maxPt', 0.)
219  subConfig.setOptionValue ('.maxRapidity', 0.)
220  subConfig.setOptionValue ('.minMass', 0.)
221  subConfig.setOptionValue ('.maxMass', 0.)
222  configSeq += subConfig
223  subConfig = factory.makeConfig ('Thinning')
224  subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
225  subConfig.setOptionValue ('.deepCopy', True)
226  subConfig.setOptionValue ('.sortPt', True)
227  subConfig.setOptionValue ('.noUniformSelection', True)
228  configSeq += subConfig
229 
230  from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
231  configAccumulator = ConfigAccumulator (dataType=None, algSeq=None,
232  autoconfigFromFlags=flags, noSysSuffix=True, noSystematics=True)
233  configSeq.fullConfigure (configAccumulator)
234  return configAccumulator.CA
235 
236 
237 
238 # Main algorithm config
239 def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs):
240  """Configure the derivation framework driving algorithm (kernel) for PHYSLITE"""
241  acc = ComponentAccumulator()
242 
243  # This block does the common physics augmentation which isn't needed (or possible) for PHYS->PHYSLITE
244  # Ensure block only runs for AOD input
245  if 'StreamAOD' in flags.Input.ProcessingTags:
246  # Common augmentations
247  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
248  acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
249 
250  # Thinning tools
251  # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
252  # This differs depending on whether the input is AOD or PHYS
253  # These are needed whatever the input since they are not applied in PHYS
254  thinningToolsArgs = {
255  'ElectronCaloClusterThinningToolName' : "PHYSLITEElectronCaloClusterThinningTool",
256  'PhotonCaloClusterThinningToolName' : "PHYSLITEPhotonCaloClusterThinningTool",
257  'ElectronGSFTPThinningToolName' : "PHYSLITEElectronGSFTPThinningTool",
258  'PhotonGSFTPThinningToolName' : "PHYSLITEPhotonGSFTPThinningTool"
259  }
260  # whereas these are only needed if the input is AOD since they are applied already in PHYS
261  if 'StreamAOD' in flags.Input.ProcessingTags:
262  thinningToolsArgs.update({
263  'TrackParticleThinningToolName' : "PHYSLITETrackParticleThinningTool",
264  'MuonTPThinningToolName' : "PHYSLITEMuonTPThinningTool",
265  'TauJetThinningToolName' : "PHYSLITETauJetThinningTool",
266  'TauJets_MuonRMThinningToolName' : "PHYSLITETauJets_MuonRMThinningTool",
267  'DiTauTPThinningToolName' : "PHYSLITEDiTauTPThinningTool",
268  'DiTauLowPtThinningToolName' : "PHYSLITEDiTauLowPtThinningTool",
269  'DiTauLowPtTPThinningToolName' : "PHYSLITEDiTauLowPtTPThinningTool",
270  })
271  # Configure the thinning tools
272  from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
273  acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
274  # Get them from the CA so they can be added to the kernel
275  thinningTools = []
276  for key in thinningToolsArgs:
277  thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
278 
279 
280  # Higgs augmentations - 4l vertex, Higgs STXS truth variables, CloseBy isolation correction (for all analyses)
281  # For PhysLite, must run CloseBy BEFORE running analysis sequences to be able to 'pass through' to the shallow copy the added isolation values
282  # Here we only run the augmentation algs
283  # These do not need to be run if PhysLite is run from Phys (i.e. not from 'StreamAOD')
284  if 'StreamAOD' in flags.Input.ProcessingTags:
285  # running from AOD
286 
287  from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
288  acc.merge(HiggsAugmentationAlgsCfg(flags))
289 
290 
291  from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
292  acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = True))
293 
294  #==============================================================================
295  # Analysis-level variables
296  #==============================================================================
297 
298  # Needed in principle to support MET association when running PHYS->PHYSLITE,
299  # but since this doesn't work for PHYS->PHYSLITE anyway, commenting for now
300  #if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags
301  # from AtlasGeoModel.GeoModelConfig import GeoModelCfg
302  # acc.merge(GeoModelCfg(flags))
303 
304  # add CP algorithms to job
305  acc.merge(CPAlgorithmsCfg(flags))
306 
307  # Build MET from our analysis objects
308  if 'StreamAOD' in flags.Input.ProcessingTags:
309  from METReconstruction.METAssocCfg import AssocConfig, METAssocConfig
310  from METReconstruction.METAssociatorCfg import getAssocCA
311  associators = [AssocConfig('PFlowJet', 'AnalysisJets'),
312  AssocConfig('Muon', 'AnalysisMuons'),
313  AssocConfig('Ele', 'AnalysisElectrons'),
314  AssocConfig('Gamma', 'AnalysisPhotons'),
315  AssocConfig('Tau', 'AnalysisTauJets'),
316  AssocConfig('Soft', '')]
317  PHYSLITE_cfg = METAssocConfig('AnalysisMET',
318  flags,
319  associators,
320  doPFlow=True,
321  usePFOLinks=True)
322  components_PHYSLITE_cfg = getAssocCA(PHYSLITE_cfg,METName='AnalysisMET')
323  acc.merge(components_PHYSLITE_cfg)
324  elif 'StreamDAOD_PHYS' in flags.Input.ProcessingTags:
325  from DerivationFrameworkJetEtMiss.METCommonConfig import METRemappingCfg
326 
327  METRemap_cfg = METRemappingCfg(flags)
328  acc.merge(METRemap_cfg)
329 
330  # The derivation kernel itself
331  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
332  acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
333 
334  return acc
335 
336 
337 def PHYSLITECfg(flags):
338 
339  acc = ComponentAccumulator()
340 
341  # Get the lists of triggers needed for trigger matching.
342  # This is needed at this scope (for the slimming) and further down in the config chain
343  # for actually configuring the matching, so we create it here and pass it down
344  # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
345  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
346  PHYSLITETriggerListsHelper = TriggerListsHelper(flags)
347 
348  # Set the stream name - varies depending on whether the input is AOD or DAOD_PHYS
349  streamName = 'StreamDAOD_PHYSLITE' if 'StreamAOD' in flags.Input.ProcessingTags else 'StreamD2AOD_PHYSLITE'
350 
351  # Common augmentations
352  acc.merge(PHYSLITEKernelCfg(flags, name="PHYSLITEKernel", StreamName = streamName, TriggerListsHelper = PHYSLITETriggerListsHelper))
353 
354  # ============================
355  # Define contents of the format
356  # =============================
357  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
358  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
359  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
360 
361  PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
362  PHYSLITESlimmingHelper.ExtraVariables = []
363  # Trigger content
364  PHYSLITESlimmingHelper.IncludeTriggerNavigation = False
365  PHYSLITESlimmingHelper.IncludeJetTriggerContent = False
366  PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False
367  PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False
368  PHYSLITESlimmingHelper.IncludeTauTriggerContent = False
369  PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False
370  PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False
371  PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False
372  PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False
373 
374  # Trigger matching
375  # Run 2
376  if flags.Trigger.EDMVersion == 2:
377  # Need to re-run matching so that new Analysis<X> containers are matched to triggers
378  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
379  acc.merge(TriggerMatchingCommonRun2Cfg(flags,
380  name = "PHYSLITETrigMatchNoTau",
381  OutputContainerPrefix = "AnalysisTrigMatch_",
382  ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau,
383  InputElectrons = "AnalysisElectrons",
384  InputPhotons = "AnalysisPhotons",
385  InputMuons = "AnalysisMuons",
386  InputTaus = "AnalysisTauJets"))
387  acc.merge(TriggerMatchingCommonRun2Cfg(flags,
388  name = "PHYSLITETrigMatchTau",
389  OutputContainerPrefix = "AnalysisTrigMatch_",
390  ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesTau,
391  DRThreshold = 0.2,
392  InputElectrons = "AnalysisElectrons",
393  InputPhotons = "AnalysisPhotons",
394  InputMuons = "AnalysisMuons",
395  InputTaus = "AnalysisTauJets"))
396  # Now add the resulting decorations to the output
397  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
398  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
399  OutputContainerPrefix = "AnalysisTrigMatch_",
400  TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesTau)
401  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
402  OutputContainerPrefix = "AnalysisTrigMatch_",
403  TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
404 
405  # Run 3, or Run 2 with navigation conversion
406  if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
407  # No need to run matching: just keep navigation so matching can be done by analysts
408  from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
410 
411  # Event content
412  PHYSLITESlimmingHelper.AppendToDictionary.update({
413  'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
414  'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
415  'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
416  'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
417  'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
418  'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
419  'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
420  'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
421  'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
422  'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
423  'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
424  'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
425  'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
426  'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
427  'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
428  'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
429  'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer',
430  'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer',
431  'AnalysisSiHitElectrons':'xAOD::ElectronContainer', 'AnalysisSiHitElectronsAux':'xAOD::ElectronAuxContainer',
432  'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer',
433  'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase',
434  'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer',
435  'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer',
436  'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer',
437  'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap',
438  'AnalysisLargeRJets':'xAOD::JetContainer','AnalysisLargeRJetsAux':'xAOD::AuxContainerBase'
439  })
440 
441  PHYSLITESlimmingHelper.SmartCollections = [
442  'EventInfo',
443  'InDetTrackParticles',
444  'PrimaryVertices',
445  ]
446 
447  from DerivationFrameworkMuons.MuonsCommonConfig import MuonVariablesCfg
448 
449  # add in extra values for Higgs
450  from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
451  setupHiggsSlimmingVariables(flags, PHYSLITESlimmingHelper)
452 
453  if flags.Input.isMC:
454  from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
455  addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper)
456  from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
457  acc.merge(HFClassificationCommonCfg(flags))
458 
459  # Save the extra variables which aren't included by other means
460  btag_variables = [f'GN2v01_p{x}' for x in ['b', 'c', 'u', 'tau']]
461  PHYSLITESlimmingHelper.ExtraVariables += [
462  'AnalysisElectrons.trackParticleLinks.f1.pt.eta.phi.m.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',
463  'AnalysisSiHitElectrons.pt.eta.phi.m.charge.author.topoetcone20_CloseByCorr.DFCommonElectronsLHVeryLoose.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.OQ.truthOrigin.truthType.firstEgMotherTruthType.firstEgMotherTruthOrigin.z0stheta.d0Normalized.nInnerExpPix.clEta.clPhi.E_mva_only',
464  'AnalysisPhotons.f1.pt.eta.phi.m.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',
465  'GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.z0.vz.charge.vertexLink.numberOfPixelHits.numberOfSCTHits.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.originalTrackParticle',
466  'GSFConversionVertices.trackParticleLinks.x.y.z.px.py.pz.pt1.pt2.neutralParticleLinks.minRfirstHit',
467  'egammaClusters.calE.calEta.calPhi.calM.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks.samplingPattern',
468  "AnalysisMuons.{var_string}".format(var_string = ".".join(MuonVariablesCfg(flags))),
469  'CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF',
470  'ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi',
471  'MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP',
472  'InDetForwardTrackParticles.vz.truthType.truthOrigin.numberDoF.numberOfTRTHits.numberOfSCTHoles.theta.numberOfTRTOutliers.numberOfPrecisionLayers.numberOfSCTDeadSensors.numberOfPixelHoles.numberOfSCTHits.numberOfPrecisionHoleLayers.numberOfPixelDeadSensors.phi.numberOfPixelHits.z0.d0.qOverP.chiSquared.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag',
473  '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',
474  '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)),
475  'TruthPrimaryVertices.t.x.y.z',
476  'MET_Core_AnalysisMET.name.mpx.mpy.sumet.source',
477  'METAssoc_AnalysisMET.',
478  'InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.numberOfTRTHits.numberOfTRTOutliers',
479  '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())),
480  'Kt4EMPFlowEventShape.Density',
481  'Kt4EMPFlowNeutEventShape.Density',
482  'TauTracks.flagSet.trackLinks',
483  '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',
484  ]
485 
486  # Output stream
487  PHYSLITEItemList = PHYSLITESlimmingHelper.GetItemList()
488 
489  formatString = 'D2AOD_PHYSLITE' if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags else 'DAOD_PHYSLITE'
490  acc.merge(OutputStreamCfg(flags, formatString, ItemList=PHYSLITEItemList, AcceptAlgs=["PHYSLITEKernel"]))
491  acc.merge(SetupMetaDataForStreamCfg(flags, formatString, AcceptAlgs=["PHYSLITEKernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
492 
493  return acc
494 
python.METCommonConfig.METRemappingCfg
def METRemappingCfg(ConfigFlags)
Definition: METCommonConfig.py:88
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=None, MetadataItemList=None, disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=None, HelperTools=None)
Definition: OutputStreamConfig.py:13
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2Cfg
def TriggerMatchingCommonRun2Cfg(flags, name, **kwargs)
Definition: TriggerMatchingCommonConfig.py:91
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:99
python.GoodRunsListsDictionary.getGoodRunsLists
def getGoodRunsLists()
Definition: GoodRunsListsDictionary.py:3
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
python.PHYSLITE.CPAlgorithmsCfg
def CPAlgorithmsCfg(flags)
Definition: PHYSLITE.py:17
python.PhysCommonThinningConfig.PhysCommonThinningCfg
def PhysCommonThinningCfg(flags, StreamName="StreamDAOD_PHYS", **kwargs)
Definition: PhysCommonThinningConfig.py:9
python.PHYSLITE.PHYSLITECfg
def PHYSLITECfg(flags)
Definition: PHYSLITE.py:337
python.PHYSLITE.PHYSLITEKernelCfg
def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs)
Definition: PHYSLITE.py:239
python.TriggerMatchingCommonConfig.AddRun2TriggerMatchingToSlimmingHelper
def AddRun2TriggerMatchingToSlimmingHelper(**kwargs)
Definition: TriggerMatchingCommonConfig.py:49
METAssociatorCfg.getAssocCA
def getAssocCA(config, METName='')
Definition: METAssociatorCfg.py:78
python.MuonsCommonConfig.MuonVariablesCfg
def MuonVariablesCfg(flags)
Definition: MuonsCommonConfig.py:89
python.HiggsPhysContent.HiggsAugmentationAlgsCfg
def HiggsAugmentationAlgsCfg(flags)
Definition: HiggsPhysContent.py:4
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.MCTruthCommonConfig.addTruth3ContentToSlimmerTool
def addTruth3ContentToSlimmerTool(slimmer)
Definition: MCTruthCommonConfig.py:480
python.HiggsPhysContent.setupHiggsSlimmingVariables
def setupHiggsSlimmingVariables(ConfigFlags, slimmingHelper)
Definition: HiggsPhysContent.py:13
IsolationSelectionConfig.IsoCloseByAlgsCfg
def IsoCloseByAlgsCfg(flags, suff="", isPhysLite=False, containerNames=["Muons", "Electrons", "Photons"], stream_name="", ttva_wp="Nonprompt_All_MaxWeight", useSelTools=False, isoDecSuffix="CloseByCorr", caloDecSuffix="", hasLRT=False)
Definition: IsolationSelectionConfig.py:146
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:13
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
python.HFClassificationCommonConfig.HFClassificationCommonCfg
def HFClassificationCommonCfg(flags)
Definition: HFClassificationCommonConfig.py:100
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
SlimmingHelper
Definition: SlimmingHelper.py:1
python.HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:66