~maddevelopers/mg5amcnlo/simple_unlops

« back to all changes in this revision

Viewing changes to tests/acceptance_tests/test_cmd_amcatnlo.py

  • Committer: olivier-mattelaer
  • Date: 2021-11-12 09:29:31 UTC
  • mfrom: (967.1.15 3.3.0)
  • Revision ID: olivier-mattelaer-20211112092931-4ec9qfzgxkeovqog
versionĀ 3.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_1.html' % self.path))
264
264
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_2.html' % self.path))
265
265
 
 
266
 
 
267
    def test_gen_evt_onlygen(self):
 
268
        """test that the event generation splitting works"""
 
269
        cmd = os.getcwd()
 
270
        self.generate(['p p > e+ ve [QCD]'], 'sm')
 
271
        card = open('%s/Cards/run_card_default.dat' % self.path).read()
 
272
        self.assertTrue( '10000 = nevents' in card)
 
273
        card = card.replace('10000 = nevents', '100 = nevents')
 
274
        open('%s/Cards/run_card.dat' % self.path, 'w').write(card)
 
275
        self.cmd_line.exec_cmd('set  cluster_temp_path /tmp/ --no_save')
 
276
        self.do('generate_events -f')
 
277
        # test the lhe event file exists
 
278
        self.assertTrue(os.path.exists('%s/Events/run_01/events.lhe.gz' % self.path))
 
279
        self.assertTrue(os.path.exists('%s/Events/run_01/summary.txt' % self.path))
 
280
        self.assertTrue(os.path.exists('%s/Events/run_01/run_01_tag_1_banner.txt' % self.path))
 
281
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_0.html' % self.path))
 
282
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_1.html' % self.path))
 
283
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_2.html' % self.path))
 
284
 
 
285
        # now re-generate with -o
 
286
        self.do('generate_events -of')
 
287
        self.assertTrue(os.path.exists('%s/Events/run_02/events.lhe.gz' % self.path))
 
288
        self.assertTrue(os.path.exists('%s/Events/run_02/summary.txt' % self.path))
 
289
        self.assertTrue(os.path.exists('%s/Events/run_02/run_02_tag_1_banner.txt' % self.path))
 
290
        self.assertTrue(os.path.exists('%s/Events/run_02/alllogs_2.html' % self.path))
 
291
 
 
292
 
 
293
 
266
294
    def test_madspin_ON_and_onshell_atNLO(self):
267
295
 
268
296
        nevents =20
700
728
        
701
729
        result = save_load_object.load_from_file('%s/HTML/results.pkl' % self.path)
702
730
        return result[run_name]
 
731
 
 
732
 
 
733
    def test_generate_taggedph_nloew(self):
 
734
        """test the param_card created is correct"""
 
735
        
 
736
 
 
737
        text = """
 
738
        import model loop_qcd_qed_sm_Gmu-a0
 
739
        generate u u~ > !a! !a! [QED]
 
740
        output %s
 
741
        launch NLO
 
742
        set lepphreco False
 
743
        set quarkphreco False
 
744
        """ % (self.path)
 
745
        
 
746
        interface = MGCmd.MasterCmd()
 
747
        interface.no_notification()
 
748
        
 
749
        open(pjoin(self.tmpdir,'cmd'),'w').write(text)
 
750
        
 
751
        
 
752
        os.system('rm -rf %s/RunWeb' % self.path)
 
753
        os.system('rm -rf %s/Events/run_*' % self.path)
 
754
 
 
755
        interface.exec_cmd('import command %s' % pjoin(self.tmpdir, 'cmd'))
 
756
        # test the lhe event file exists
 
757
        self.assertTrue(os.path.exists('%s/Events/run_01/summary.txt' % self.path))
 
758
        self.assertTrue(os.path.exists('%s/Events/run_01/run_01_tag_1_banner.txt' % self.path))
 
759
        self.assertTrue(os.path.exists('%s/Events/run_01/res_0.txt' % self.path))
 
760
        self.assertTrue(os.path.exists('%s/Events/run_01/res_1.txt' % self.path))
 
761
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_0.html' % self.path))
 
762
        self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_1.html' % self.path))
 
763
 
 
764
        check_html_page(self, pjoin(self.path, 'crossx.html'))
 
765
        check_html_page(self, pjoin(self.path, 'HTML', 'run_01', 'results.html'))