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