12 """Return a level-of-detail function that also schedules an algorithm.
14 LEVEL is the level of detail.
16 ALG is the name of the algorithm.
19 def lodfunc (reqlev, blockargs, hookargs):
20 if reqlev < level:
return False
21 algmod = __import__ (
'egammaD3PDAnalysis.' + alg +
'Config',
22 fromlist = [alg +
'Config'])
23 algfunc = getattr (algmod, alg +
'Cfg')
24 def hookfn (c, flags, acc, *args, **kw):
25 acc.merge (algfunc (flags,
26 prefix = hookargs[
'prefix'],
27 sgkey = hookargs[
'sgkey'],
28 typeName = hookargs[
'typeName'],
29 allowMissing = hookargs.get(
'allowMissing',
False)))
31 hookargs[
'd3pdo'].defineHook (hookfn)