~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to madgraph/interface/madgraph_interface.py

mwrge with 2.7.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
464
464
        logger.info("      -d: specify other MG/ME directory")
465
465
        logger.info("      -noclean: no cleaning performed in \"path\".")
466
466
        logger.info("      -nojpeg: no jpeg diagrams will be generated.")
467
 
        logger.info("      -noeps: no jpeg and eps diagrams will be generated.")
 
467
        logger.info("      --noeps=True: no jpeg and eps diagrams will be generated.")
468
468
        logger.info("      -name: the postfix of the main file in pythia8 mode.")
469
469
        logger.info("   Examples:",'$MG:color:GREEN')
470
470
        logger.info("       output",'$MG:color:GREEN')
535
535
        logger.info(" > Except for the 'gauge' test, all checks above are also")
536
536
        logger.info("   available for loop processes with ML5 ('virt=' mode)")
537
537
        logger.info("Example: check full p p > j j",'$MG:color:GREEN')
 
538
        logger.info("Using leshouches file as input",'$MG:color:GREEN')
 
539
        logger.info("    use the option --events=PATH")
 
540
        logger.info("      zipped file are not supported")
 
541
        logger.info("      to loop over the file use the option --skip_evt=X")
 
542
        logger.info("")
538
543
        logger.info("Options for loop processes only:",'$MG:BOLD')
539
544
        logger.info("o timing:",'$MG:color:GREEN')
540
545
        logger.info("   Generate and output a process and returns detailed")
935
940
                   '--helicity':'-1','--seed':'-1','--collier_cache':'-1',
936
941
                   '--collier_req_acc':'auto',
937
942
                   '--collier_internal_stability_test':'False',
938
 
                   '--collier_mode':'1'}  
 
943
                   '--collier_mode':'1',
 
944
                   '--events': None,
 
945
                   '--skip_evt':0}  
939
946
 
940
947
        if args[0] in ['cms'] or args[0].lower()=='cmsoptions':
941
948
            # increase the default energy to 5000
1084
1091
            
1085
1092
        if '[' in process and '{' in process:
1086
1093
            valid = False
1087
 
            if 'noborn' in process:
 
1094
            if 'noborn' in process or 'sqrvirt' in process:
1088
1095
                valid = True
1089
1096
            else:
1090
1097
                raise self.InvalidCmd('Polarization restriction can not be used for NLO processes')
1683
1690
                    continue
1684
1691
                elif not '=' in arg:
1685
1692
                    raise self.InvalidCmd('Options required an equal (and then the value)')
1686
 
                arg, value = arg.split('=')
 
1693
                arg, value = arg.split('=',1)
1687
1694
                if arg[2:] not in options:
1688
1695
                    raise self.InvalidCmd('%s not valid options' % arg)
1689
1696
                options[arg[2:]] = value
2860
2867
    _import_formats = ['model_v4', 'model', 'proc_v4', 'command', 'banner']
2861
2868
    _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis',
2862
2869
                     'update', 'Golem95', 'QCDLoop', 'maddm', 'maddump',
2863
 
                     'looptools']
 
2870
                     'looptools', 'MadSTR']
2864
2871
    
2865
2872
    # The targets below are installed using the HEPToolsInstaller.py script
