From fcbde76f47d427d928f89ce266bfcc3ef0c6cc7a Mon Sep 17 00:00:00 2001 From: Nils Krumnack <krumnack@iastate.edu> Date: Wed, 1 Apr 2020 14:42:48 -0500 Subject: [PATCH] make sure dynConfig works correctly for private tools While in AnalysisBase this technically works with a '.' in the name, it is much cleaner if this is indeed setting the property on the subtool. --- .../D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py index 7706b92ef212..31090b947d17 100644 --- a/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py +++ b/PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AnaAlgSequence.py @@ -106,7 +106,14 @@ class AnaAlgSequence( AlgSequence ): pass for alg, meta in zip( self, self._algorithmMeta ): for var, func in meta.dynConfig.items() : - setattr (alg, var, func (metaConfig)) + # if this is a subtool, find the subtool + obj = alg + while '.' in var : + obj = getattr (alg, var[:var.find('.')]) + var = var[var.find('.')+1:] + pass + # set the property on the algorithm/tool + setattr (obj, var, func (metaConfig)) pass for name, value in meta.metaConfig.items() : if not name in metaConfig : -- GitLab