error in computing decay width with form factor

Asked by nblinov on 2016-12-23

Hi,

I'm generating events from a model that contains a form factor,
which was implemented according to https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors

When one sets decay for one of the new particles to Auto in the param card, MG5 returns the following error
Command "generate_events " interrupted in sub-command:
"set max_npoint_for_channel 0" with error:
NameError : name 'AAA' is not defined

However, the param_card.dat does get updated with a number for the width, such that
running generate_events a second time goes through smoothly.

Is there any way to prevent this error from occurring? Currently my work-around
is to just run gen_events twice...

Thank you!

PS. Here's the output of the MG5_debug file, immediately after the error occurs:

#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.3.3 2015-10-25 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************
set group_subprocesses Auto
set ignore_six_quark_processes False
set loop_color_flows False
set gauge unitary
set complex_mass_scheme False
set max_npoint_for_channel 0
Traceback (most recent call last):
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 908, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 897, in onecmd_orig
    return func(arg, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 1998, in do_generate_events
    postcmd=False)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 958, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 897, in onecmd_orig
    return func(arg, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 2655, in do_survey
    self.configure_directory()
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 3874, in configure_directory
    self.do_treatcards('')
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 2451, in do_treatcards
    self.check_param_card(pjoin(self.me_dir, 'Cards','param_card.dat'))
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/common_run_interface.py", line 1633, in check_param_card
    self.do_compute_widths('%s %s' % (' '.join(pdg), path))
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/common_run_interface.py", line 1206, in do_compute_widths
    cmd.exec_cmd(line, model=opts['model'])
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/extended_cmd.py", line 958, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/extended_cmd.py", line 897, in onecmd_orig
    return func(arg, **opt)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/master_interface.py", line 331, in do_compute_widths
    return self.cmd.do_compute_widths(self, *args, **opts)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/madgraph_interface.py", line 7205, in do_compute_widths
    ), skip_2body=skip_2body)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/master_interface.py", line 319, in do_decay_diagram
    return self.cmd.do_decay_diagram(self, *args, **opts)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/madgraph_interface.py", line 7460, in do_decay_diagram
    model.find_all_channels(2,generate_abstract=False)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 2877, in find_all_channels
    part.update_decay_attributes(True, True, True, self)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 453, in update_decay_attributes
    self.estimate_width_error(model)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 475, in estimate_width_error
    for c in self.get_channels(final_level, False)])/ \
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 3450, in get
    return self.get_apx_decaywidth_nextlevel(model)
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4440, in get_apx_decaywidth_nextlevel
    self['apx_decaywidth_nextlevel'] = self.get_apx_decaywidth(model)*err
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4403, in get_apx_decaywidth
    self.get_apx_psarea(model)/ \
  File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4167, in get_apx_matrixelement_sq
    lor_value = eval(new_structure % q_dict_lor)
  File "<string>", line 1, in <module>
NameError: name 'AAA' is not defined
                          MadGraph5_aMC@NLO Options
                          ----------------
        complex_mass_scheme : False
                      gauge : unitary
         group_subprocesses : Auto
  ignore_six_quark_processes : False
           loop_color_flows : False
      loop_optimized_output : True
     max_npoint_for_channel : 0
               stdout_level : 20 (user set)

                         MadEvent Options
                          ----------------
     automatic_html_opening : False (user set)
                    nb_core : None
        notification_center : True
                   run_mode : 2

                      Configuration Options
                      ---------------------
                        OLP : MadLoop
                    amcfast : amcfast-config
                   applgrid : applgrid-config
                auto_update : 7
         cluster_local_path : /cvmfs/cp3.uclouvain.be/madgraph/
           cluster_nb_retry : 1
              cluster_queue : None
         cluster_retry_wait : 300
               cluster_size : 100
      cluster_status_update : (600, 30)
          cluster_temp_path : None
               cluster_type : condor
               cpp_compiler : None
               delphes_path : ./Delphes
                 eps_viewer : None
        exrootanalysis_path : ./ExRootAnalysis
              f2py_compiler : None
                    fastjet : None (user set)
           fortran_compiler : None
                      golem : None (user set)
                 hepmc_path : None (user set)
                  hwpp_path : None (user set)
                     lhapdf : lhapdf-config
           madanalysis_path : ./MadAnalysis
        output_dependencies : external
                      pjfry : None (user set)
            pythia-pgs_path : ./pythia-pgs
               pythia8_path : None (user set)
               syscalc_path : ./SysCalc
                    td_path : ./td
                text_editor : None
                thepeg_path : None (user set)
                    timeout : 60
                web_browser : None

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
nblinov
Solved:
2016-12-26
Last query:
2016-12-26
Last reply:
2016-12-26

