Example #1
0
class TestPythia8Dataset(unittest.TestCase):
    
    def setUp(self):
        self.dataset = Dataset(dataset_name_pythia8, dataset_pattern_pythia8,
                               cache=False,
                               extract_info=True, 
                               cfg=cfg_name, xsection=1.8e-9)        
        self.dataset.write()
        self.nfiles = 5
        self.ngoodfiles = 5
        self.nevents = 50

    def test_1_create(self):
        '''Test dataset creation'''
        self.assertEqual(len(self.dataset.all_files), self.nfiles)
        self.assertEqual(len(self.dataset.list_of_good_files()), self.ngoodfiles)
        self.assertEqual(self.dataset.nfiles(), self.nfiles)
        self.assertEqual(self.dataset.ngoodfiles(), self.ngoodfiles)
        self.assertEqual(self.dataset.nevents(), self.nevents)
        self.assertEqual(self.dataset.jobtype(), 'pythia8')
Example #2
0
 def test_3_nevents(self):
     """Test that the number of events is correct"""
     dataset = Dataset(dataset_name_fccsw, cache=cache)
     self.assertEqual(dataset.nevents(), 100)
Example #3
0
 def test_3_nevents(self):
     """Test that the number of events is correct"""
     dataset = Dataset(dataset_name_heppy, cache=True)
     self.assertEqual(dataset.nevents(), self.nevents)