ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaCommon
python
AthenaCommonFlags.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
7
8
""" AthenaCommonFlags
9
Python module to hold common flags to configure JobOptions.
10
11
From the python prompt:
12
>>> from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
13
>>> print athenaCommonFlags.EvtMax()
14
>>> athenaCommonFlags.EvtMax = 50
15
>>> assert( athenaCommonFlags.EvtMax() == 50 )
16
>>> athenaCommonFlags.print_JobProperties('tree&value')
17
18
"""
19
20
__author__ =
"S.Binet, M.Gallas"
21
__version__=
"$Revision: 1.11 $"
22
__doc__ =
"AthenaCommonFlags"
23
24
__all__ = [
"athenaCommonFlags"
]
25
26
28
29
from
AthenaCommon.JobProperties
import
JobProperty, JobPropertyContainer
30
from
AthenaCommon.JobProperties
import
jobproperties
31
32
34
35
class
EvtMax
(JobProperty):
36
"""Number of events to process or generate"""
37
statusOn =
False
38
allowedTypes = [
'int'
]
39
StoredValue = 5
40
41
class
SkipEvents
(JobProperty):
42
"""Number of events to skip when reading an input POOL file. This should
43
be given to the EventSelector service.
44
"""
45
statusOn =
False
46
allowedTypes = [
'int'
]
47
StoredValue = 0
48
49
class
FilesInput
(JobProperty):
50
"""The list of input data files (if not empty override all the specific XYZInput) """
51
statusOn =
True
52
allowedTypes = [
'list'
]
53
StoredValue = []
54
55
def
_do_action
( self, *args, **kwds ):
56
#first remove any blanks
57
if
""
in
self.
StoredValue
:
58
self.
StoredValue
= list(filter(
None
,self.
StoredValue
))
59
from
AthenaCommon
import
AppMgr
60
if
hasattr(AppMgr.ServiceMgr,
"EventSelector"
)
and
hasattr(AppMgr.ServiceMgr.EventSelector,
"InputCollections"
):
61
AppMgr.ServiceMgr.EventSelector.InputCollections = self.
StoredValue
62
63
pass
64
65
class
AllowIgnoreConfigError
(JobProperty):
66
"""Allow an algorithm to ignore return error code from upstream algorithm
67
and tools.
68
"""
69
statusOn =
True
70
allowedTypes = [
'bool'
]
71
StoredValue =
True
72
73
class
isOnline
(JobProperty):
74
""" Set to True when running online
75
"""
76
statusOn =
True
77
allowedTypes = [
'bool'
]
78
StoredValue =
False
79
80
81
84
class
AthenaCommonFlags
(JobPropertyContainer):
85
"""Container for the common flags
86
"""
87
pass
88
89
92
jobproperties.add_Container(AthenaCommonFlags)
93
94
97
jobproperties.AthenaCommonFlags.add_JobProperty(EvtMax)
98
jobproperties.AthenaCommonFlags.add_JobProperty(SkipEvents)
99
jobproperties.AthenaCommonFlags.add_JobProperty(FilesInput )
100
jobproperties.AthenaCommonFlags.add_JobProperty(AllowIgnoreConfigError)
101
jobproperties.AthenaCommonFlags.add_JobProperty(isOnline)
102
103
110
athenaCommonFlags = jobproperties.AthenaCommonFlags
python.AthenaCommonFlags.AllowIgnoreConfigError
Definition
AthenaCommonFlags.py:65
python.AthenaCommonFlags.AthenaCommonFlags
Definition
AthenaCommonFlags.py:84
python.AthenaCommonFlags.EvtMax
Definition
AthenaCommonFlags.py:35
python.AthenaCommonFlags.FilesInput
Definition
AthenaCommonFlags.py:49
python.AthenaCommonFlags.FilesInput.StoredValue
list StoredValue
Definition
AthenaCommonFlags.py:53
python.AthenaCommonFlags.FilesInput._do_action
_do_action(self, *args, **kwds)
Definition
AthenaCommonFlags.py:55
python.AthenaCommonFlags.SkipEvents
Definition
AthenaCommonFlags.py:41
python.AthenaCommonFlags.isOnline
Definition
AthenaCommonFlags.py:73
Generated on
for ATLAS Offline Software by
1.17.0