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 else:
35 from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
36 kwargs.setdefault("TrigDecisionTool", acc.getPrimaryAndMerge(
37 TrigDecisionToolCfg(flags)))
38 acc.addPublicTool(
39 CompFactory.DerivationFramework.xAODStringSkimmingTool(name, **kwargs),
40 primary = True)
41 return acc
42
43### Trigger skimming list
44def TriggerSkimmingToolCfg(flags, name, **kwargs):
45 acc = ComponentAccumulator()
46 the_tool = CompFactory.DerivationFramework.TriggerSkimmingTool(name,**kwargs)
47 acc.addPublicTool(the_tool, primary = True)
48 return acc
49### Invariant mass tool config
50def InvariantMassToolCfg(flags, name , **kwargs):
51 acc= ComponentAccumulator()
52 the_tool = CompFactory.DerivationFramework.InvariantMassTool(name,**kwargs)
53 acc.addPublicTool(the_tool, primary = True)
54 return acc
55# Prescale tool
56def PrescaleToolCfg(flags, name, **kwargs):
57 """Configure the DAOD prescale tool"""
58 acc = ComponentAccumulator()
59 PrescaleTool = CompFactory.DerivationFramework.PrescaleTool
60 acc.addPublicTool(PrescaleTool(name, **kwargs),
61 primary = True)
62 return acc
63
64# Tool for combining several filter tools with AND logic
65def FilterCombinationANDCfg(flags, name, **kwargs):
66 """Configure the FilterCombinationAND tool"""
67 acc = ComponentAccumulator()
68 FilterCombinationAND = CompFactory.DerivationFramework.FilterCombinationAND
69 acc.addPublicTool(FilterCombinationAND(name, **kwargs),
70 primary = True)
71 return acc
72
73# Tool for combining several filter tools with OR logic
74def FilterCombinationORCfg(flags, name, **kwargs):
75 """Configure the FilterCombinationOR tool"""
76 acc = ComponentAccumulator()
77 FilterCombinationOR = CompFactory.DerivationFramework.FilterCombinationOR
78 acc.addPublicTool(FilterCombinationOR(name, **kwargs),
79 primary = True)
80 return acc