Hi,

That’s a very dangerous work around, since it indicates that you do not include three body decay.
If those are negligible then it might be ok but otherwise you are biasing your computation.

Can you send me (to my email: <email address hidden> ) your model such that I can take a look.

Cheers,

Olivier

PS: I might be quite slow to look at this due to the holliday period.
PPS: If you are in a hurry, you can try with the most recent version of the code, I can of doubt that such bug was fixed but since you are using a quite old version of the code it is possible that I fix such bug and do not remember it.

> On Dec 23, 2016, at 04:28, nblinov <email address hidden> wrote:
>
> New question #408658 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/408658
>
> Hi,
>
> I'm generating events from a model that contains a form factor,
> which was implemented according to https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/FormFactors
>
> When one sets decay for one of the new particles to Auto in the param card, MG5 returns the following error
> Command "generate_events " interrupted in sub-command:
> "set max_npoint_for_channel 0" with error:
> NameError : name 'AAA' is not defined
>
> However, the param_card.dat does get updated with a number for the width, such that
> running generate_events a second time goes through smoothly.
>
> Is there any way to prevent this error from occurring? Currently my work-around
> is to just run gen_events twice...
>
> Thank you!
>
> PS. Here's the output of the MG5_debug file, immediately after the error occurs:
>
>
> #************************************************************
> #* MadGraph5_aMC@NLO *
> #* *
> #* * * *
> #* * * * * *
> #* * * * * 5 * * * * *
> #* * * * * *
> #* * * *
> #* *
> #* *
> #* VERSION 2.3.3 2015-10-25 *
> #* *
> #* The MadGraph5_aMC@NLO Development Team - Find us at *
> #* https://server06.fynu.ucl.ac.be/projects/madgraph *
> #* *
> #************************************************************
> #* *
> #* Command File for MadGraph5_aMC@NLO *
> #* *
> #* run as ./bin/mg5_aMC filename *
> #* *
> #************************************************************
> set group_subprocesses Auto
> set ignore_six_quark_processes False
> set loop_color_flows False
> set gauge unitary
> set complex_mass_scheme False
> set max_npoint_for_channel 0
> Traceback (most recent call last):
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 908, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 897, in onecmd_orig
> return func(arg, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 1998, in do_generate_events
> postcmd=False)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 958, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/extended_cmd.py", line 897, in onecmd_orig
> return func(arg, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 2655, in do_survey
> self.configure_directory()
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 3874, in configure_directory
> self.do_treatcards('')
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/madevent_interface.py", line 2451, in do_treatcards
> self.check_param_card(pjoin(self.me_dir, 'Cards','param_card.dat'))
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/common_run_interface.py", line 1633, in check_param_card
> self.do_compute_widths('%s %s' % (' '.join(pdg), path))
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mAp_scan_1/bin/internal/common_run_interface.py", line 1206, in do_compute_widths
> cmd.exec_cmd(line, model=opts['model'])
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/extended_cmd.py", line 958, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/extended_cmd.py", line 897, in onecmd_orig
> return func(arg, **opt)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/master_interface.py", line 331, in do_compute_widths
> return self.cmd.do_compute_widths(self, *args, **opts)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/madgraph_interface.py", line 7205, in do_compute_widths
> ), skip_2body=skip_2body)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/master_interface.py", line 319, in do_decay_diagram
> return self.cmd.do_decay_diagram(self, *args, **opts)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/madgraph/interface/madgraph_interface.py", line 7460, in do_decay_diagram
> model.find_all_channels(2,generate_abstract=False)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 2877, in find_all_channels
> part.update_decay_attributes(True, True, True, self)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 453, in update_decay_attributes
> self.estimate_width_error(model)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 475, in estimate_width_error
> for c in self.get_channels(final_level, False)])/ \
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 3450, in get
> return self.get_apx_decaywidth_nextlevel(model)
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4440, in get_apx_decaywidth_nextlevel
> self['apx_decaywidth_nextlevel'] = self.get_apx_decaywidth(model)*err
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4403, in get_apx_decaywidth
> self.get_apx_psarea(model)/ \
> File "/home/nblinov/HEP/MG5_aMC_v2_3_3/mg5decay/decay_objects.py", line 4167, in get_apx_matrixelement_sq
> lor_value = eval(new_structure % q_dict_lor)
> File "<string>", line 1, in <module>
> NameError: name 'AAA' is not defined
> MadGraph5_aMC@NLO Options
> ----------------
> complex_mass_scheme : False
> gauge : unitary
> group_subprocesses : Auto
> ignore_six_quark_processes : False
> loop_color_flows : False
> loop_optimized_output : True
> max_npoint_for_channel : 0
> stdout_level : 20 (user set)
>
> MadEvent Options
> ----------------
> automatic_html_opening : False (user set)
> nb_core : None
> notification_center : True
> run_mode : 2
>
> Configuration Options
> ---------------------
> OLP : MadLoop
> amcfast : amcfast-config
> applgrid : applgrid-config
> auto_update : 7
> cluster_local_path : /cvmfs/cp3.uclouvain.be/madgraph/
> cluster_nb_retry : 1
> cluster_queue : None
> cluster_retry_wait : 300
> cluster_size : 100
> cluster_status_update : (600, 30)
> cluster_temp_path : None
> cluster_type : condor
> cpp_compiler : None
> delphes_path : ./Delphes
> eps_viewer : None
> exrootanalysis_path : ./ExRootAnalysis
> f2py_compiler : None
> fastjet : None (user set)
> fortran_compiler : None
> golem : None (user set)
> hepmc_path : None (user set)
> hwpp_path : None (user set)
> lhapdf : lhapdf-config
> madanalysis_path : ./MadAnalysis
> output_dependencies : external
> pjfry : None (user set)
> pythia-pgs_path : ./pythia-pgs
> pythia8_path : None (user set)
> syscalc_path : ./SysCalc
> td_path : ./td
> text_editor : None
> thepeg_path : None (user set)
> timeout : 60
> web_browser : None
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Hi,

