225
225
draw_list = step_data.keys()
226
226
draw_list = self.move(draw_list, "G4_AIR", 0)
227
227
draw_list = self.move(draw_list, "G4_Galactic", 1)
228
x_list, z_list = [], []
228
black_x_list, black_y_list = [], []
229
grey_x_list, grey_y_list = [], []
229
230
canvas = common.make_root_canvas("Material vs z")
230
231
hist = ROOT.TH2D("name", "Material vs z", 30000, z_range[0], z_range[1],
231
232
len(draw_list)+1, -0.5, len(draw_list)+0.5)
232
233
common._hist_persistent.append(hist) #pylint: disable=W0212
233
234
for material in draw_list:
234
hist.Fill(0., material, 1.)
235
hist.Fill(z_range[0], material, 1.)
235
236
hist.SetBit(ROOT.TH1.kCanRebin)
237
238
hist.LabelsDeflate("Y")
238
239
hist.LabelsOption("v")
240
for material in draw_list:
241
x_list += [step["r"] for step in step_data[material] \
243
z_list += [step["z"] for step in step_data[material] \
245
if len(x_list) != len(z_list) or len(x_list) == 0:
246
print "Detected no steps on axis, aborting 1d plot"
247
hist, graph = common.make_root_graph("", z_list, "z [mm]",
249
common._graph_persistent.append(graph) #pylint: disable=W0212
241
for i, material in enumerate(draw_list):
242
grey_x_list += [i+0.1 for step in step_data[material]]
243
grey_y_list += [step["z"] for step in step_data[material]]
244
black_x_list += [i for step in step_data[material] \
246
black_y_list += [step["z"] for step in step_data[material] \
249
if len(grey_x_list) == 0:
251
hist, graph = common.make_root_graph("", grey_y_list, "z [mm]",
252
grey_x_list, "material index")
253
graph.SetMarkerColor(ROOT.TColor.GetColor(0.5, 0.5, 0.5))
250
254
graph.SetMarkerStyle(7)
256
if len(black_x_list) != 0:
257
hist, graph = common.make_root_graph("", black_y_list, "z [mm]",
258
black_x_list, "material index")
259
graph.SetMarkerStyle(7)
253
262
for _format in self.formats:
254
263
canvas.Print(self.mat_1d+"."+_format)
277
286
self.volume_data[volume]["z_max"]]
278
287
y_list = [i+0.1, i+0.1]
279
288
hist, graph = common.make_root_graph("", x_list, "z [mm]",
280
y_list, "material index")
289
y_list, "volume index")
281
290
graph.SetLineColor(ROOT.TColor.GetColor(0.5, 0.5, 0.5))
283
292
if self.volume_data[volume]["r_min"] < 1e-9: