ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkPhys
python
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
12
def
SKIMSkimmingToolCfg
(flags):
13
"""Configure the skimming tool"""
14
from
DerivationFrameworkTools.DerivationFrameworkToolsConfig
import
(
15
xAODStringSkimmingToolCfg)
16
return
xAODStringSkimmingToolCfg(flags, name =
"SKIMStringSkimmingTool"
,
17
expression = flags.Derivation.skimmingExpression)
18
19
def
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
31
def
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
python.SKIM.SKIMSkimmingToolCfg
SKIMSkimmingToolCfg(flags)
Definition
SKIM.py:12
python.SKIM.SKIMKernelCfg
SKIMKernelCfg(flags, name='SKIMKernel', **kwargs)
Definition
SKIM.py:19
python.SKIM.SKIMCfg
SKIMCfg(flags)
Definition
SKIM.py:31
Generated on
for ATLAS Offline Software by
1.17.0