def testFailValidityTreeInput(self): i = ti.Input(input_file='doesnotexist.root', tree='test', branch='x', selection='1', weight_branch='1') self.assertFalse(i.isValid())
def testValidityTreeInput(self): i = ti.Input(input_file='test.root', tree='test', branch='x', selection='1', weight_branch='1') self.assertTrue(i.isValid())
def testReadHist(self): i = ti.Input( input_file='test.root', hist='test_hist', ) h = i.read() h_test = create_test_hist() self.assertEqual(h.nbins(), h_test.nbins())
def testToDict1(self): i = ti.Input( input_file='test.root', hist='test_hist', ) d = i.toDict() expected = { 'class': 'dps.utils.input.Input', 'input_file': 'test.root', 'hist': 'test_hist' } self.assertEqual(d, expected)
def testReadTree(self): i = ti.Input( input_file='test.root', tree='test', branch='x', selection='1', weight_branch='EventWeight', n_bins=10, x_min=0, x_max=10, ) h = i.read() self.assertEqual(h.nbins(), 10)
def testFailValidityHistInput(self): i = ti.Input( input_file='test.root', hist='doesnotexist', ) self.assertFalse(i.isValid())
def testValidityHistInput(self): i = ti.Input( input_file='test.root', hist='test_hist', ) self.assertTrue(i.isValid())