ATLAS Offline Software
Classes | Functions | Variables
python.HLT.MET.ConfigHelpers Namespace Reference

Classes

class  AlgConfig
 

Functions

def streamer_hypo_tool (chainDict)
 
str metRecoDictToString (dict[str, str] recoDict, bool skipDefaults=True)
 
dict[str, Any] stringToMETRecoDict (str string, bool onlyRecoKeys=False)
 
def make_MET_menu_sequenceGenCfg (flags, sel_acc, hypo_tool)
 

Variables

 log
 
 recoKeys
 

Function Documentation

◆ make_MET_menu_sequenceGenCfg()

def python.HLT.MET.ConfigHelpers.make_MET_menu_sequenceGenCfg (   flags,
  sel_acc,
  hypo_tool 
)

Definition at line 303 of file ConfigHelpers.py.

303 def make_MET_menu_sequenceGenCfg(flags, sel_acc, hypo_tool):
304  return MenuSequenceCA(flags, selectionCA=sel_acc, HypoToolGen=hypo_tool)
305 
306 # Load all the defined configurations

◆ metRecoDictToString()

str python.HLT.MET.ConfigHelpers.metRecoDictToString ( dict[str, str recoDict,
bool   skipDefaults = True 
)
Convert a dictionary containing reconstruction keys to a string

Any key (from recoKeys) missing will just be skipped.

Parameters
----------
recoDict : dict[str, str]
    The reconstruction dictionary
skipDefaults : bool, optional
    If true, skip any values that match the default, by default True

Returns
-------
str
    The fixed string representation

Definition at line 49 of file ConfigHelpers.py.

49 def metRecoDictToString(recoDict: dict[str, str], skipDefaults: bool = True) -> str:
50  """Convert a dictionary containing reconstruction keys to a string
51 
52  Any key (from recoKeys) missing will just be skipped.
53 
54  Parameters
55  ----------
56  recoDict : dict[str, str]
57  The reconstruction dictionary
58  skipDefaults : bool, optional
59  If true, skip any values that match the default, by default True
60 
61  Returns
62  -------
63  str
64  The fixed string representation
65  """
66  return "_".join(
67  recoDict[k]
68  for k in recoKeys
69  if k in recoDict
70  and (not skipDefaults or recoDict[k] != METChainParts_Default[k])
71  )
72 
73 

◆ streamer_hypo_tool()

def python.HLT.MET.ConfigHelpers.streamer_hypo_tool (   chainDict)

Definition at line 28 of file ConfigHelpers.py.

28 def streamer_hypo_tool(chainDict):
29  return CompFactory.TrigStreamerHypoTool(chainDict["chainName"])
30 
31 

◆ stringToMETRecoDict()

dict[str, Any] python.HLT.MET.ConfigHelpers.stringToMETRecoDict ( str  string,
bool   onlyRecoKeys = False 
)
Convert a string to a MET reco dict. Optionally only keep entries contained in recoKeys. 
Necessary for correctly configuring algorithms as inputs to NN.

Definition at line 74 of file ConfigHelpers.py.

74 def stringToMETRecoDict(string: str, onlyRecoKeys: bool = False) -> dict[str, Any]:
75  """Convert a string to a MET reco dict. Optionally only keep entries contained in recoKeys.
76  Necessary for correctly configuring algorithms as inputs to NN.
77  """
78  defaults = copy(METChainParts_Default)
79  if onlyRecoKeys:
80  defaults = {key: defaults[key] for key in recoKeys}
81  # Now go through the parts of the string and fill in the dict
82  for part in string.split("_"):
83  for key, values in METChainParts.items():
84  if not isinstance(values, list):
85  continue
86  if part in values:
87  if isinstance(defaults[key], list):
88  defaults[key].append(part) # type: ignore[attr-defined]
89  else:
90  defaults[key] = part
91  return defaults
92 
93 

Variable Documentation

◆ log

python.HLT.MET.ConfigHelpers.log

Definition at line 32 of file ConfigHelpers.py.

◆ recoKeys

python.HLT.MET.ConfigHelpers.recoKeys

Definition at line 37 of file ConfigHelpers.py.

python.HLT.MET.ConfigHelpers.metRecoDictToString
str metRecoDictToString(dict[str, str] recoDict, bool skipDefaults=True)
Definition: ConfigHelpers.py:49
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.HLT.MET.ConfigHelpers.streamer_hypo_tool
def streamer_hypo_tool(chainDict)
Definition: ConfigHelpers.py:28
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.HLT.MET.ConfigHelpers.make_MET_menu_sequenceGenCfg
def make_MET_menu_sequenceGenCfg(flags, sel_acc, hypo_tool)
Definition: ConfigHelpers.py:303
calibdata.copy
bool copy
Definition: calibdata.py:27
python.HLT.MET.ConfigHelpers.stringToMETRecoDict
dict[str, Any] stringToMETRecoDict(str string, bool onlyRecoKeys=False)
Definition: ConfigHelpers.py:74