ATLAS Offline Software
Loading...
Searching...
No Matches
HLTCFComponents.CFSequence Class Reference

CFSequence class. More...

Inheritance diagram for HLTCFComponents.CFSequence:
Collaboration diagram for HLTCFComponents.CFSequence:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, ChainStep, FilterAlg)
 setDecisions (self)
 connectCombo (self)
 mergeStepSequences (self, chainStep)
 findComboHypoAlg (self)
 __repr__ (self)

Public Attributes

 filterNode = FilterAlg
 step = ChainStep
 ca = ComponentAccumulator()
 seq = seqAndWithFilter
 stepReco = parOR(ChainStep.name + CFNaming.RECO_POSTFIX)
list decisions = []

Detailed Description

CFSequence class.

Class to describe the flow of decisions through ChainStep + filter with their connections (input, output)
A Filter can have more than one input/output if used in different chains, so this class stores and manages all of them (when doing the connect)

Definition at line 88 of file HLTCFComponents.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

HLTCFComponents.CFSequence.__init__ ( self,
ChainStep,
FilterAlg )

Definition at line 92 of file HLTCFComponents.py.

92 def __init__(self, ChainStep, FilterAlg):
93 log.debug(" *** Create CFSequence %s with Filter %s", ChainStep.name, FilterAlg.Alg.getName())
94 self.filterNode = FilterAlg
95 self.step = ChainStep
96
97 self.ca = ComponentAccumulator()
98 #empty step: add the PassSequence, one instance only is appended to the tree
99 seqAndWithFilter = FilterAlg.Alg if ChainStep.isEmpty else seqAND(ChainStep.name)
100 self.ca.addSequence(seqAndWithFilter)
101 self.seq = seqAndWithFilter
102 if not ChainStep.isEmpty:
103 self.ca.addEventAlgo(FilterAlg.Alg, sequenceName=seqAndWithFilter.getName())
104 self.stepReco = parOR(ChainStep.name + CFNaming.RECO_POSTFIX)
105 # all reco algorithms from all the sequences in a parallel sequence
106 self.ca.addSequence(self.stepReco, parentName=seqAndWithFilter.getName())
107 log.debug("created parOR %s inside seqAND %s ", self.stepReco.getName(), seqAndWithFilter.getName())
108 self.mergeStepSequences(ChainStep)
109 # merge the Hypoalg (before the Combo)
110 for menuseq in ChainStep.sequences:
111 if not isinstance(menuseq, EmptyMenuSequence):
112 self.ca.merge(menuseq.hypoAcc, sequenceName=seqAndWithFilter.getName())
113
114 self.connectCombo()
115 self.setDecisions()
116 if self.step.combo is not None:
117 self.ca.merge(self.step.combo.acc, sequenceName=seqAndWithFilter.getName())
118 log.debug("CFSequence.__init: created %s ",self)
119
120
Definition merge.py:1

Member Function Documentation

◆ __repr__()

HLTCFComponents.CFSequence.__repr__ ( self)

Definition at line 161 of file HLTCFComponents.py.

161 def __repr__(self):
162 return "--- CFSequence ---\n + Filter: %s \n + decisions: %s\n + %s \n"%(\
163 self.filterNode.Alg.name, self.decisions, self.step)
164
165
166
167

◆ connectCombo()

HLTCFComponents.CFSequence.connectCombo ( self)
connect Combo to Hypos

Definition at line 132 of file HLTCFComponents.py.

132 def connectCombo(self):
133 """ connect Combo to Hypos"""
134 if self.step.combo is None:
135 log.debug("CFSequence.connectCombo: no Combo found")
136 return
137
138 for seq in self.step.sequences:
139 combo_input=seq.getOutputList()[0]
140 self.step.combo.addInput(combo_input)
141 inputs = self.step.combo.readInputList()
142 legindex = inputs.index(combo_input)
143 log.debug("CFSequence.connectCombo: adding input to %s: %s", self.step.combo.Alg.getName(), combo_input)
144 # inputs are the output decisions of the hypos of the sequences
145 combo_output=CFNaming.comboHypoOutputName (self.step.combo.Alg.getName(), legindex)
146 self.step.combo.addOutput(combo_output)
147 log.debug("CFSequence.connectCombo: adding output to %s: %s", self.step.combo.Alg.getName(), combo_output)
148

◆ findComboHypoAlg()

HLTCFComponents.CFSequence.findComboHypoAlg ( self)

Definition at line 158 of file HLTCFComponents.py.

158 def findComboHypoAlg(self):
159 return findAlgorithmByPredicate(self.seq, lambda alg: alg.name == self.step.Alg.name and isComboHypoAlg(alg))
160

◆ mergeStepSequences()

HLTCFComponents.CFSequence.mergeStepSequences ( self,
chainStep )

Definition at line 149 of file HLTCFComponents.py.

149 def mergeStepSequences(self, chainStep):
150 for menuseq in chainStep.sequences:
151 try:
152 self.ca.merge(menuseq.ca, sequenceName=self.stepReco.getName())
153 except Exception as e:
154 log.error(f'Failed to merge into {self.stepReco.getName()}')
155 raise e
156

◆ setDecisions()

HLTCFComponents.CFSequence.setDecisions ( self)
Set the output decision of this CFSequence as the hypo outputdecision; In case of combo, takes the Combo outputs

Definition at line 121 of file HLTCFComponents.py.

121 def setDecisions(self):
122 """ Set the output decision of this CFSequence as the hypo outputdecision; In case of combo, takes the Combo outputs"""
123 self.decisions=[]
124 # empty steps:
125 if self.step.combo is None:
126 self.decisions.extend(self.filterNode.getOutputList())
127 else:
128 self.decisions.extend(self.step.combo.getOutputList())
129 log.debug("CFSequence: set out decisions: %s", self.decisions)
130
131

Member Data Documentation

◆ ca

HLTCFComponents.CFSequence.ca = ComponentAccumulator()

Definition at line 97 of file HLTCFComponents.py.

◆ decisions

HLTCFComponents.CFSequence.decisions = []

Definition at line 123 of file HLTCFComponents.py.

◆ filterNode

HLTCFComponents.CFSequence.filterNode = FilterAlg

Definition at line 94 of file HLTCFComponents.py.

◆ seq

HLTCFComponents.CFSequence.seq = seqAndWithFilter

Definition at line 101 of file HLTCFComponents.py.

◆ step

HLTCFComponents.CFSequence.step = ChainStep

Definition at line 95 of file HLTCFComponents.py.

◆ stepReco

HLTCFComponents.CFSequence.stepReco = parOR(ChainStep.name + CFNaming.RECO_POSTFIX)

Definition at line 104 of file HLTCFComponents.py.


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