ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
MenuComponents.MenuSequence Class Reference
Collaboration diagram for MenuComponents.MenuSequence:

Public Member Functions

def __init__ (self, flags, selectionCA, HypoToolGen, globalRecoCA=None)
 
def __del__ (self)
 
def globalRecoCA (self)
 
def name (self)
 
def sequence (self)
 
def maker (self)
 
def hypo (self)
 
def getOutputList (self)
 
def connectToFilter (self, outfilter)
 
def getHypoToolConf (self)
 
def buildDFDot (self, cfseq_algs, all_hypos, last_step_hypo_nodes, file)
 
def __repr__ (self)
 

Public Attributes

 ca
 
 hypoAcc
 

Private Attributes

 _globalCA
 
 _sequence
 
 _maker
 
 _name
 
 _hypo
 
 _hypoToolConf
 

Detailed Description

Class to group reco sequences with the Hypo.
By construction it has one Hypo only, which gives the name to this class object

Definition at line 377 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

def MenuComponents.MenuSequence.__init__ (   self,
  flags,
  selectionCA,
  HypoToolGen,
  globalRecoCA = None 
)

Definition at line 381 of file MenuComponents.py.

381  def __init__(self, flags, selectionCA, HypoToolGen, globalRecoCA=None):
382  self.ca = selectionCA
383  self._globalCA = globalRecoCA
384  # separate the HypoCA to be merged later
385  self.hypoAcc = selectionCA.hypoAcc
386 
387  sequence = self.ca.topSequence()
388  self._sequence = Node(Alg=sequence)
389 
390  # get the InputMaker
391  inputMaker = [ a for a in self.ca.getEventAlgos() if isInputMakerBase(a)]
392  assert len(inputMaker) == 1, f"{len(inputMaker)} input makers in the ComponentAccumulator"
393  inputMaker = inputMaker[0]
394  assert inputMaker.name.startswith("IM"), f"Input maker {inputMaker.name} name needs to start with 'IM'"
395  self._maker = InputMakerNode( Alg = inputMaker )
396  input_maker_output = self.maker.readOutputList()[0] # only one since it's merged
397 
398 
399  # get the HypoAlg
400  hypoAlg = selectionCA.hypoAcc.getEventAlgos()
401  assert len(hypoAlg) == 1, f"{len(hypoAlg)} hypo algs in the ComponentAccumulator"
402  hypoAlg = hypoAlg[0]
403  hypoAlg.RuntimeValidation = flags.Trigger.doRuntimeNaviVal
404 
405  self._name = CFNaming.menuSequenceName(hypoAlg.name)
406  self._hypo = HypoAlgNode( Alg = hypoAlg )
407  self._hypo.addOutput( CFNaming.hypoAlgOutName(hypoAlg.name) )
408  self._hypo.setPreviousDecision( input_maker_output )
409  self._hypoToolConf = HypoToolConf( HypoToolGen )
410 
411  # Connect InputMaker output to ROBPrefetchingAlg(s) if there is any
412  if ROBPrefetching.StepRoI in flags.Trigger.ROBPrefetchingOptions:
413  for child in sequence.Members:
414  if ( isinstance(child, CompFactory.ROBPrefetchingAlg) and
415  input_maker_output not in child.ROBPrefetchingInputDecisions ):
416  child.ROBPrefetchingInputDecisions.append(input_maker_output)
417 
418  log.debug("connecting InputMaker and HypoAlg, adding: InputMaker::%s.output=%s",
419  self.maker.Alg.name, input_maker_output)
420  log.debug("HypoAlg::%s.HypoInputDecisions=%s, HypoAlg::%s.HypoOutputDecisions=%s",
421  self.hypo.Alg.name, self.hypo.readInputList()[0],
422  self.hypo.Alg.name, self.hypo.readOutputList()[0])
423 

◆ __del__()

def MenuComponents.MenuSequence.__del__ (   self)

Definition at line 424 of file MenuComponents.py.

424  def __del__(self):
425  self.ca.wasMerged()
426  self.hypoAcc.wasMerged()
427  if self._globalCA:
428  self._globalCA.wasMerged()
429 

Member Function Documentation

◆ __repr__()

def MenuComponents.MenuSequence.__repr__ (   self)

Definition at line 476 of file MenuComponents.py.

476  def __repr__(self):
477  hyponame = self._hypo.Alg.name
478  hypotool = self._hypoToolConf.name
479  return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\
480  %(self.name, hyponame, self.maker.Alg.name, self.sequence.Alg.name, hypotool)
481 
482 

