2
################################################################################
4
# Copyright (c) 2011 The MadGraph5_aMC@NLO Development team and Contributors
6
# This file is a part of the MadGraph5_aMC@NLO project, an application which
7
# automatically generates Feynman diagrams and matrix elements for arbitrary
8
# high-energy processes in the Standard Model and beyond.
10
# It is subject to the MadGraph5_aMC@NLO license which should accompany this
13
# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch
15
################################################################################
16
""" This is the main script in order to generate events in MadEvent """
26
root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0]
28
sys.path.append(pjoin(root_path,'bin','internal'))
29
import amcatnlo_run_interface as run
31
if not sys.version_info[0] == 2 or sys.version_info[1] < 6:
32
sys.exit('MadEvent works with python 2.6 or higher (but not python 3.X).\n\
33
Please upgrade your version of python.')
36
def set_configuration():
37
import coloring_logging
38
logging.config.fileConfig(os.path.join(root_path, 'bin', 'internal', 'me5_logging.conf'))
39
logging.root.setLevel(logging.INFO)
40
logging.getLogger('amcatnlo').setLevel(logging.INFO)
41
logging.getLogger('madgraph').setLevel(logging.INFO)
44
def treat_old_argument(argument):
45
"""Have the MG4 behavior for this script"""
48
mode = int(argument[1])
50
mode = int(raw_input('Enter 2 for multi-core, 1 for parallel, 0 for serial run\n'))
55
name = raw_input('Enter run name\n')
61
opt = raw_input('Enter name for jobs on pbs queue\n')
63
opt = int(raw_input('Enter number of cores\n'))
68
name = raw_input('enter run name\n')
70
# launch = ME.MadEventCmd(me_dir=root_path)
74
argument = ['fake','-f', str(name), '--cluster']
76
argument = ['fake','-f', '--multicore', str(name), '--nb_core=%s' % opt]
78
argument = ['fake','-f', name]
88
################################################################################
90
################################################################################
91
if '__main__' == __name__:
92
# Check that python version is valid
97
if '-h' in argument or '--help' in argument:
98
launch = run.aMCatNLOCmd(me_dir=root_path)
99
launch.exec_cmd('help calculate_xsect')
101
elif len(argument) > 1 and argument[1] in ['0', '1', '2']:
102
argument = treat_old_argument(argument)
104
launch = run.aMCatNLOCmd(me_dir=root_path)
105
launch.run_cmd('calculate_xsect %s' % ' '.join(argument[1:]))
106
launch.run_cmd('quit')
107
except KeyboardInterrupt:
109
launch.run_cmd('quit')
113
if os.path.exists(pjoin(root_path, 'RunWeb')):
114
os.remove(pjoin(root_path, 'RunWeb'))
116
# reconfigure path for the web
117
#if len(argument) == 5:
118
# ME.pass_in_web_mode()