Here is a patch which solves the problem.
Note that the patch is created for 2.5.2 (the latest version). I can not guarantee that such patch works for older version of the code and/or in conjonction of any unofficial patch of the code.

Cheers,

Olivier

=== modified file 'mg5decay/decay_objects.py'
--- mg5decay/decay_objects.py 2016-04-25 14:02:24 +0000
+++ mg5decay/decay_objects.py 2016-12-26 16:49:51 +0000
@@ -4164,8 +4164,25 @@
                     for i, part in enumerate(vertex['particles']):
                         mass = abs(eval(part.get('mass')))
                         q_dict_lor['q%i' % (i+1)] = mass / 2
-
- lor_value = eval(new_structure % q_dict_lor)
+
+ try:
+ lor_value = eval(new_structure % q_dict_lor)
+ except NameError , error:
+ ufo_struct = model.lorentz_dict[vertex['lorentz'][key[1]]]
+
+ for obj in ufo_struct.formfactors:
+ val = self.lor_pattern.sub(self.simplify_lorentz,
+ obj.value)
+ while True:
+ try:
+ exec('%s=%s' % (obj.name, val % q_dict_lor))
+ except NameError, error:
+ failname = str(error).split("'")[1]
+ exec('%s=mdl_%s' % (failname, failname))
+ else:
+ break
+ lor_value = eval(new_structure % q_dict_lor)
+
                     # Avoid accidental zeros in lor_value
                     if lor_value == 0:
                         new_structure = new_structure.replace('-','+')

nblinov (nblinov) said : #3

Hi Olivier,

Thank you for your help. This patch fixed the problem (I updated my model files to work with the latest version of MG5, so I only tested the patch with that).