ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFrameworkToolsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#==============================================================================
4# Provides configs for the common derivation framework tools
5#==============================================================================
6
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8from AthenaConfiguration.ComponentFactory import CompFactory
9
10# Wrapper to allow ASG tools to decorste via the derivation framework
11def AsgSelectionToolWrapperCfg(flags, name, **kwargs):
12 """Configure the ASG selection tool wrapper"""
13 acc = ComponentAccumulator()
14 AsgSelectionToolWrapper = CompFactory.DerivationFramework.AsgSelectionToolWrapper
15 acc.addPublicTool(AsgSelectionToolWrapper(name, **kwargs),
16 primary = True)
17 return acc
18
19# Generic thinning tool (via ExpressionEvaluation strings)
20def GenericObjectThinningCfg(flags, name, **kwargs):
21 """Configure the generic object thinning tool"""
22 acc = ComponentAccumulator()
23 GenericObjectThinning = CompFactory.DerivationFramework.GenericObjectThinning
24 acc.addPublicTool(GenericObjectThinning(name, **kwargs),
25 primary = True)
26 return acc
27
28# Skimming via ExpressionEvaluation strings
29def xAODStringSkimmingToolCfg(flags, name, **kwargs):
30 """Configure the generic skimming tool"""
31 acc = ComponentAccumulator()
32 if flags.Trigger.EDMVersion < 0:
33 kwargs.setdefault("TrigDecisionTool", None)
34 acc.addPublicTool(
35 CompFactory.DerivationFramework.xAODStringSkimmingTool(name, **kwargs),
36 primary = True)
37 return acc
38
39### Trigger skimming list
40def TriggerSkimmingToolCfg(flags, name, **kwargs):
41 acc = ComponentAccumulator()
42 the_tool = CompFactory.DerivationFramework.TriggerSkimmingTool(name,**kwargs)
43 acc.addPublicTool(the_tool, primary = True)
44 return acc
45### Invariant mass tool config
46def InvariantMassToolCfg(flags, name , **kwargs):
47 acc= ComponentAccumulator()
48 the_tool = CompFactory.DerivationFramework.InvariantMassTool(name,**kwargs)
49 acc.addPublicTool(the_tool, primary = True)
50 return acc
51# Prescale tool
52def PrescaleToolCfg(flags, name, **kwargs):
53 """Configure the DAOD prescale tool"""
54 acc = ComponentAccumulator()
55 PrescaleTool = CompFactory.DerivationFramework.PrescaleTool
56 acc.addPublicTool(PrescaleTool(name, **kwargs),
57 primary = True)
58 return acc
59
60# Tool for combining several filter tools with AND logic
61def FilterCombinationANDCfg(flags, name, **kwargs):
62 """Configure the FilterCombinationAND tool"""
63 acc = ComponentAccumulator()
64 FilterCombinationAND = CompFactory.DerivationFramework.FilterCombinationAND
65 acc.addPublicTool(FilterCombinationAND(name, **kwargs),
66 primary = True)
67 return acc
68
69# Tool for combining several filter tools with OR logic
70def FilterCombinationORCfg(flags, name, **kwargs):
71 """Configure the FilterCombinationOR tool"""
72 acc = ComponentAccumulator()
73 FilterCombinationOR = CompFactory.DerivationFramework.FilterCombinationOR
74 acc.addPublicTool(FilterCombinationOR(name, **kwargs),
75 primary = True)
76 return acc