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