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