Exemple #1
0
        def test_mw_cuts(self):

            file_to_mod = './SubProcesses/cuts.bk'
            rule = './Source/MadWeight/mod_file/mod_cuts'
            mod_file(file_to_mod, rule, write='./SubProcesses/cuts.mod')
            self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
            self.assertEqual(create_run.bw_cut_is_active('cuts.mod'), 1)
            self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

            file_to_mod = './SubProcesses/cuts.mod'
            rule = './Source/MadWeight/mod_file/suppress_cuts_MW'

            mod_file(file_to_mod, rule, write='./SubProcesses/cuts.mod')
            self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
            self.assertEqual(create_run.bw_cut_is_active('cuts.mod'), 1)
            self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

            mod_file(file_to_mod, rule, write='./SubProcesses/cuts.mod')
            self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
            self.assertEqual(create_run.bw_cut_is_active('cuts.mod'), 1)
            self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

            mod_file(file_to_mod, rule, write='./SubProcesses/cuts.mod')
            self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
            self.assertEqual(create_run.bw_cut_is_active('cuts.mod'), 1)
            self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

            mod_file(file_to_mod, rule, write='./SubProcesses/cuts.mod')
            self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
            self.assertEqual(create_run.bw_cut_is_active('cuts.mod'), 1)
            self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())
Exemple #2
0
    def test_cuts(self):
        """ test if we can activate/desactivate the cuts """

        self.assertEqual(create_run.cut_is_active('cuts.bk'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.bk'),1)

        file_to_mod='./SubProcesses/cuts.bk'
        rule='./Source/MadWeight/mod_file/suppress_cuts_MG'
        #modify file                                            
        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        file_to_mod='./SubProcesses/cuts.mod'
        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())
Exemple #3
0
    def test_mw_cuts(self):

        file_to_mod ='./SubProcesses/cuts.bk'
        rule= './Source/MadWeight/mod_file/mod_cuts'
        mod_file.mod_file(file_to_mod,rule, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)            
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())
        
        file_to_mod='./SubProcesses/cuts.mod'
        rule = './Source/MadWeight/mod_file/suppress_cuts_MW'
        
        mod_file.mod_file(file_to_mod,rule, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())
Exemple #4
0
    def test_cuts(self):
        """ test if we can activate/desactivate the cuts """

        self.assertEqual(create_run.cut_is_active('cuts.bk'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.bk'),1)

        file_to_mod='./SubProcesses/cuts.bk'
        rule='./Source/MadWeight/mod_file/suppress_cuts_MG'
        #modify file                                            
        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        file_to_mod='./SubProcesses/cuts.mod'
        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 0)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())

        mod_file.mod_file(file_to_mod,rule,opt={'nowarning':"""['PASSCUTS','MW_NEW_DEF','DESACTIVATE_BW_CUT']"""}, write='./SubProcesses/cuts.mod')
        self.assertEqual(create_run.cut_is_active('cuts.mod'), 1)
        self.assertEqual(create_run.bw_cut_is_active('cuts.mod'),1)
        self.assertFalse('\n$B$' in open('./SubProcesses/cuts.mod').read())