diff --git a/PhysSel/PhysSelPython/python/PhysSelPython/Wrappers.py b/PhysSel/PhysSelPython/python/PhysSelPython/Wrappers.py index ccfdf11f11c77c4226b727822158bcc87da561a4..b332257deb3850eb0441723fb5e8233d8a0f0ce7 100755 --- a/PhysSel/PhysSelPython/python/PhysSelPython/Wrappers.py +++ b/PhysSel/PhysSelPython/python/PhysSelPython/Wrappers.py @@ -258,19 +258,25 @@ class AutomaticData(NamedObject, SelectionBase) : _alg = VoidFilter( 'SelFilter'+self.name() ) + _alg.Preambulo += [ + "from LoKiCore.functions import in_range" + ] + if not monitor : _alg.Code = """ - 0<CONTAINS('%s',%s) + in_range ( 0.1 , CONTAINS('%s',%s) , 1.1e+9 ) """ % ( Location , UseRootInTES ) else : _alg.Preambulo += [ - "from LoKiCore.functions import monitor" , + "from LoKiCore.functions import monitor , switch" , "from LoKiCore.math import max as lmax" , + "nobjects = lmax ( CONTAINS ( '%s' , %s ) , 0 ) " % ( Location , UseRootInTES ) , + "nobjects = switch ( 1.0e+9 < nobjects , 0.0 , nobjects ) " ] - ## create monitored functor + ## create monitored functor _alg.Code = """ - 0< monitor ( lmax ( CONTAINS('%s',%s), FZERO ) ,'# %s', 0 ) - """ % ( Location , UseRootInTES , Location ) + in_range ( 0.1 , monitor ( nobjects , '# %s', 0 ) , 1.1e+9 ) + """ % Location SelectionBase.__init__(self, algorithm = _alg,