6 from AthenaCommon.AlgSequence
import AthSequencer
7 from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFTools
import algColor
8 from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFComponents
import isPassSequence
10 from AthenaCommon.CFElements
import isSequence
18 for hypotool
in hp.Alg.HypoTools:
19 file.write(
" \"%s\"[fillcolor=yellow,style=filled,shape= Mdiamond]\n" % hypotool.getName())
20 file.write(
" \"%s\" -> \"%s\" [style=dashed, color=grey]\n" % (hp.Alg.name, hypotool.getName()))
24 def _dump (seq, indent):
29 o.append( (
"%s[color=%s, shape=circle, width=.5, fixedsize=true ,style=filled]\n"%(c.name,_seqColor(c)), indent) )
31 o.append( (
"%s[fillcolor=%s,style=filled]\n"%(c.name,
algColor(c)), indent) )
32 o.append( (
"%s -> %s\n"%(seq.name, c.name), indent))
33 o.extend( _dump (c, indent+1) )
38 if seq.ModeOR
is True:
39 if seq.Sequential
is False:
40 if seq.StopOverride
is True:
42 except AttributeError:
48 if seq.ModeOR
is False:
49 if seq.Sequential
is True:
50 if seq.StopOverride
is False:
52 except AttributeError:
66 with open(
'%s.CF.dot'%stepCF.name, mode=
"wt")
as file:
68 file.write(
'digraph step { \n'\
69 +
' concentrate=true;\n'\
71 +
' node [ shape=polygon, fontname=Helvetica ]\n'\
72 +
' edge [ fontname=Helvetica ]\n'
73 +
' %s [shape=Mdiamond]\n'%stepCF.name)
78 out.extend( _dump( stepCF, indent=indent+1 ) )
88 with open(
'%s.dot'%(name), mode=
"wt")
as file:
89 file.write(
'digraph step { \n'\
90 +
' concentrate=true;\n'\
92 +
' node [ shape=polygon, fontname=Helvetica ]\n'\
93 +
' edge [ fontname=Helvetica ]\n'
94 +
' %s [shape=Mdiamond]\n'%name)
97 last_step_hypoNodes=[]
99 for cfseq_list
in step_list:
101 step_connections = []
102 step_connections.extend(last_step_hypoNodes)
104 last_step_hypoNodes =[]
105 for cfseq
in cfseq_list:
106 file.write(
" %s[fillcolor=%s style=filled]\n"%(cfseq.sequenceCA.filterNode.Alg.name,
algColor(cfseq.sequenceCA.filterNode.Alg)))
107 step_connections.append(cfseq.sequenceCA.filterNode)
108 file.write(
'\n subgraph cluster_%s {\n'%(cfseq.sequenceCA.step.name)\
109 +
' concentrate=true;\n'
110 +
' node [color=white style=filled]\n'\
112 +
' color=lightgrey\n'\
113 +
' fontname=Helvetica\n'\
114 +
' label = %s\n'%(cfseq.sequenceCA.step.name))
117 cfseq_algs.append(cfseq.sequenceCA.filterNode)
119 if len(cfseq.sequenceCA.step.sequences)==0:
120 last_step_hypoNodes.append(cfseq.sequenceCA.filterNode)
122 for menuseq
in cfseq.sequenceCA.step.sequences:
123 cfseq_algs, all_hypos, last_step_hypoNodes = menuseq.buildDFDot(cfseq_algs,
129 if cfseq.sequenceCA.step.combo
is not None:
130 file.write(
" %s[color=%s]\n"%(cfseq.sequenceCA.step.combo.Alg.name,
algColor(cfseq.sequenceCA.step.combo.Alg)))
131 cfseq_algs.append(cfseq.sequenceCA.step.combo)
132 last_step_hypoNodes.append(cfseq.sequenceCA.step.combo)
147 with open(
'%s.DF.dot'%name, mode=
"wt" )
as file:
149 file.write(
'digraph step { \n'\
150 +
' concentrate=true; \n'\
152 +
' node [ shape=polygon, fontname=Helvetica ]\n'\
153 +
' edge [ fontname=Helvetica ]\n'
154 +
' %s [shape=Mdiamond]\n'%name)
158 for cfseq
in cfseq_list:
159 file.write(
" %s[fillcolor=%s style=filled]\n"%(cfseq.sequenceCA.filterNode.Alg.name,
algColor(cfseq.sequenceCA.filterNode.Alg)))
160 for inp
in cfseq.sequenceCA.filterNode.getInputList():
161 file.write(
addConnection(name, cfseq.sequenceCA.filterNode.Alg.name, inp))
163 file.write(
'\n subgraph cluster_%s {\n'%(cfseq.sequenceCA.step.name)\
164 +
' concentrate=true;\n'
165 +
' node [color=white style=filled]\n'\
167 +
' color=lightgrey\n'\
168 +
' fontname=Helvetica\n'\
169 +
' label = %s\n'%(cfseq.sequenceCA.step.name))
172 cfseq_algs.append(cfseq.sequenceCA.filterNode)
174 for menuseq
in cfseq.sequenceCA.step.sequences:
175 cfseq_algs, all_hypos, _ = menuseq.buildDFDot(cfseq_algs,
179 if cfseq.sequenceCA.step.combo
is not None:
180 file.write(
" %s[color=%s]\n"%(cfseq.sequenceCA.step.combo.Alg.name,
algColor(cfseq.sequenceCA.step.combo.Alg)))
181 cfseq_algs.append(cfseq.sequenceCA.step.combo)
197 alg_set =
set(alg_list)
198 for nodeA, nodeB
in itertools.permutations(alg_set, 2):
201 ins=nodeB.getInputList()
202 outs=nodeA.getOutputList()
204 if len(dataIntersection) > 0:
205 for line
in dataIntersection:
206 lineconnect+=
addConnection(nodeA.Alg.name, nodeB.Alg.name, line)
215 for nodeA, nodeB
in itertools.combinations(alg_list, 2):
225 if len(dataIntersection) > 0:
226 for line
in dataIntersection:
227 lineconnect+=
addConnection(nodeA.Alg.name, nodeB.Alg.name, line)
234 Excluded = [
"StoreGateSvc/DetectorStore",
"StoreGateSvc"]
237 if isinstance(node.Alg, AthSequencer):
241 algs.append(node.Alg)
245 for k, cval
in alg.getValuedProperties().
items():
246 if type(cval)
is list:
249 if val
not in Excluded:
252 if cval
not in Excluded:
260 line =
" %s -> %s \n"%(nodeA,nodeB)