ATLAS Offline Software
Loading...
Searching...
No Matches
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
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.ComponentFactory import CompFactory
9from AthenaConfiguration.Enums import MetadataCategory
10from AthenaCommon.CFElements import seqAND
11
13 """Configure the skimming tool"""
14 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
15 xAODStringSkimmingToolCfg)
16 return xAODStringSkimmingToolCfg(flags, name = "SKIMStringSkimmingTool",
17 expression = flags.Derivation.skimmingExpression)
18
19def SKIMKernelCfg(flags, name='SKIMKernel', **kwargs):
20 """Configure the derivation framework driving algorithm (kernel)"""
21 acc = ComponentAccumulator()
22 acc.addSequence( seqAND("SKIMSequence") )
23 acc.getSequence("SKIMSequence").ExtraDataForDynamicConsumers = flags.Derivation.dynamicConsumers
24 acc.getSequence("SKIMSequence").ProcessDynamicDataDependencies = True
25 skimmingTool = acc.getPrimaryAndMerge(SKIMSkimmingToolCfg(flags))
26 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
27 acc.addEventAlgo(DerivationKernel(name, SkimmingTools = [skimmingTool]), sequenceName="SKIMSequence")
28 return acc
29
30
31def SKIMCfg(flags):
32
33 acc = ComponentAccumulator()
34 acc.merge(SKIMKernelCfg(flags, name="SKIMKernel"))
35
36 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
37 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
38
39 acc.merge(OutputStreamCfg(flags, "D2AOD_SKIM", ItemList=flags.Input.TypedCollections, AcceptAlgs=["SKIMKernel"]))
40 acc.merge(SetupMetaDataForStreamCfg(flags, "D2AOD_SKIM", AcceptAlgs=["SKIMKernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
41
42 return acc
SKIMSkimmingToolCfg(flags)
Definition SKIM.py:12
SKIMCfg(flags)
Definition SKIM.py:31
SKIMKernelCfg(flags, name='SKIMKernel', **kwargs)
Definition SKIM.py:19