ATLAS Offline Software
MenuComponents.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from TriggerMenuMT.HLT.Config.Utility.HLTMenuConfig import HLTMenuConfig
4 from TriggerMenuMT.HLT.Config.ControlFlow.MenuComponentsNaming import CFNaming
5 from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFTools import (NoHypoToolCreated,
6  algColor,
7  isHypoBase,
8  isInputMakerBase)
9 from AthenaCommon.CFElements import parOR, seqAND, findAlgorithmByPredicate
10 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 from DecisionHandling.DecisionHandlingConfig import ComboHypoCfg
13 from TriggerJobOpts.TriggerConfigFlags import ROBPrefetching
14 
15 from collections.abc import MutableSequence
16 import functools
17 import re
18 import types
19 
20 from AthenaCommon.Logging import logging
21 log = logging.getLogger( __name__ )
22 # Pool of mutable ComboHypo instances (FIXME: ATR-29181)
23 _ComboHypoPool = dict()
24 _CustomComboHypoAllowed = set()
25 
26 class Node(object):
27  """base class representing one Alg + inputs + outputs, to be used to connect """
28  """stores all the inputs, even if repeated (self.inputs)"""
29  def __init__(self, Alg):
30  self.name = ("%sNode")%( Alg.getName() )
31  self.Alg=Alg
32  self.inputs=[]
33  self.outputs=[]
34 
35  def addOutput(self, name):
36  self.outputs.append(str(name))
37 
38  def addInput(self, name):
39  self.inputs.append(str(name))
40 
41  def getOutputList(self):
42  return self.outputs
43 
44  def getInputList(self):
45  return self.inputs
46 
47  def __repr__(self):
48  return "Node::%s [%s] -> [%s]"%(self.Alg.getName(), ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList())))
49 
50 
51 class AlgNode(Node):
52  """Node class that represent an algorithm: sets R/W handles (as unique input/output) and properties as parameters """
53  """Automatically de-duplicates input ReadHandles upon repeated calls to addInput."""
54  def __init__(self, Alg, inputProp, outputProp):
55  Node.__init__(self, Alg)
56  self.outputProp = outputProp
57  self.inputProp = inputProp
58 
59  def setPar(self, propname, value):
60  cval = getattr( self.Alg, propname)
61  if isinstance(cval, MutableSequence):
62  cval.append(value)
63  return setattr(self.Alg, propname, cval)
64  else:
65  return setattr(self.Alg, propname, value)
66 
67  def addOutput(self, name):
68  outputs = self.readOutputList()
69  if name in outputs:
70  log.debug("Output DH not added in %s: %s already set!", self.Alg.getName(), name)
71  else:
72  if self.outputProp != '':
73  self.setPar(self.outputProp, name)
74  else:
75  log.debug("no outputProp set for output of %s", self.Alg.getName())
76  Node.addOutput(self, name)
77 
78  def readOutputList(self):
79  cval = getattr(self.Alg, self.outputProp)
80  return (cval if isinstance(cval, MutableSequence) else
81  ([str(cval)] if cval else []))
82 
83  def addInput(self, name):
84  inputs = self.readInputList()
85  if name in inputs:
86  log.debug("Input DH not added in %s: %s already set!", self.Alg.getName(), name)
87  else:
88  if self.inputProp != '':
89  self.setPar(self.inputProp, name)
90  else:
91  log.debug("no InputProp set for input of %s", self.Alg.getName())
92  Node.addInput(self, name)
93  return len(self.readInputList())
94 
95  def readInputList(self):
96  cval = getattr(self.Alg, self.inputProp)
97  return (cval if isinstance(cval, MutableSequence) else
98  ([str(cval)] if cval else []))
99 
100  def __repr__(self):
101  return "Alg::%s [%s] -> [%s]"%(self.Alg.getName(), ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList())))
102 
103 
105  """ Class to group info on hypotools for ChainDict"""
106  def __init__(self, hypoToolGen):
107  self.hypoToolGen = hypoToolGen
108  self.name=hypoToolGen.__name__
109 
110  def setConf( self, chainDict):
111  if type(chainDict) is not dict:
112  raise RuntimeError("Configuring hypo with %s, not good anymore, use chainDict" % str(chainDict) )
113  self.chainDict = chainDict
114 
115  def create(self, flags):
116  """creates instance of the hypo tool"""
117  return self.hypoToolGen( flags, self.chainDict )
118 
119  def confAndCreate(self, flags, chainDict):
120  """sets the configuration and creates instance of the hypo tool"""
121  self.setConf(chainDict)
122  return self.create(flags)
123 
124 
126  """AlgNode for HypoAlgs"""
127  initialOutput= 'StoreGateSvc+UNSPECIFIED_OUTPUT'
128  def __init__(self, Alg):
129  assert isHypoBase(Alg), "Error in creating HypoAlgNode from Alg " + Alg.name
130  AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions')
131  self.previous=[]
132 
133  def addOutput(self, name):
134  outputs = self.readOutputList()
135  if name in outputs:
136  log.debug("Output DH not added in %s: %s already set!", self.name, name)
137  elif self.initialOutput in outputs:
138  AlgNode.addOutput(self, name)
139  else:
140  log.error("Hypo %s has already %s as configured output: you may want to duplicate the Hypo!",
141  self.name, outputs[0])
142 
143  def addHypoTool (self, flags, hypoToolConf):
144  log.debug("Adding HypoTool %s for chain %s to %s", hypoToolConf.name, hypoToolConf.chainDict['chainName'], self.Alg.getName())
145  try:
146  result = hypoToolConf.create(flags)
147  if isinstance(result, ComponentAccumulator):
148  tool = result.popPrivateTools()
149  assert not isinstance(tool, list), "Can not handle list of tools"
150  self.Alg.HypoTools.append(tool)
151  return result
152  else:
153  self.Alg.HypoTools = self.Alg.HypoTools + [result] # see ATEAM-773
154 
155  except NoHypoToolCreated as e:
156  log.debug("%s returned empty tool: %s", hypoToolConf.name, e)
157  return None
158 
159  def setPreviousDecision(self,prev):
160  self.previous.append(prev)
161  return self.addInput(prev)
162 
163  def __repr__(self):
164  return "HypoAlg::%s [%s] -> [%s], previous = [%s], HypoTools=[%s]" % \
165  (self.Alg.name,' '.join(map(str, self.getInputList())),
166  ' '.join(map(str, self.getOutputList())),
167  ' '.join(map(str, self.previous)),
168  ' '.join([t.getName() for t in self.Alg.HypoTools]))
169 
170 
172  """AlgNode for InputMaker Algs"""
173  def __init__(self, Alg):
174  assert isInputMakerBase(Alg), "Error in creating InputMakerNode from Alg " + Alg.name
175  AlgNode.__init__(self, Alg, 'InputMakerInputDecisions', 'InputMakerOutputDecisions')
176  input_maker_output = CFNaming.inputMakerOutName(self.Alg.name)
177  self.addOutput(input_maker_output)
178 
179 
181  """AlgNode for Combo HypoAlgs"""
182  def __init__(self, name, comboHypoCfg):
183  self.comboHypoCfg = comboHypoCfg
184  self.acc = self.create( name )
185  thealgs= self.acc.getEventAlgos()
186  if thealgs is None:
187  log.error("ComboHypoNode: Combo alg %s not found", name)
188  if len(thealgs) != 1:
189  log.error("ComboHypoNode: Combo alg %s len is %d",name, len(thealgs))
190  Alg=thealgs[0]
191 
192  log.debug("ComboHypoNode init: Alg %s", name)
193  AlgNode.__init__(self, Alg, 'HypoInputDecisions', 'HypoOutputDecisions')
194 
195  def __del__(self):
196  self.acc.wasMerged()
197 
198  def create (self, name):
199  log.debug("ComboHypoNode.create %s",name)
200  return self.comboHypoCfg(name=name)
201 
202  """
203  AlgNode automatically de-duplicates input ReadHandles upon repeated calls to addInput.
204  Node instead stores all the inputs, even if repeated (self.inputs)
205  This function maps from the raw number of times that addInput was called to the de-duplicated index of the handle.
206  E.g. a step processing chains such as HLT_e5_mu6 would return [0,1]
207  E.g. a step processing chains such as HLT_e5_e6 would return [0,0]
208  E.g. a step processing chains such as HLT_e5_mu6_mu7 would return [0,1,1]
209  These data are needed to configure the step's ComboHypo
210  """
212  mapping = []
213  theInputs = self.readInputList() #only unique inputs
214  for rawInput in self.inputs: # all inputs
215  mapping.append( theInputs.index(rawInput) )
216  return mapping
217 
218 
219  def addChain(self, chainDict):
220  chainName = chainDict['chainName']
221  chainMult = chainDict['chainMultiplicities']
222  legsToInputCollections = self.mapRawInputsToInputsIndex()
223  if len(chainMult) != len(legsToInputCollections):
224  log.error("ComboHypoNode for Alg:{} with addChain for:{} Chain multiplicity:{} Per leg input collection index:{}."
225  .format(self.Alg.name, chainName, tuple(chainMult), tuple(legsToInputCollections)))
226  log.error("The size of the multiplicies vector must be the same size as the per leg input collection vector.")
227  log.error("The ComboHypo needs to know which input DecisionContainers contain the DecisionObjects to be used for each leg.")
228  log.error("Check why ComboHypoNode.addInput(...) was not called exactly once per leg.")
229  raise Exception("[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
230 
231  if chainName in self.Alg.MultiplicitiesMap:
232  log.error("ComboAlg %s has already been configured for chain %s", self.Alg.name, chainName)
233  raise Exception("[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
234  else:
235  self.Alg.MultiplicitiesMap[chainName] = chainMult
236  self.Alg.LegToInputCollectionMap[chainName] = legsToInputCollections
237 
238 
239  def getChains(self):
240  return self.Alg.MultiplicitiesMap.keys()
241 
242 
243  def createComboHypoTools(self, flags, chainDict, comboToolConfs):
244  """Create the ComboHypoTools and add them to the main alg"""
245  if not len(comboToolConfs):
246  return
247  confs = [ HypoToolConf( tool ) for tool in comboToolConfs ]
248  log.debug("ComboHypoNode.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict["chainName"],self.Alg.getName(), len(comboToolConfs))
249  for conf in confs:
250  log.debug("ComboHypoNode.createComboHypoTools adding %s", conf)
251  tools = self.Alg.ComboHypoTools
252  self.Alg.ComboHypoTools = tools + [ conf.confAndCreate( flags, chainDict ) ]
253 
254 
255 
258 
260  """Class to emulate reco sequences with no Hypo"""
261  """It contains an InputMaker and and empty seqAND used for merging"""
262  """It contains empty function to follow the same MenuSequence behaviour"""
263  def __init__(self, the_name):
264  log.debug("Made EmptySequence %s", the_name)
265  self._name = the_name
266 
267  # isEmptyStep causes the IM to try at runtime to merge by feature by default
268  # (i.e for empty steps appended after a leg has finised). But if this failes then it will
269  # merge by initial ROI instead (i.e. for empy steps prepended before a leg has started)
270  makerAlg = CompFactory.InputMakerForRoI(f"IM{the_name}",
271  isEmptyStep = True,
272  RoIsLink = 'initialRoI')
273 
274  self._maker = InputMakerNode( Alg = makerAlg )
275  self._sequence = Node( Alg = seqAND(the_name, [makerAlg]))
276 
278  self.ca.addSequence(seqAND(the_name))
279  self.ca.addEventAlgo(makerAlg, sequenceName=the_name)
280 
281  def __del__(self):
282  self.ca.wasMerged()
283 
284  @property
285  def sequence(self):
286  return self._sequence
287 
288  @property
289  def maker(self):
290  # Input makers are added during DataFlow building (connectToFilter) when a chain
291  # uses this sequence in another step. So we need to make sure to update the
292  # algorithm when accessed.
293  self._maker.Alg = self.ca.getEventAlgo(self._maker.Alg.name)
294  return self._maker
295 
296  @property
297  def name(self):
298  return self._name
299 
300  def getOutputList(self):
301  return self.maker.readOutputList() # Only one since it's merged
302 
303  def connectToFilter(self, outfilter):
304  """Connect filter to the InputMaker"""
305  self.maker.addInput(outfilter)
306 
307  def getHypoToolConf(self):
308  return None
309 
310  def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file):
311  cfseq_algs.append(self.maker)
312  cfseq_algs.append(self.sequence )
313  file.write(" %s[fillcolor=%s]\n"%(self.maker.Alg.getName(), algColor(self.maker.Alg)))
314  file.write(" %s[fillcolor=%s]\n"%(self.sequence.Alg.getName(), algColor(self.sequence.Alg)))
315  return cfseq_algs, all_hypos, last_step_hypo_nodes
316 
317  def __repr__(self):
318  return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\
319  %(self.name, "Empty", self.maker.Alg.getName(), self.sequence.Alg.getName(), "None")
320 
321 def createEmptyMenuSequenceCfg(flags, name):
322  """ creates the generator function named as the empty sequence"""
323  def create_sequence(flags, name):
324  return EmptyMenuSequence(name)
325  # this allows to create the function with the same name as the sequence
326  create_sequence.__name__ = name
327  globals()[name] = create_sequence
328  return globals()[name]
329 
330 
332  return 'Empty' in o.func.__name__
333 
335  """Class to group reco sequences with the Hypo.
336  By construction it has one Hypo only, which gives the name to this class object"""
337 
338  def __init__(self, flags, selectionCA, HypoToolGen):
339  self.ca = selectionCA
340  # separate the HypoCA to be merged later
341  self.hypoAcc = selectionCA.hypoAcc
342 
343  sequence = self.ca.topSequence()
344  self._sequence = Node(Alg=sequence)
345 
346  # get the InputMaker
347  inputMaker = [ a for a in self.ca.getEventAlgos() if isInputMakerBase(a)]
348  assert len(inputMaker) == 1, f"{len(inputMaker)} input makers in the ComponentAccumulator"
349  inputMaker = inputMaker[0]
350  assert inputMaker.name.startswith("IM"), f"Input maker {inputMaker.name} name needs to start with 'IM'"
351  self._maker = InputMakerNode( Alg = inputMaker )
352  input_maker_output = self.maker.readOutputList()[0] # only one since it's merged
353 
354 
355  # get the HypoAlg
356  hypoAlg = selectionCA.hypoAcc.getEventAlgos()
357  assert len(hypoAlg) == 1, f"{len(hypoAlg)} hypo algs in the ComponentAccumulator"
358  hypoAlg = hypoAlg[0]
359  hypoAlg.RuntimeValidation = flags.Trigger.doRuntimeNaviVal
360 
361  self._name = CFNaming.menuSequenceName(hypoAlg.name)
362  self._hypo = HypoAlgNode( Alg = hypoAlg )
363  self._hypo.addOutput( CFNaming.hypoAlgOutName(hypoAlg.name) )
364  self._hypo.setPreviousDecision( input_maker_output )
365  self._hypoToolConf = HypoToolConf( HypoToolGen )
366 
367  # Connect InputMaker output to ROBPrefetchingAlg(s) if there is any
368  if ROBPrefetching.StepRoI in flags.Trigger.ROBPrefetchingOptions:
369  for child in sequence.Members:
370  if ( isinstance(child, CompFactory.ROBPrefetchingAlg) and
371  input_maker_output not in child.ROBPrefetchingInputDecisions ):
372  child.ROBPrefetchingInputDecisions.append(input_maker_output)
373 
374  log.debug("connecting InputMaker and HypoAlg, adding: InputMaker::%s.output=%s",
375  self.maker.Alg.name, input_maker_output)
376  log.debug("HypoAlg::%s.HypoInputDecisions=%s, HypoAlg::%s.HypoOutputDecisions=%s",
377  self.hypo.Alg.name, self.hypo.readInputList()[0],
378  self.hypo.Alg.name, self.hypo.readOutputList()[0])
379 
380  def __del__(self):
381  self.ca.wasMerged()
382  self.hypoAcc.wasMerged()
383 
384  @property
385  def name(self):
386  return self._name
387 
388  @property
389  def sequence(self):
390  return self._sequence
391 
392  @property
393  def maker(self):
394  # Input makers are added during DataFlow building (connectToFilter) when a chain
395  # uses this sequence in another step. So we need to make sure to update the
396  # algorithm when accessed.
397  self._maker.Alg = self.ca.getEventAlgo(self._maker.Alg.name)
398  return self._maker
399 
400  @property
401  def hypo(self):
402  return self._hypo
403 
404  def getOutputList(self):
405  return [self._hypo.readOutputList()[0]]
406 
407  def connectToFilter(self, outfilter):
408  """Connect filter to the InputMaker"""
409  log.debug("connecting %s to inputs of %s", outfilter, self.maker.Alg.name)
410  self.maker.addInput(outfilter)
411 
412  def getHypoToolConf(self) :
413  return self._hypoToolConf
414 
415 
416  def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file):
417  cfseq_algs.append(self.maker)
418  cfseq_algs.append(self.sequence)
419  file.write(" %s[fillcolor=%s]\n"%(self.maker.Alg.getName(), algColor(self.maker.Alg)))
420  file.write(" %s[fillcolor=%s]\n"%(self.sequence.Alg.getName(), algColor(self.sequence.Alg)))
421  cfseq_algs.append(self._hypo)
422  file.write(" %s[color=%s]\n"%(self._hypo.Alg.getName(), algColor(self._hypo.Alg)))
423  all_hypos.append(self._hypo)
424  return cfseq_algs, all_hypos, last_step_hypo_nodes
425 
426  def __repr__(self):
427  hyponame = self._hypo.Alg.name
428  hypotool = self._hypoToolConf.name
429  return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\
430  %(self.name, hyponame, self.maker.Alg.name, self.sequence.Alg.name, hypotool)
431 
432 
433 class Chain(object):
434  """Basic class to define the trigger menu """
435  __slots__ ='name','steps','nSteps','alignmentGroups','L1decisions', 'topoMap'
436  def __init__(self, name, ChainSteps, L1decisions, nSteps = None, alignmentGroups = None, topoMap=None):
437 
438  """
439  Construct the Chain from the steps
440  Out of all arguments the ChainSteps & L1Thresholds are most relevant, the chain name is used in debug messages
441  """
442 
443  # default mutable values must be initialized to None
444  if nSteps is None: nSteps = []
445  if alignmentGroups is None: alignmentGroups = []
446 
447  self.name = name
448  self.steps = ChainSteps
449  self.nSteps = nSteps
450  self.alignmentGroups = alignmentGroups
451 
452 
453  # The chain holds a map of topo ComboHypoTool configurators
454  # This is needed to allow placement of the ComboHypoTool in the right position
455  # for multi-leg chains (defaults to last step)
456  # Format is {"[step name]" : ([topo config function], [topo descriptor string]), ...}
457  # Here, the topo descriptor string would usually be the chain name expression that
458  # configures the topo
459  self.topoMap = {}
460  if topoMap:
461  self.topoMap.update(topoMap)
462 
463  # L1decisions are used to set the seed type (EM, MU,JET), removing the actual threshold
464  # in practice it is the HLTSeeding Decision output
465  self.L1decisions = L1decisions
466  log.debug("[Chain.__init__] Made Chain %s with seeds: %s ", name, self.L1decisions)
467 
468  def append_bjet_steps(self,new_steps):
469  assert len(self.nSteps) == 1, "[Chain.append_bjet_steps] appending already-merged step lists - chain object will be broken. This should only be used to append Bjets to jets!"
470  self.steps = self.steps + new_steps
471  self.nSteps = [len(self.steps)]
472 
473  def append_step_to_jet(self,new_steps):
474  assert len(self.nSteps) == 1, "[Chain.append_step_to_jet] appending already-merged step lists - chain object will be broken. This is used either for appending Beamspot algorithms to jets!"
475  self.steps = self.steps + new_steps
476  self.nSteps = [len(self.steps)]
477 
478 
479  def numberAllSteps(self):
480  if len(self.steps)==0:
481  return
482  else:
483  for stepID,step in enumerate(self.steps):
484  step_name = step.name
485  if re.search('^Step[0-9]_',step_name):
486  step_name = step_name[6:]
487  elif re.search('^Step[0-9]{2}_', step_name):
488  step_name = step_name[7:]
489  step.name = 'Step%d_'%(stepID+1)+step_name
490  # also modify the empty sequence names to follow the step name change
491  for iseq, seq in enumerate(step.sequenceGens):
492  if isEmptySequenceCfg(seq):
493  name = seq.func.__name__
494  if re.search('Seq[0-9]_',name):
495  newname = re.sub('Seq[0-9]_', 'Seq%d_'%(stepID+1), name)
496  #replace the empty sequence
497  thisEmpty = createEmptyMenuSequenceCfg(flags=None, name=newname)
498  step.sequenceGens[iseq]=functools.partial(thisEmpty, flags=None, name=newname)
499  return
500 
501 
502  def insertEmptySteps(self, empty_step_name, n_new_steps, start_position):
503  #start position indexed from 0. if start position is 3 and length is 2, it works like:
504  # [old1,old2,old3,old4,old5,old6] ==> [old1,old2,old3,empty1,empty2,old4,old5,old6]
505 
506  if len(self.steps) == 0 :
507  log.error("I can't insert empty steps because the chain doesn't have any steps yet!")
508 
509  if len(self.steps) < start_position :
510  log.error("I can't insert empty steps at step %d because the chain doesn't have that many steps!", start_position)
511 
512 
513  chain_steps_pre_split = self.steps[:start_position]
514  chain_steps_post_split = self.steps[start_position:]
515 
516  next_step_name = ''
517  prev_step_name = ''
518  # copy the same dictionary as the last step, which else?
519  prev_chain_dict = []
520  if start_position == 0:
521  next_step_name = chain_steps_post_split[0].name
522  if re.search('^Step[0-9]_',next_step_name):
523  next_step_name = next_step_name[6:]
524  elif re.search('^Step[0-9]{2}_', next_step_name):
525  next_step_name = next_step_name[7:]
526 
527  prev_step_name = 'empty_'+str(len(self.L1decisions))+'L1in'
528  prev_chain_dict = chain_steps_post_split[0].stepDicts
529  else:
530  if len(chain_steps_post_split) == 0:
531  log.error("Adding empty steps to the end of a chain (%s)- why would you do this?",self.name)
532  else:
533  prev_step_name = chain_steps_pre_split[-1].name
534  next_step_name = chain_steps_post_split[0].name
535  prev_chain_dict = chain_steps_pre_split[-1].stepDicts
536 
537 
538  steps_to_add = []
539  for stepID in range(1,n_new_steps+1):
540  new_step_name = prev_step_name+'_'+empty_step_name+'%d_'%stepID+next_step_name
541 
542  log.debug("Adding empty step %s", new_step_name)
543  steps_to_add += [ChainStep(new_step_name, chainDicts=prev_chain_dict, comboHypoCfg=ComboHypoCfg, isEmpty=True)]
544 
545  self.steps = chain_steps_pre_split + steps_to_add + chain_steps_post_split
546 
547  return
548 
549  def checkNumberOfLegs(self):
550  """ return 0 if the chain has unexpected number of step legs """
551  if len(self.steps) == 0: # skip if it's noAlg chains
552  return 1
553 
554  mult=[step.nLegs for step in self.steps] # one nLegs per step
555  not_empty_mult = [m for m in mult if m!=0]
556  # cannot accept chains with all empty steps
557  if len(not_empty_mult) == 0:
558  log.error("checkNumberOfLegs: Chain %s has all steps with nLegs =0: what to do?", self.name)
559  return 0
560 
561  # cannot accept chains with steps with different number of legs
562  if not_empty_mult.count(not_empty_mult[0]) != len(not_empty_mult):
563  log.error("checkNumberOfLegs: Chain %s has steps with differnt number of legs: %s", self.name, ' '.join(mult))
564  return 0
565 
566  # check that the chain number of legs is the same as the number of L1 seeds
567  if not_empty_mult[0] != len(self.L1decisions):
568  log.error("checkNumberOfLegs: Chain %s has %i legs per step, and %d L1Decisions", self.name, mult, len(self.L1decisions))
569  return 0
570  return not_empty_mult[0]
571 
572 
573  # Receives a pair with the topo config function and an identifier string,
574  # optionally also a target step name
575  # The string is needed to rename the step after addition of the ComboHypoTool
576  def addTopo(self,topoPair,step="last"):
577  stepname = "last step" if step=="last" else step.name
578  log.debug("Adding topo configurator %s for %s to %s", topoPair[0].__qualname__, topoPair[1], "step " + stepname)
579  self.topoMap[step] = topoPair
580 
581  def __str__(self):
582  return "\n-*- Chain %s -*- \n + Seeds: %s, Steps: %s, AlignmentGroups: %s "%(\
583  self.name, ' '.join(map(str, self.L1decisions)), self.nSteps, self.alignmentGroups)
584 
585  def __repr__(self):
586  return "\n-*- Chain %s -*- \n + Seeds: %s, Steps: %s, AlignmentGroups: %s \n + Steps: \n %s \n"%(\
587  self.name, ' '.join(map(str, self.L1decisions)), self.nSteps, self.alignmentGroups, '\n '.join(map(str, self.steps)))
588 
589 
590 
592  """ Class to describe one step of a chain;
593  a step is described by a list of ChainDicts and a list of sequence generators;
594  there is one leg per ChainDict;
595  a step can have one leg (single) or more legs (combined);
596  not-empty steps have one sequence per leg;
597  empty steps have zero sequences, while chainDict len is not zero;
598  legID is taken from the ChainDict;
599  """
600 
601  def __init__(self, name, SequenceGens = None, chainDicts = None, comboHypoCfg = ComboHypoCfg , comboToolConfs = None, isEmpty = False, createsGhostLegs = False):
602 
603  # default mutable values must be initialized to None
604  if SequenceGens is None: SequenceGens = []
605  if comboToolConfs is None: comboToolConfs = []
606  assert chainDicts is not None,"Error building a ChainStep without chainDicts"
607 
608  self.name = name
609  self.sequences = []
610  self.sequenceGens = SequenceGens
611  self.comboHypoCfg = comboHypoCfg
612  self.comboToolConfs = list(comboToolConfs)
613  self.stepDicts = chainDicts # one dict per leg
614  self.nLegs = len(self.stepDicts) # cannot be zero
615  self.isEmpty = isEmpty
616 
617  # sanity check on inputs, excluding empty steps
618  if not self.isEmpty:
619  log.debug("Building step %s for chain %s: n.sequences=%d, nLegs=%i", name, chainDicts[0]['chainName'], len (self.sequenceGens) , self.nLegs )
620  if len (self.sequenceGens) != self.nLegs:
621  log.error("[ChainStep] SequenceGens: %s",self.sequenceGens)
622  log.error("[ChainStep] stepDicts: %s",self.stepDicts)
623  log.error("[ChainStep] n.legs: %i",self.nLegs)
624  raise RuntimeError("[ChainStep] Tried to configure a ChainStep %s with %i legs and %i sequences. These lists must have the same size" % (name, self.nLegs, len (self.sequenceGens) ) )
625 
626 
627  for iseq, seq in enumerate(self.sequenceGens):
628  if not isinstance(seq, functools.partial):
629  log.error("[ChainStep] %s SequenceGens verification failed, sequence %d is not partial function, likely ChainBase.getStep function was not used", self.name, iseq)
630  log.error("[ChainStep] It rather seems to be of type %s trying to print it", type(seq))
631  raise RuntimeError("Sequence is not packaged in a tuple, see error message above" )
632 
633  self.onlyJets = False
634  sig_set = None
635  if 'signature' in chainDicts[0]:
636  sig_set = set([step['signature'] for step in chainDicts])
637  if len(sig_set) == 1 and ('Jet' in sig_set or 'Bjet' in sig_set):
638  self.onlyJets = True
639  if len(sig_set) == 2 and ('Jet' in sig_set and 'Bjet' in sig_set):
640  self.onlyJets = True
641 
642 
643 
644  if not self.isEmpty:
645  self.setChainPartIndices()
646  self.makeCombo()
647 
648  def createSequences(self):
649  """ creation of this step sequences with instantiation of the CAs"""
650  log.debug("creating sequences for step %s", self.name)
651  for seq in self.sequenceGens:
652  self.sequences.append(seq()) # create the sequences
653 
654 
655  #Heather updated for full jet chain dicts
657  leg_counter = 0
658  lists_of_chainPartNames = []
659  for step_dict in self.stepDicts:
660  if len(lists_of_chainPartNames) == 0:
661  lists_of_chainPartNames += [[cp['chainPartName'] for cp in step_dict['chainParts']]]
662  else:
663  new_list_of_chainPartNames = [cp['chainPartName'] for cp in step_dict['chainParts']]
664  if new_list_of_chainPartNames == lists_of_chainPartNames[-1]:
665  leg_counter -= len(new_list_of_chainPartNames)
666  for chainPart in step_dict['chainParts']:
667  chainPart['chainPartIndex'] = leg_counter
668  leg_counter += 1
669  return
670 
671 
672  def addComboHypoTools(self, tool):
673  #this function does not add tools, it just adds one tool. do not pass it a list!
674  self.comboToolConfs.append(tool)
675 
677  return self.comboHypoCfg.__name__ if isinstance(self.comboHypoCfg, types.FunctionType) else self.comboHypoCfg
678 
679 
680  def makeCombo(self):
681  """ Configure the Combo Hypo Alg and generate the corresponding function, without instantiation which is done in createSequences() """
682  self.combo = None
683  if self.isEmpty:
684  return
685  comboNameFromStep = CFNaming.comboHypoName(self.name) # name expected from the step name
686  funcName = self.getComboHypoFncName() # name of the function generator
687  key = hash((comboNameFromStep, funcName))
688  if key not in _ComboHypoPool:
689  tmpCombo = ComboHypoNode(comboNameFromStep, self.comboHypoCfg)
690  CHname = tmpCombo.name[:-4] # remove 'Node'
691  # exceptions for BLS chains that re-use the same custom CH in differnt steps
692  # this breaks the run-one-CH-per-step, but the BLS CH are able to handle decisions internally
693  if comboNameFromStep != CHname:
694  log.debug("Created ComboHypo with name %s, expected from the step is instead %s. This is accepted only for allowed custom ComboHypos", CHname, comboNameFromStep)
695  _CustomComboHypoAllowed.add(CHname)
696  key = hash((CHname, funcName))
697  _ComboHypoPool[key] = tmpCombo
698  self.combo = _ComboHypoPool[key]
699  log.debug("Created combo %s with name %s, step comboName %s, key %s", funcName, self.combo.name, comboNameFromStep,key)
700 
701 
702  def createComboHypoTools(self, flags, chainName):
703  chainDict = HLTMenuConfig.getChainDictFromChainName(chainName)
704  self.combo.createComboHypoTools(flags, chainDict, self.comboToolConfs)
705 
706  def getChainLegs(self):
707  """ This is extrapolating the chain legs from the step dictionaries"""
708  legs = [part['chainName'] for part in self.stepDicts]
709  return legs
710 
711  def getChainNames(self):
712  if self.combo is not None:
713  return list(self.combo.getChains())
714  return self.getChainLegs()
715 
716  def __repr__(self):
717  if len(self.sequenceGens) == 0:
718  return "\n--- ChainStep %s ---\n is Empty, ChainDict = %s "%(self.name, ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])) )
719 
720  repr_string= "\n--- ChainStep %s ---\n , nLegs = %s ChainDict = %s \n + MenuSequenceGens = %s "%\
721  (self.name, self.nLegs,
722  ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])),
723  ' '.join(map(str, [seq.func.__name__ for seq in self.sequenceGens]) ))
724 
725  if self.combo is not None:
726  repr_string += "\n + ComboHypo = %s" % self.combo.Alg.name
727  if len(self.comboToolConfs)>0:
728  repr_string +=", ComboHypoTools = %s" %(' '.join(map(str, [tool.__name__ for tool in self.comboToolConfs])))
729  repr_string += "\n"
730  return repr_string
731 
732 
734  """ Class to handle in-event reco """
735  def __init__(self, name, inputMaker=None, **inputMakerArgs):
736  super( InEventRecoCA, self ).__init__()
737  self.name = name
738  self.recoSeq = None
739 
740  if inputMaker:
741  assert len(inputMakerArgs) == 0, "No support for explicitly passed input maker and and input maker arguments at the same time"
742  self.inputMakerAlg = inputMaker
743  else:
744  assert 'name' not in inputMakerArgs, "The name of input maker is predefined by the name of sequence"
745  args = {'name': "IM"+name,
746  'RoIsLink' : 'initialRoI',
747  'RoIs' : f'{name}RoIs',
748  'RoITool': CompFactory.ViewCreatorInitialROITool(),
749  'mergeUsingFeature': False}
750  args.update(**inputMakerArgs)
751  self.inputMakerAlg = CompFactory.InputMakerForRoI(**args)
752 
753  def addRecoSequence(self):
754  if self.recoSeq is None:
755  self.recoSeq = parOR( self.name )
756  self.addSequence( self.recoSeq )
757 
758  def mergeReco( self, ca ):
759  """ Merged CA moving reconstruction algorithms into the right sequence """
760  self.addRecoSequence()
761  return self.merge( ca, sequenceName=self.recoSeq.name )
762 
763  def addRecoAlgo( self, algo ):
764  """ Place algorithm in the correct reconstruction sequence """
765  self.addRecoSequence()
766  return self.addEventAlgo( algo, sequenceName=self.recoSeq.name )
767 
768  def inputMaker( self ):
769  return self.inputMakerAlg
770 
771 
772 
774  """ Class to handle in-view reco, sets up the View maker if not provided and exposes InputMaker so that more inputs to it can be added in the process of assembling the menu """
775  def __init__(self, name, viewMaker=None, isProbe=False, **viewMakerArgs):
776  super( InViewRecoCA, self ).__init__()
777  self.name = name +"_probe" if isProbe else name
778  def updateHandle(baseTool, probeTool, handleName):
779  if hasattr(baseTool, handleName) and getattr(baseTool, handleName).Path!="StoreGateSvc+":
780  setattr(probeTool, handleName, getattr(probeTool, handleName).Path + "_probe")
781 
782  if len(viewMakerArgs) != 0:
783  assert viewMaker is None, "No support for explicitly passed view maker and args for EventViewCreatorAlgorithm"
784 
785  if viewMaker:
786  assert len(viewMakerArgs) == 0, "No support for explicitly passed view maker and args for EventViewCreatorAlgorithm"
787  if isProbe:
788  self.viewMakerAlg = viewMaker.__class__(viewMaker.getName()+'_probe', **viewMaker._properties)
789  self.viewMakerAlg.Views = viewMaker.Views+'_probe'
790  roiTool = self.viewMakerAlg.RoITool.__class.__(self.viewMakerAlg.RoITool.getName()+'_probe', **self.viewMakerAlg.RoITool._properties)
791  log.debug(f"InViewRecoCA: Setting InputCachedViews on {self.viewMaker.getName()} to read decisions from tag leg {viewMaker.getName()}: {viewMaker.InputMakerOutputDecisions}")
792  self.viewMakerAlg.InputCachedViews = viewMaker.InputMakerOutputDecisions
793  updateHandle(viewMakerArgs['RoITool'], roiTool, "RoisWriteHandleKey")
794  if hasattr(viewMakerArgs['RoITool'], "RoiCreator"):
795  updateHandle(viewMakerArgs['RoITool'], roiTool, "ExtraPrefetchRoIsKey")
796  updateHandle(viewMakerArgs['RoITool'].RoiCreator, roiTool.RoiCreator, "RoisWriteHandleKey")
797 
798  self.viewMakerAlg.RoITool = roiTool
799  else:
800  self.viewMakerAlg = viewMaker
801  else:
802  assert 'name' not in viewMakerArgs, "The name of view maker is predefined by the name of sequence"
803  assert 'Views' not in viewMakerArgs, "The Views is predefined by the name of sequence"
804  assert 'ViewsNodeName' not in viewMakerArgs, "The ViewsNodeName is predefined by the name of sequence"
805  if 'RoITool' in viewMakerArgs:
806  roiTool = viewMakerArgs['RoITool']
807  else:
808  roiTool = CompFactory.ViewCreatorInitialROITool()
809 
810 
811  args = {'name': f'IM_{self.name}',
812  'ViewFallThrough' : True,
813  'RoIsLink' : 'initialRoI',
814  'RoITool' : roiTool,
815  'InViewRoIs' : f'{name}RoIs',
816  'Views' : f'{name}Views'+'_probe' if isProbe else f'{name}Views',
817  'ViewNodeName' : f'{name}InViews'+'_probe' if isProbe else f'{name}InViews',
818  'RequireParentView' : False,
819  'mergeUsingFeature' : False }
820  args.update(**viewMakerArgs)
821  self.viewMakerAlg = CompFactory.EventViewCreatorAlgorithm(**args)
822  if isProbe:
823  updateHandle(args['RoITool'], roiTool, "RoisWriteHandleKey")
824  if hasattr(args['RoITool'], "RoiCreator"):
825  updateHandle(args['RoITool'], roiTool, "ExtraPrefetchRoIsKey")
826  updateHandle(args['RoITool'].RoiCreator, roiTool.RoiCreator, "RoisWriteHandleKey")
827  self.viewsSeq = parOR( self.viewMakerAlg.ViewNodeName )
828  self.addSequence( self.viewsSeq )
829 
830  def mergeReco( self, ca ):
831  """ Merge CA moving reconstruction algorithms into the right sequence """
832  return self.merge( ca, sequenceName=self.viewsSeq.name )
833 
834 
835  def addRecoAlgo( self, algo ):
836  """ Place algorithm in the correct reconstruction sequence """
837  return self.addEventAlgo( algo, sequenceName=self.viewsSeq.name )
838 
839 
840  def inputMaker( self ):
841  return self.viewMakerAlg
842 
843 
845  """ CA component for MenuSequence sequence """
846  def __init__(self, name, isProbe=False):
847  self.name = name+"_probe" if isProbe else name
848  self.isProbe=isProbe
849  super( SelectionCA, self ).__init__()
850 
853 
854  def wasMerged(self):
855  super( SelectionCA, self ).wasMerged()
856  self.hypoAcc.wasMerged()
857 
858  def mergeReco(self, recoCA, robPrefetchCA=None, upSequenceCA=None):
859  ''' upSequenceCA is the user CA to run before the recoCA'''
861  ca.addSequence(self.stepViewSequence)
862  if upSequenceCA:
863  ca.merge(upSequenceCA, sequenceName=self.stepViewSequence.name)
864  ca.addEventAlgo(recoCA.inputMaker(), sequenceName=self.stepViewSequence.name)
865  if robPrefetchCA:
866  ca.merge(robPrefetchCA, self.stepViewSequence.name)
867  ca.merge(recoCA, sequenceName=self.stepViewSequence.name)
868  self.merge(ca)
869 
870  def mergeHypo(self, other):
871  """To be used when the hypo alg configuration comes with auxiliary tools/services"""
872  self.hypoAcc.merge(other)
873 
874  def addHypoAlgo(self, algo):
875  """To be used when the hypo alg configuration does not require auxiliary tools/services"""
876  if self.isProbe:
877  newname = algo.getName()+'_probe'
878  algo.name=newname
879  self.hypoAcc.addEventAlgo(algo)
880 
881  def hypo(self):
882  """Access hypo algo (or throws)"""
883  h = findAlgorithmByPredicate(self.stepViewSequence, lambda alg: "HypoInputDecisions" in alg._descriptors ) # can't use isHypo
884  assert h is not None, "No hypo in SeelectionCA {}".format(self.name)
885  return h
886 
887  def inputMaker(self):
888  """Access Input Maker (or throws)"""
889  im = findAlgorithmByPredicate(self.stepViewSequence, lambda alg: "InputMakerInputDecisions" in alg._descriptors )
890  assert im is not None, "No input maker in SeelectionCA {}".format(self.name)
891  return im
892 
893  def topSequence(self):
894  return self.stepViewSequence
test_athena_ntuple_filter.seq
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...
Definition: test_athena_ntuple_filter.py:18
MenuComponents.AlgNode.readOutputList
def readOutputList(self)
Definition: MenuComponents.py:78
MenuComponents.Node.getOutputList
def getOutputList(self)
Definition: MenuComponents.py:41
MenuComponents.ChainStep.setChainPartIndices
def setChainPartIndices(self)
Definition: MenuComponents.py:656
MenuComponents.HypoAlgNode.initialOutput
initialOutput
Definition: MenuComponents.py:127
MenuComponents.ChainStep.comboHypoCfg
comboHypoCfg
Definition: MenuComponents.py:611
MenuComponents.EmptyMenuSequence.ca
ca
Definition: MenuComponents.py:277
MenuComponents.ChainStep.nLegs
nLegs
Definition: MenuComponents.py:614
MenuComponents.HypoToolConf.confAndCreate
def confAndCreate(self, flags, chainDict)
Definition: MenuComponents.py:119
MenuComponents.InEventRecoCA.__init__
def __init__(self, name, inputMaker=None, **inputMakerArgs)
Definition: MenuComponents.py:735
MenuComponents.Node.inputs
inputs
Definition: MenuComponents.py:32
MenuComponents.InputMakerNode
Definition: MenuComponents.py:171
MenuComponents.ChainStep.sequenceGens
sequenceGens
Definition: MenuComponents.py:610
MenuComponents.ChainStep.name
name
Definition: MenuComponents.py:608
MenuComponents.EmptyMenuSequence.__del__
def __del__(self)
Definition: MenuComponents.py:281
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MenuComponents.InEventRecoCA.inputMakerAlg
inputMakerAlg
Definition: MenuComponents.py:742
MenuComponents.MenuSequence._hypo
_hypo
Definition: MenuComponents.py:362
MenuComponents.Node.addOutput
def addOutput(self, name)
Definition: MenuComponents.py:35
vtune_athena.format
format
Definition: vtune_athena.py:14
MenuComponents.MenuSequence
Definition: MenuComponents.py:334
MenuComponents.ComboHypoNode.addChain
def addChain(self, chainDict)
Definition: MenuComponents.py:219
MenuComponents.MenuSequence.hypoAcc
hypoAcc
Definition: MenuComponents.py:341
MenuComponents.MenuSequence._maker
_maker
Definition: MenuComponents.py:351
MenuComponents.Chain.__init__
def __init__(self, name, ChainSteps, L1decisions, nSteps=None, alignmentGroups=None, topoMap=None)
Definition: MenuComponents.py:436
MenuComponents.ComboHypoNode
Definition: MenuComponents.py:180
MenuComponents.Chain.addTopo
def addTopo(self, topoPair, step="last")
Definition: MenuComponents.py:576
MenuComponents.ChainStep.makeCombo
def makeCombo(self)
Definition: MenuComponents.py:680
AthenaPoolTestReadDoubleSelector.topSequence
topSequence
Definition: AthenaPoolTestReadDoubleSelector.py:18
MenuComponents.MenuSequence.getOutputList
def getOutputList(self)
Definition: MenuComponents.py:404
MenuComponents.ChainStep.addComboHypoTools
def addComboHypoTools(self, tool)
Definition: MenuComponents.py:672
MenuComponents.ComboHypoNode.acc
acc
Definition: MenuComponents.py:184
python.CFElements.findAlgorithmByPredicate
def findAlgorithmByPredicate(startSequence, predicate, depth=1000000)
Definition: CFElements.py:102
MenuComponents.MenuSequence._hypoToolConf
_hypoToolConf
Definition: MenuComponents.py:365
MenuComponents.SelectionCA.inputMaker
def inputMaker(self)
Definition: MenuComponents.py:887
MenuComponents.ChainStep
Definition: MenuComponents.py:591
MenuComponents.InEventRecoCA.addRecoAlgo
def addRecoAlgo(self, algo)
Definition: MenuComponents.py:763
MenuComponents.Node.outputs
outputs
Definition: MenuComponents.py:33
MenuComponents.MenuSequence.__del__
def __del__(self)
Definition: MenuComponents.py:380
MenuComponents.SelectionCA.hypoAcc
hypoAcc
Definition: MenuComponents.py:852
MenuComponents.Chain.numberAllSteps
def numberAllSteps(self)
Definition: MenuComponents.py:479
MenuComponents.HypoToolConf.create
def create(self, flags)
Definition: MenuComponents.py:115
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:50
MenuComponents.ComboHypoNode.createComboHypoTools
def createComboHypoTools(self, flags, chainDict, comboToolConfs)
Definition: MenuComponents.py:243
MenuComponents.SelectionCA.wasMerged
def wasMerged(self)
Definition: MenuComponents.py:854
MenuComponents.MenuSequence.hypo
def hypo(self)
Definition: MenuComponents.py:401
python.TrigConfigSvcUtils.getChains
def getChains(connection, smk)
Definition: TrigConfigSvcUtils.py:592
MenuComponents.HypoAlgNode.previous
previous
Definition: MenuComponents.py:131
MenuComponents.AlgNode
Definition: MenuComponents.py:51
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
MenuComponents.ComboHypoNode.create
def create(self, name)
Definition: MenuComponents.py:198
MenuComponents.MenuSequence.__repr__
def __repr__(self)
Definition: MenuComponents.py:426
MenuComponents.ChainStep.__init__
def __init__(self, name, SequenceGens=None, chainDicts=None, comboHypoCfg=ComboHypoCfg, comboToolConfs=None, isEmpty=False, createsGhostLegs=False)
Definition: MenuComponents.py:601
MenuComponents.EmptyMenuSequence.getOutputList
def getOutputList(self)
Definition: MenuComponents.py:300
MenuComponents.SelectionCA.mergeReco
def mergeReco(self, recoCA, robPrefetchCA=None, upSequenceCA=None)
Definition: MenuComponents.py:858
MenuComponents.Chain.__str__
def __str__(self)
Definition: MenuComponents.py:581
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
MenuComponents.EmptyMenuSequence.__repr__
def __repr__(self)
Definition: MenuComponents.py:317
MenuComponents.ChainStep.__repr__
def __repr__(self)
Definition: MenuComponents.py:716
dumpTruth.getName
getName
Definition: dumpTruth.py:34
MenuComponents.InViewRecoCA.viewsSeq
viewsSeq
Definition: MenuComponents.py:827
MenuComponents.Node.Alg
Alg
Definition: MenuComponents.py:31
HLTCFTools.isHypoBase
def isHypoBase(alg)
Definition: HLTCFTools.py:31
MenuComponents.InViewRecoCA.name
name
Definition: MenuComponents.py:777
MenuComponents.MenuSequence.getHypoToolConf
def getHypoToolConf(self)
Definition: MenuComponents.py:412
MenuComponents.EmptyMenuSequence
Definition: MenuComponents.py:259
MenuComponents.HypoToolConf.__init__
def __init__(self, hypoToolGen)
Definition: MenuComponents.py:106
MenuComponents.EmptyMenuSequence._maker
_maker
Definition: MenuComponents.py:274
MenuComponents.InEventRecoCA.inputMaker
def inputMaker(self)
Definition: MenuComponents.py:768
MenuComponents.Chain.nSteps
nSteps
Definition: MenuComponents.py:449
MenuComponents.ChainStep.getChainLegs
def getChainLegs(self)
Definition: MenuComponents.py:706
MenuComponents.SelectionCA.__init__
def __init__(self, name, isProbe=False)
Definition: MenuComponents.py:846
MenuComponents.isEmptySequenceCfg
def isEmptySequenceCfg(o)
Definition: MenuComponents.py:331
MenuComponents.InEventRecoCA.recoSeq
recoSeq
Definition: MenuComponents.py:738
MenuComponents.HypoToolConf.chainDict
chainDict
Definition: MenuComponents.py:113
MenuComponents.Chain.topoMap
topoMap
Definition: MenuComponents.py:459
MenuComponents.EmptyMenuSequence.connectToFilter
def connectToFilter(self, outfilter)
Definition: MenuComponents.py:303
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
MenuComponents.Node.__repr__
def __repr__(self)
Definition: MenuComponents.py:47
MenuComponents.Node.getInputList
def getInputList(self)
Definition: MenuComponents.py:44
HLTCFTools.isInputMakerBase
def isInputMakerBase(alg)
Definition: HLTCFTools.py:40
MenuComponents.MenuSequence.__init__
def __init__(self, flags, selectionCA, HypoToolGen)
Definition: MenuComponents.py:338
MenuComponents.EmptyMenuSequence._name
_name
Definition: MenuComponents.py:265
MenuComponents.Chain.steps
steps
Definition: MenuComponents.py:448
python.JetAnalysisCommon.parOR
parOR
Definition: JetAnalysisCommon.py:271
MenuComponents.InEventRecoCA.mergeReco
def mergeReco(self, ca)
Definition: MenuComponents.py:758
MenuComponents.InputMakerNode.__init__
def __init__(self, Alg)
Definition: MenuComponents.py:173
MenuComponents.ChainStep.getComboHypoFncName
def getComboHypoFncName(self)
Definition: MenuComponents.py:676
MenuComponents.InEventRecoCA.name
name
Definition: MenuComponents.py:737
MenuComponents.ChainStep.createSequences
def createSequences(self)
Definition: MenuComponents.py:648
MenuComponents.InViewRecoCA.addRecoAlgo
def addRecoAlgo(self, algo)
Definition: MenuComponents.py:835
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
MenuComponents.ComboHypoNode.mapRawInputsToInputsIndex
def mapRawInputsToInputsIndex(self)
Definition: MenuComponents.py:211
MenuComponents.Chain
Definition: MenuComponents.py:433
MenuComponents.ChainStep.sequences
sequences
Definition: MenuComponents.py:609
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
MenuComponents.MenuSequence.sequence
def sequence(self)
Definition: MenuComponents.py:389
MenuComponents.AlgNode.outputProp
outputProp
Definition: MenuComponents.py:56
MenuComponents.ChainStep.getChainNames
def getChainNames(self)
Definition: MenuComponents.py:711
MenuComponents.HypoAlgNode.__repr__
def __repr__(self)
Definition: MenuComponents.py:163
MenuComponents.AlgNode.readInputList
def readInputList(self)
Definition: MenuComponents.py:95
MenuComponents.MenuSequence._name
_name
Definition: MenuComponents.py:361
MenuComponents.MenuSequence.maker
def maker(self)
Definition: MenuComponents.py:393
MenuComponents.Node.__init__
def __init__(self, Alg)
Definition: MenuComponents.py:29
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
MenuComponents.AlgNode.addOutput
def addOutput(self, name)
Definition: MenuComponents.py:67
MenuComponents.SelectionCA.addHypoAlgo
def addHypoAlgo(self, algo)
Definition: MenuComponents.py:874
MenuComponents.EmptyMenuSequence.sequence
def sequence(self)
Definition: MenuComponents.py:285
MenuComponents.Node
Definition: MenuComponents.py:26
MenuComponents.Chain.__repr__
def __repr__(self)
Definition: MenuComponents.py:585
MenuComponents.ComboHypoNode.comboHypoCfg
comboHypoCfg
Definition: MenuComponents.py:183
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
MenuComponents.InEventRecoCA.addRecoSequence
def addRecoSequence(self)
Definition: MenuComponents.py:753
MenuComponents.ChainStep.combo
combo
Definition: MenuComponents.py:682
MenuComponents.HypoAlgNode.__init__
def __init__(self, Alg)
Definition: MenuComponents.py:128
MenuComponents.InViewRecoCA.mergeReco
def mergeReco(self, ca)
Definition: MenuComponents.py:830
MenuComponents.HypoAlgNode.addHypoTool
def addHypoTool(self, flags, hypoToolConf)
Definition: MenuComponents.py:143
MenuComponents.HypoToolConf
Definition: MenuComponents.py:104
MenuComponents.HypoAlgNode.setPreviousDecision
def setPreviousDecision(self, prev)
Definition: MenuComponents.py:159
MenuComponents.AlgNode.addInput
def addInput(self, name)
Definition: MenuComponents.py:83
MenuComponents.HypoToolConf.hypoToolGen
hypoToolGen
Definition: MenuComponents.py:107
MenuComponents.MenuSequence.ca
ca
Definition: MenuComponents.py:339
MenuComponents.MenuSequence.connectToFilter
def connectToFilter(self, outfilter)
Definition: MenuComponents.py:407
MenuComponents.InViewRecoCA.inputMaker
def inputMaker(self)
Definition: MenuComponents.py:840
MenuComponents.EmptyMenuSequence.name
def name(self)
Definition: MenuComponents.py:297
MenuComponents.EmptyMenuSequence.maker
def maker(self)
Definition: MenuComponents.py:289
MenuComponents.EmptyMenuSequence.buildDFDot
def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file)
Definition: MenuComponents.py:310
MenuComponents.InEventRecoCA
Definition: MenuComponents.py:733
MenuComponents.MenuSequence._sequence
_sequence
Definition: MenuComponents.py:344
MenuComponents.EmptyMenuSequence.getHypoToolConf
def getHypoToolConf(self)
Definition: MenuComponents.py:307
MenuComponents.Chain.alignmentGroups
alignmentGroups
Definition: MenuComponents.py:450
MenuComponents.ChainStep.onlyJets
onlyJets
Definition: MenuComponents.py:633
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
MenuComponents.AlgNode.inputProp
inputProp
Definition: MenuComponents.py:57
MenuComponents.InViewRecoCA
Definition: MenuComponents.py:773
MenuComponents.Chain.checkNumberOfLegs
def checkNumberOfLegs(self)
Definition: MenuComponents.py:549
MenuComponents.Chain.L1decisions
L1decisions
Definition: MenuComponents.py:465
MenuComponents.ChainStep.createComboHypoTools
def createComboHypoTools(self, flags, chainName)
Definition: MenuComponents.py:702
MenuComponents.ComboHypoNode.__init__
def __init__(self, name, comboHypoCfg)
Definition: MenuComponents.py:182
MenuComponents.SelectionCA.mergeHypo
def mergeHypo(self, other)
Definition: MenuComponents.py:870
MenuComponents.AlgNode.__repr__
def __repr__(self)
Definition: MenuComponents.py:100
MenuComponents.SelectionCA.isProbe
isProbe
Definition: MenuComponents.py:848
MenuComponents.SelectionCA.stepViewSequence
stepViewSequence
Definition: MenuComponents.py:851
MenuComponents.HypoToolConf.name
name
Definition: MenuComponents.py:108
MenuComponents.Node.addInput
def addInput(self, name)
Definition: MenuComponents.py:38
MenuComponents.MenuSequence.name
def name(self)
Definition: MenuComponents.py:385
MenuComponents.HypoToolConf.setConf
def setConf(self, chainDict)
Definition: MenuComponents.py:110
MenuComponents.HypoAlgNode.addOutput
def addOutput(self, name)
Definition: MenuComponents.py:133
pickleTool.object
object
Definition: pickleTool.py:29
MenuComponents.ChainStep.stepDicts
stepDicts
Definition: MenuComponents.py:613
str
Definition: BTagTrackIpAccessor.cxx:11
MenuComponents.EmptyMenuSequence._sequence
_sequence
Definition: MenuComponents.py:275
MenuComponents.SelectionCA.hypo
def hypo(self)
Definition: MenuComponents.py:881
MenuComponents.AlgNode.setPar
def setPar(self, propname, value)
Definition: MenuComponents.py:59
MenuComponents.SelectionCA
Definition: MenuComponents.py:844
MenuComponents.EmptyMenuSequence.__init__
def __init__(self, the_name)
Definition: MenuComponents.py:263
MenuComponents.HypoAlgNode
Definition: MenuComponents.py:125
MenuComponents.Chain.append_step_to_jet
def append_step_to_jet(self, new_steps)
Definition: MenuComponents.py:473
MenuComponents.Node.name
name
Definition: MenuComponents.py:30
MenuComponents.Chain.insertEmptySteps
def insertEmptySteps(self, empty_step_name, n_new_steps, start_position)
Definition: MenuComponents.py:502
MenuComponents.AlgNode.__init__
def __init__(self, Alg, inputProp, outputProp)
Definition: MenuComponents.py:54
MenuComponents.InViewRecoCA.viewMakerAlg
viewMakerAlg
Definition: MenuComponents.py:788
HLTCFTools.algColor
def algColor(alg)
Definition: HLTCFTools.py:15
MenuComponents.ChainStep.isEmpty
isEmpty
Definition: MenuComponents.py:615
MenuComponents.ComboHypoNode.__del__
def __del__(self)
Definition: MenuComponents.py:195
MenuComponents.ChainStep.comboToolConfs
comboToolConfs
Definition: MenuComponents.py:612
merge
Definition: merge.py:1
MenuComponents.InViewRecoCA.__init__
def __init__(self, name, viewMaker=None, isProbe=False, **viewMakerArgs)
Definition: MenuComponents.py:775
MenuComponents.createEmptyMenuSequenceCfg
def createEmptyMenuSequenceCfg(flags, name)
Definition: MenuComponents.py:321
MenuComponents.Chain.append_bjet_steps
def append_bjet_steps(self, new_steps)
Definition: MenuComponents.py:468
MenuComponents.MenuSequence.buildDFDot
def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file)
Definition: MenuComponents.py:416
MenuComponents.SelectionCA.name
name
Definition: MenuComponents.py:847
MenuComponents.ComboHypoNode.getChains
def getChains(self)
Definition: MenuComponents.py:239
MenuComponents.SelectionCA.topSequence
def topSequence(self)
Definition: MenuComponents.py:893
MenuComponents.Chain.name
name
Definition: MenuComponents.py:447