11 from ROOT
import Belle2
16 from ROOT
import gSystem
18 gSystem.Load(
'libtracking_trackFindingCDC')
22 AttributeMap = Belle2.TrackFindingCDC.PrimitivePlotter.AttributeMap
28 groupAttributes = AttributeMap()
29 groupAttributes[
'stroke'] =
'black'
30 groupAttributes[
'stroke-width'] =
'5'
33 plotter.startGroup(groupAttributes)
36 plotter.drawLine(0, 0, 100, 100)
39 lineAttributes = AttributeMap()
40 lineAttributes[
'stroke'] =
'green'
43 plotter.drawLine(0, 100, 100, 0, lineAttributes)
59 arcAttributes = AttributeMap()
60 arcAttributes[
"fill"] =
"none"
61 arcAttributes[
"stroke"] =
"violet"
62 arcAttributes[
"stroke-width"] =
"5"
64 plotter.drawCircleArc(startX, startY, endX, endY, radius, longArc, sweepFlag, arcAttributes)
67 arrowAttributes = AttributeMap()
68 arrowAttributes[
"stroke"] =
"yellow"
69 arrowAttributes[
"stroke-width"] =
"5"
71 plotter.drawArrow(50, 90, 50, 10, arrowAttributes)
83 circleAttributes = AttributeMap()
84 circleAttributes[
"stroke"] =
"green"
85 circleAttributes[
"stroke-width"] =
"5"
86 circleAttributes[
"fill"] =
"white"
87 circleAttributes[
"_showAt"] =
"0s"
92 for secs, x
in enumerate((25, 40, 55, 70)):
93 circleAttributes[
"_showAt"] = str(secs) +
"s"
94 plotter.drawCircle(x, y, r, circleAttributes)
97 testFileName =
"test.svg"
99 plotter.save(testFileName)
104 with open(testFileName)
as input_file:
105 for line
in input_file:
108 os.remove(testFileName)
A concrete plotter that can draw primitive objects to standalone SVG files.