Skip to content
Snippets Groups Projects
Commit c0c1e8be authored by Carlo Varni's avatar Carlo Varni Committed by Adam Edward Barton
Browse files

Add function decorator

parent aecb596c
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47681Add function decorator
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Python's Decorator for ACTS algorithm sequence
# This will set the debug level to the desired value
# and change the name of all the sequences accordingly
# to the environment
def acts_sequence_configuration(func):
def wrapper(ConfigFlags, **kwargs):
acc = func(ConfigFlags, **kwargs)
# Set OutputLevel can be set with the following piece of code
# This will set the Outputl Level of all the algorithms and Tools to
# a defined value
# TO-DO: Add a flag (maybe in the config flags) that defines the output level
# for our algorithms/tools
#
# from AthenaCommon.Constants import DEBUG
# for el in acc._allSequences:
# for member in el.Members:
# member.OutputLevel = DEBUG
# the following is needed to reliably determine whether we're really being steered from an old-style job option
# assume we're running CPython
import inspect
stack = inspect.stack()
if len(stack) >= 2 and stack[1].function == 'CAtoGlobalWrapper':
for el in acc._allSequences:
el.name = "TopAlg"
return acc
return wrapper
......@@ -4,7 +4,9 @@ from AthenaCommon.Configurable import ConfigurableRun3Behavior
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from ActsTrkFinding.ActsSeedingAlgorithmConfig import ActsSeedingAlgorithmCfg
from ActsTrkFinding.ActsSequenceConfiguration import acts_sequence_configuration
@acts_sequence_configuration
def ActsTrackingSequenceCfg(ConfigFlags,
inputCollections: list = []):
# prepare entire sequence
......@@ -16,23 +18,6 @@ def ActsTrackingSequenceCfg(ConfigFlags,
name = 'ActsSeedingAlgorithm',
inputCollection = i_collection,
outputCollection = o_collection))
# Set OutputLevel can be set with the following piece of code
# This will set the Outputl Level of all the algorithms and Tools to
# a defined value
#
# from AthenaCommon.Constants import DEBUG
# for el in acc._allSequences:
# for member in el.Members:
# member.OutputLevel = DEBUG
# the following is needed to reliably determine whether we're really being steered from an old-style job option
# assume we're running CPython
import inspect
stack = inspect.stack()
if len(stack) >= 2 and stack[1].function == 'CAtoGlobalWrapper':
for el in acc._allSequences:
el.name = "TopAlg"
return acc
......
......@@ -4,8 +4,10 @@ from AthenaCommon.Configurable import ConfigurableRun3Behavior
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
from ActsTrkFinding.ActsSeedingAlgorithmConfig import ActsSeedingAlgorithmCfg
from ActsTrkFinding.ActsSequenceConfiguration import acts_sequence_configuration
from ActsInterop import UnitConstants
@acts_sequence_configuration
def ActsTrackingSequenceFromAthenaCfg(ConfigFlags,
inputCollections: list = []):
# prepare entire sequence
......@@ -30,23 +32,6 @@ def ActsTrackingSequenceFromAthenaCfg(ConfigFlags,
inputCollection = i_collection,
outputCollection = o_collection,
**seedingOptions))
# Set OutputLevel can be set with the following piece of code
# This will set the Outputl Level of all the algorithms and Tools to
# a defined value
#
# from AthenaCommon.Constants import DEBUG
# for el in acc._allSequences:
# for member in el.Members:
# member.OutputLevel = DEBUG
# the following is needed to reliably determine whether we're really being steered from an old-style job option
# assume we're running CPython
import inspect
stack = inspect.stack()
if len(stack) >= 2 and stack[1].function == 'CAtoGlobalWrapper':
for el in acc._allSequences:
el.name = "TopAlg"
return acc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment