ATLAS Offline Software
Loading...
Searching...
No Matches
python.defineBlockAndAlg Namespace Reference

Functions

 defineAlgLODFunc (level, alg)
 defineBlockAndAlg (d3pdo, level, blockname, blockfunc, alg, **kw)

Function Documentation

◆ defineAlgLODFunc()

python.defineBlockAndAlg.defineAlgLODFunc ( level,
alg )
Return a level-of-detail function that also schedules an algorithm.

LEVEL is the level of detail.

ALG is the name of the algorithm.

Definition at line 11 of file defineBlockAndAlg.py.

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

◆ defineBlockAndAlg()

python.defineBlockAndAlg.defineBlockAndAlg ( d3pdo,
level,
blockname,
blockfunc,
alg,
** kw )
Define a block, and schedule an algorithm if the block is used.

D3PDO is the D3PDObject for which the block should be defined.

LEVEL is the level of detail.

BLOCKNAME is the name of the block.

BLOCKFUNC is the function that creates the block.

ALG is the name of the algorithm.

Definition at line 35 of file defineBlockAndAlg.py.

36 **kw):
37 """Define a block, and schedule an algorithm if the block is used.
38
39 D3PDO is the D3PDObject for which the block should be defined.
40
41 LEVEL is the level of detail.
42
43 BLOCKNAME is the name of the block.
44
45 BLOCKFUNC is the function that creates the block.
46
47 ALG is the name of the algorithm.
48"""
49
50 lodfunc = defineAlgLODFunc (level, alg)
51 d3pdo.defineBlock (lodfunc, blockname, blockfunc, **kw)
52 return