ATLAS Offline Software
BuildSignatureFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
4 from TrkConfig.TrackingPassFlags import createTrackingPassFlags,createITkTrackingPassFlags
5 from TrigEDMConfig.TriggerEDM import recordable
6 
7 from AthenaCommon.Logging import logging
8 import AthenaCommon.SystemOfUnits as Units
9 import math
10 from copy import deepcopy
11 from collections.abc import Callable
12 
13 log = logging.getLogger("__name__")
14 
15 def defaultTrigTrackingFlags(flags : AthConfigFlags):
16 
17  flags.addFlag("input_name", "")
18  flags.addFlag("name", "")
19  flags.addFlag("suffix", "")
20 
21  flags.addFlag("pTmin", 1.*Units.GeV) #fix - consolidate pTmin and minPT
22  flags.addFlag("TripletDoPPS", True)
23  flags.addFlag("Triplet_D0Max", 4.0)
24  flags.addFlag("Triplet_D0_PPS_Max", 1.7)
25  flags.addFlag("DoPhiFiltering", True)
26  flags.addFlag("doZFinder", False)
27  flags.addFlag("doZFinderOnly", False)
28  flags.addFlag("doResMon", False)
29  flags.addFlag("doCloneRemoval", True)
30  flags.addFlag("doSeedRedundancyCheck",False)
31  flags.addFlag("DoubletDR_Max", 270)
32  flags.addFlag("SeedRadBinWidth", 2)
33  flags.addFlag("holeSearch_FTF", False)
34  flags.addFlag("electronPID", False)
35  flags.addFlag("etaHalfWidth", 0.1)
36  flags.addFlag("phiHalfWidth", 0.1)
37  flags.addFlag("zedHalfWidth", -999) # don't set this parameter unless it is >= 0)
38  flags.addFlag("doFullScan", False)
39  flags.addFlag("monPS", 1)
40  flags.addFlag("monPtMin", 1*Units.GeV)
41  flags.addFlag("doTRT", True)
42  flags.addFlag("keepTrackParameters", False) # Keep track parameters in conversion to TrackParticles
43  flags.addFlag("UsePixelSpacePoints", True)
44  flags.addFlag("TrackInitialD0Max", 20.0)
45  flags.addFlag("TrackZ0Max", 300.0)
46  flags.addFlag("isLRT", False)
47  flags.addFlag("UseTrigSeedML", 0)
48  flags.addFlag("nClustersMin", 7)
49  flags.addFlag("roi", "")
50  flags.addFlag("LRT_D0Min", 2.0)
51  flags.addFlag("LRT_HardPtMin", 1.0*Units.GeV)
52  flags.addFlag("doRecord", True)
53  flags.addFlag("vertex", "")
54  flags.addFlag("adaptiveVertex", False)
55  flags.addFlag("addSingleTrackVertices", False)
56  flags.addFlag("TracksMaxZinterval", 1) #mm
57  flags.addFlag("minNSiHits_vtx", 10) #from vtxCuts
58  flags.addFlag("vertex_jet", "")
59  flags.addFlag("adaptiveVertex_jet", False)
60  flags.addFlag("dodEdxTrk", False)
61  flags.addFlag("doHitDV", False)
62  flags.addFlag("doDisappearingTrk", False)
63  flags.addFlag("useDynamicRoiZWidth", False)
64 
65 
66  #precision tracking configuration values
67  #__provisional change__:
68  #the following settings are incorrect but this is what is being used in the production running
69  #at the moment. Setting them explicitly here will prevent trigger count differences in
70  #https://gitlab.cern.ch/atlas/athena/-/merge_requests/56607
71  flags.maxEta = 2.7
72  flags.addFlag("minSiClusters", 7)
73  flags.addFlag("maxSiHoles", 5)
74  flags.maxPixelHoles = 5
75  flags.addFlag("maxSCTHoles", 5) #fix2024 - consolidate names maxSctHoles and others in addFlag here
76  flags.maxDoubleHoles = 2
77  flags.addFlag("doEmCaloSeed", False)
78 
79  flags.useSeedFilter = False
80  flags.doBremRecoverySi = False #fix2023 setTrue for electron once validated
81 
82  flags.addFlag("refitROT", True)
83  flags.addFlag("trtExtensionType", "xf")
84  flags.addFlag("doTruth", False)
85  flags.addFlag("perigeeExpression","BeamLine") #always use beamline regardless of Reco.EnableHI
86  flags.addFlag("SuperRoI", False) #TBD - move to bphys/menu
87 
88  flags.addFlag("trkTracks_FTF", "")
89  flags.addFlag("trkTracks_IDTrig","")
90  flags.addFlag("tracks_FTF", "")
91  flags.addFlag("tracks_IDTrig", "")
92 
93 
94 def defaultInDetTrigTrackingFlags() -> AthConfigFlags:
95 
96  flags = createTrackingPassFlags()
98 
99  flags.minPT = flags.pTmin #hack to sync pT threshold used in offline and trigger
100 
101  flags.minClusters = 7 #hardcoded to preserve trigger settings (not used for FTF config)
102  flags.minSiNotShared = 5
103  flags.maxShared = 2
104  flags.Xi2max = 9.
105  flags.Xi2maxNoAdd = 25.
106  flags.nHolesMax = 2
107  flags.nHolesGapMax = 2
108  flags.nWeightedClustersMin= 6
109  flags.roadWidth =10.
110 
111 
112  flags.maxPrimaryImpact = 10.
113  flags.maxEMImpact = 50.
114  flags.maxZImpact = 250.
115 
116  flags.minTRTonTrk =9
117 
118  #TODO - simple ambiguitues
119  flags.useTIDE_Ambi = False
120 
121  #2023fix - it should read 2
122  flags.maxSiHoles = 5
123  flags.maxSCTHoles = 5
124  #end
125 
126  return flags
127 
128 def defaultITkTrigTrackingFlags() -> AthConfigFlags:
129 
132 
133  flags.minPT = [1.0*Units.GeV,0.45*Units.GeV,0.45*Units.GeV] #ITk flags have eta dependant settings
134  flags.minClusters = [9,8,7] #offline defaults are [9,8,7]
135  flags.Xi2max = [9.]
136  flags.Xi2maxNoAdd = [25.]
137  flags.nHolesMax = [2]
138  flags.nHolesGapMax = [2]
139  flags.nWeightedClustersMin= [6]
140  flags.maxDoubleHoles = [2]
141  flags.maxPixelHoles = [5]
142  flags.maxZImpact = [250.0]
143  flags.doTRT = False
144  flags.doZFinder = False
145  flags.DoPhiFiltering = True
146  flags.UsePixelSpacePoints = True # In LRT they use only SCT SP, but for ITk we want pixel SP
147  flags.doDisappearingTrk = False # Not working yet for ITk
148  flags.doCaloSeededBremSi = False
149  flags.doCaloSeededAmbiSi = False
150  flags.DoubletDR_Max = 150.0
151 
152  return flags
153 
154 def defaultModeTrigTrackingFlags(flags: AthConfigFlags) -> AthConfigFlags:
155  return flags
156 
157 def signatureTrigTrackingFlags(mode : str) -> AthConfigFlags:
158 
159  signatureSet = {
160  "electron" : electron,
161  "photon" : electron,
162 
163  "muon" : muon,
164  "muonIso" : muonIso,
165  "muonIsoMS" : muonIso,
166  "muonCore" : muon,
167  "muonFS" : muon,
168  "muonLate" : muon,
169 
170  "tauCore" : tauCore,
171  "tauIso" : tauIso,
172 
173  "bjet" : bjet,
174 
175  "fullScan" : fullScan,
176  "FS" : fullScan,
177  "jetSuper" : jetSuper,
178 
179  "beamSpot" : beamSpot,
180  "BeamSpot" : beamSpot,
181  "beamSpotFS" : beamSpotFS,
182 
183  "cosmics" : cosmics,
184  "bmumux" : bmumux,
185 
186  "minBias" : minBias,
187  "minBiasPixel" : minBiasPixel,
188 
189  "electronLRT" : electronLRT,
190  "muonLRT" : muonLRT,
191  "tauLRT" : tauLRT,
192  "bjetLRT" : bjetLRT,
193  "fullScanLRT" : fullScanLRT,
194  "DJetLRT" : DJetLRT,
195  "DVtxLRT" : DVtxLRT,
196  }
197 
198  flags = AthConfigFlags()
199 
200  if mode == "InDet":
201  category = 'Trigger.InDetTracking'
202  defaults = defaultInDetTrigTrackingFlags
203  elif mode == "ITk":
204  category = 'Trigger.ITkTracking'
205  defaults = defaultITkTrigTrackingFlags
206  elif mode == "Acts":
207  category = "Trigger.ActsTracking"
208  defaults = defaultITkTrigTrackingFlags
209  else:
210  log.error("Acts not supported yet")
211 
212 
213  class categoryGeneratorWrapper():
214  """ wrap function which can be consumed by addFlagsCategory and provide its args """
215  def __init__(self, fun : Callable[[AthConfigFlags, str, str], AthConfigFlags],
216  flags : AthConfigFlags, signatureInstance : str, recoMode : str):
217  self.flags = flags
218  self.sig = signatureInstance
219  self.fun = fun
220  self.mode= recoMode
221  def run(self):
222  return self.fun(self.flags,self.sig,self.mode)
223 
224  for i in signatureSet.keys():
225  trackingflags = deepcopy(defaults())
226  a = categoryGeneratorWrapper(signatureSet[i],trackingflags,i,mode)
227  signatureCategory = "{}.{}".format(category,i)
228  flags.addFlagsCategory(signatureCategory,a.run,prefix=True)
229 
230  addGlobalFlags(flags, category) # they should not be needed / backward compatibility
231 
232  return flags
233 
234 
236  """ convenience decorator to automate config steps """
237  def invokeSteps(*args, **kwargs):
238  flagsSig = func(*args, **kwargs) #invoke signature specific code
239  recoMode = args[2]
240  derivedFromSignatureFlags(flagsSig,recoMode) #invoke code dependant on signature flags
241  return flagsSig
242  return invokeSteps
243 
244 
245 def tsetter(var, value):
246  """ use previous type of the var and convert value to it
247  for the moment just makes list of a value if needed
248  """
249  type2set = type(var)
250  typeOfValue = type(value)
251  if type2set == typeOfValue:
252  var = value
253  else:
254  basic = (bool, str, int, float, type(None))
255  if isinstance(var,basic):
256  var = value
257  else:
258  var = [value]
259 
260  return var
261 
262 
263 @signatureActions
264 def electron(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
265 
266  flags.input_name = instanceName
267  flags.name = "electron"
268  flags.suffix = "Electron"
269  flags.roi = "HLT_Roi_Electron"
270  flags.etaHalfWidth = 0.05 # this size should be increased to 0.1
271  flags.phiHalfWidth = 0.1
272  flags.doCloneRemoval = True
273  flags.doSeedRedundancyCheck = True
274  if recoMode=="InDet":
275  flags.doTRT = True
276  flags.keepTrackParameters = True
277  flags.electronPID = True
278  return flags
279 
280 @signatureActions
281 def muon(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
282 
283  flags.input_name = instanceName
284  flags.name = "muon"
285  flags.suffix = "Muon"
286  flags.roi = "HLT_Roi_L2SAMuon"
287  flags.Triplet_D0Max = 10.0
288  flags.doResMon = True
289  flags.DoPhiFiltering = False
290  flags.doSeedRedundancyCheck = True
291  flags.monPtMin = 12*Units.GeV
292  return flags
293 
294 @signatureActions
295 def muonIso(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
296 
297  flags.input_name = instanceName
298  flags.name = "muonIso"
299  flags.suffix = "MuonIso"
300  flags.roi = "HLT_Roi_MuonIso"
301  flags.etaHalfWidth = 0.35
302  flags.phiHalfWidth = 0.35
303  flags.zedHalfWidth = 10.0
304  return flags
305 
306 @signatureActions
307 def tauCore(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
308 
309  flags.input_name = instanceName
310  flags.name = "tauCore"
311  flags.suffix = "TauCore"
312  flags.roi = "HLT_Roi_TauCore"
313  flags.pTmin = 0.8*Units.GeV
314  flags.minPT = tsetter(flags.minPT, flags.pTmin)
315 
316  flags.holeSearch_FTF = True
317  return flags
318 
319 @signatureActions
320 def tauIso(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
321 
322  flags.input_name = instanceName
323  flags.name = "tauIso"
324  flags.suffix = "TauIso"
325  flags.roi = "HLT_Roi_TauIso"
326  flags.etaHalfWidth = 0.4
327  flags.phiHalfWidth = 0.4
328  flags.zedHalfWidth = 7.0
329  flags.adaptiveVertex = True
330  flags.addSingleTrackVertices = True
331  flags.vertex = "HLT_IDVertex_Tau"
332  flags.electronPID = False
333  flags.pTmin = 0.8*Units.GeV
334  flags.minPT = tsetter(flags.minPT, flags.pTmin)
335  return flags
336 
337 @signatureActions
338 def bjet(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
339 
340  flags.input_name = instanceName
341  flags.name = "bjet"
342  flags.suffix = "Bjet"
343  flags.roi = "HLT_Roi_Bjet"
344  flags.etaHalfWidth = 0.4
345  flags.phiHalfWidth = 0.4
346  flags.zedHalfWidth = 10.0
347  flags.pTmin = 0.8*Units.GeV
348  flags.minPT = tsetter(flags.minPT, flags.pTmin)
349  flags.Xi2max = tsetter(flags.Xi2max,12.)
350  return flags
351 
352 @signatureActions
353 def jetSuper(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
354 
355  flags.input_name = instanceName
356  flags.name = "jetSuper"
357  flags.suffix = "JetSuper"
358  flags.vertex = "HLT_IDVertex_JetSuper"
359  flags.adaptiveVertex = True
360  flags.addSingleTrackVertices = True
361  flags.roi = "HLT_Roi_JetSuper"
362  flags.etaHalfWidth = 0.3
363  flags.phiHalfWidth = 0.3
364  flags.doFullScan = True
365  flags.pTmin = 1*Units.GeV
366  flags.minPT = tsetter(flags.minPT, flags.pTmin)
367  #-----
368  flags.doTRT = False
369  flags.DoubletDR_Max = 200
370  flags.SeedRadBinWidth = 10
371  flags.doSeedRedundancyCheck = True
372  flags.TripletDoPPS = False
373  flags.nClustersMin = 8
374  flags.UseTrigSeedML = 4
375  flags.roadWidth = 5.
376  return flags
377 
378 @signatureActions
379 def minBias(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
380 
381  flags.input_name = instanceName
382  flags.name = "minBias"
383  flags.suffix = "MinBias"
384  flags.roi = "HLT_Roi_MinBias"
385  flags.doFullScan = True
386  flags.pTmin = 0.1*Units.GeV # TODO: double check
387  flags.minPT = tsetter(flags.minPT, flags.pTmin)
388 
389  flags.doTRT = False
390  flags.etaHalfWidth = 3
391  flags.phiHalfWidth = math.pi
392  flags.doZFinder = True
393  flags.doZFinderOnly = True
394 
395  flags.nClustersMin = 5
396  flags.useSeedFilter = True
397  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 10.*Units.mm)
398  flags.maxZImpact = tsetter(flags.maxZImpact, 150.*Units.mm)
399  flags.roadWidth = 20
400  flags.usePrdAssociationTool = False #for backward compatibility #2023fix?
401  return flags
402 
403 
404 @signatureActions
405 def minBiasPixel(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
406 
407  flags.input_name = instanceName
408  flags.name = "minBiasPixel"
409  flags.suffix = "MinBiasPixel"
410  flags.roi = "HLT_Roi_MinBias"
411  flags.doFullScan = True
412  flags.pTmin = 0.1*Units.GeV # this is good for HI which is the client of this setup
413  flags.minPT = tsetter(flags.minPT, flags.pTmin)
414 
415 
416  flags.maxHoles = 0 # HI setup
417  flags.maxPixelHoles = 0 # HI setup
418  flags.maxSctHoles = 0
419  flags.maxDoubleHoles = 0
420  flags.minSiNotShared = 3
421  flags.maxShared = 0
422  flags.nHolesMax = 0
423  flags.nHolesGapMax = 0
424  if recoMode=="InDet":
425  flags.useSCT = False
426  flags.useSCTSeeding = False
427  flags.useTRT = False
428 
429  flags.roadWidth = 12.0
430  flags.Xi2max = 15
431  flags.Xi2maxNoAdd = 35.0
432  flags.nWeightedClustersMin = 6
433  flags.doBremRecoverySi = False
434  flags.RunPixelPID = False # we use these tracks only for counting
435 
436  flags.doTRT = False
437  flags.etaHalfWidth = 3
438  flags.phiHalfWidth = math.pi
439  flags.doZFinder = False
440  flags.doZFinderOnly = True
441 
442  flags.minClusters = 3
443  flags.nClustersMin = 3
444  flags.useSeedFilter = True
445  flags.maxPrimaryImpact = 10.*Units.mm
446  flags.maxZImpact = 150.*Units.mm
447  flags.roadWidth = 20
448  flags.usePrdAssociationTool = False
449  return flags
450 
451 
452 
453 @signatureActions
454 def beamSpot(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
455 
456  flags.input_name = instanceName
457  flags.name = "beamSpot"
458  flags.suffix = "BeamSpot"
459  flags.roi = "HLT_Roi_FS"
460  flags.doFullScan = True
461  flags.doZFinder = True
462  flags.DoubletDR_Max = 200
463  flags.SeedRadBinWidth = 10
464  flags.etaHalfWidth = 3
465  flags.phiHalfWidth = math.pi
466  flags.doTRT = False
467  flags.doSeedRedundancyCheck = True
468  flags.doRecord = False
469  return flags
470 
471 
472 @signatureActions
473 def fullScan(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
474 
475  flags.input_name = instanceName
476  flags.name = "fullScan"
477  flags.suffix = "FS"
478  flags.roi = "HLT_Roi_FS"
479  flags.vertex = "HLT_IDVertex_FS"
480  flags.adaptiveVertex = True
481  # these are being evaluated and may be added
482  # flags.addSingleTrackVertices = True
483  # flags.TracksMaxZinterval = 3
484  flags.vertex_jet = "HLT_IDVertex_FS"
485  flags.adaptiveVertex_jet = True
486  flags.doFullScan = True
487  flags.etaHalfWidth = 3.
488  flags.phiHalfWidth = math.pi
489  flags.doTRT = False
490  flags.DoubletDR_Max = 200
491  flags.SeedRadBinWidth = 10
492  flags.doSeedRedundancyCheck = True
493  flags.TripletDoPPS = False
494  flags.nClustersMin = 8
495  flags.UseTrigSeedML = 4
496  flags.dodEdxTrk = True
497  flags.doHitDV = True
498  flags.doDisappearingTrk = True if recoMode=="InDet" else False
499  flags.roadWidth = 5.
500  return flags
501 
502 
503 @signatureActions
504 def beamSpotFS(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
505 
506  flags.input_name = instanceName
507  flags.name = "fullScan"
508  flags.suffix = "FS"
509  flags.roi = "HLT_Roi_FS"
510  flags.doFullScan = True
511  flags.etaHalfWidth = 3.
512  flags.phiHalfWidth = math.pi
513  flags.doTRT = False
514  flags.DoubletDR_Max = 200
515  flags.SeedRadBinWidth = 10
516  flags.TripletDoPPS = False
517  flags.nClustersMin = 8
518  flags.UseTrigSeedML = 4
519  flags.doRecord = False
520  return flags
521 
522 
523 @signatureActions
524 def cosmics(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
525 
526  flags.input_name = instanceName
527  flags.name = "cosmics"
528  flags.suffix = "Cosmic"
529  flags.roi = "HLT_Roi_Cosmics"
530  flags.Triplet_D0Max = 1000.0
531  flags.Triplet_D0_PPS_Max = 1000.0
532  flags.TrackInitialD0Max = 1000.
533  flags.TrackZ0Max = 1000.
534  flags.doTRT = False
535  flags.doFullScan = True
536  flags.etaHalfWidth = 3
537  flags.phiHalfWidth = math.pi
538 
539  flags.minPT = tsetter(flags.minPT, 0.5*Units.GeV)
540 
541  flags.nClustersMin = 4
542  flags.minSiNotShared = 3
543  flags.maxShared = 0
544  flags.nHolesMax = 3
545  flags.maxSiHoles = 3
546  flags.maxSCTHoles = 3
547  flags.maxPixelHoles = tsetter(flags.maxPixelHoles,3)
548  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 1000.*Units.mm)
549 
550  flags.Xi2max = tsetter(flags.Xi2max, 60.)
551  flags.Xi2maxNoAdd = tsetter(flags.Xi2maxNoAdd, 100.)
552  flags.maxDoubleHoles = tsetter(flags.maxDoubleHoles,1)
553 
554  flags.nWeightedClustersMin= 8
555  flags.useSeedFilter = True
556  flags.usePrdAssociationTool = False #for backward compatibility #2023fix?
557  flags.roadWidth = 75.
558  flags.maxZImpact= tsetter(flags.maxZImpact, 10000.*Units.mm)
559  if recoMode=="InDet":
560  flags.minTRTonTrk = 20
561 
562  return flags
563 
564 @signatureActions
565 def bmumux(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
566 
567  flags.input_name = instanceName
568  flags.name = "bphysics"
569  flags.suffix = "Bmumux"
570  flags.roi = "HLT_Roi_Bmumux"
571  flags.Triplet_D0Max = 10.
572  flags.DoPhiFiltering = False
573  flags.etaHalfWidth = 0.75
574  flags.phiHalfWidth = 0.75
575  flags.zedHalfWidth = 50.
576  flags.doSeedRedundancyCheck = True
577  flags.SuperRoI = True
578  return flags
579 
580 @signatureActions
581 def electronLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
582 
583  flags.input_name = instanceName
584  flags.name = "electronLRT"
585  flags.suffix = "ElecLRT"
586  flags.roi = "HLT_Roi_Electron"
587  flags.etaHalfWidth = 0.1
588  flags.phiHalfWidth = 0.4
589  flags.UsePixelSpacePoints = False
590  flags.Triplet_D0Max = 300.
591  flags.TrackInitialD0Max = 300.
592  flags.TrackZ0Max = 500.
593  flags.zedHalfWidth = 225.
594  flags.keepTrackParameters = True
595  flags.doSeedRedundancyCheck = True
596  flags.nClustersMin = 8
597  flags.isLRT = True
598  #pt config
599  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
600  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
601  flags.maxEta = 2.7
602  flags.doEmCaloSeed = False
603  return flags
604 
605 
606 @signatureActions
607 def muonLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
608 
609  flags.input_name = instanceName
610  flags.name = "muonLRT"
611  flags.suffix = "MuonLRT"
612  flags.roi = "HLT_Roi_Muon"
613  flags.UsePixelSpacePoints = False
614  flags.etaHalfWidth = 0.2
615  flags.phiHalfWidth = 0.4
616  flags.Triplet_D0Max = 300.
617  flags.TrackInitialD0Max = 300.
618  flags.TrackZ0Max = 500.
619  flags.zedHalfWidth = 225.
620  flags.doSeedRedundancyCheck = True
621  flags.nClustersMin = 8
622  flags.isLRT = True
623  flags.doResMon = True
624  flags.DoPhiFiltering = False
625  #pt config
626  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
627  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
628  flags.maxEta = 2.7
629  flags.doEmCaloSeed = False
630 
631  return flags
632 
633 
634 
635 @signatureActions
636 def tauLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
637 
638  flags.input_name = instanceName
639  flags.name = "tauLRT"
640  flags.suffix = "TauLRT"
641  flags.roi = "HLT_Roi_TauLRT"
642  flags.vertex = "HLT_IDVertex_Tau" # TODO: does this need renaming?
643  flags.pTmin = 0.8*Units.GeV
644  flags.minPT = tsetter(flags.minPT, flags.pTmin)
645  flags.etaHalfWidth = 0.4
646  flags.phiHalfWidth = 0.4
647  flags.zedHalfWidth = 225.
648  flags.UsePixelSpacePoints = False
649  flags.Triplet_D0Max = 300.
650  flags.TrackInitialD0Max = 300.
651  flags.TrackZ0Max = 500.
652  flags.nClustersMin = 8
653  flags.isLRT = True
654  #pt config
655  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
656  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
657  flags.maxEta = 2.7
658  flags.doEmCaloSeed = False
659  if recoMode=="InDet":
660  flags.doTRT = True
661 
662  return flags
663 
664 
665 @signatureActions
666 def bjetLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
667 
668  flags.input_name = instanceName
669  flags.name = "bjetLRT"
670  flags.suffix = "BjetLRT"
671  flags.roi = "HLT_Roi_Bjet"
672  flags.etaHalfWidth = 0.4
673  flags.phiHalfWidth = 0.4
674  flags.UsePixelSpacePoints = False
675  flags.Triplet_D0Max = 300.
676  flags.TrackInitialD0Max = 300.
677  flags.TrackZ0Max = 500.
678  flags.nClustersMin = 8
679  flags.isLRT = True
680  #pt config
681  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
682  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
683  flags.maxEta = 2.7
684  flags.doEmCaloSeed = False
685 
686  return flags
687 
688 
689 @signatureActions
690 def fullScanLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
691 
692  flags.input_name = instanceName
693  flags.name = "fullScanLRT"
694  flags.suffix = "FSLRT"
695  flags.roi = "HLT_Roi_FS"
696  flags.doFullScan = True
697  flags.etaHalfWidth = 3.
698  flags.phiHalfWidth = math.pi
699  flags.doTRT = False
700  flags.doSeedRedundancyCheck = True
701  flags.UsePixelSpacePoints = False
702  flags.Triplet_D0Max = 300.
703  flags.TrackInitialD0Max = 300.
704  flags.TrackZ0Max = 500.
705  flags.Triplet_D0_PPS_Max = 300.
706  flags.DoubletDR_Max = 200
707  flags.nClustersMin = 8
708  flags.isLRT = True
709  #pt config
710  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
711  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
712  flags.maxEta = 2.7
713  flags.doEmCaloSeed = False
714 
715  return flags
716 
717 
718 @signatureActions
719 def DJetLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
720 
721  flags.input_name = instanceName
722  flags.name = "DJetLRT"
723  flags.suffix = "DJLRT"
724  flags.roi = "HLT_Roi_DJ"
725  flags.doFullScan = False
726  flags.etaHalfWidth = 0.4
727  flags.phiHalfWidth = 0.4
728  flags.zedHalfWidth = 225.
729  flags.doTRT = False
730  flags.doSeedRedundancyCheck = True
731  flags.UsePixelSpacePoints = False
732  flags.Triplet_D0Max = 300.
733  flags.TrackInitialD0Max = 300.
734  flags.TrackZ0Max = 500.
735  flags.Triplet_D0_PPS_Max = 300.
736  flags.DoubletDR_Max = 200
737  flags.nClustersMin = 8
738  flags.isLRT = True
739  #pt config
740  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
741  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
742  flags.maxEta = 2.7
743  flags.doEmCaloSeed = False
744 
745  return flags
746 
747 
748 @signatureActions
749 def DVtxLRT(flags: AthConfigFlags, instanceName: str, recoMode: str) -> AthConfigFlags:
750 
751  flags.input_name = instanceName
752  flags.name = "DVtxLRT"
753  flags.suffix = "DVLRT"
754  flags.roi = "HLT_Roi_DV"
755  flags.doFullScan = False
756  flags.etaHalfWidth = 0.35
757  flags.phiHalfWidth = 0.35
758  flags.doTRT = False
759  flags.doSeedRedundancyCheck = True
760  flags.UsePixelSpacePoints = False
761  flags.Triplet_D0Max = 300.
762  flags.TrackInitialD0Max = 300.
763  flags.TrackZ0Max = 500.
764  flags.Triplet_D0_PPS_Max = 300.
765  flags.DoubletDR_Max = 200
766  flags.nClustersMin = 8
767  flags.isLRT = True
768  #pt config
769  flags.maxPrimaryImpact = tsetter(flags.maxPrimaryImpact, 300.*Units.mm)
770  flags.maxEMImpact = tsetter(flags.maxEMImpact, 300.*Units.mm)
771  flags.maxEta = 2.7
772  flags.doEmCaloSeed = False
773 
774  return flags
775 
776 
777 def derivedFromSignatureFlags(flags: AthConfigFlags, recoMode : str):
778 
779  flags.trkTracks_FTF = f'HLT_IDTrkTrack_{flags.suffix}_FTF'
780  flags.trkTracks_IDTrig = f'HLT_IDTrkTrack_{flags.suffix}_IDTrig'
781  flags.tracks_FTF = collToRecordable(flags, f'HLT_IDTrack_{flags.suffix}_FTF')
782  # ToDo: shouldn't be setting flags using this if type structures, the flags should be
783  # actually set somewhere in appropriate config functions
784  flags.tracks_IDTrig = collToRecordable(flags,"HLT_IDTrack_{}_IDTrig".format(flags.suffix if flags.input_name != "tauIso" else "Tau"))
785 
786  if recoMode == "Acts":
787  flags.trkTracks_FTF = f'HLT_Acts_{flags.suffix}_Tracks'
788  flags.trkTracks_IDTrig = f'HLT_Acts_{flags.suffix}_Ambi_Tracks'
789 
790  if flags.isLRT: # to be moved to a separate function once LRTs differ
791  flags.minClusters = tsetter(flags.minClusters , 8)
792  flags.nHolesGapMax = tsetter(flags.nHolesGapMax , 1)
793  flags.nWeightedClustersMin= tsetter(flags.nWeightedClustersMin, 8)
794  flags.maxSiHoles = tsetter(flags.maxSiHoles , 2)
795  flags.maxSCTHoles = tsetter(flags.maxSCTHoles , 1)
796  flags.maxPixelHoles = tsetter(flags.maxPixelHoles , 1)
797  flags.maxDoubleHoles = tsetter(flags.maxDoubleHoles , 0)
798  flags.maxZImpact = tsetter(flags.maxZImpact , 500.)
799 
800 
801  if recoMode == "ITk":
802  flags.extension = flags.input_name #needed in the ITk mode?
803 
804  if flags.isLRT:
805  flags.UsePixelSpacePoints = True #In LRT cases they use only SCT SP, but for ITk we want pixel SP
806 
807 
808 def collToRecordable(flags,name):
809  # ToDo: should just be a flag set per signature in the per signature config
810  # and not setting parameters using tests on the signature name
811  ret = name
812  signature = flags.input_name
813  firstStage = True if "FTF" in name else False
814  record = True
815  if firstStage:
816  if signature in ["minBias","minBiasPixel","bjetLRT",
817  "beamSpot","BeamSpot"]:
818  record = False
819  else:
820  if signature in ["tauCore","tauIso","tauIsoBDT",
821  "jet","fullScan","FS","jetSuper",
822  "beamSpot", "BeamSpot","beamSpotFS",
823  "bjetLRT","DJetLRT","DVtxLRT"]:
824  record = False
825 
826  if record:
827  ret = recordable(name)
828 
829  return ret
830 
831 def addGlobalFlags(flags: AthConfigFlags, category : str):
832  flags.addFlag(f'{category}.RoiZedWidthDefault', 180.0 * Units.mm)
833  flags.addFlag(f'{category}.doGPU', False)
834  flags.addFlag(f'{category}.UseTrigTrackFollowing', False)
835  flags.addFlag(f'{category}.UseTrigRoadPredictor', False)
836  flags.addFlag(f'{category}.UseTracklets', False)
837  flags.addFlag(f'{category}.trackletPoints', 1)
838  flags.addFlag(f'{category}.PixelClusterCacheKey', "PixelTrigClustersCache")
839  flags.addFlag(f'{category}.SCTClusterCacheKey', "SCT_ClustersCache")
840  flags.addFlag(f'{category}.SpacePointCachePix', "PixelSpacePointCache")
841  flags.addFlag(f'{category}.SpacePointCacheSCT', "SctSpacePointCache")
842  flags.addFlag(f'{category}.SCTBSErrCacheKey', "SctBSErrCache")
843  flags.addFlag(f'{category}.SCTFlaggedCondCacheKey', "SctFlaggedCondCache")
844  flags.addFlag(f'{category}.SCTRDOCacheKey', "SctRDOCache")
845  flags.addFlag(f'{category}.PixRDOCacheKey', "PixRDOCache")
846  flags.addFlag(f'{category}.PixBSErrCacheKey', "PixBSErrCache")
847  flags.addFlag(f'{category}.TRTRDOCacheKey', "TrtRDOCache")
848  flags.addFlag(f'{category}.TRT_DriftCircleCacheKey', "TRT_DriftCircleCache")
849 
850 
851 import unittest
852 
853 class FlagValuesTest(unittest.TestCase):
854  def setUp(self):
855  from AthenaConfiguration.AllConfigFlags import initConfigFlags
856  flags = initConfigFlags()
857  flags.Trigger.InDetTracking.electron.pTmin=3.
858  self.newflags = flags.cloneAndReplace('Tracking.ActiveConfig', 'Trigger.InDetTracking.electron',
859  keepOriginal = True)
860  self.newflags2 = flags.cloneAndReplace('Tracking.ActiveConfig', 'Trigger.InDetTracking.muonLRT',
861  keepOriginal = True)
862 
863  def runTest(self):
864  self.assertEqual(self.newflags.Tracking.ActiveConfig.pTmin, 3., msg="Preset value lost")
865  self.assertEqual(self.newflags.Tracking.ActiveConfig.input_name, "electron", msg="Incorrect config")
866  self.assertEqual(self.newflags2.Tracking.ActiveConfig.input_name, "muonLRT", msg="Incorrect config")
867 
868 
869 if __name__ == "__main__":
870  unittest.main()
python.BuildSignatureFlags.FlagValuesTest.setUp
def setUp(self)
Definition: BuildSignatureFlags.py:854
python.BuildSignatureFlags.bjet
AthConfigFlags bjet(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:338
SystemOfUnits
python.BuildSignatureFlags.tauIso
AthConfigFlags tauIso(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:320
vtune_athena.format
format
Definition: vtune_athena.py:14
python.BuildSignatureFlags.FlagValuesTest.newflags2
newflags2
Definition: BuildSignatureFlags.py:860
python.BuildSignatureFlags.muonLRT
AthConfigFlags muonLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:607
python.BuildSignatureFlags.tauLRT
AthConfigFlags tauLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:636
python.BuildSignatureFlags.electron
AthConfigFlags electron(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:264
python.BuildSignatureFlags.addGlobalFlags
def addGlobalFlags(AthConfigFlags flags, str category)
Definition: BuildSignatureFlags.py:831
python.BuildSignatureFlags.muon
AthConfigFlags muon(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:281
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
python.BuildSignatureFlags.FlagValuesTest.runTest
def runTest(self)
Definition: BuildSignatureFlags.py:863
python.BuildSignatureFlags.defaultITkTrigTrackingFlags
AthConfigFlags defaultITkTrigTrackingFlags()
Definition: BuildSignatureFlags.py:128
python.TrackingPassFlags.createTrackingPassFlags
def createTrackingPassFlags()
Definition: TrackingPassFlags.py:18
python.BuildSignatureFlags.defaultModeTrigTrackingFlags
AthConfigFlags defaultModeTrigTrackingFlags(AthConfigFlags flags)
Definition: BuildSignatureFlags.py:154
python.BuildSignatureFlags.fullScanLRT
AthConfigFlags fullScanLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:690
python.BuildSignatureFlags.signatureTrigTrackingFlags
AthConfigFlags signatureTrigTrackingFlags(str mode)
Definition: BuildSignatureFlags.py:157
python.BuildSignatureFlags.collToRecordable
def collToRecordable(flags, name)
Definition: BuildSignatureFlags.py:808
python.BuildSignatureFlags.tauCore
AthConfigFlags tauCore(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:307
python.BuildSignatureFlags.defaultInDetTrigTrackingFlags
AthConfigFlags defaultInDetTrigTrackingFlags()
Definition: BuildSignatureFlags.py:94
python.BuildSignatureFlags.FlagValuesTest.newflags
newflags
Definition: BuildSignatureFlags.py:858
python.BuildSignatureFlags.bmumux
AthConfigFlags bmumux(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:565
python.BuildSignatureFlags.minBiasPixel
AthConfigFlags minBiasPixel(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:405
python.BuildSignatureFlags.cosmics
AthConfigFlags cosmics(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:524
python.BuildSignatureFlags.muonIso
AthConfigFlags muonIso(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:295
python.BuildSignatureFlags.defaultTrigTrackingFlags
def defaultTrigTrackingFlags(AthConfigFlags flags)
Definition: BuildSignatureFlags.py:15
python.BuildSignatureFlags.FlagValuesTest
Definition: BuildSignatureFlags.py:853
python.BuildSignatureFlags.minBias
AthConfigFlags minBias(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:379
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
python.BuildSignatureFlags.beamSpotFS
AthConfigFlags beamSpotFS(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:504
python.BuildSignatureFlags.electronLRT
AthConfigFlags electronLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:581
python.Utilities.__init__
__init__
Definition: Utilities.py:103
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.BuildSignatureFlags.tsetter
def tsetter(var, value)
Definition: BuildSignatureFlags.py:245
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:34
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:454
python.BuildSignatureFlags.DJetLRT
AthConfigFlags DJetLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:719
python.BuildSignatureFlags.DVtxLRT
AthConfigFlags DVtxLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:749
python.BuildSignatureFlags.jetSuper
AthConfigFlags jetSuper(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:353
python.BuildSignatureFlags.signatureActions
def signatureActions(func)
Definition: BuildSignatureFlags.py:235
python.BuildSignatureFlags.derivedFromSignatureFlags
def derivedFromSignatureFlags(AthConfigFlags flags, str recoMode)
Definition: BuildSignatureFlags.py:777
python.BuildSignatureFlags.fullScan
AthConfigFlags fullScan(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:473
python.TrackingPassFlags.createITkTrackingPassFlags
def createITkTrackingPassFlags()
ITk mode ####################.
Definition: TrackingPassFlags.py:121
python.BuildSignatureFlags.bjetLRT
AthConfigFlags bjetLRT(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:666