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