ATLAS Offline Software
AllConfigFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.SystemOfUnits import GeV, TeV
4 from AthenaConfiguration.AthConfigFlags import AthConfigFlags, isGaudiEnv
5 from AthenaConfiguration.AutoConfigFlags import GetFileMD, getInitialTimeStampsFromRunNumbers, getRunToTimestampDict, getSpecialConfigurationMetadata, getGeneratorsInfo
6 from AthenaConfiguration.Enums import BeamType, Format, ProductionStep, BunchStructureSource, Project
7 from Campaigns.Utils import Campaign
8 from PyUtils.moduleExists import moduleExists
9 
10 
11 def _addFlagsCategory (acf, name, generator, modName = None):
12  """Add flags category and return True/False on success/failure"""
13  if moduleExists (modName):
14  acf.addFlagsCategory (name, generator)
15  return True
16  return False
17 
18 
20 
21  acf=AthConfigFlags()
22 
23  #Flags steering the job execution:
24  from AthenaCommon.Constants import INFO
25  acf.addFlag('Exec.OutputLevel', INFO, help='Global OutputLevel')
26  acf.addFlag('Exec.QuietMode', False, help='Suppress excess output for grid running')
27  acf.addFlag('Exec.PrintAlgsSequence', False, help='print algorithm sequence in ApplicationMgr')
28  acf.addFlag('Exec.MaxEvents', -1, type=int, help='number of events to proceess (-1 for all)')
29  acf.addFlag('Exec.SkipEvents', 0, type=int, help='number of events to skip')
30  acf.addFlag('Exec.FirstEvent', 1, type=int, help='first event number when not reading from input file')
31  acf.addFlag('Exec.DebugStage', '', help='attach debugger at stage: conf, init, exec, fini')
32  acf.addFlag('Exec.Interactive', "", help='interactive prompt at stage: init, exec')
33  acf.addFlag('Exec.FPE', 0, help='FPE check mode: -2 (no FPE check), -1 (abort with core-dump), 0 (FPE Auditor w/o stack-tace) , >0 (number of stack-traces printed by the job)')
34  acf.addFlag('Exec.EventTimeOut', 0, help='per-event timeout (in ns) after which the job is aborted (0 means no timeout)')
35  acf.addFlag('Exec.EventPrintoutInterval', 1, help='interval of event heartbeat printouts from the loop manager')
36 
37  #Custom messaging for components, see Utils.setupLoggingLevels
38  acf.addFlag('Exec.VerboseMessageComponents', [], help='verbose output for listed components (wildcards)')
39  acf.addFlag('Exec.DebugMessageComponents', [], help='debug output for listed components (wildcards)')
40  acf.addFlag('Exec.InfoMessageComponents', [], help='info output for listed components (wildcards)')
41  acf.addFlag('Exec.WarningMessageComponents', [], help='warning output for listed components (wildcards)')
42  acf.addFlag('Exec.ErrorMessageComponents', [], help='error output for listed components (wildcards)')
43 
44  #Multi-threaded event service mode
45  acf.addFlag('Exec.MTEventService', False, help='use multi-threaded event service')
46  acf.addFlag('Exec.MTEventServiceChannel', 'EventService_EventRanges', help='name of YAMPL communication channel between AthenaMT and pilot')
47 
48  #Activate per-event log-output of StoreGate content
49  acf.addFlag('Debug.DumpEvtStore', False, help='dump event store on each event')
50  acf.addFlag('Debug.DumpDetStore', False, help='dump detector store on each event')
51  acf.addFlag('Debug.DumpCondStore', False, help='dump conditions store on each event')
52 
53  acf.addFlag('ExecutorSplitting.TotalSteps', 0, help='number of steps for pileup overlay')
54  acf.addFlag('ExecutorSplitting.Step', -1, help='step number of current pileup overlay job')
55  acf.addFlag('ExecutorSplitting.TotalEvents', -1, help='events per pileup overlay step')
56 
57  #Flags describing the input data
58  acf.addFlag('Input.Files', ["_ATHENA_GENERIC_INPUTFILE_NAME_",], help='input files')
59  acf.addFlag("Input.FileNentries", -1, help='actual number of events in file (filled from runArgs')
60  acf.addFlag('Input.SecondaryFiles', [], help='secondary input files for DoubleEventSelector')
61  acf.addFlag('Input.isMC', lambda prevFlags : "IS_SIMULATION" in GetFileMD(prevFlags.Input.Files).get("eventTypes", []), help='Monte Carlo input')
62  acf.addFlag('Input.OverrideRunNumber', False, help='override run number' )
63  acf.addFlag("Input.ConditionsRunNumber", -1, help='override HITS file run number with one from a data') # TODO merge with Input.RunNumbers
64  acf.addFlag('Input.RunNumbers', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("runNumbers", [])), type=list, help='run numbers of input files')
65  acf.addFlag('Input.MCChannelNumber', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("mc_channel_number", 0), help='Monte Carlo channel number')
66  acf.addFlag('Input.LumiBlockNumbers', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("lumiBlockNumbers", [])), type=list, help='lumi block numbers of input files')
67  acf.addFlag('Input.TimeStamps', lambda prevFlags : getInitialTimeStampsFromRunNumbers(prevFlags.Input.RunNumbers) if prevFlags.Input.OverrideRunNumber else [], type=list, help='timestamps of inputs files')
68  # Configure EvtIdModifierSvc with a list of dictionaries of the form:
69  # {'run': 152166, 'lb': 202, 'starttstamp': 1269948352889940910, 'evts': 1, 'mu': 0.005}
70  acf.addFlag("Input.RunAndLumiOverrideList", [], help='list of dictionaries to configure EvtIdModifierSvc')
71  # Job number
72  acf.addFlag("Input.JobNumber", 1, help='job number for pileup overlay')
73  acf.addFlag('Input.FailOnUnknownCollections', False, help='fail on unknown collections in input load')
74 
75  def _dataYearFromFlags(prevFlags):
76  dataYear = GetFileMD(prevFlags.Input.Files).get("data_year", "")
77  if dataYear:
78  return int(dataYear)
79  if prevFlags.Input.ProjectName.startswith("data"):
80  return 2000 + int(prevFlags.Input.ProjectName[4:6])
81  return 0
82 
83  acf.addFlag('Input.ProjectName', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("project_name", ""), help='project name')
84  acf.addFlag('Input.DataYear', _dataYearFromFlags, help='year of input data')
85  acf.addFlag('Input.MCCampaign', lambda prevFlags : Campaign(GetFileMD(prevFlags.Input.Files).get("mc_campaign", "")), type=Campaign, help='Monte Carlo campaign')
86  acf.addFlag('Input.TriggerStream', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("stream", "") if prevFlags.Input.Format == Format.BS
87  else GetFileMD(prevFlags.Input.Files).get("triggerStreamOfFile", ""), help='trigger stream name')
88  acf.addFlag('Input.Format', lambda prevFlags : Format.BS if GetFileMD(prevFlags.Input.Files).get("file_type", "BS") == "BS" else Format.POOL, type=Format, help='input format type')
89  acf.addFlag('Input.ProcessingTags', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("processingTags", []), help='list of stream names in this file')
90  acf.addFlag('Input.GeneratorsInfo', lambda prevFlags : getGeneratorsInfo(prevFlags), help='generator version')
91  acf.addFlag('Input.SpecialConfiguration', lambda prevFlags : getSpecialConfigurationMetadata(prevFlags), help='special configuration options read from input file metadata')
92 
93  def _inputCollections(inputFile):
94  rawCollections = [type_key[1] for type_key in GetFileMD(inputFile).get("itemList", [])]
95  collections = [col for col in rawCollections if not col.endswith('Aux.')]
96  return collections
97 
98  def _typedInputCollections(inputFile):
99  collections = ['%s#%s' % type_key for type_key in GetFileMD(inputFile).get("itemList", [])]
100  return collections
101 
102  acf.addFlag('Input.Collections', lambda prevFlags : _inputCollections(prevFlags.Input.Files), help='input collections')
103  acf.addFlag('Input.SecondaryCollections', lambda prevFlags : _inputCollections(prevFlags.Input.SecondaryFiles), help='secondary input collections for overlay')
104  acf.addFlag('Input.TypedCollections', lambda prevFlags : _typedInputCollections(prevFlags.Input.Files), help='input collections key#type')
105  acf.addFlag('Input.SecondaryTypedCollections', lambda prevFlags : _typedInputCollections(prevFlags.Input.SecondaryFiles), help='secondary input collections key#type')
106 
107  def _metadataItems(inputFile):
108  return GetFileMD(inputFile).get("metadata_items", {})
109 
110  acf.addFlag('Input.MetadataItems', lambda prevFlags : _metadataItems(prevFlags.Input.Files), help='metadata items in input' )
111  acf.addFlag('Input.Release', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("AtlasRelease", ""), help='release of input file')
112  acf.addFlag('Input.AODFixesDone', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("AODFixVersion", ""), help='set of already applied AODFixes')
113 
114  acf.addFlag('Concurrency.NumProcs', 0, help='number of concurrent processes')
115  acf.addFlag('Concurrency.NumThreads', 0, help='number of threads' )
116  acf.addFlag('Concurrency.NumConcurrentEvents', lambda prevFlags : prevFlags.Concurrency.NumThreads, help='number of concurrent events')
117  acf.addFlag('Concurrency.DebugWorkers', False, help='stops the worker in bootstrap until SIGUSR1 is received')
118 
119  acf.addFlag('Scheduler.CheckDependencies', True, help='runtime check of algorithm input dependencies')
120  acf.addFlag('Scheduler.CheckOutputUsage', False, help='runtime check of algorithm output usage')
121  acf.addFlag('Scheduler.ShowDataDeps', False, help='show data dependencies')
122  acf.addFlag('Scheduler.ShowDataFlow', False, help='show data flow')
123  acf.addFlag('Scheduler.ShowControlFlow', False, help='show data flow')
124  acf.addFlag('Scheduler.EnableVerboseViews', True, help='enable verbose view output')
125  acf.addFlag('Scheduler.AutoLoadUnmetDependencies', True, help='auto-load unmet data dependencies')
126 
127  acf.addFlag('MP.WorkerTopDir', 'athenaMP_workers', help='work directory for MP workers')
128  acf.addFlag('MP.OutputReportFile', 'AthenaMPOutputs', help='name of MP report file')
129  acf.addFlag('MP.Strategy', 'SharedQueue', help='event assignment strategy')
130  acf.addFlag('MP.CollectSubprocessLogs', False, help='collects log of sub-processes')
131  acf.addFlag('MP.PollingInterval', 100, help='time interval in milliseconds between subsequent polling of subproceses')
132  acf.addFlag('MP.EventsBeforeFork', 0, help='number of events to process before forking')
133  acf.addFlag('MP.EventRangeChannel', 'EventService_EventRanges', help='channel name for communicating event ranges with the pilot')
134  acf.addFlag('MP.EvtRangeScattererCaching', False, help='activate extra event caching by the EvtRangeScatterer')
135  acf.addFlag('MP.MemSamplingInterval', 0, help='time interval in seconds between taking memory samples')
136  acf.addFlag('MP.ChunkSize', -1, help='size of event chunks in shared queue (-1: auto_flush for LZMA-compressed files, -2: auto_flush for LZMA or ZLIB, -3: auto_flush for LZMA, ZLIB or LZ4, -4: auto_flush)')
137  acf.addFlag('MP.ReadEventOrders', False, help='read event order from ASCII file for reproducibility')
138  acf.addFlag('MP.EventOrdersFile', 'athenamp_eventorders.txt', help='file name for event order')
139  acf.addFlag('MP.UseSharedReader', False, help='use shared reader')
140  acf.addFlag('MP.UseSharedWriter', False, help='use shared writer')
141  acf.addFlag('MP.UseParallelCompression', True, help='enable event compression in workers')
142 
143  acf.addFlag('Common.MsgSuppression', True, help='enable log message suppression')
144  acf.addFlag('Common.MsgSourceLength', 50, help='length of the source-field in the log message format')
145  acf.addFlag('Common.ShowMsgStats', False ,help='print message statistics at the end of the job')
146 
147  acf.addFlag('Common.isOnline', False, help='job runs in an online environment')
148  acf.addFlag('Common.useOnlineLumi', lambda prevFlags : prevFlags.Common.isOnline, help='use online version of luminosity')
149  acf.addFlag('Common.isOverlay', lambda prevFlags: (prevFlags.Common.ProductionStep == ProductionStep.Overlay or
150  (prevFlags.Common.ProductionStep == ProductionStep.FastChain and
151  prevFlags.Overlay.FastChain)),
152  help='enable overlay')
153  acf.addFlag('Common.doExpressProcessing', False, help='do express stream processing')
154  acf.addFlag('Common.ProductionStep', ProductionStep.Default, type=ProductionStep, help='production step')
155  acf.addFlag('Common.Project', Project.determine(), type=Project, help='current athena software project')
156 
157  # replace global.Beam*
158  acf.addFlag('Beam.BunchSpacing', 25, help='bunch spacing in nanoseconds')
159  acf.addFlag('Beam.Type', lambda prevFlags : BeamType(GetFileMD(prevFlags.Input.Files).get('beam_type', 'collisions')), type=BeamType, help='beam type')
160  acf.addFlag("Beam.NumberOfCollisions", lambda prevFlags : 2. if prevFlags.Beam.Type is BeamType.Collisions else 0., help='number of pileup collisions')
161 
162  def _configureBeamEnergy(prevFlags):
163  metadata = GetFileMD(prevFlags.Input.Files)
164  default = 6.8 * TeV
165  # pool files
166  if prevFlags.Input.Format == Format.POOL:
167  return float(metadata.get("beam_energy", default))
168  # BS files
169  elif prevFlags.Input.Format == Format.BS:
170  if metadata.get("eventTypes", [""])[0] == "IS_DATA":
171  # special option for online running
172  if prevFlags.Common.isOnline:
173  from PyUtils.OnlineISConfig import GetRunType
174 
175  return float(GetRunType()[1] or default)
176 
177  # configure Beam energy depending on beam type:
178  if prevFlags.Beam.Type.value == "cosmics":
179  return 0.0
180  elif prevFlags.Beam.Type.value == "singlebeam":
181  return 450.0 * GeV
182  elif prevFlags.Beam.Type.value == "collisions":
183  projectName = prevFlags.Input.ProjectName
184  beamEnergy = None
185 
186  if "GeV" in projectName:
187  beamEnergy = (
188  float(
189  (str(projectName).split("_")[1]).replace("GeV", "", 1)
190  )
191  / 2
192  * GeV
193  )
194  elif "TeV" in projectName:
195  if "hip5TeV" in projectName:
196  # Approximate 'beam energy' here as sqrt(sNN)/2.
197  beamEnergy = 1.577 * TeV
198  elif "hip8TeV" in projectName:
199  # Approximate 'beam energy' here as sqrt(sNN)/2.
200  beamEnergy = 2.51 * TeV
201  else:
202  beamEnergy = (
203  float(
204  (str(projectName).split("_")[1])
205  .replace("TeV", "", 1)
206  .replace("p", ".")
207  )
208  / 2
209  * TeV
210  )
211  if "5TeV" in projectName:
212  # these are actually sqrt(s) = 5.02 TeV
213  beamEnergy = 2.51 * TeV
214  elif projectName.endswith("_hi") or projectName.endswith("_hip"):
215  if projectName in ("data10_hi", "data11_hi"):
216  beamEnergy = 1.38 * TeV # 1.38 TeV (=3.5 TeV * (Z=82/A=208))
217  elif projectName == "data12_hi":
218  beamEnergy = 1.577 * TeV # 1.577 TeV (=4 TeV * (Z=82/A=208))
219  elif projectName in ("data12_hip", "data13_hip"):
220  # Pb (p) Beam energy in p-Pb collisions in 2012/3 was 1.577 (4) TeV.
221  # Approximate 'beam energy' here as sqrt(sNN)/2.
222  beamEnergy = 2.51 * TeV
223  elif projectName in ("data15_hi", "data18_hi"):
224  beamEnergy = 2.51 * TeV # 2.51 TeV (=6.37 TeV * (Z=82/A=208)) - lowered to 6.37 to match s_NN = 5.02 in Pb-p runs.
225  elif projectName == "data17_hi":
226  beamEnergy = 2.721 * TeV # 2.72 TeV for Xe-Xe (=6.5 TeV * (Z=54/A=129))
227  return beamEnergy or default
228  elif metadata.get("eventTypes", [""])[0] == "IS_SIMULATION":
229  return float(metadata.get("beam_energy", default))
230  return default
231 
232 
233  acf.addFlag('Beam.Energy', lambda prevFlags : _configureBeamEnergy(prevFlags), help='beam energy in MeV')
234  acf.addFlag('Beam.estimatedLuminosity', lambda prevFlags : ( 1E33*(prevFlags.Beam.NumberOfCollisions)/2.3 ) *\
235  (25./prevFlags.Beam.BunchSpacing), help='luminosity estimated from pileup')
236  acf.addFlag('Beam.BunchStructureSource', lambda prevFlags: BunchStructureSource.MC if prevFlags.Input.isMC else BunchStructureSource.TrigConf, help='source of bunch structure')
237 
238  # output
239  acf.addFlag('Output.EVNTFileName', '', help='EVNT output file name')
240  acf.addFlag('Output.EVNT_TRFileName', '', help='EVNT_TR output file name')
241  acf.addFlag('Output.HITSFileName', '', help='HITS output file name')
242  acf.addFlag('Output.RDOFileName', '', help='RDO output file name')
243  acf.addFlag('Output.RDO_SGNLFileName', '', help='RDO_SGNL output file name')
244  acf.addFlag('Output.ESDFileName', '', help='ESD output file name')
245  acf.addFlag('Output.AODFileName', '', help='AOD output file name')
246  acf.addFlag('Output.HISTFileName', '', help='HIST output file name')
247 
248  acf.addFlag('Output.doWriteEVNT', lambda prevFlags: bool(prevFlags.Output.EVNTFileName), help='write EVNT file')
249  acf.addFlag('Output.doWriteEVNT_TR', lambda prevFlags: bool(prevFlags.Output.EVNT_TRFileName), help='write EVNT_TR file')
250  acf.addFlag('Output.doWriteHITS', lambda prevFlags: bool(prevFlags.Output.HITSFileName), help='write HITS file')
251  acf.addFlag('Output.doWriteRDO', lambda prevFlags: bool(prevFlags.Output.RDOFileName), help='write RDO file')
252  acf.addFlag('Output.doWriteRDO_SGNL', lambda prevFlags: bool(prevFlags.Output.RDO_SGNLFileName), help='write RDO_SGNL file')
253  acf.addFlag('Output.doWriteESD', lambda prevFlags: bool(prevFlags.Output.ESDFileName), help='write ESD file')
254  acf.addFlag('Output.doWriteAOD', lambda prevFlags: bool(prevFlags.Output.AODFileName), help='write AOD file')
255  acf.addFlag('Output.doWriteBS', False, help='write bytestream file')
256  acf.addFlag('Output.doWriteDAOD', False, help='write at least one DAOD file')
257  acf.addFlag('Output.doJiveXML', False, help='write JiveXML file')
258 
259  acf.addFlag('Output.OneDataHeaderForm', False, help="Write only a single common DataHeaderForm per stream")
260  acf.addFlag('Output.TreeAutoFlush', {}, help="dict with auto-flush settings for stream e.g. {'STREAM': 123}")
261  acf.addFlag('Output.TemporaryStreams', [], help='list of output streams that are marked temporary')
262  acf.addFlag('Output.StorageTechnology.EventData', 'ROOTTREEINDEX', help='set the underlying POOL storage technology for event data')
263  acf.addFlag('Output.StorageTechnology.MetaData', 'ROOTTREE', help='set the underlying POOL storage technology for metadata')
264 
265  # Might move this elsewhere in the future.
266  # Some flags from https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/TrkDetDescrJobProperties.py
267  # (many, e.g. those that set properties of one tool are not needed)
268  acf.addFlag('TrackingGeometry.MagneticFileMode', 6) # TODO: unused?
269  acf.addFlag('TrackingGeometry.MaterialSource', 'COOL', help='material source (COOL, Input or None)')
270 
271 #Detector Flags:
272  def __detector():
273  from AthenaConfiguration.DetectorConfigFlags import createDetectorConfigFlags
275  acf.addFlagsCategory( "Detector", __detector )
276 
277 #Simulation Flags:
278  def __simulation():
279  from SimulationConfig.SimConfigFlags import createSimConfigFlags
280  return createSimConfigFlags()
281  _addFlagsCategory (acf, "Sim", __simulation, 'SimulationConfig' )
282 
283 #Test Beam Simulation Flags:
284  def __testbeam():
285  from SimulationConfig.TestBeamConfigFlags import createTestBeamConfigFlags
287  _addFlagsCategory (acf, "TestBeam", __testbeam, 'SimulationConfig' )
288 
289 #Digitization Flags:
290  def __digitization():
291  from DigitizationConfig.DigitizationConfigFlags import createDigitizationCfgFlags
293  _addFlagsCategory(acf, "Digitization", __digitization, 'DigitizationConfig' )
294 
295 #Overlay Flags:
296  def __overlay():
297  from OverlayConfiguration.OverlayConfigFlags import createOverlayConfigFlags
298  return createOverlayConfigFlags()
299  _addFlagsCategory(acf, "Overlay", __overlay, 'OverlayConfiguration' )
300 
301 #Geo Model Flags:
302  def __geomodel():
303  from AthenaConfiguration.GeoModelConfigFlags import createGeoModelConfigFlags
304  return createGeoModelConfigFlags(not isGaudiEnv() or acf.Common.Project is Project.AthAnalysis)
305  acf.addFlagsCategory( "GeoModel", __geomodel )
306 
307 #Reco Flags:
308  def __reco():
309  from RecJobTransforms.RecoConfigFlags import createRecoConfigFlags
310  return createRecoConfigFlags()
311  _addFlagsCategory(acf, "Reco", __reco, 'RecJobTransforms')
312 
313 #Generator Flags:
314  def __generators():
315  from GeneratorConfig.GeneratorConfigFlags import createGeneratorConfigFlags
317  _addFlagsCategory(acf, "Generator", __generators, 'GeneratorConfig')
318 
319 #IOVDbSvc Flags:
320  if isGaudiEnv():
321  from IOVDbSvc.IOVDbAutoCfgFlags import getLastGlobalTag, getDatabaseInstanceDefault
322 
323  def __getTrigTag(flags):
324  from TriggerJobOpts.TriggerConfigFlags import trigGlobalTag
325  return trigGlobalTag(flags)
326 
327  acf.addFlag("IOVDb.GlobalTag", lambda flags :
328  (__getTrigTag(flags) if flags.Trigger.doLVL1 or flags.Trigger.doHLT else None) or
329  getLastGlobalTag(flags), help='global conditions tag')
330 
331  acf.addFlag("IOVDb.DatabaseInstance", getDatabaseInstanceDefault, help='conditions DB instance')
332 
333  # Run dependent simulation
334  acf.addFlag("IOVDb.RunToTimestampDict", lambda prevFlags: getRunToTimestampDict(), help='runNumber to timestamp map')
335  acf.addFlag("IOVDb.DBConnection", lambda prevFlags : "sqlite://;schema=mycool.db;dbname=" + prevFlags.IOVDb.DatabaseInstance, help='default DB connection string')
336  acf.addFlag("IOVDb.CrestServer", "http://crest-undertow-api.web.cern.ch", help="CREST server URL")
337 
338  #For HLT-jobs, the ring-size should be 0 (eg no cleaning at all since there are no IOV-updates during the job)
339  acf.addFlag("IOVDb.CleanerRingSize",lambda prevFlags : 0 if prevFlags.Trigger.doHLT else 2*max(1, prevFlags.Concurrency.NumConcurrentEvents), help='size of ring-buffer for conditions cleaner')
340  acf.addFlag("IOVDb.SqliteInput","",help="Folders found in this file will be used instead of the production db")
341  acf.addFlag("IOVDb.SqliteFolders",(),help="Folders listed here will be taken from the IOVDb.SqliteInput file instead of the production db. If empty, all folders found in the file are used.")
342 #PoolSvc Flags:
343  acf.addFlag("PoolSvc.MaxFilesOpen", lambda prevFlags : 2 if prevFlags.MP.UseSharedReader else 0, help='maximum number of open files')
344 
345 
346  def __bfield():
347  from MagFieldConfig.BFieldConfigFlags import createBFieldConfigFlags
348  return createBFieldConfigFlags()
349  _addFlagsCategory(acf, "BField", __bfield, 'MagFieldConfig')
350 
351  def __lar():
352  from LArConfiguration.LArConfigFlags import createLArConfigFlags
353  return createLArConfigFlags()
354  _addFlagsCategory(acf, "LAr", __lar, 'LArConfiguration' )
355 
356  def __tile():
357  from TileConfiguration.TileConfigFlags import createTileConfigFlags
358  return createTileConfigFlags()
359  _addFlagsCategory(acf, 'Tile', __tile, 'TileConfiguration' )
360 
361 
362  def __calo():
363  from CaloRec.CaloConfigFlags import createCaloConfigFlags
364  return createCaloConfigFlags()
365  _addFlagsCategory(acf, 'Calo', __calo, 'CaloRec' )
366 
367 #Random engine Flags:
368  acf.addFlag("Random.Engine", "dSFMT", help='random number service ("dSFMT", "Ranlux64", "Ranecu")')
369  acf.addFlag("Random.SeedOffset", 0, help='seed offset') # TODO replace usage of Digitization.RandomSeedOffset with this flag
370 
371  def __trigger():
372  from TriggerJobOpts.TriggerConfigFlags import createTriggerFlags
373  return createTriggerFlags(acf.Common.Project is not Project.AthAnalysis)
374 
375  added = _addFlagsCategory(acf, "Trigger", __trigger, 'TriggerJobOpts' )
376  if not added:
377  # If TriggerJobOpts is not available, we add at least these basic flags
378  # to indicate Trigger is not available:
379  acf.addFlag('Trigger.doLVL1', False, help='enable L1 simulation')
380  acf.addFlag('Trigger.doHLT', False, help='run HLT selection algorithms')
381 
382  def __indet():
383  from InDetConfig.InDetConfigFlags import createInDetConfigFlags
384  return createInDetConfigFlags()
385  _addFlagsCategory(acf, "InDet", __indet, 'InDetConfig' )
386 
387  def __itk():
388  from InDetConfig.ITkConfigFlags import createITkConfigFlags
389  return createITkConfigFlags()
390  _addFlagsCategory(acf, "ITk", __itk, 'InDetConfig' )
391 
392  def __tracking():
393  from TrkConfig.TrkConfigFlags import createTrackingConfigFlags
395  _addFlagsCategory(acf, "Tracking", __tracking, 'TrkConfig')
396 
397  def __trackoverlay():
398  from TrackOverlayConfig.TrackOverlayConfigFlags import createTrackOverlayConfigFlags
400  _addFlagsCategory(acf, "TrackOverlay", __trackoverlay, 'TrackOverlayConfig')
401 
402  def __acts():
403  from ActsConfig.ActsConfigFlags import createActsConfigFlags
404  return createActsConfigFlags()
405  _addFlagsCategory(acf, "Acts", __acts, 'ActsConfig')
406 
407  def __hgtd():
408  from HGTD_Config.HGTD_ConfigFlags import createHGTD_ConfigFlags
409  return createHGTD_ConfigFlags()
410  _addFlagsCategory(acf, "HGTD", __hgtd, 'HGTD_Config' )
411 
412  def __muon():
413  from MuonConfig.MuonConfigFlags import createMuonConfigFlags
414  return createMuonConfigFlags()
415  _addFlagsCategory(acf, "Muon", __muon, 'MuonConfig' )
416 
417  def __muoncombined():
418  from MuonCombinedConfig.MuonCombinedConfigFlags import createMuonCombinedConfigFlags
420  _addFlagsCategory(acf, "MuonCombined", __muoncombined, 'MuonCombinedConfig' )
421 
422  def __egamma():
423  from egammaConfig.egammaConfigFlags import createEgammaConfigFlags
424  return createEgammaConfigFlags()
425  _addFlagsCategory(acf, "Egamma", __egamma, 'egammaConfig' )
426 
427  def __met():
428  from METReconstruction.METConfigFlags import createMETConfigFlags
429  return createMETConfigFlags()
430  _addFlagsCategory(acf,"MET",__met, 'METReconstruction')
431 
432  def __jet():
433  from JetRecConfig.JetConfigFlags import createJetConfigFlags
434  return createJetConfigFlags()
435  _addFlagsCategory(acf,"Jet",__jet, 'JetRecConfig')
436 
437  def __ufo():
438  from TrackCaloClusterRecTools.UFOConfigFlags import createUFOConfigFlags
439  return createUFOConfigFlags()
440  _addFlagsCategory(acf,"UFO",__ufo, 'TrackCaloClusterRecTools')
441 
442  def __tau():
443  from tauRec.TauConfigFlags import createTauConfigFlags
444  return createTauConfigFlags()
445  _addFlagsCategory(acf, "Tau",__tau, 'tauRec')
446 
447  def __ditau():
448  from DiTauRec.DiTauConfigFlags import createDiTauConfigFlags
449  return createDiTauConfigFlags()
450  _addFlagsCategory(acf, "DiTau",__ditau, 'DiTauRec')
451 
452  def __pflow():
453  from eflowRec.PFConfigFlags import createPFConfigFlags
454  return createPFConfigFlags()
455  _addFlagsCategory(acf,"PF",__pflow, 'eflowRec')
456 
457  def __btagging():
458  from JetTagConfig.BTaggingConfigFlags import createBTaggingConfigFlags
460  _addFlagsCategory(acf,"BTagging",__btagging, 'JetTagConfig')
461 
462  def __hi():
463  from HIRecConfig.HIRecConfigFlags import createHIRecConfigFlags
464  return createHIRecConfigFlags()
465  _addFlagsCategory(acf, "HeavyIon", __hi, "HIRecConfig")
466 
467  def __onlineED():
468  from EventDisplaysOnline.EventDisplaysOnlineFlags import createOnlineEventDisplayFlags
470  _addFlagsCategory(acf, "OnlineEventDisplays", __onlineED, 'EventDisplaysOnline' )
471 
472  def __dq():
473  from AthenaMonitoring.DQConfigFlags import createDQConfigFlags
474  dqf = createDQConfigFlags()
475  return dqf
476  _addFlagsCategory(acf, "DQ", __dq, 'AthenaMonitoring' )
477 
478  def __perfmon():
479  from PerfMonComps.PerfMonConfigFlags import createPerfMonConfigFlags
480  return createPerfMonConfigFlags()
481  _addFlagsCategory(acf, "PerfMon", __perfmon, 'PerfMonComps')
482 
483  def __physVal():
484  from PhysValMonitoring.PhysValFlags import createPhysValConfigFlags
485  return createPhysValConfigFlags()
486  _addFlagsCategory(acf, "PhysVal", __physVal , "PhysValMonitoring")
487 
488  def __caloRinger():
489  from CaloRingerAlgs.CaloRingerFlags import createCaloRingerConfigFlags
491  _addFlagsCategory(acf, "CaloRinger", __caloRinger, 'CaloRingerAlgs' )
492 
493  def __caloGPU():
494  from CaloRecGPU.CaloRecGPUFlags import createFlagsCaloRecGPU
495  return createFlagsCaloRecGPU()
496  _addFlagsCategory(acf, "CaloRecGPU", __caloGPU, 'CaloRecGPU' )
497 
498 
499 #egamma derivation Flags:
500  def __egammaDerivation():
501  from DerivationFrameworkEGamma.EGammaDFConfigFlags import createEGammaDFConfigFlags
503  _addFlagsCategory(acf, "Derivation.Egamma", __egammaDerivation, 'DerivationFrameworkEGamma' )
504 
505 #llp derivation Flags:
506  def __llpDerivation():
507  from DerivationFrameworkLLP.LLPDFConfigFlags import createLLPDFConfigFlags
508  return createLLPDFConfigFlags()
509  _addFlagsCategory(acf, "Derivation.LLP", __llpDerivation, 'DerivationFrameworkLLP' )
510 
511  # Trigger derivation flags
512  def __triggerDerivation():
513  from DerivationFrameworkTrigger.TriggerDFConfigFlags import createTriggerDFConfigFlags
515  _addFlagsCategory(acf, "Derivation.Trigger", __triggerDerivation, 'DerivationFrameworkTrigger')
516 
517  # onnxruntime flags
518  def __onnxruntime():
519  from AthOnnxComps.OnnxRuntimeFlags import createOnnxRuntimeFlags
520  return createOnnxRuntimeFlags()
521  _addFlagsCategory(acf, "AthOnnx", __onnxruntime, 'AthOnnxComps')
522 
523  # For AnalysisBase, pick up things grabbed in Athena by the functions above
524  if not isGaudiEnv():
525  def EDMVersion(flags):
526  # POOL files: decide based on HLT output type present in the file
527  default_version = 3
528  collections = flags.Input.Collections
529  if "HLTResult_EF" in collections:
530  return 1
531  elif "TrigNavigation" in collections:
532  return 2
533  elif any("HLTNav_Summary" in s for s in collections):
534  return 3
535  elif not flags.Input.Collections:
536  # Special case for empty input files (can happen in merge jobs on the grid)
537  # The resulting version doesn't really matter as there's nothing to be done, but we want a valid configuration
538  return 3
539 
540  return default_version
541  acf.addFlag('Trigger.EDMVersion', lambda prevFlags: EDMVersion(prevFlags),
542  help='Trigger EDM version (determined by input file or set to the version to be produced)')
543 
544  return acf
545 
546 
547 if __name__=="__main__":
548  from AthenaConfiguration.TestDefaults import defaultTestFiles
549  flags = initConfigFlags()
550  import sys
551  if len(sys.argv) > 1:
552  flags.Input.Files = sys.argv[1:]
553  else:
554  flags.Input.Files = defaultTestFiles.AOD_RUN3_DATA
555 
556  flags.loadAllDynamicFlags()
557  flags.initAll()
558  flags.dump()
python.PerfMonConfigFlags.createPerfMonConfigFlags
def createPerfMonConfigFlags()
Definition: PerfMonConfigFlags.py:5
python.ZdcRecConfig.EDMVersion
EDMVersion
Definition: ZdcRecConfig.py:376
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.HIRecConfigFlags.createHIRecConfigFlags
def createHIRecConfigFlags()
Definition: HIRecConfigFlags.py:6
python.TrkConfigFlags.createTrackingConfigFlags
def createTrackingConfigFlags()
Definition: TrkConfigFlags.py:59
python.CaloConfigFlags.createCaloConfigFlags
def createCaloConfigFlags()
Definition: CaloConfigFlags.py:6
python.LLPDFConfigFlags.createLLPDFConfigFlags
def createLLPDFConfigFlags()
Definition: LLPDFConfigFlags.py:8
SystemOfUnits
python.AutoConfigFlags.getGeneratorsInfo
def getGeneratorsInfo(flags)
Definition: AutoConfigFlags.py:209
max
#define max(a, b)
Definition: cfImp.cxx:41
python.OnlineISConfiguration.GetRunType
def GetRunType()
Definition: OnlineISConfiguration.py:16
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TauConfigFlags.createTauConfigFlags
def createTauConfigFlags()
Definition: TauConfigFlags.py:8
python.BFieldConfigFlags.createBFieldConfigFlags
def createBFieldConfigFlags()
Definition: BFieldConfigFlags.py:31
EventDisplaysOnlineFlags.createOnlineEventDisplayFlags
def createOnlineEventDisplayFlags()
Definition: EventDisplaysOnlineFlags.py:5
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True)
Definition: AutoConfigFlags.py:51
python.RecoConfigFlags.createRecoConfigFlags
def createRecoConfigFlags()
Definition: RecoConfigFlags.py:26
python.TriggerConfigFlags.trigGlobalTag
def trigGlobalTag(flags)
Definition: TriggerConfigFlags.py:21
python.DetectorConfigFlags.createDetectorConfigFlags
def createDetectorConfigFlags()
Definition: DetectorConfigFlags.py:26
python.egammaConfigFlags.createEgammaConfigFlags
def createEgammaConfigFlags()
Definition: egammaConfigFlags.py:6
python.OnnxRuntimeFlags.createOnnxRuntimeFlags
def createOnnxRuntimeFlags()
Definition: OnnxRuntimeFlags.py:19
python.EGammaDFConfigFlags.createEGammaDFConfigFlags
def createEGammaDFConfigFlags()
Definition: EGammaDFConfigFlags.py:8
TrackOverlayConfigFlags.createTrackOverlayConfigFlags
def createTrackOverlayConfigFlags()
Definition: TrackOverlayConfigFlags.py:4
python.JetConfigFlags.createJetConfigFlags
def createJetConfigFlags()
Definition: JetConfigFlags.py:8
BTaggingConfigFlags.createBTaggingConfigFlags
def createBTaggingConfigFlags()
Definition: BTaggingConfigFlags.py:97
python.IOVDbAutoCfgFlags.getLastGlobalTag
def getLastGlobalTag(prevFlags)
Definition: IOVDbAutoCfgFlags.py:6
METConfigFlags.createMETConfigFlags
def createMETConfigFlags()
Definition: METConfigFlags.py:5
CaloRingerFlags.createCaloRingerConfigFlags
def createCaloRingerConfigFlags()
Definition: CaloRingerFlags.py:5
CBNT_TBInfo.BeamType
BeamType
Definition: CBNT_TBInfo.py:29
python.ITkConfigFlags.createITkConfigFlags
def createITkConfigFlags()
Definition: ITkConfigFlags.py:7
python.SimConfigFlags.createSimConfigFlags
def createSimConfigFlags()
Definition: SimConfigFlags.py:12
python.InDetConfigFlags.createInDetConfigFlags
def createInDetConfigFlags()
Definition: InDetConfigFlags.py:8
python.MuonConfigFlags.createMuonConfigFlags
def createMuonConfigFlags()
Definition: MuonConfigFlags.py:40
python.TileConfigFlags.createTileConfigFlags
def createTileConfigFlags()
Definition: TileConfigFlags.py:42
python.HGTD_ConfigFlags.createHGTD_ConfigFlags
def createHGTD_ConfigFlags()
Definition: HGTD_ConfigFlags.py:5
PFConfigFlags.createPFConfigFlags
def createPFConfigFlags()
Definition: PFConfigFlags.py:5
Constants
some useful constants -------------------------------------------------—
python.GeneratorConfigFlags.createGeneratorConfigFlags
def createGeneratorConfigFlags()
Definition: GeneratorConfigFlags.py:9
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.AthConfigFlags.isGaudiEnv
def isGaudiEnv()
Definition: AthConfigFlags.py:14
python.GeoModelConfigFlags.createGeoModelConfigFlags
def createGeoModelConfigFlags(analysis=False)
Definition: GeoModelConfigFlags.py:7
python.AllConfigFlags._addFlagsCategory
def _addFlagsCategory(acf, name, generator, modName=None)
Definition: AllConfigFlags.py:11
DiTauConfigFlags.createDiTauConfigFlags
def createDiTauConfigFlags()
Definition: DiTauConfigFlags.py:6
python.DigitizationConfigFlags.createDigitizationCfgFlags
def createDigitizationCfgFlags()
Definition: DigitizationConfigFlags.py:33
ActsConfigFlags.createActsConfigFlags
def createActsConfigFlags()
Definition: ActsConfigFlags.py:31
python.AutoConfigFlags.getRunToTimestampDict
def getRunToTimestampDict()
Definition: AutoConfigFlags.py:193
python.LArConfigFlags.createLArConfigFlags
def createLArConfigFlags()
Definition: LArConfigFlags.py:13
CaloRecGPUFlags.createFlagsCaloRecGPU
def createFlagsCaloRecGPU()
Definition: CaloRecGPUFlags.py:6
python.OverlayConfigFlags.createOverlayConfigFlags
def createOverlayConfigFlags()
Definition: OverlayConfigFlags.py:9
python.DQConfigFlags.createDQConfigFlags
def createDQConfigFlags()
Definition: DQConfigFlags.py:35
TriggerDFConfigFlags.createTriggerDFConfigFlags
def createTriggerDFConfigFlags()
Definition: TriggerDFConfigFlags.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.AutoConfigFlags.getInitialTimeStampsFromRunNumbers
def getInitialTimeStampsFromRunNumbers(runNumbers)
Definition: AutoConfigFlags.py:199
python.MuonCombinedConfigFlags.createMuonCombinedConfigFlags
def createMuonCombinedConfigFlags()
Definition: MuonCombinedConfigFlags.py:6
PhysValFlags.createPhysValConfigFlags
def createPhysValConfigFlags()
Definition: PhysValFlags.py:3
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.TriggerConfigFlags.createTriggerFlags
def createTriggerFlags(doTriggerRecoFlags)
Definition: TriggerConfigFlags.py:34
str
Definition: BTagTrackIpAccessor.cxx:11
python.TestBeamConfigFlags.createTestBeamConfigFlags
def createTestBeamConfigFlags()
Definition: TestBeamConfigFlags.py:7
UFOConfigFlags.createUFOConfigFlags
def createUFOConfigFlags()
Definition: UFOConfigFlags.py:5
python.AutoConfigFlags.getSpecialConfigurationMetadata
def getSpecialConfigurationMetadata(flags)
Definition: AutoConfigFlags.py:225
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38