test_canvas.py
Go to the documentation of this file.
1 import Canvas
2 ########################### Test canvas
3 print "\ntest : --- Testing canvas"
4 canvas = Canvas.Canvas()
5 
6 import ROOT
7 root_file_name = "/nova/ana/users/tamsett/ana_valid/condor_output/validation/test_grid_validation/v3/inspect_dataset/v1/prod_decaf_S15-05-22a_nd_numi_numu_contain_goodruns/inspect_dataset.root"
8 open_root_file = ROOT.TFile(root_file_name)
9 assert open_root_file.IsOpen()
10 
11 histogram = open_root_file.Get("SAM/definition_summary")
12 assert histogram
13 
14 root_file_name_b = "/nova/ana/users/tamsett/ana_valid/condor_output/validation/test_grid_validation/v3/inspect_dataset/v1/prod_decaf_S15-05-22a_nd_numi_numu_contain_1426895999-to-2c_goodruns/inspect_dataset.root"
15 open_root_file_b = ROOT.TFile(root_file_name_b)
16 assert open_root_file_b.IsOpen()
17 
18 histogram_b = open_root_file_b.Get("SAM/definition_summary")
19 assert histogram_b
20 
21 canvas.draw([histogram, histogram_b], ["a","b"], "x;y;", colours=[ROOT.kRed, ROOT.kBlue], log_y=True, lines=[1,2], draw_option="hist")
22 
23 print "test : --- passed\n"