ATLAS Offline Software
Loading...
Searching...
No Matches
MenuComponents.MenuSequence Class Reference
Collaboration diagram for MenuComponents.MenuSequence:

Public Member Functions

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

Public Attributes

 ca = selectionCA
 hypoAcc = selectionCA.hypoAcc
 maker
 sequence
 name

Protected Attributes

 _sequence = Node(Alg=sequence)
 _maker = InputMakerNode( Alg = inputMaker )
 _name = CFNaming.menuSequenceName(hypoAlg.name)
 _hypo = HypoAlgNode( Alg = hypoAlg )
 _hypoToolConf = HypoToolConf( HypoToolGen )

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 332 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

MenuComponents.MenuSequence.__init__ ( self,
flags,
selectionCA,
HypoToolGen )

Definition at line 336 of file MenuComponents.py.

336 def __init__(self, flags, selectionCA, HypoToolGen):
337 self.ca = selectionCA
338 # separate the HypoCA to be merged later
339 self.hypoAcc = selectionCA.hypoAcc
340
341 sequence = self.ca.topSequence()
342 self._sequence = Node(Alg=sequence)
343
344 # get the InputMaker
345 inputMaker = [ a for a in self.ca.getEventAlgos() if isInputMakerBase(a)]
346 assert len(inputMaker) == 1, f"{len(inputMaker)} input makers in the ComponentAccumulator"
347 inputMaker = inputMaker[0]
348 assert inputMaker.name.startswith("IM"), f"Input maker {inputMaker.name} name needs to start with 'IM'"
349 self._maker = InputMakerNode( Alg = inputMaker )
350 input_maker_output = self.maker.readOutputList()[0] # only one since it's merged
351
352
353 # get the HypoAlg
354 hypoAlg = selectionCA.hypoAcc.getEventAlgos()
355 assert len(hypoAlg) == 1, f"{len(hypoAlg)} hypo algs in the ComponentAccumulator"
356 hypoAlg = hypoAlg[0]
357 hypoAlg.RuntimeValidation = flags.Trigger.doRuntimeNaviVal
358
359 self._name = CFNaming.menuSequenceName(hypoAlg.name)
360 self._hypo = HypoAlgNode( Alg = hypoAlg )
361 self._hypo.addOutput( CFNaming.hypoAlgOutName(hypoAlg.name) )
362 self._hypo.setPreviousDecision( input_maker_output )
363 self._hypoToolConf = HypoToolConf( HypoToolGen )
364
365 log.debug("connecting InputMaker and HypoAlg, adding: InputMaker::%s.output=%s",
366 self.maker.Alg.name, input_maker_output)
367 log.debug("HypoAlg::%s.HypoInputDecisions=%s, HypoAlg::%s.HypoOutputDecisions=%s",
368 self.hypo.Alg.name, self.hypo.readInputList()[0],
369 self.hypo.Alg.name, self.hypo.readOutputList()[0])
370

◆ __del__()

MenuComponents.MenuSequence.__del__ ( self)

Definition at line 371 of file MenuComponents.py.

371 def __del__(self):
372 self.ca.wasMerged()
373 self.hypoAcc.wasMerged()
374

Member Function Documentation

◆ __repr__()

MenuComponents.MenuSequence.__repr__ ( self)

Definition at line 417 of file MenuComponents.py.

417 def __repr__(self):
418 hyponame = self._hypo.Alg.name
419 hypotool = self._hypoToolConf.name
420 return "MenuSequence::%s \n Hypo::%s \n Maker::%s \n Sequence::%s \n HypoTool::%s\n"\
421 %(self.name, hyponame, self.maker.Alg.name, self.sequence.Alg.name, hypotool)
422
423

◆ buildDFDot()

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

Definition at line 407 of file MenuComponents.py.

