Reweighting aQGC in MG2.6

Asked by Robert Les on 2017-12-14

Hi MG experts,

I am attempting to generate the VBS process pp > z z j j using the aQGC model (http://feynrules.irmp.ucl.ac.be/wiki/AnomalousGaugeCoupling). When reweighing events using either MG2.6.0 or 2.6.1 the jobs end unexpectedly and I find the following error in the debug.log:

reweight run_02 -from_cards
Traceback (most recent call last):
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/extended_cmd.py", line 1467, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/extended_cmd.py", line 1421, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/common_run_interface.py", line 2035, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1609, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1494, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1421, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/reweight_interface.py", line 480, in do_launch
    self.load_module()
  File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/reweight_interface.py", line 1758, in load_module
    if self.model.get_mass(int(pdg[i])) == self.model.get_mass(int(oldpdg[i])):
AttributeError: 'Model' object has no attribute 'get_mass'

I found as a naive workaround that commenting out this problematic line and adjusting the indent on the subsequent line solves this problem and the reweighing proceeds properly. Is there a better fix to this issue?

Regards,
Robert Les

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Les
Solved:
2018-07-03
Last query:
2018-07-03
Last reply:
2018-06-27

This question was reopened

Hi,

Yes, it should be fine in 99% of the case. This is a line that check that everything is fine (i.e. it should always be True).
The problem is that we have two format for the model internally and looks like you have found a case where the type of model which does not have the function
to evaluate the mass is used.

Thanks I will secure this problem in next version of the code.

Cheers,

Olivier

> On Dec 14, 2017, at 22:57, Robert Les <email address hidden> wrote:
>
> New question #661784 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/661784
>
> Hi MG experts,
>
> I am attempting to generate the VBS process pp > z z j j using the aQGC model (http://feynrules.irmp.ucl.ac.be/wiki/AnomalousGaugeCoupling). When reweighing events using either MG2.6.0 or 2.6.1 the jobs end unexpectedly and I find the following error in the debug.log:
>
> reweight run_02 -from_cards
> Traceback (most recent call last):
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/extended_cmd.py", line 1467, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/extended_cmd.py", line 1421, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/bin/aQGC_LS012_nodecay_reweight_generate/bin/internal/common_run_interface.py", line 2035, in do_reweight
> reweight_cmd.import_command_file(path)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1609, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1494, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/extended_cmd.py", line 1421, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/various/misc.py", line 100, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/reweight_interface.py", line 480, in do_launch
> self.load_module()
> File "/afs/cern.ch/user/r/rles/public/MG5_aMC_v2_6_1/madgraph/interface/reweight_interface.py", line 1758, in load_module
> if self.model.get_mass(int(pdg[i])) == self.model.get_mass(int(oldpdg[i])):
> AttributeError: 'Model' object has no attribute 'get_mass'
>
> I found as a naive workaround that commenting out this problematic line and adjusting the indent on the subsequent line solves this problem and the reweighing proceeds properly. Is there a better fix to this issue?
>
> Regards,
> Robert Les
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Robert Les (robertles) said : #2

Thanks Olivier Mattelaer, that solved my question.

Robert Les (robertles) said : #3

Hi,

For reference, I have tested again using the current newest release, 2.6.2, and this problem still exist

-Robert

Hi Robert,

Then I would need that you provide to me the exact list of command that you use, since everything is working fine for me with that model (but I'm not even sure that I use the same model as you).

Cheers,

Olivier

Launchpad Janitor (janitor) said : #5

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Robert Les (robertles) said : #6

Hi Olivier,

Sorry for the delay on my end. I use the following card to generate the process:

import model sm-no_b_mass
import model SM_LS012
define p = g u c d s b u~ c~ d~ s~ b~
define j = g u c d s b u~ c~ d~ s~ b~
define l+ = e+ mu+ ta+
define l- = e- mu- ta-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
define w = w+ w-
generate p p > j j z z QCD=0 QED=4 NP=1
output aQGC_LS012_nodecay_reweight
launch
#### Set paramters
set FS0 1.0e-12
set FS1 0.0e-12
set FS2 0.0e-12
set FM0 0.0e-12
set FM1 0.0e-12
set FM2 0.0e-12
set FM3 0.0e-12
set FM4 0.0e-12
set FM5 0.0e-12
set FM6 0.0e-12
set FM7 0.0e-12
set FT0 0.0e-12
set FT1 0.0e-12
set FT2 0.0e-12
set FT3 0.0e-12
set FT4 0.0e-12
set FT5 0.0e-12
set FT6 0.0e-12
set FT7 0.0e-12
set FT8 0.0e-12
set FT9 0.0e-12

Then I add the following reweight_card.dat and run generate_events:

change mode LO
change model SM_LS012
launch --rwgt_name=FS0_10_test
  set FS0 10.0e-12
  set FS1 0.0e-12
  set FS2 0.0e-12
  set FM0 0.0e-12
  set FM1 0.0e-12
  set FM2 0.0e-12
  set FM3 0.0e-12
  set FM4 0.0e-12
  set FM5 0.0e-12
  set FM6 0.0e-12
  set FM7 0.0e-12
  set FT0 0.0e-12
  set FT1 0.0e-12
  set FT2 0.0e-12
  set FT3 0.0e-12
  set FT4 0.0e-12
  set FT5 0.0e-12
  set FT6 0.0e-12
  set FT7 0.0e-12
  set FT8 0.0e-12
  set FT9 0.0e-12

Which leads to this snippet from the output:

INFO: Extracting the banner ...
INFO: process: p p > j j z z QCD=0 QED=4
INFO: options: NP=1
INFO: Running Reweighting
change mode LO # Define type of Reweighting. For LO sample this command
change model SM_LS012
launch --rwgt_name=FS0_10_test
INFO: detected model: SM_LS012. Loading...
INFO: generating the square matrix element for reweighting
INFO: generate p p > j j z z QCD=0 QED=4 NP=1 ;
INFO: Done 67.24
INFO: detected model: SM_LS012. Loading...
INFO: generating the square matrix element for reweighting (second model and/or processes)
INFO: generate p p > j j z z QCD=0 QED=4 NP=1 ;
INFO: Done 66.55
Command "generate_events " interrupted with error:
AttributeError : 'Model' object has no attribute 'get_mass'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/run_02_tag_1_debug.log'.
Please attach this file to your report.

Which contains:

generate_events
Traceback (most recent call last):
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1501, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/madevent_interface.py", line 2467, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/common_run_interface.py", line 6685, in new_fct
    original_fct(obj, *args, **opts)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/madevent_interface.py", line 2559, in run_generate_events
    self.exec_cmd('reweight -from_cards', postcmd=False)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1528, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/common_run_interface.py", line 2138, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1643, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/reweight_interface.py", line 487, in do_launch
    self.load_module()
  File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/reweight_interface.py", line 1788, in load_module
    if not self.model or not getattr(self.model, 'get_mass'):
AttributeError: 'Model' object has no attribute 'get_mass'

-Rob

Hi,

When i do

> import model SM_LS012

it returns:

> DEBUG: no model with that name found online
> Error detected in sub-command import model SM_LS012
> write debug file MG5_debug
> If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
> UFOImportError : Path SM_LS012 is not a valid pathname

Which means that you model is NOT on the feynrules database (otherwise it should have been downloaded automatically.). So I change the model by LS012 which does exists in the FR website. If this is not the correct model, please tell me.

So i have written the following script to test your setup:
> import model LS012
> define p = g u c d s b u~ c~ d~ s~ b~
> define j = g u c d s b u~ c~ d~ s~ b~
> define l+ = e+ mu+ ta+
> define l- = e- mu- ta-
> define vl = ve vm vt
> define vl~ = ve~ vm~ vt~
> define w = w+ w-
> generate p p > j j z z QCD=0 QED=4 NP=1
> output aQGC_LS012_nodecay_reweight
> launch
> reweight=ON
> #### Set paramters
> set FS0 1.0e-12
> set FS1 0.0e-12
> set FS2 0.0e-12
> set FM0 0.0e-12
> set FM1 0.0e-12
> set FM2 0.0e-12
> set FM3 0.0e-12
> set FM4 0.0e-12
> set FM5 0.0e-12
> set FM6 0.0e-12
> set FM7 0.0e-12
> set FT0 0.0e-12
> set FT1 0.0e-12
> set FT2 0.0e-12
> set FT3 0.0e-12
> set FT4 0.0e-12
> set FT5 0.0e-12
> set FT6 0.0e-12
> set FT7 0.0e-12
> set FT8 0.0e-12
> set FT9 0.0e-12
> edit reweight --clean change mode LO
> edit reweight change model LS012
> edit reweight launch --rwgt_name=FS0_10_test
> edit reweight set FS0 10.0e-12
> edit reweight set FS1 0.0e-12
> edit reweight set FS2 0.0e-12
> edit reweight set FM0 0.0e-12
> edit reweight set FM1 0.0e-12
> edit reweight set FM2 0.0e-12
> edit reweight set FM3 0.0e-12
> edit reweight set FM4 0.0e-12
> edit reweight set FM5 0.0e-12
> edit reweight set FM6 0.0e-12
> edit reweight set FM7 0.0e-12
> edit reweight set FT0 0.0e-12
> edit reweight set FT1 0.0e-12
> edit reweight set FT2 0.0e-12
> edit reweight set FT3 0.0e-12
> edit reweight set FT4 0.0e-12
> edit reweight set FT5 0.0e-12
> edit reweight set FT6 0.0e-12
> edit reweight set FT7 0.0e-12
> edit reweight set FT8 0.0e-12
> edit reweight set FT9 0.0e-12

and indeed face a crash which sounds similar to yours.
I have applied the following modification to the code:

> === modified file 'madgraph/interface/reweight_interface.py'
> --- madgraph/interface/reweight_interface.py 2018-06-15 15:10:56 +0000
> +++ madgraph/interface/reweight_interface.py 2018-06-27 08:37:05 +0000
> @@ -1787,7 +1787,7 @@
> for i in range(len(pdg)):
> if pdg[i] == oldpdg[i]:
> continue
> - if not self.model or not getattr(self.model, 'get_mass'):
> + if not self.model or not hasattr(self.model, 'get_mass'):
> continue
> if self.model.get_mass(int(pdg[i])) == self.model.get_mass(int(oldpdg[i])):
> continue

and the it was working.

Thanks for your help,

Cheers,

Olivier

> On 25 Jun 2018, at 20:27, Robert Les <email address hidden> wrote:
>
> Question #661784 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/661784
>
> Status: Expired => Open
>
> Robert Les is still having a problem:
> Hi Olivier,
>
> Sorry for the delay on my end. I use the following card to generate the
> process:
>
> import model sm-no_b_mass
> import model SM_LS012
> define p = g u c d s b u~ c~ d~ s~ b~
> define j = g u c d s b u~ c~ d~ s~ b~
> define l+ = e+ mu+ ta+
> define l- = e- mu- ta-
> define vl = ve vm vt
> define vl~ = ve~ vm~ vt~
> define w = w+ w-
> generate p p > j j z z QCD=0 QED=4 NP=1
> output aQGC_LS012_nodecay_reweight
> launch
> #### Set paramters
> set FS0 1.0e-12
> set FS1 0.0e-12
> set FS2 0.0e-12
> set FM0 0.0e-12
> set FM1 0.0e-12
> set FM2 0.0e-12
> set FM3 0.0e-12
> set FM4 0.0e-12
> set FM5 0.0e-12
> set FM6 0.0e-12
> set FM7 0.0e-12
> set FT0 0.0e-12
> set FT1 0.0e-12
> set FT2 0.0e-12
> set FT3 0.0e-12
> set FT4 0.0e-12
> set FT5 0.0e-12
> set FT6 0.0e-12
> set FT7 0.0e-12
> set FT8 0.0e-12
> set FT9 0.0e-12
>
> Then I add the following reweight_card.dat and run generate_events:
>
> change mode LO
> change model SM_LS012
> launch --rwgt_name=FS0_10_test
> set FS0 10.0e-12
> set FS1 0.0e-12
> set FS2 0.0e-12
> set FM0 0.0e-12
> set FM1 0.0e-12
> set FM2 0.0e-12
> set FM3 0.0e-12
> set FM4 0.0e-12
> set FM5 0.0e-12
> set FM6 0.0e-12
> set FM7 0.0e-12
> set FT0 0.0e-12
> set FT1 0.0e-12
> set FT2 0.0e-12
> set FT3 0.0e-12
> set FT4 0.0e-12
> set FT5 0.0e-12
> set FT6 0.0e-12
> set FT7 0.0e-12
> set FT8 0.0e-12
> set FT9 0.0e-12
>
> Which leads to this snippet from the output:
>
> INFO: Extracting the banner ...
> INFO: process: p p > j j z z QCD=0 QED=4
> INFO: options: NP=1
> INFO: Running Reweighting
> change mode LO # Define type of Reweighting. For LO sample this command
> change model SM_LS012
> launch --rwgt_name=FS0_10_test
> INFO: detected model: SM_LS012. Loading...
> INFO: generating the square matrix element for reweighting
> INFO: generate p p > j j z z QCD=0 QED=4 NP=1 ;
> INFO: Done 67.24
> INFO: detected model: SM_LS012. Loading...
> INFO: generating the square matrix element for reweighting (second model and/or processes)
> INFO: generate p p > j j z z QCD=0 QED=4 NP=1 ;
> INFO: Done 66.55
> Command "generate_events " interrupted with error:
> AttributeError : 'Model' object has no attribute 'get_mass'
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in '/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/run_02_tag_1_debug.log'.
> Please attach this file to your report.
>
> Which contains:
>
> generate_events
> Traceback (most recent call last):
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1501, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/madevent_interface.py", line 2467, in do_generate_events
> self.run_generate_events(switch_mode, args)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/common_run_interface.py", line 6685, in new_fct
> original_fct(obj, *args, **opts)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/madevent_interface.py", line 2559, in run_generate_events
> self.exec_cmd('reweight -from_cards', postcmd=False)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1528, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/bin/aQGC_LS012_nodecay_reweight/bin/internal/common_run_interface.py", line 2138, in do_reweight
> reweight_cmd.import_command_file(path)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1643, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/various/misc.py", line 100, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/reweight_interface.py", line 487, in do_launch
> self.load_module()
> File "/afs/cern.ch/work/r/rles/private/MCGeneration/MG5_aMC_v2_6_2/madgraph/interface/reweight_interface.py", line 1788, in load_module
> if not self.model or not getattr(self.model, 'get_mass'):
> AttributeError: 'Model' object has no attribute 'get_mass'
>
> -Rob
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Robert Les (robertles) said : #8

Hi Olivier,

Thanks, that should solve this question.

-Rob