◆ buildDFDot()

def MenuComponents.MenuSequence.buildDFDot (   self,
  cfseq_algs,
  all_hypos,
  last_step_hypo_nodes,
  file 
)

Definition at line 466 of file MenuComponents.py.

466  def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file):
467  cfseq_algs.append(self.maker)
468  cfseq_algs.append(self.sequence)
469  file.write(" %s[fillcolor=%s]\n"%(self.maker.Alg.getName(), algColor(self.maker.Alg)))
470  file.write(" %s[fillcolor=%s]\n"%(self.sequence.Alg.getName(), algColor(self.sequence.Alg)))
471  cfseq_algs.append(self._hypo)
472  file.write(" %s[color=%s]\n"%(self._hypo.Alg.getName(), algColor(self._hypo.Alg)))
473  all_hypos.append(self._hypo)
474  return cfseq_algs, all_hypos, last_step_hypo_nodes
475 

◆ connectToFilter()

def MenuComponents.MenuSequence.connectToFilter (   self,
  outfilter 
)
Connect filter to the InputMaker

Definition at line 457 of file MenuComponents.py.

457  def connectToFilter(self, outfilter):
458  """Connect filter to the InputMaker"""
459  log.debug("connecting %s to inputs of %s", outfilter, self.maker.Alg.name)
460  self.maker.addInput(outfilter)
461 

◆ getHypoToolConf()

def MenuComponents.MenuSequence.getHypoToolConf (   self)

Definition at line 462 of file MenuComponents.py.

462  def getHypoToolConf(self) :
463  return self._hypoToolConf
464 
465 

◆ getOutputList()

def MenuComponents.MenuSequence.getOutputList (   self)

Definition at line 454 of file MenuComponents.py.

454  def getOutputList(self):
455  return [self._hypo.readOutputList()[0]]
456 

◆ globalRecoCA()

def MenuComponents.MenuSequence.globalRecoCA (   self)

Definition at line 431 of file MenuComponents.py.

431  def globalRecoCA(self):
432  return self._globalCA
433 

◆ hypo()

def MenuComponents.MenuSequence.hypo (   self)

Definition at line 451 of file MenuComponents.py.

451  def hypo(self):
452  return self._hypo
453 

◆ maker()

def MenuComponents.MenuSequence.maker (   self)

Definition at line 443 of file MenuComponents.py.

443  def maker(self):
444  # Input makers are added during DataFlow building (connectToFilter) when a chain
445  # uses this sequence in another step. So we need to make sure to update the
446  # algorithm when accessed.
447  self._maker.Alg = self.ca.getEventAlgo(self._maker.Alg.name)
448  return self._maker
449 

◆ name()

def MenuComponents.MenuSequence.name (   self)

Definition at line 435 of file MenuComponents.py.

435  def name(self):
436  return self._name
437 

◆ sequence()

def MenuComponents.MenuSequence.sequence (   self)

Definition at line 439 of file MenuComponents.py.

439  def sequence(self):
440  return self._sequence
441 

Member Data Documentation

◆ _globalCA

MenuComponents.MenuSequence._globalCA
private

Definition at line 383 of file MenuComponents.py.

◆ _hypo

MenuComponents.MenuSequence._hypo
private

Definition at line 406 of file MenuComponents.py.

◆ _hypoToolConf

MenuComponents.MenuSequence._hypoToolConf
private

Definition at line 409 of file MenuComponents.py.

◆ _maker

MenuComponents.MenuSequence._maker
private

Definition at line 395 of file MenuComponents.py.

◆ _name

MenuComponents.MenuSequence._name
private

Definition at line 405 of file MenuComponents.py.

◆ _sequence

MenuComponents.MenuSequence._sequence
private

Definition at line 388 of file MenuComponents.py.

◆ ca

MenuComponents.MenuSequence.ca

Definition at line 382 of file MenuComponents.py.

◆ hypoAcc

MenuComponents.MenuSequence.hypoAcc

Definition at line 385 of file MenuComponents.py.


The documentation for this class was generated from the following file:
AthenaPoolTestReadDoubleSelector.topSequence
topSequence
Definition: AthenaPoolTestReadDoubleSelector.py:18
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:49
HLTCFTools.isInputMakerBase
def isInputMakerBase(alg)
Definition: HLTCFTools.py:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.AthDsoLogger.__del__
def __del__(self)
Definition: AthDsoLogger.py:82
HLTCFTools.algColor
def algColor(alg)
Definition: HLTCFTools.py:15