ATLAS Offline Software
Functions
python.resolveSGKey Namespace Reference

Functions

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

Function Documentation

◆ resolveSGKey()

def 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.

13 def resolveSGKey (flags, keystr):
14  """Pick proper SG key out of a list from ObjKeyStore.
15 
16 KEYSTR is a comma-separated list of StoreGate keys.
17 Return the first one from that list that exists in the input.
18 Raise 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()

def 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.

36 def testSGKey (flags, keystr):
37  """Test to see if SG keys are in the input.
38 
39 KEYSTR is a comma-separated list of StoreGate keys.
40 Return 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 
python.resolveSGKey.resolveSGKey
def resolveSGKey(flags, keystr)
Definition: resolveSGKey.py:13
python.resolveSGKey.testSGKey
def testSGKey(flags, keystr)
Definition: resolveSGKey.py:36