2 from subprocess
import check_output
8 drifter = graph.key(
"Drifter",
"Drifter"+letter)
9 diffuser = graph.key(
"Diffuser",
"Diffuser"+letter)
10 ductor = graph.key(
"PlaneDuctor",
"PlaneDuctor"+letter)
11 graph.connect(g,
"TrackDepos", drifter)
12 graph.connect(g, drifter, diffuser)
13 graph.connect(g, diffuser, ductor)
14 graph.connect(g, ductor,
"PlaneSliceMerger", 0, ind)
15 graph.connect(g,
"PlaneSliceMerger",
"Digitizer")
16 graph.connect(g,
"WireSource",
"Digitizer",0,1)
17 graph.connect(g,
"Digitizer",
"ChannelCellSelector")
18 graph.connect(g,
"WireSource",
"BoundCells")
19 graph.connect(g,
"BoundCells",
"ChannelCellSelector",0,1)
20 graph.connect(g,
"ChannelCellSelector",
"CellSliceSink")
21 desc = nodetype.loads(
open(
"nodedesc.json").
read())
22 graph.validate(g, desc)
25 open(
"test_dfp_sim.dot",
"w").
write(ag.string())
26 print check_output(
"dot -Tpdf -otest_dfp_sim.pdf test_dfp_sim.dot", shell=
True)
28 wcg = graph.wirecell_graph(g)
29 cfg = [dict(type=
"TbbFlow", data=dict(dfp =
"TbbDataFlowGraph", graph = wcg)),]
31 json.dump(cfg,
open(
"test_dfp_sim.cfg",
"w"), indent=2)
33 if '__main__' == __name__:
int open(const char *, int)
Opens a file descriptor.
size_t write(int, const char *, size_t)
Writes count bytes from buf to the filedescriptor fd.
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
int read(int, char *, size_t)
Read bytes from a file descriptor.