ATLAS Offline Software
Loading...
Searching...
No Matches
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
29from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
30from AthenaCommon.JobProperties import jobproperties
31
32
34
35class EvtMax(JobProperty):
36 """Number of events to process or generate"""
37 statusOn = False
38 allowedTypes = ['int']
39 StoredValue = 5
40
41class 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
49class 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
65class 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
73class isOnline(JobProperty):
74 """ Set to True when running online
75 """
76 statusOn = True
77 allowedTypes = ['bool']
78 StoredValue = False
79
80
81
84class AthenaCommonFlags(JobPropertyContainer):
85 """Container for the common flags
86 """
87 pass
88
89
92jobproperties.add_Container(AthenaCommonFlags)
93
94
97jobproperties.AthenaCommonFlags.add_JobProperty(EvtMax)
98jobproperties.AthenaCommonFlags.add_JobProperty(SkipEvents)
99jobproperties.AthenaCommonFlags.add_JobProperty(FilesInput )
100jobproperties.AthenaCommonFlags.add_JobProperty(AllowIgnoreConfigError)
101jobproperties.AthenaCommonFlags.add_JobProperty(isOnline)
102
103
110athenaCommonFlags = jobproperties.AthenaCommonFlags