Skip to content

Commit

Permalink
[susy] in CODEGEN add fixes for Majorana particles only in the aS-ind…
Browse files Browse the repository at this point in the history
…ep parameters madgraph5#622
  • Loading branch information
valassi committed Apr 1, 2023
1 parent 95eab09 commit 0e86554
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/model_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,14 +719,6 @@ def write_hardcoded_parameters(self, params):
skipnextline = False
for iline, line in enumerate(parset.split('\n')):
###print(iline, line) # for debugging
#if skipnextline:
# print('WARNING! Skip line after leading "if" :', line)
# skipnextline = False
# continue # skip line after leading "if", assuming a two-line if statement (#622)
#elif line.startswith('if'):
# print('WARNING! Skip line with leading "if" :', line)
# skipnextline = True
# continue # skip line with leading "if" (#622)
if line.startswith('indices'):
###print('WARNING! Skip line with leading "indices" :', line)
continue # skip line with leading "indices", before slha.get_block_entry (#622)
Expand Down Expand Up @@ -755,8 +747,9 @@ def super_write_set_parameters_donotfixMajorana(self, params):
return "\n".join(res_strings)

# AV - replace export_cpp.UFOModelConverterCPP method (eventually split writing of parameters and fixes for Majorana particles #622)
def super_write_set_parameters_onlyfixMajorana(self):
def super_write_set_parameters_onlyfixMajorana(self, hardcoded): # FIXME! split hardcoded (constexpr) and not-hardcoded code
"""Write out the lines of independent parameters"""
print( 'super_write_set_parameters_onlyfixMajorana (hardcoded=%s)'%hardcoded )
res_strings = []
# Correct width sign for Majorana particles (where the width and mass need to have the same sign)
for particle in self.model.get('particles'):
Expand Down Expand Up @@ -792,6 +785,7 @@ def super_generate_parameters_class_files(self):
if '"aS =' in line else
line for line in self.write_print_parameters(self.params_indep).split('\n') ]
replace_dict['print_independent_parameters'] = '\n'.join( print_params_indep )
replace_dict['print_independent_parameters'] += self.super_write_set_parameters_onlyfixMajorana( hardcoded=False ) # add fixes for Majorana particles only in the aS-indep parameters #622
replace_dict['print_independent_couplings'] = self.write_print_parameters(self.coups_indep)
replace_dict['print_dependent_parameters'] = self.write_print_parameters(self.params_dep)
replace_dict['print_dependent_couplings'] = self.write_print_parameters(list(self.coups_dep.values()))
Expand All @@ -801,7 +795,7 @@ def super_generate_parameters_class_files(self):
assert self.super_write_set_parameters_donotfixMajorana([]) == '', 'super_write_set_parameters_donotfixMajorana([]) is not empty' # AV sanity check (#622)
###misc.sprint(self.params_indep) # for debugging
hrd_params_indep = [ line.replace('constexpr','//constexpr') + ' // now retrieved event-by-event (as G) from Fortran (running alphas #373)' if 'aS =' in line else line for line in self.write_hardcoded_parameters(self.params_indep).split('\n') ]
replace_dict['hardcoded_independent_parameters'] = '\n'.join( hrd_params_indep )
replace_dict['hardcoded_independent_parameters'] = '\n'.join( hrd_params_indep ) + self.super_write_set_parameters_onlyfixMajorana( hardcoded=True ) # add fixes for Majorana particles only in the aS-indep parameters #622
###misc.sprint(self.coups_indep) # for debugging
replace_dict['hardcoded_independent_couplings'] = self.write_hardcoded_parameters(self.coups_indep)
###misc.sprint(self.params_dep) # for debugging
Expand Down

0 comments on commit 0e86554

Please # to comment.