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

Functions

 resolveSGKey (flags, keystr)
 testSGKey (flags, keystr)

Function Documentation

◆ resolveSGKey()

python.resolveSGKey.resolveSGKey ( flags,
keystr )
Pick proper SG key out of a list from ObjKeyStore.

KEYSTR is a comma-separated list of StoreGate keys.
Return the first one from that list that exists in the input.
Raise an exception if none of them exist.

Definition at line 13 of file resolveSGKey.py.

13def resolveSGKey (flags, keystr):
14 """Pick proper SG key out of a list from ObjKeyStore.
15
16KEYSTR is a comma-separated list of StoreGate keys.
17Return the first one from that list that exists in the input.
18Raise an exception if none of them exist.
19"""
20
21 log = logging.getLogger ('D3PD')
22 kl = keystr.split(',')
23 for k in kl:
24 if k in flags.Input.Collections:
25 log.verbose ("Using SG key %s for type %s." % (k, type))
26 return k
27 if len (kl) == 1:
28 # Just one, hope for the best.
29 return k
30
31 raise Exception ("No keys among `%s' for type `%s' in ObjKeyStore." %
32 (keystr, type))
33
34
35

◆ testSGKey()

python.resolveSGKey.testSGKey ( flags,
keystr )
Test to see if SG keys are in the input.

KEYSTR is a comma-separated list of StoreGate keys.
Return true if any key from that list exists in the input.

Definition at line 36 of file resolveSGKey.py.

36def testSGKey (flags, keystr):
37 """Test to see if SG keys are in the input.
38
39KEYSTR is a comma-separated list of StoreGate keys.
40Return true if any key from that list exists in the input.
41"""
42
43 kl = keystr.split(',')
44 for k in kl:
45 if k in flags.Input.Collections:
46 return True
47 return False
48
49