ATLAS Offline Software
PhysicsAnalysis
D3PDMaker
D3PDMakerCoreComps
python
resolveSGKey.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
# @file D3PDMakerCoreComps/python/resolveSGKey.py
4
# @author scott snyder <snyder@bnl.gov>
5
# @date Jan, 2010
6
# @brief Pick proper SG key out of a list from ObjKeyStore.
7
#
8
9
10
from
AthenaCommon.Logging
import
logging
11
12
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
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
Generated on Thu Nov 7 2024 21:24:43 for ATLAS Offline Software by
1.8.18