885
885
# Make sure aloha is in quadruple precision if needed
886
886
old_aloha_mp=aloha.mp_precision
887
887
aloha.mp_precision=self.opt['mp']
889
889
# create the MODEL
890
890
write_dir=pjoin(self.dir_path, 'Source', 'MODEL')
891
891
model_builder = UFO_model_to_mg4(model, write_dir, self.opt + self.proc_characteristic)
2042
2042
open(pjoin(self.dir_path,'__init__.py'),'w')
2043
2043
open(pjoin(self.dir_path,'SubProcesses','__init__.py'),'w')
2045
if 'mode' in self.opt and self.opt['mode'] == "reweight":
2045
if False:#'mode' in self.opt and self.opt['mode'] == "reweight":
2046
2046
#add the module to hande the NLO weight
2047
2047
files.copytree(pjoin(MG5DIR, 'Template', 'RWGTNLO'),
2048
2048
pjoin(self.dir_path, 'Source'))
2050
2050
pjoin(self.dir_path, 'Source', 'PDF'))
2051
2051
self.write_pdf_opendata()
2053
if self.prefix_info:
2053
if self.prefix_info:
2054
2054
self.write_f2py_splitter()
2055
2055
self.write_f2py_makefile()
2056
2056
self.write_f2py_check_sa(matrix_elements,
2107
2107
CALL SETPARA(PATH) !first call to setup the paramaters
2112
subroutine CHANGE_PARA(name, value)
2114
CF2PY intent(in) :: name
2115
CF2PY intent(in) :: value
2118
double precision value
2120
include '../Source/MODEL/input.inc'
2121
include '../Source/MODEL/coupl.inc'
2126
write(*,*) 'no parameter matching', name, value
2132
subroutine update_all_coup()
2111
2139
subroutine get_pdg_order(PDG)
2161
2189
if min_nexternal != max_nexternal:
2162
2190
text.append('endif')
2192
params = self.get_model_parameter(self.model)
2194
for key, var in params.items():
2195
parameter_setup.append(' CASE ("%s")\n %s = value'
2164
2198
formatting = {'python_information':'\n'.join(info),
2165
2199
'smatrixhel': '\n'.join(text),
2166
2200
'maxpart': max_nexternal,
2167
2201
'nb_me': len(allids),
2168
2202
'pdgs': ','.join(str(pdg[i]) if i<len(pdg) else '0'
2169
2203
for i in range(max_nexternal) for pdg in allids),
2170
'prefix':'\',\''.join(allprefix)
2204
'prefix':'\',\''.join(allprefix),
2205
'parameter_setup': '\n'.join(parameter_setup),
2172
2207
formatting['lenprefix'] = len(formatting['prefix'])
2173
2208
text = template % formatting
2174
2209
fsock = writers.FortranWriter(pjoin(self.dir_path, 'SubProcesses', 'all_matrix.f'),'w')
2175
2210
fsock.writelines(text)
2213
def get_model_parameter(self, model):
2214
""" returns all the model parameter
2217
for p in model.get('parameters')[('external',)]:
2219
nopref = name[4:] if name.startswith('mdl_') else name
2220
params[nopref] = name
2223
lha = '_'.join([str(i) for i in p.lhacode])
2224
params['%s_%s' % (block.upper(), lha)] = name
2178
2232
def write_f2py_check_sa(self, matrix_element, writer):
2179
2233
""" Write the general check_sa.py in SubProcesses that calls all processes successively."""
2180
2234
# To be implemented. It is just an example file, i.e. not crucial.