2866
2873
    _advanced_install_opts = ['pythia8','zlib','boost','lhapdf6','lhapdf5','collier',
3947
3954
            option = args[i].split('=')
3948
3955
            if option[0] =='--energy':
3949
3956
                options['energy']=float(option[1])
 
3957
            elif option[0] == '--events' and option[1]:
 
3958
                if option[1] == 'None':
 
3959
                    options['events'] = None
 
3960
                elif not os.path.exists(option[1]):
 
3961
                    raise Exception('path %s does not exists' % option[1])
 
3962
                else:
 
3963
                    options['events'] = option[1]
 
3964
            elif option[0] == '--skip_evt':
 
3965
                options['skip_evt']=int(option[1])
3950
3966
            elif option[0]=='--split_orders':
3951
3967
                options['split_orders']=int(option[1])
3952
3968
            elif option[0]=='--helicity':
5685
5701
                    #self.do_define(line)
5686
5702
                    self.exec_cmd('define %s' % line, printcmd=False, precmd=True)
5687
5703
            except self.InvalidCmd as why:
5688
 
                logger_stderr.warning('impossible to set default multiparticles %s because %s' %
 
5704
                logger.warning('impossible to set default multiparticles %s because %s' %
5689
5705
                                        (line.split()[0],why))
5690
5706
                if self.history[-1] == 'define %s' % line.strip():
5691
5707
                    self.history.pop(-1)
6060
6076
         # Return true for successful installation
6061
6077
        return True
6062
6078
 
6063
 
    install_plugin = ['maddm', 'maddump']
 
6079
    install_plugin = ['maddm', 'maddump', 'MadSTR']
6064
6080
    install_ad = {'pythia-pgs':['arXiv:0603175'],
6065
6081
                          'Delphes':['arXiv:1307.6346'],
6066
6082
                          'Delphes2':['arXiv:0903.2225'],
6078
6094
                          'collier':['arXiv:1604.06792'],
6079
6095
                          'oneloop':['arXiv:1007.4716'],
6080
6096
                          'maddm':['arXiv:1804.00444'],
6081
 
                          'maddump':['arXiv:1812.06771']}
 
6097
                          'maddump':['arXiv:1812.06771'],
 
6098
                          'MadSTR':['arXiv:1612.00440']}
6082
6099
    
6083
6100
    install_server = ['http://madgraph.phys.ucl.ac.be/package_info.dat',
6084
6101
                         'http://madgraph.physics.illinois.edu/package_info.dat']
6205
6222
            name = args[0]
6206
6223
        if args[0] == 'MadAnalysis4':
6207
6224
            args[0] = 'MadAnalysis'
6208
 
        
 
6225
        elif args[0] in ['madstr', 'madSTR']:
 
6226
            args[0] = 'MadSTR'
 
6227
            name = 'MadSTR'
 
6228
            
6209
6229
        if args[0] in self._advanced_install_opts:
6210
6230
            # Now launch the advanced installation of the tool args[0]
6211
6231
            # path['HEPToolsInstaller'] is the online adress where to downlaod
6429
6449
                                               cwd = os.path.join(MG5DIR, name))
6430
6450
            else:
6431
6451
                status = misc.call(['make']+make_flags, cwd = os.path.join(MG5DIR, name))
 
6452
            devnull.close()
6432
6453
        else:
6433
6454
            try:
6434
6455
                misc.compile(['clean'], mode='', cwd = os.path.join(MG5DIR, name))
6477
6498
 
6478
6499
            if sys.platform == "darwin":
6479
6500
                logger.info('Downloading TD for Mac')
6480
 
                target = 'http://madgraph.phys.ucl.ac.be/Downloads/td_mac_intel.tar.gz'
 
6501
                target = 'https://home.fnal.gov/~parke/TD/td_mac_intel64.tar.gz'
6481
6502
                misc.wget(target, 'td.tgz', cwd=pjoin(MG5DIR,'td'))
6482
6503
                misc.call(['tar', '-xzpvf', 'td.tgz'],
6483
6504
                                                  cwd=pjoin(MG5DIR,'td'))
6484
 
                files.mv(MG5DIR + '/td/td_mac_intel',MG5DIR+'/td/td')
 
6505
                files.mv(MG5DIR + '/td/td_intel_mac64',MG5DIR+'/td/td')
6485
6506
            else:
6486
6507
                if sys.maxsize > 2**32:
6487
6508
                    logger.info('Downloading TD for Linux 64 bit')
6488
 
                    target = 'http://madgraph.phys.ucl.ac.be/Downloads/td64/td'
6489
 
                    logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.
6490
 
                In 99% of the case, this is perfectly fine. If you do not have plot, please follow 
6491
 
                instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')
 
6509
                    target = 'https://home.fnal.gov/~parke/TD/td_linux_64bit.tar.gz'
 
6510
                    #logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.
 
6511
                #In 99% of the case, this is perfectly fine. If you do not have plot, please follow 
 
6512
                #instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')
6492
6513
                else:                    
6493
6514
                    logger.info('Downloading TD for Linux 32 bit')
6494
6515
                    target = 'http://madgraph.phys.ucl.ac.be/Downloads/td'