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

Classes

class  AlgConfig
 

Functions

def streamer_hypo_tool (flags, 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 301 of file ConfigHelpers.py.

301 def make_MET_menu_sequenceGenCfg(flags, sel_acc, hypo_tool):
302  return MenuSequence(flags, selectionCA=sel_acc, HypoToolGen=hypo_tool)
303 
304 # 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 48 of file ConfigHelpers.py.

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

◆ streamer_hypo_tool()

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

Definition at line 27 of file ConfigHelpers.py.

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

◆ 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 73 of file ConfigHelpers.py.

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

Variable Documentation

◆ log

python.HLT.MET.ConfigHelpers.log

Definition at line 31 of file ConfigHelpers.py.

◆ recoKeys

python.HLT.MET.ConfigHelpers.recoKeys

Definition at line 36 of file ConfigHelpers.py.

python.HLT.MET.ConfigHelpers.streamer_hypo_tool
def streamer_hypo_tool(flags, chainDict)
Definition: ConfigHelpers.py:27
python.HLT.MET.ConfigHelpers.metRecoDictToString
str metRecoDictToString(dict[str, str] recoDict, bool skipDefaults=True)
Definition: ConfigHelpers.py:48
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
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:301
calibdata.copy
bool copy
Definition: calibdata.py:26
python.HLT.MET.ConfigHelpers.stringToMETRecoDict
dict[str, Any] stringToMETRecoDict(str string, bool onlyRecoKeys=False)
Definition: ConfigHelpers.py:73