Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrigADHypoConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 log = logging.getLogger('TrigADHypoAlgs')
7 
8 # Object cuts sets used to configure the AD input multiplicity and pT threshold
9 object_cuts_sets = {
10  "default": {
11  "max_jets": 6,
12  "max_electrons": 3,
13  "max_muons": 3,
14  "max_photons": 3,
15  }
16 }
17 
18 # cuts applied for each config value
19 config_dict = {
20  "default":{
21  "object_cuts": "default",
22  "adScoreThres": 0.5,
23  },
24  "L":{
25  "object_cuts": "default",
26  "adScoreThres": 8.768, # 20 Hz est. w/ v2
27  },
28  "M":{
29  "object_cuts": "default",
30  "adScoreThres": 10.574, # 10 Hz est. w/ v2
31  },
32  "T":{
33  "object_cuts": "default",
34  "adScoreThres": 15.0277, # 5 Hz est. w/ v2
35  }
36 
37 }
38 
39 def TrigADGetConfigValue(chainDict, key):
40  values = [i.strip(key) for i in chainDict['topo']]
41 
42  if len(values) != 1:
43  raise RuntimeError("Invalid chain dictionary for AD trigger, unable to find config value in {}".format(str(chainDict)))
44 
45  return values[0]
46 
48  name = chainDict['chainName']
49 
50  log.debug("Inside AD ComboHypoToolFromDict")
51  log.debug("chainDict:", chainDict)
52 
53  cfg_name = TrigADGetConfigValue(chainDict, "anomdet")
54  cfg = config_dict[cfg_name]
55 
56  obj_cuts = object_cuts_sets[cfg["object_cuts"]]
57 
58  tool = CompFactory.TrigADComboHypoTool(
59  name,
60  max_jets = obj_cuts["max_jets"],
61  max_electrons = obj_cuts["max_electrons"],
62  max_muons = obj_cuts["max_muons"],
63  max_photons = obj_cuts["max_photons"],
64  ModelFileName = "TrigAnomalyDetectionHypo/2025-03-12/HLT_AD_v2.onnx",
65  adScoreThres = float(cfg["adScoreThres"])
66  )
67 
68  return tool
vtune_athena.format
format
Definition: vtune_athena.py:14
TrigADHypoConfig.TrigADComboHypoToolFromDict
def TrigADComboHypoToolFromDict(chainDict)
Definition: TrigADHypoConfig.py:47
TrigADHypoConfig.TrigADGetConfigValue
def TrigADGetConfigValue(chainDict, key)
Definition: TrigADHypoConfig.py:39
str
Definition: BTagTrackIpAccessor.cxx:11
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65