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