Inherits ABC.
Inherited by python.HLT.MET.AlgConfigs.CellConfig, python.HLT.MET.AlgConfigs.CVFPufitConfig, python.HLT.MET.AlgConfigs.MHTConfig, python.HLT.MET.AlgConfigs.MHTPufitConfig, python.HLT.MET.AlgConfigs.NNHLTConfig, python.HLT.MET.AlgConfigs.PFOPufitConfig, python.HLT.MET.AlgConfigs.PFSumConfig, python.HLT.MET.AlgConfigs.TCConfig, python.HLT.MET.AlgConfigs.TCPufitConfig, and python.HLT.MET.AlgConfigs.TrkMHTConfig.
|
str | algType (cls) |
|
def | __init__ (self, **str recoDict) |
|
str | outputKey (self) |
|
str | fexName (self) |
|
dict[str, Any] | interpret_reco_dict (self) |
|
def | getMonTool (self, flags) |
|
str | name_step (self, idx) |
|
StepOutput | make_reco_algs (self, flags, **recoDict) |
|
def | make_reco_ca (self, flags) |
|
def | make_accumulator_steps (self, flags, chainDict) |
|
def | make_hypo_alg (self) |
|
def | make_passthrough_hypo_alg (self, step) |
|
def | inputMakerCA (self, idx) |
|
AlgConfig | fromRecoDict (cls, EFrecoAlg, **recoDict) |
|
Base class to describe algorithm configurations
Each individual 'EFrecoAlg' should be described by *one* AlgConfig subclass.
It must provide its list of required inputs to the constructor and override
the make_fex method
The name of fexAlg *must* be self.fexName and the METContainerKey property
*must* be set to self.outputKey (but this class usually should take care of
this).
The subclass must also implement the @classmethod 'algType' which returns
the EFrecoAlg string that it describes.
Definition at line 94 of file ConfigHelpers.py.
◆ __init__()
def python.HLT.MET.ConfigHelpers.AlgConfig.__init__ |
( |
|
self, |
|
|
**str |
recoDict |
|
) |
| |
Initialise the base class
=========
Arguments
=========
recoDict: Pass *all* the keys required for the recoDict
Definition at line 119 of file ConfigHelpers.py.
119 def __init__(self, **recoDict: str):
120 """Initialise the base class
125 recoDict: Pass *all* the keys required for the recoDict
130 alg_type = self.algType()
131 assert all(k
in recoDict
for k
in recoKeys), (
132 f
"AlgConfig.__init__ for {alg_type} did not receive all the recoKeys"
133 " - this suggests a problem in the subclass __init__ method!"
135 self.recoDict =
copy(recoDict)
◆ _append_fex()
None python.HLT.MET.ConfigHelpers.AlgConfig._append_fex |
( |
|
self, |
|
|
|
flags, |
|
|
|
fex, |
|
|
Optional[StepOutput] |
inputs = None |
|
) |
| |
|
private |
Append the FEX to the output object
Finalizes the FEX by setting the monitoring tool and output name.
Definition at line 168 of file ConfigHelpers.py.
168 def _append_fex(self, flags, fex, inputs: Optional[StepOutput] =
None) ->
None:
169 """Append the FEX to the output object
171 Finalizes the FEX by setting the monitoring tool and output name.
173 fex.MonTool = self.getMonTool(flags)
174 fex.METContainerKey = self.outputKey
176 acc.addEventAlgo(fex, primary=
True)
177 return StepOutput.create(acc, inputs, MET=self.outputKey)
◆ _get_subclasses()
def python.HLT.MET.ConfigHelpers.AlgConfig._get_subclasses |
( |
|
cls | ) |
|
|
private |
Provides a way to iterate over all subclasses of this class
Definition at line 288 of file ConfigHelpers.py.
288 def _get_subclasses(cls):
289 """Provides a way to iterate over all subclasses of this class"""
290 for subcls
in cls.__subclasses__():
291 for subsubcls
in subcls.__subclasses__():
◆ algType()
str python.HLT.MET.ConfigHelpers.AlgConfig.algType |
( |
|
cls | ) |
|
◆ fexName()
str python.HLT.MET.ConfigHelpers.AlgConfig.fexName |
( |
|
self | ) |
|
The name of the algorithm made by this configuration
Definition at line 146 of file ConfigHelpers.py.
146 def fexName(self) -> str:
147 """The name of the algorithm made by this configuration"""
148 return "EFMET_{}".
format(self._suffix)
◆ fromRecoDict()
AlgConfig python.HLT.MET.ConfigHelpers.AlgConfig.fromRecoDict |
( |
|
cls, |
|
|
|
EFrecoAlg, |
|
|
** |
recoDict |
|
) |
| |
Definition at line 296 of file ConfigHelpers.py.
296 def fromRecoDict(cls, EFrecoAlg, **recoDict) -> AlgConfig:
297 for subcls
in cls._get_subclasses():
298 if subcls.algType() == EFrecoAlg:
299 return subcls(EFrecoAlg=EFrecoAlg, **recoDict)
301 raise ValueError(
"Unknown EFrecoAlg '{}' requested".
format(EFrecoAlg))
◆ getMonTool()
def python.HLT.MET.ConfigHelpers.AlgConfig.getMonTool |
( |
|
self, |
|
|
|
flags |
|
) |
| |
Create the monitoring tool
Definition at line 154 of file ConfigHelpers.py.
154 def getMonTool(self, flags):
155 """Create the monitoring tool"""
◆ inputMakerCA()
def python.HLT.MET.ConfigHelpers.AlgConfig.inputMakerCA |
( |
|
self, |
|
|
|
idx |
|
) |
| |
Get the InEventRecoCA for the given step index
Definition at line 264 of file ConfigHelpers.py.
264 def inputMakerCA(self, idx):
265 """Get the InEventRecoCA for the given step index"""
266 from TrigT2CaloCommon.CaloDef
import clusterFSInputMaker
267 from AthenaConfiguration.ComponentFactory
import CompFactory
268 from ..CommonSequences.FullScanDefs
import trkFSRoI
270 name = self.name_step(idx) +
"Reco"
276 return InEventRecoCA(
278 inputMaker=CompFactory.InputMakerForRoI(
279 "IM_Jet_TrackingStep",
280 RoITool=CompFactory.ViewCreatorInitialROITool(),
285 raise KeyError(f
"No input maker for step {idx}")
◆ interpret_reco_dict()
dict[str, Any] python.HLT.MET.ConfigHelpers.AlgConfig.interpret_reco_dict |
( |
|
self | ) |
|
◆ make_accumulator_steps()
def python.HLT.MET.ConfigHelpers.AlgConfig.make_accumulator_steps |
( |
|
self, |
|
|
|
flags, |
|
|
|
chainDict |
|
) |
| |
Make the full accumulator steps
Definition at line 193 of file ConfigHelpers.py.
193 def make_accumulator_steps(self, flags, chainDict):
194 """Make the full accumulator steps"""
197 reco_sequences = self.make_reco_algs(flags, **self.interpret_reco_dict()).steps
202 for step_idx, reco_sequence
in enumerate(reco_sequences):
203 reco_acc = self.inputMakerCA(step_idx)
205 step_name = f
"Empty_METStep{step_idx}"
209 if step_idx == len(reco_sequences) - 1:
211 hypo_alg = self.make_hypo_alg()
212 hypo_tool = TrigMETHypoToolFromDict
215 hypo_alg = self.make_passthrough_hypo_alg(step_idx)
216 hypo_tool = streamer_hypo_tool
219 reco_acc.mergeReco(reco_sequence)
222 sel_acc = SelectionCA(
"METAthSeq_" + self.name_step(step_idx))
224 sel_acc.mergeReco(reco_acc)
226 sel_acc.addHypoAlgo(hypo_alg)
233 step_name = sel_acc.name
239 multiplicity=[]
if sel_acc
is None else [1],
240 chainDicts=[chainDict],
244 functools.partial(make_MET_menu_sequenceGenCfg, flags, sel_acc, hypo_tool)
246 comboHypoCfg=ComboHypoCfg
◆ make_hypo_alg()
def python.HLT.MET.ConfigHelpers.AlgConfig.make_hypo_alg |
( |
|
self | ) |
|
The hypo alg used for this configuration
Definition at line 253 of file ConfigHelpers.py.
254 """The hypo alg used for this configuration"""
255 return CompFactory.TrigMissingETHypoAlg(
256 f
"METHypoAlg_{self._suffix}", METContainerKey=self.outputKey
◆ make_passthrough_hypo_alg()
def python.HLT.MET.ConfigHelpers.AlgConfig.make_passthrough_hypo_alg |
( |
|
self, |
|
|
|
step |
|
) |
| |
Definition at line 259 of file ConfigHelpers.py.
259 def make_passthrough_hypo_alg(self, step):
260 return CompFactory.TrigStreamerHypoAlg(
261 "METPassThroughHypo_" + self.name_step(step)
◆ make_reco_algs()
StepOutput python.HLT.MET.ConfigHelpers.AlgConfig.make_reco_algs |
( |
|
self, |
|
|
|
flags, |
|
|
** |
recoDict |
|
) |
| |
Create the reconstruction sequences including the FEX
Returns a list of CAs split by step
Reimplemented in python.HLT.MET.AlgConfigs.NNHLTConfig, python.HLT.MET.AlgConfigs.MHTPufitConfig, python.HLT.MET.AlgConfigs.CVFPufitConfig, python.HLT.MET.AlgConfigs.PFOPufitConfig, python.HLT.MET.AlgConfigs.PFSumConfig, python.HLT.MET.AlgConfigs.TrkMHTConfig, python.HLT.MET.AlgConfigs.MHTConfig, python.HLT.MET.AlgConfigs.TCPufitConfig, python.HLT.MET.AlgConfigs.TCConfig, and python.HLT.MET.AlgConfigs.CellConfig.
Definition at line 162 of file ConfigHelpers.py.
162 def make_reco_algs(self, flags, **recoDict) -> StepOutput:
163 """Create the reconstruction sequences including the FEX
165 Returns a list of CAs split by step
◆ make_reco_ca()
def python.HLT.MET.ConfigHelpers.AlgConfig.make_reco_ca |
( |
|
self, |
|
|
|
flags |
|
) |
| |
Make the reconstruction sequences for the new JO style
Definition at line 179 of file ConfigHelpers.py.
179 def make_reco_ca(self, flags):
180 """Make the reconstruction sequences for the new JO style"""
182 log.verbose(
"Create inputs for %s", self._suffix)
183 steps, inputs = self.inputRegistry.build_steps(
184 flags, self._inputs, metFSRoIs, self.recoDict, return_ca=
True
187 fex = self.make_fex_accumulator(flags, self.fexName, inputs)
188 fex.MonTool = self.getMonTool(flags)
189 fex.METContainerKey = self.outputKey
190 steps[-1].addEventAlgo(fex)
◆ name_step()
str python.HLT.MET.ConfigHelpers.AlgConfig.name_step |
( |
|
self, |
|
|
|
idx |
|
) |
| |
Definition at line 158 of file ConfigHelpers.py.
158 def name_step(self, idx) -> str:
159 return f
"step{ascii_uppercase[idx]}_{self._suffix}"
◆ outputKey()
str python.HLT.MET.ConfigHelpers.AlgConfig.outputKey |
( |
|
self | ) |
|
The MET container object produced by this algorithm
Definition at line 139 of file ConfigHelpers.py.
140 """The MET container object produced by this algorithm"""
141 from TrigEDMConfig.TriggerEDM
import recordable
◆ _suffix
python.HLT.MET.ConfigHelpers.AlgConfig._suffix |
|
private |
◆ recoDict
python.HLT.MET.ConfigHelpers.AlgConfig.recoDict |
The documentation for this class was generated from the following file: