ATLAS Offline Software
TriggerConfigFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 import os
4 
5 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
6 from AthenaConfiguration.Enums import FlagEnum, Format, LHCPeriod
7 from AthenaCommon.Logging import logging
8 
9 log=logging.getLogger('TriggerConfigFlags')
10 
11 class ROBPrefetching(FlagEnum):
12  # Enable mapping step InputMaker outputs as ROBPrefetchingAlg inputs
13  StepRoI = 'StepRoI'
14  # Enable mapping chains' first step to pre-HLT prefetching rules based on initial RoIs
15  InitialRoI = 'InitialRoI'
16  # Enable using larger RoI in TauCore step to speculatively prefetch ROBs for the subsequent TauIso step (ATR-26419)
17  TauCoreLargeRoI = 'TauCoreLargeRoI'
18 
19 
20 def trigGlobalTag(flags):
21  """Return global conditions data to be used in the HLT. Return None to indicate that
22  no trigger-specific tag is required. Used for IOVDb.GlobalTag in AllConfigFlags.py.
23  """
24  return None if flags.Input.isMC else 'CONDBR2-HLTP-2025-01'
25 
26 def trigGeoTag(flags):
27  """Return geometry tag to be used in the HLT. Returns None to indicate that
28  no trigger-specific tag is required. Used for GeoModel.AtlasVersion in GeoModelConfigFlags.py.
29  """
30  return None if flags.Input.isMC else 'ATLAS-R3S-2021-03-02-00'
31 
32 
33 def createTriggerFlags(doTriggerRecoFlags):
34  flags = AthConfigFlags()
35 
36  flags.addFlag('Trigger.doLVL1', lambda prevFlags: prevFlags.Input.isMC,
37  help='enable L1 simulation')
38 
39  flags.addFlag('Trigger.doHLT', False,
40  help='run HLT selection algorithms')
41 
42  flags.addFlag("Trigger.forceEnableAllChains", lambda prevFlags: prevFlags.GeoModel.Run >= LHCPeriod.Run4,
43  help='always enable all configured chains (for testing). Currently enabled by default for Run 4.')
44 
45  flags.addFlag("Trigger.disableL1ConsistencyChecker", False,
46  help='force disabling the L1 ConsistencyChecker')
47 
48  flags.addFlag('Trigger.enableL0Muon',
49  lambda prevFlags: prevFlags.GeoModel.Run >= LHCPeriod.Run4,
50  help='enable Run-4+ L0 Muon simulation or decoding')
51 
52  flags.addFlag('Trigger.enableL1MuonPhase1', lambda prevFlags:
53  (not prevFlags.Trigger.enableL0Muon) and
54  prevFlags.Trigger.EDMVersion >= 3 or prevFlags.Detector.EnableMM or prevFlags.Detector.EnablesTGC,
55  help='enable Run-3 LVL1 muon decoding')
56 
57  flags.addFlag('Trigger.enableL1CaloPhase1', lambda prevFlags:
58  prevFlags.Trigger.EDMVersion >= 3 or prevFlags.GeoModel.Run >= LHCPeriod.Run3,
59  help='enable Phase-1 LVL1 calo simulation and/or decoding for Run-3+')
60 
61  flags.addFlag('Trigger.enableL1TopoDump', False,
62  help='enable L1Topo simulation to write inputs to txt file')
63 
64  flags.addFlag('Trigger.enableL1TopoBWSimulation', True,
65  help='enable bitwise L1Topo simulation')
66 
67  flags.addFlag('Trigger.enableL1CaloLegacy', lambda prevFlags:
68  not (not prevFlags.Input.isMC and prevFlags.Trigger.doHLT), #Disable when we're running the trigger on data, keep when doing offline simulation
69  help='enable Run-2 L1Calo simulation and/or decoding')
70 
71  # L0MuonSim category (for Run-4+) : needs Trigger.enableL0Muon=True
72  flags.addFlag('Trigger.L0MuonSim.doEmulation',
73  lambda prevFlags: prevFlags.Trigger.enableL0Muon and
74  prevFlags.Input.isMC and
75  'TruthParticleContainer' in prevFlags.Input.Collections,
76  help='Emulate the L0Muon trigger TOBs from smeared truth muon particles')
77 
78  # L1MuonSim category
79  flags.addFlag('Trigger.L1MuonSim.EmulateNSW', False,
80  help='enable emulation tool for NSW-TGC coincidence')
81 
82  flags.addFlag('Trigger.L1MuonSim.doMMTrigger', True,
83  help='enable NSW MM trigger')
84 
85  flags.addFlag('Trigger.L1MuonSim.doPadTrigger', True,
86  help='enable NSW sTGC pad trigger')
87 
88  flags.addFlag('Trigger.L1MuonSim.doStripTrigger', False,
89  help='enable NSW sTGC strip trigger')
90 
91  flags.addFlag('Trigger.L1MuonSim.WriteNSWDebugNtuple', False,
92  help='enable Storing NSW debug Ntuple')
93 
94  flags.addFlag('Trigger.L1MuonSim.WriteMMBranches', False,
95  help='enable storing of Micromega branches in NSW debug Ntuple')
96 
97  flags.addFlag('Trigger.L1MuonSim.WritesTGCBranches', False,
98  help='enable storing of TGC branches in NSW debug Ntuple')
99 
100  flags.addFlag('Trigger.L1MuonSim.NSWVetoMode', True,
101  help='enable the veto mode of the NSW-TGC coincidence')
102 
103  flags.addFlag('Trigger.L1MuonSim.doBIS78', True,
104  help='enable TGC-RPC BIS78 coincidence')
105 
106  flags.addFlag('Trigger.L1MuonSim.CondDBOffline', 'OFLCOND-MC16-SDR-RUN2-04',
107  help='offline CondDB tag for RPC/TGC coincidence window in rerunLVL1 on data')
108 
109  flags.addFlag('Trigger.L1MuonSim.RPCNBX', lambda prevFlags:
110  8 if prevFlags.Input.isMC else 4,
111  help='Number of bunch crossings in RPC readout')
112 
113  flags.addFlag('Trigger.L1MuonSim.RPCNBCZ', lambda prevFlags:
114  3 if prevFlags.Input.isMC else 1,
115  help='Nominal BC for RPC readout')
116 
117 
118  # Detector flags
119  flags.addFlag('Trigger.doID', True,
120  help='enable Inner Detector')
121 
122  flags.addFlag('Trigger.doMuon', True,
123  help='enable muon systems')
124 
125  flags.addFlag('Trigger.doCalo', True,
126  help='enable calorimeters')
127 
128  flags.addFlag('Trigger.doZDC', False,
129  help='enable ZDC system')
130 
131  flags.addFlag('Trigger.ZdcLUT', 'TrigT1ZDC/zdcRun3T1LUT_v2_08_08_2023.json',
132  help='path to Run3 ZDC LUT')
133 
134  # Enable TRT fast-OR trigger
135  flags.addFlag('Trigger.doTRT', False)
136 
137  # Set TTC multiplicity required for the TRT fast-OR trigger
138  flags.addFlag('Trigger.TRT.TTCMultiplicity', 4)
139 
140  # Path to file with list of masked chips
141  flags.addFlag('Trigger.TRT.maskedChipsFile', 'TrigT1TRT/fastORmaskedChips.json')
142 
143 
144  flags.addFlag('Trigger.doValidationMonitoring', False,
145  help='enable additional validation histograms')
146 
147  flags.addFlag('Trigger.doRuntimeNaviVal', False,
148  help=('Check validity of each Decision objects in the entire decision tree (CPU expensive). '
149  'Also enable per-step decision printouts.'))
150 
151  flags.addFlag('Trigger.ROBPrefetchingOptions',
152  [ROBPrefetching.InitialRoI, ROBPrefetching.StepRoI, ROBPrefetching.TauCoreLargeRoI],
153  help='select ROB prefetching types, empty list disables prefetching')
154 
155  def EDMVersion(flags):
156  """Determine Trigger EDM version based on the input file."""
157  _log = logging.getLogger('TriggerConfigFlags.EDMVersion')
158 
159  default_version = -1 # intentionally invalid default value, ATR-22856
160 
161  if flags.Input.Format is Format.BS:
162  _log.debug("Input format is ByteStream")
163 
164  if not any(flags.Input.Files) and flags.Common.isOnline:
165  _log.info("Online reconstruction, no input file. Return default EDMVersion=%d", default_version)
166  return default_version
167  try:
168  from TrigEDMConfig.Utils import getEDMVersionFromBS
169  except ImportError:
170  log.error("Failed to import TrigEDMConfig, analysing ByteStream files is not possible in this release!")
171  raise
172 
173 
174  version = getEDMVersionFromBS(flags.Input.Files[0])
175 
176  return version if version is not None else default_version
177 
178  else:
179  # POOL files: decide based on HLT output type present in the file
180  _log.debug("Input format is POOL -- determine from input file collections")
181  collections = flags.Input.Collections
182  if "HLTResult_EF" in collections:
183  _log.info("Determined EDMVersion to be 1, because HLTResult_EF found in POOL file")
184  return 1
185  elif "TrigNavigation" in collections:
186  _log.info("Determined EDMVersion to be 2, because TrigNavigation found in POOL file")
187  return 2
188  elif flags.Trigger.doHLT:
189  if flags.GeoModel.Run >= LHCPeriod.Run4:
190  _log.info("Determined EDMVersion to be 4, because we're now running the trigger and GeoModel.Run >= 4")
191  return 4
192  else:
193  _log.info("Determined EDMVersion to be 3, because we're now running the trigger")
194  return 3
195  elif any("HLTNav_Summary" in s for s in collections):
196  if flags.GeoModel.Run >= LHCPeriod.Run4:
197  _log.info("Determined EDMVersion to be 4, because HLTNav_Summary.* found in POOL file and GeoModel.Run >= 4")
198  return 4
199  else:
200  _log.info("Determined EDMVersion to be 3, because HLTNav_Summary.* found in POOL file")
201  return 3
202  elif not flags.Input.Collections:
203  # Special case for empty input files (can happen in merge jobs on the grid)
204  # The resulting version doesn't really matter as there's nothing to be done, but we want a valid configuration
205  _log.warning("All input files seem to be empty, cannot determine EDM version. Guessing EDMVersion=3")
206  return 3
207 
208  _log.info("Could not determine EDM version from the input file. Return default EDMVersion=%d",
209  default_version)
210  return default_version
211 
212  flags.addFlag('Trigger.EDMVersion', lambda prevFlags: EDMVersion(prevFlags),
213  help='Trigger EDM version (determined by input file or set to the version to be produced)')
214 
215  flags.addFlag('Trigger.doEDMVersionConversion', False,
216  help='convert Run-1&2 EDM to Run-3 EDM')
217 
218  flags.addFlag('Trigger.doxAODConversion', True,
219  help=('convert Run-1 EDM to xAOD'))
220 
221  flags.addFlag('Trigger.doOnlineNavigationCompactification', True,
222  help='enable trigger Navigation compactification into a single collection')
223 
224  flags.addFlag('Trigger.doNavigationSlimming', True,
225  help='enable Navigation slimming for RAWtoXYZ or AODtoDAOD transforms')
226 
227  flags.addFlag('Trigger.derivationsExtraChains', [],
228  help='list of chains which should be considered for trigger-matching in addition to those from the TriggerAPI when running derivations')
229 
230  # CostMonitoring category
231  flags.addFlag('Trigger.CostMonitoring.doCostMonitoring', True,
232  help='enable cost monitoring')
233 
234  flags.addFlag('Trigger.CostMonitoring.chain', 'HLT_noalg_CostMonDS_L1All',
235  help='Cost monitoring chain name')
236 
237  flags.addFlag('Trigger.CostMonitoring.outputCollection', 'HLT_TrigCostContainer',
238  help='Cost monitoring output collection name')
239 
240  flags.addFlag('Trigger.CostMonitoring.monitorAllEvents', False,
241  help='enable Cost monitoring for all events')
242 
243  flags.addFlag('Trigger.CostMonitoring.monitorROBs', True,
244  help='enable Cost monitoring of ROB accesses')
245 
246  # L1 category
247  flags.addFlag('Trigger.L1.doMuon', True,
248  help='enable L1Muon ByteStream conversion/simulation')
249 
250  flags.addFlag('Trigger.L1.doMuonTopoInputs', True,
251  help='enable ByteStream conversion/simulation of MUCTPI Topo TOBs')
252 
253  flags.addFlag('Trigger.L1.doCalo', True,
254  help='enable L1Calo ByteStream conversion/simulation')
255 
256  flags.addFlag('Trigger.L1.doCaloInputs', lambda prevFlags:
257  prevFlags.Trigger.L1.doCalo and prevFlags.Trigger.enableL1CaloPhase1 and not prevFlags.Trigger.doHLT,
258  help='enable L1Calo Input ([ejg]Towers) ByteStream conversion/simulation')
259 
260  flags.addFlag('Trigger.L1.doeFex', lambda prevFlags:
261  prevFlags.Trigger.L1.doCalo and prevFlags.Trigger.enableL1CaloPhase1,
262  help='enable eFEX ByteStream conversion/simulation')
263 
264  flags.addFlag('Trigger.L1.Menu.doeFexBDTTau', True,
265  help='set BDT tau algorithm as the active one for eFEX when constructing L1 menus')
266 
267  flags.addFlag('Trigger.L1.dojFex', lambda prevFlags:
268  prevFlags.Trigger.L1.doCalo and prevFlags.Trigger.enableL1CaloPhase1,
269  help='enable jFEX ByteStream conversion/simulation')
270 
271  flags.addFlag('Trigger.L1.dogFex', lambda prevFlags:
272  prevFlags.Trigger.L1.doCalo and prevFlags.Trigger.enableL1CaloPhase1,
273  help='enable gFEX ByteStream conversion/simulation')
274 
275  flags.addFlag('Trigger.L1.L1CaloSuperCellContainerName', lambda prevFlags:
276  "EmulatedSCell" if prevFlags.GeoModel.Run is LHCPeriod.Run2 else "SCell",
277  help='name of SuperCell container')
278 
279  flags.addFlag('Trigger.L1.doTopo', True,
280  help='enable L1Topo ByteStream conversion/simulation (steering both legacy and phase-1 Topo)')
281 
282  flags.addFlag('Trigger.L1.doTopoPhase1', lambda prevFlags:
283  prevFlags.Trigger.L1.doTopo and prevFlags.Trigger.enableL1CaloPhase1,
284  help='control Phase-I L1Topo simulation even if L1.doTopo is True')
285 
286  flags.addFlag('Trigger.L1.doGlobal', lambda prevFlags: prevFlags.GeoModel.Run >= LHCPeriod.Run4,
287  help='enable L0Global ByteStream conversion/simulation')
288 
289  flags.addFlag('Trigger.L1.doCTP', True,
290  help='enable CTP ByteStream conversion/simulation')
291 
292  flags.addFlag('Trigger.L1.Menu.doHeavyIonTobThresholds', lambda prevFlags:
293  'HI' in prevFlags.Trigger.triggerMenuSetup,
294  help='modify min-pt-to-Topo threshold for TOBs to HI values')
295 
296  flags.addFlag('Trigger.L1.errorOnMissingTOB', True,
297  help='Set to true to enable strict-mode which will generate an ERROR on missing (non-overflow) TOB events in HLT-seeding from L1')
298 
299  # Online category
300  flags.addFlag('Trigger.Online.partitionName', os.getenv('TDAQ_PARTITION') or '',
301  help='partition name used to determine online vs offline BS result writing')
302 
303  flags.addFlag('Trigger.Online.isPartition', lambda prevFlags: len(prevFlags.Trigger.Online.partitionName)>0,
304  help='check if job is running in a partition (i.e. partition name is not empty)')
305 
306  flags.addFlag('Trigger.Online.useOnlineTHistSvc', False,
307  help='use online THistSvc')
308 
309  flags.addFlag('Trigger.Online.useOnlineWebdaqHistSvc', False,
310  help='use online Webdaq HistSvc')
311 
312  flags.addFlag('Trigger.Online.BFieldAutoConfig', True,
313  help='auto-configure magnetic field from currents in IS')
314 
315  flags.addFlag('Trigger.writeBS', False,
316  help='enable bytestream writing of trigger information')
317 
318  flags.addFlag('Trigger.doTransientByteStream', lambda prevFlags:
319  True if prevFlags.Input.Format is Format.POOL and prevFlags.Trigger.doCalo else False,
320  help='create transient BS (for running on MC RDO with clients that require BS inputs)')
321 
322  flags.addFlag('Trigger.AODEDMSet', lambda flags: 'AODSLIM' if flags.Input.isMC else 'AODFULL',
323  help='list of EDM objects to be written to AOD')
324 
325  flags.addFlag('Trigger.ESDEDMSet', 'ESD',
326  help='list of EDM objects to be written to ESD')
327 
328  flags.addFlag('Trigger.ExtraEDMList', [],
329  help='list of extra EDM objects to be stored (for testing). Supported features: Add new items. Add extra decorations to existing Aux. Add additional output targets.')
330 
331  def __availableRecoMetadata(flags):
332  systems = ['L1','HLT']
333  # Online reco without input files
334  if not any(flags.Input.Files) and flags.Common.isOnline:
335  return systems
336  # Makes no sense when running HLT
337  elif flags.Trigger.doHLT:
338  raise RuntimeError('Trigger.availableRecoMetadata is ill-defined if Trigger.doHLT==True')
339  # RAW: check if keys are in COOL
340  elif flags.Input.Format is Format.BS:
341  from TrigConfigSvc.TriggerConfigAccess import getKeysFromCool
342  keys = getKeysFromCool(flags.Input.RunNumbers[0], lbNr = 1) # currently only checking first file
343  return ( (['L1'] if 'L1PSK' in keys else []) +
344  (['HLT'] if 'HLTPSK' in keys else []) )
345  # POOL: metadata (do not distinguish L1/HLT yet, see discussions on GitLab commit f83ae2bc)
346  else:
347  return systems if flags.Trigger.triggerConfig == 'INFILE' else []
348 
349  flags.addFlag('Trigger.availableRecoMetadata', lambda flags: __availableRecoMetadata(flags),
350  help="list of enabled trigger sub-systems in reconstruction: ['L1,'HLT']")
351 
352  flags.addFlag("Trigger.decodeHLT", True,
353  help='enable decoding of HLT trigger decision/result in reconstruction')
354 
355  flags.addFlag("Trigger.DecisionMakerValidation.Execute", True,
356  help='run trigger decision validation algorithm in reconstruction')
357 
358  flags.addFlag("Trigger.DecisionMakerValidation.ErrorMode", True,
359  help='emit an ERROR (or WARNING) in case of trigger decision validation failure')
360 
361  # Auto configure most probable choice for trigger configuration source based on job setup
362  def __triggerConfig(flags):
363  _log = logging.getLogger('TriggerConfigFlags.triggerConfig')
364  if flags.Common.isOnline and not flags.Trigger.doHLT:
365  # When running reconstruction at P1 (e.g. global monitoring, event display, etc.)
366  _log.debug("Autoconfigured default value for running reconstruction inside Point 1: 'DB'")
367  return 'DB'
368  elif flags.Input.Format is Format.BS:
369  from glob import glob
370  hasLocal = True if (glob("HLTMenu*.json") and glob("L1Menu*.json") and glob("HLTPrescales*.json") and glob("L1Prescales*.json") and glob("HLTMonitoring*.json") and glob("BunchGroupSet*.json")) else False
371  if flags.Trigger.doHLT:
372  # When running the Run 3 trigger on data, data the default config source is from the JSON created by compiling the menu in the job config phase
373  _log.debug("Autoconfigured default value for running the trigger on data: 'FILE'")
374  return 'FILE'
375  elif hasLocal:
376  # When running reco (doHLT == False) from RAW in a directory which already has a full suite of JSONs, assume that the user has just run the trigger manually
377  # and now wants to reconstruct the output using the menu files created when the trigger was executed, rather than reading the DB configuration for the run.
378  # A number of ART tests chain trigger then reco like this.
379  _log.debug("Autoconfigured default value for running reconstruction with a pre-supplied set of trigger configuration JSON files: 'FILE'")
380  return 'FILE'
381  elif flags.GeoModel.Run >= LHCPeriod.Run3:
382  # When reconstructing Run 3 data the default config source is the database
383  _log.debug("Autoconfigured default value for reconstruction of Run 3 data: 'DB'")
384  return 'DB'
385  else:
386  # When reconstructing Run 2 or Run 1 data, a stand-alone database converter will be called from python. We then need to load the converted JSON from disk
387  _log.debug("Autoconfigured default value for reconstruction of Run 1 or Run 2 data: 'FILE'")
388  return 'FILE'
389  else: # Format.POOL
390  from AthenaConfiguration.AutoConfigFlags import GetFileMD
391  md = GetFileMD(flags.Input.Files)
392  # Note: the following comprehension will detect both Run 2 and Run 3 in-file metadata formats.
393  # As of 2023, the Run 2 metadata format is still in production use for Run 2 MC AODs, DAODs produced with the Release 21 Run 2 trigger.
394  hasTrigMeta = ("metadata_items" in md and any(('TriggerMenu' in key) for key in md["metadata_items"].keys()))
395  if hasTrigMeta:
396  # When running over a file which already has metadata content (RDO_TRIG, ESD, AOD, DAOD), then read this from within the file's meta store
397  _log.debug("Autoconfigured default value to read trigger configuration data from the input file: 'INFILE'")
398  return 'INFILE'
399  else:
400  # MC production, read the menu JSON generated during the trigger job configuration
401  _log.debug("Autoconfigured default value to read trigger configuration data from disk for MC production: 'FILE'")
402  return 'FILE'
403 
404  flags.addFlag('Trigger.triggerConfig', lambda flags: __triggerConfig(flags),
405  help='Trigger configuration source (https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerConfigFlag)')
406 
407  flags.addFlag('Trigger.triggerMenuSetup', lambda flags: 'MC_pp_run3_v1_BulkMCProd_prescale' if flags.GeoModel.Run is LHCPeriod.Run3 else 'MC_pp_run4_v1_BulkMCProd_prescale',
408  help='name of the trigger menu')
409 
410  flags.addFlag('Trigger.generateMenuDiagnostics', False,
411  help='print debug output from control flow generation')
412 
413  flags.addFlag('Trigger.fastMenuGeneration', True,
414  help='avoid re-merging CAs that were already seen once')
415 
416  flags.addFlag('Trigger.disableCPS', False,
417  help='disable coherent prescale sets (for testing with small menu)')
418 
419  flags.addFlag('Trigger.enableEndOfEventProcessing', True,
420  help='enable execution of extra algorithms for accepted events')
421 
422  flags.addFlag('Trigger.doCFEmulationTest', False,
423  help='enable run Control Flow Emulation test')
424 
425  # trigger reconstruction
426  # Protection against import of packages not in the analysis release
427  # Signature and other trigger reco flags should be handled here
428  if doTriggerRecoFlags:
429  flags.join( createTriggerRecoFlags() )
430 
431  # Disable the CPS system if the restricted menu flags are active
432  flags.Trigger.disableCPS = lambda prevFlags: prevFlags.Trigger.selectChains or len(prevFlags.Trigger.enabledSignatures)==1
433 
434  return flags
435 
436 
438  flags = AthConfigFlags()
439 
440  # Additional flags to filter chains
441  def _allSignatures (prevFlags):
442  from TriggerMenuMT.HLT.Config.GenerateMenuMT import allSignatures
443  l = list(allSignatures())
444  l.sort()
445  return l
446  flags.addFlag("Trigger.enabledSignatures", _allSignatures, help='list of enabled trigger signatures')
447  flags.addFlag("Trigger.disabledSignatures", [], help='list of disabled trigger signatures')
448  flags.addFlag("Trigger.selectChains", [], help='list of enabled chains')
449  flags.addFlag("Trigger.disableChains", [], help='list of disabled chains')
450 
451  def __egamma():
452  from TriggerMenuMT.HLT.Egamma.TrigEgammaConfigFlags import createTrigEgammaConfigFlags
454  flags.addFlagsCategory('Trigger.egamma', __egamma )
455 
456  # muon offline reco flags varaint for trigger
457  def __muonSA():
458  from MuonConfig.MuonConfigFlags import createMuonConfigFlags
459  muonflags = createMuonConfigFlags()
460  muonflags.Muon.useTGCPriorNextBC=True
461  muonflags.Muon.MuonTrigger=True
462  muonflags.Muon.SAMuonTrigger=True
463  muonflags.Muon.runCommissioningChain=False
464  muonflags.Muon.enableErrorTuning=False
465  return muonflags
466  flags.addFlagsCategory('Trigger.Offline.SA', __muonSA, prefix=True)
467 
468  def __muon():
469  from MuonConfig.MuonConfigFlags import createMuonConfigFlags
470  muonflags = createMuonConfigFlags()
471  muonflags.Muon.useTGCPriorNextBC=True
472  muonflags.Muon.MuonTrigger=True
473  muonflags.Muon.enableErrorTuning=False
474  return muonflags
475  flags.addFlagsCategory('Trigger.Offline', __muon, prefix=True)
476 
477  def __muonCombined():
478  from MuonCombinedConfig.MuonCombinedConfigFlags import createMuonCombinedConfigFlags
479  muonflags = createMuonCombinedConfigFlags()
480  muonflags.MuonCombined.doCaloTrkMuId = False
481  muonflags.MuonCombined.doSiAssocForwardMuons = False
482  muonflags.MuonCombined.doStatisticalCombination = False
483  muonflags.MuonCombined.doMuGirl = False
484  muonflags.MuonCombined.doCombinedFit = True
485  return muonflags
486  flags.addFlagsCategory('Trigger.Offline.Combined', __muonCombined, prefix=True)
487 
488  def __tau():
489  from TrigTauRec.TrigTauConfigFlags import createTrigTauConfigFlags
490  return createTrigTauConfigFlags()
491  flags.addFlagsCategory('Trigger.Offline.Tau', __tau )
492 
493  def __idTrk():
494  from TrigInDetConfig.TrigTrackingPassFlags import createTrigTrackingPassFlags
496  flags.addFlagsCategory( 'Trigger.InDetTracking', __idTrk )
497 
498  def __idITk():
499  from TrigInDetConfig.TrigTrackingPassFlags import createTrigTrackingPassFlags
500  return createTrigTrackingPassFlags(mode='ITk')
501  flags.addFlagsCategory( 'Trigger.ITkTracking', __idITk )
502 
503  def _idActs():
504  from TrigInDetConfig.TrigTrackingPassFlags import createTrigTrackingPassFlags
505  return createTrigTrackingPassFlags(mode='Acts')
506  flags.addFlagsCategory( 'Trigger.ActsTracking', _idActs )
507 
508  flags.addFlag('Trigger.useActsTracking', False, help='use ACTS for ITk tracking')
509  flags.addFlag('Trigger.EFTrackPipeline', "", help='string to specify EFTrack pipeline')
510 
511  def __trigCalo():
512  from TrigCaloRec.TrigCaloConfigFlags import createTrigCaloConfigFlags
514  flags.addFlagsCategory( 'Trigger.Calo', __trigCalo )
515 
516  def __muctpiFlags():
517  from TrigT1MuctpiPhase1.TrigMUCTPIConfigFlags import createTrigMUCTPIConfigFlags
519  flags.addFlagsCategory('Trigger.MUCTPI', __muctpiFlags )
520 
521  def __ctpFlags():
522  from TrigT1CTP.CTPSimulationConfigFlags import createTrigCTPConfigFlags
523  return createTrigCTPConfigFlags()
524  flags.addFlagsCategory('Trigger.CTP', __ctpFlags )
525 
526  def __fpgatracksimFlags():
527  """Additional function delays import"""
528  from FPGATrackSimConfTools.FPGATrackSimConfigFlags import createFPGATrackSimConfigFlags
530  flags.addFlagsCategory("Trigger.FPGATrackSim", __fpgatracksimFlags, prefix=True )
531 
532  def __jet():
533  from TriggerMenuMT.HLT.Jet.TrigJetConfigFlags import createTrigJetConfigFlags
534  return createTrigJetConfigFlags()
535  flags.addFlagsCategory('Trigger.Jet', __jet )
536 
537  def __fshad():
538  from TriggerMenuMT.HLT.Jet.TrigJetConfigFlags import createTrigFSHadConfigFlags
540  flags.addFlagsCategory('Trigger.FSHad', __fshad )
541 
542  return flags
543 
544 
545 if __name__ == "__main__":
546  import unittest
547  from AthenaConfiguration.AllConfigFlags import initConfigFlags
548  from AthenaConfiguration.Enums import Project
549  flags = initConfigFlags()
550 
551  class Tests(unittest.TestCase):
552 
553  @unittest.skipIf(flags.Common.Project is Project.AthAnalysis, "project is AthAnalysis")
554  def test_recoFlags(self):
555  """Check if offline reco flags can be added to trigger"""
556  flags = initConfigFlags()
557  flags.Trigger.Offline.Tau.doTauRec=False
558  flags.Tau.doTauRec=True
559  self.assertEqual(flags.Trigger.Offline.Tau.doTauRec, False, "dependent flag setting does not work")
560  self.assertEqual(flags.Tau.doTauRec, True, "dependent flag setting does not work")
561 
562  newflags = flags.cloneAndReplace('Tau', 'Trigger.Offline.Tau')
563 
564  self.assertEqual(flags.Tau.doTauRec, True, "dependent flag setting does not work")
565  self.assertEqual(newflags.Tau.doTauRec, False, "dependent flag setting does not work")
566 
567  def test_allFlags(self):
568  """Force load all dynamic flags"""
569  flags = initConfigFlags()
570  flags.loadAllDynamicFlags()
571 
572  unittest.main()
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True, maxLevel='peeker')
Definition: AutoConfigFlags.py:65
GenerateMenuMT.allSignatures
def allSignatures()
Definition: GenerateMenuMT.py:32
GlobalL1TopoSimulation_ctest.EDMVersion
EDMVersion
Definition: GlobalL1TopoSimulation_ctest.py:46
TrigCaloConfigFlags.createTrigCaloConfigFlags
def createTrigCaloConfigFlags()
Definition: TrigCaloConfigFlags.py:5
python.TriggerConfigFlags.createTriggerRecoFlags
def createTriggerRecoFlags()
Definition: TriggerConfigFlags.py:437
python.TriggerConfigFlags.ROBPrefetching
Definition: TriggerConfigFlags.py:11
TrigTauConfigFlags.createTrigTauConfigFlags
def createTrigTauConfigFlags()
Definition: TrigTauConfigFlags.py:6
python.Utils.getEDMVersionFromBS
def getEDMVersionFromBS(filename)
Definition: Trigger/TriggerCommon/TrigEDMConfig/python/Utils.py:11
python.TriggerConfigFlags.Tests.test_recoFlags
def test_recoFlags(self)
Definition: TriggerConfigFlags.py:554
python.TriggerConfigFlags.trigGlobalTag
def trigGlobalTag(flags)
Definition: TriggerConfigFlags.py:20
python.TriggerConfigFlags.Tests.test_allFlags
def test_allFlags(self)
Definition: TriggerConfigFlags.py:567
python.FPGATrackSimConfigFlags.createFPGATrackSimConfigFlags
def createFPGATrackSimConfigFlags()
Definition: FPGATrackSimConfigFlags.py:5
python.TrigTrackingPassFlags.createTrigTrackingPassFlags
def createTrigTrackingPassFlags(mode="InDet")
Definition: TrigTrackingPassFlags.py:5
python.HLT.Egamma.TrigEgammaConfigFlags.createTrigEgammaConfigFlags
def createTrigEgammaConfigFlags()
Definition: TrigEgammaConfigFlags.py:5
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.HLT.Jet.TrigJetConfigFlags.createTrigFSHadConfigFlags
def createTrigFSHadConfigFlags()
Definition: TrigJetConfigFlags.py:49
MuonCombinedConfigFlags.createMuonCombinedConfigFlags
def createMuonCombinedConfigFlags()
Definition: MuonCombinedConfigFlags.py:6
python.HLT.Jet.TrigJetConfigFlags.createTrigJetConfigFlags
def createTrigJetConfigFlags()
Definition: TrigJetConfigFlags.py:6
python.TriggerConfigFlags.trigGeoTag
def trigGeoTag(flags)
Definition: TriggerConfigFlags.py:26
python.TrigMUCTPIConfigFlags.createTrigMUCTPIConfigFlags
def createTrigMUCTPIConfigFlags()
Definition: TrigMUCTPIConfigFlags.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
MuonConfigFlags.createMuonConfigFlags
def createMuonConfigFlags()
Definition: MuonConfigFlags.py:40
python.TriggerConfigFlags.createTriggerFlags
def createTriggerFlags(doTriggerRecoFlags)
Definition: TriggerConfigFlags.py:33
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
python.CTPSimulationConfigFlags.createTrigCTPConfigFlags
def createTrigCTPConfigFlags()
Definition: CTPSimulationConfigFlags.py:5
python.TriggerConfigAccess.getKeysFromCool
dict[str, int] getKeysFromCool(int runNr, int lbNr=0)
Definition: TriggerConfigAccess.py:52
python.TriggerConfigFlags.Tests
Definition: TriggerConfigFlags.py:551