Comment 9 for bug 1689276

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Thanks Benj for the explanation and Liang for the help.

So in attachment you will find the patch which solves such problem.

Thanks,

Olivier

=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2017-04-28 12:41:49 +0000
+++ madgraph/interface/common_run_interface.py 2017-05-12 23:16:08 +0000
@@ -2672,9 +2672,15 @@
             else:
                 target = pjoin(self.me_dir,'MA5_%s_ANALYSIS_%s'\
                                   %(mode.upper(),MA5_runtag),'PDF','main.pdf')
+
             if not os.path.isfile(target):
- raise MadGraph5Error, "MadAnalysis5 failed to produced "+\
+ target = pjoin(self.me_dir,'MA5_%s_ANALYSIS_%s'\
+ %(mode.upper(),MA5_runtag),'HTML','index.html')
+ if MA5_runtag.upper()=='RECASTING' or not os.path.isfile(target):
+ raise MadGraph5Error, "MadAnalysis5 failed to produced "+\
                         "an output for the analysis '%s' in\n %s"%(MA5_runtag,target)
+ else:
+ target = None

             # Copy the PDF report or CLs in the Events/run directory.
             if MA5_runtag.upper()=='RECASTING':
@@ -2682,7 +2688,8 @@
             else:
                 carboncopy_name = '%s_MA5_%s_analysis_%s.pdf'%(
                                                    self.run_tag,mode,MA5_runtag)
- shutil.copy(target, pjoin(self.me_dir,'Events',self.run_name,carboncopy_name))
+ if target:
+ shutil.copy(target, pjoin(self.me_dir,'Events',self.run_name,carboncopy_name))
             if MA5_runtag!='default':
                 logger.info("MadAnalysis5 successfully completed the "+
                   "%s. Reported results are placed in:"%("analysis '%s'"%MA5_runtag