11def defineAlgLODFunc (level, alg):
12 """Return a level-of-detail function that also schedules an algorithm.
13
14 LEVEL is the level of detail.
15
16 ALG is the name of the algorithm.
17"""
18
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)))
30 return
31 hookargs['d3pdo'].defineHook (hookfn)
32 return True
33 return lodfunc
34