Ejemplo n.º 1
0
 def setUp(self):
     with File.open('test.root', 'recreate') as f:
         f.mkdir('TTbar_plus_X_analysis/EPlusJets/Ref selection',
                 recurse=True)
         f.cd('TTbar_plus_X_analysis/EPlusJets/Ref selection')
         tree = Tree("test")
         tree.create_branches({
             'x': 'F',
             'y': 'F',
             'z': 'F',
             'i': 'I',
             'EventWeight': "F"
         })
         for i in xrange(10000):
             tree.x = gauss(.5, 1.)
             tree.y = gauss(.3, 2.)
             tree.z = gauss(13., 42.)
             tree.i = i
             tree.EventWeight = 1.
             tree.fill()
         f.write()
         h = create_test_hist()
         h.write()
         tree.write()
         f.write()
         f.Close()
Ejemplo n.º 2
0
def create_test_tree(filename='test.root'):
    with File.open (filename, 'recreate') as f:
        tree = Tree("test")
        tree.create_branches(
            {'x': 'F',
             'y': 'F',
             'z': 'F',
             'i': 'I',
             'EventWeight': "F"})
        for i in xrange(10000):
            tree.x = gauss(.5, 1.)
            tree.y = gauss(.3, 2.)
            tree.z = gauss(13., 42.)
            tree.i = i
            tree.EventWeight = 1.
            tree.fill()
        f.write()
Ejemplo n.º 3
0
def create_test_tree(filename='test.root'):
    with File.open(filename, 'recreate') as f:
        tree = Tree("test")
        tree.create_branches({
            'x': 'F',
            'y': 'F',
            'z': 'F',
            'i': 'I',
            'EventWeight': "F"
        })
        for i in xrange(10000):
            tree.x = gauss(.5, 1.)
            tree.y = gauss(.3, 2.)
            tree.z = gauss(13., 42.)
            tree.i = i
            tree.EventWeight = 1.
            tree.fill()
        f.write()
 def setUp(self):
     with File.open ('test.root', 'recreate') as f:
         f.mkdir('TTbar_plus_X_analysis/EPlusJets/Ref selection', recurse=True)
         f.cd('TTbar_plus_X_analysis/EPlusJets/Ref selection')
         tree = Tree("test")
         tree.create_branches(
             {'x': 'F',
              'y': 'F',
              'z': 'F',
              'i': 'I',
              'EventWeight': "F"})
         for i in xrange(10000):
             tree.x = gauss(.5, 1.)
             tree.y = gauss(.3, 2.)
             tree.z = gauss(13., 42.)
             tree.i = i
             tree.EventWeight = 1.
             tree.fill()
         f.write()
         h = create_test_hist()
         h.write()
         tree.write()
         f.write()
         f.Close()