Exemple #1
0
def test_chain_draw():
    if sys.version_info[0] >= 3:
        raise SkipTest("Python 3 support not implemented")
    chain = TreeChain('tree', FILE_PATHS)
    hist = Hist(100, 0, 1)
    chain.draw('a_x', hist=hist)
    assert_equal(hist.Integral() > 0, True)
    assert_equal(hist.GetEntries(), 300)

    # check that Draw can be repeated
    hist2 = Hist(100, 0, 1)
    chain.draw('a_x', hist=hist2)
    assert_equal(hist.Integral(), hist2.Integral())

    # draw into a graph
    graph = chain.draw("a_x:a_y")
    assert_true(isinstance(graph, _GraphBase))
    assert_equal(len(graph), chain.GetEntries())
    assert_equal(len(graph), 300)