Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SKIM.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 # SKIM.py - special format allowing skimming of PHYS/PHYSLITE via a string
3 # passed via the command line (--skimmingExpression)
4 # All containers used for the skimming must be listed via --skimmingContainers
5 # NOT TO BE USED FOR CENTRAL PRODUCTION
6 
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.Enums import MetadataCategory
10 from AthenaCommon.CFElements import seqAND
11 
13  """Configure the skimming tool"""
14  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
15  acc = ComponentAccumulator()
16  tdt = acc.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
17 
18  acc.addPublicTool(CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "SKIMStringSkimmingTool",
19  expression = flags.Derivation.skimmingExpression,
20  TrigDecisionTool=tdt),
21  primary = True)
22  return(acc)
23 
24 
25 def SKIMKernelCfg(flags, name='SKIMKernel', **kwargs):
26  """Configure the derivation framework driving algorithm (kernel)"""
27  acc = ComponentAccumulator()
28  acc.addSequence( seqAND("SKIMSequence") )
29  acc.getSequence("SKIMSequence").ExtraDataForDynamicConsumers = flags.Derivation.dynamicConsumers
30  acc.getSequence("SKIMSequence").ProcessDynamicDataDependencies = True
31  skimmingTool = acc.getPrimaryAndMerge(SKIMSkimmingToolCfg(flags))
32  DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
33  acc.addEventAlgo(DerivationKernel(name, SkimmingTools = [skimmingTool]), sequenceName="SKIMSequence")
34  return acc
35 
36 
37 def SKIMCfg(flags):
38 
39  acc = ComponentAccumulator()
40  acc.merge(SKIMKernelCfg(flags, name="SKIMKernel"))
41 
42  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
43  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
44 
45  acc.merge(OutputStreamCfg(flags, "D2AOD_SKIM", ItemList=flags.Input.TypedCollections, AcceptAlgs=["SKIMKernel"]))
46  acc.merge(SetupMetaDataForStreamCfg(flags, "D2AOD_SKIM", AcceptAlgs=["SKIMKernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
47 
48  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.SKIM.SKIMKernelCfg
def SKIMKernelCfg(flags, name='SKIMKernel', **kwargs)
Definition: SKIM.py:25
python.SKIM.SKIMCfg
def SKIMCfg(flags)
Definition: SKIM.py:37
python.SKIM.SKIMSkimmingToolCfg
def SKIMSkimmingToolCfg(flags)
Definition: SKIM.py:12
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
python.HION12.DerivationKernel
DerivationKernel
Definition: HION12.py:66