407 def buildDFDot(self, cfseq_algs, all_hypos, last_step_hypo_nodes, file):
408 cfseq_algs.append(self.maker)
409 cfseq_algs.append(self.sequence)
410 file.write(" %s[fillcolor=%s]\n"%(self.maker.Alg.getName(), algColor(self.maker.Alg)))
411 file.write(" %s[fillcolor=%s]\n"%(self.sequence.Alg.getName(), algColor(self.sequence.Alg)))
412 cfseq_algs.append(self._hypo)
413 file.write(" %s[color=%s]\n"%(self._hypo.Alg.getName(), algColor(self._hypo.Alg)))
414 all_hypos.append(self._hypo)
415 return cfseq_algs, all_hypos, last_step_hypo_nodes
416

◆ connectToFilter()

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

Definition at line 398 of file MenuComponents.py.

398 def connectToFilter(self, outfilter):
399 """Connect filter to the InputMaker"""
400 log.debug("connectToFilter: connecting %s to inputs of %s", outfilter, self.maker.Alg.name)
401 self.maker.addInput(outfilter)
402

◆ getHypoToolConf()

MenuComponents.MenuSequence.getHypoToolConf ( self)

Definition at line 403 of file MenuComponents.py.

403 def getHypoToolConf(self) :
404 return self._hypoToolConf
405
406

◆ getOutputList()

MenuComponents.MenuSequence.getOutputList ( self)

Definition at line 395 of file MenuComponents.py.

395 def getOutputList(self):
396 return [self._hypo.readOutputList()[0]]
397

◆ hypo()

MenuComponents.MenuSequence.hypo ( self)

Definition at line 392 of file MenuComponents.py.

392 def hypo(self):
393 return self._hypo
394

◆ maker()

MenuComponents.MenuSequence.maker ( self)

Definition at line 384 of file MenuComponents.py.

384 def maker(self):
385 # Input makers are added during DataFlow building (connectToFilter) when a chain
386 # uses this sequence in another step. So we need to make sure to update the
387 # algorithm when accessed.
388 self._maker.Alg = self.ca.getEventAlgo(self._maker.Alg.name)
389 return self._maker
390

◆ name()

MenuComponents.MenuSequence.name ( self)

Definition at line 376 of file MenuComponents.py.

376 def name(self):
377 return self._name
378

◆ sequence()

MenuComponents.MenuSequence.sequence ( self)

Definition at line 380 of file MenuComponents.py.

380 def sequence(self):
381 return self._sequence
382

Member Data Documentation

◆ _hypo

MenuComponents.MenuSequence._hypo = HypoAlgNode( Alg = hypoAlg )
protected

Definition at line 360 of file MenuComponents.py.

◆ _hypoToolConf

MenuComponents.MenuSequence._hypoToolConf = HypoToolConf( HypoToolGen )
protected

Definition at line 363 of file MenuComponents.py.

◆ _maker

MenuComponents.MenuSequence._maker = InputMakerNode( Alg = inputMaker )
protected

Definition at line 349 of file MenuComponents.py.

◆ _name

MenuComponents.MenuSequence._name = CFNaming.menuSequenceName(hypoAlg.name)
protected

Definition at line 359 of file MenuComponents.py.

◆ _sequence

MenuComponents.MenuSequence._sequence = Node(Alg=sequence)
protected

Definition at line 342 of file MenuComponents.py.

◆ ca

MenuComponents.MenuSequence.ca = selectionCA

Definition at line 337 of file MenuComponents.py.

◆ hypoAcc

MenuComponents.MenuSequence.hypoAcc = selectionCA.hypoAcc

Definition at line 339 of file MenuComponents.py.

◆ maker

MenuComponents.MenuSequence.maker

Definition at line 408 of file MenuComponents.py.

◆ name

MenuComponents.MenuSequence.name

Definition at line 421 of file MenuComponents.py.

◆ sequence

MenuComponents.MenuSequence.sequence

Definition at line 409 of file MenuComponents.py.


The documentation for this class was generated from the following file: