NLO rw failing: No particle qed<=3 in model

Asked by senka duric

Dear experts,
I am trying to run NLO reweighting for anomalous couplings for WW production. I can generate events and also LO reweighting runs fine. This is my process card:

import model EWdim6NLO-no_cmass_cwwwcbcw
define j = g u c d s u~ c~ d~ s~
define p = g u c d s u~ c~ d~ s~
define ell+ = e+ mu+ ta+
define ell- = e- mu- ta-
define V = w+ w-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3

And this is the output:

<<-----------------------------------
reweight cmsgrid -from_cards
Traceback (most recent call last):
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/extended_cmd.py", line 1009, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/common_run_interface.py", line 1179, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1154, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1035, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/various/misc.py", line 169, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/reweight_interface.py", line 427, in do_launch
    self.create_standalone_directory()
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/various/misc.py", line 169, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/reweight_interface.py", line 1444, in create_standalone_directory
    mgcmd.exec_cmd(commandline, precmd=True)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1031, in exec_cmd
    line = current_interface.precmd(line)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 599, in precmd
    stop = self.onecmd_orig(subline)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 263, in do_generate
    return self.cmd.do_generate(self, line, *args, **opts)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/madgraph_interface.py", line 4180, in do_generate
    self.do_add(" ".join(args))
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 214, in do_add
    return self.cmd.do_add(self, line, *args, **opts)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/loop_interface.py", line 738, in do_add
    self.exec_cmd("add process %s" % base_proc.nice_string(prefix=False, print_weighted=True))
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1035, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 214, in do_add
    return self.cmd.do_add(self, line, *args, **opts)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/loop_interface.py", line 731, in do_add
    myprocdef = self.extract_process(line)
  File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/madgraph_interface.py", line 4386, in extract_process
     raise self.InvalidCmd, "No particle %s in model" % part_name
InvalidCmd: No particle qed<=3 in model
Value of current Options:
------------------------------>>

What am I doing wrong?

I am using MG 242.

All cards are here:

https://github.com/senka/aTGC_cards/tree/master/final_Nov18/SMP/WWTolnulnu_01j_aTGC_lep_WWmass_4f_NLO_FXFX

Thank you in advance!

Greetings,
Senka

Question information

Language:
English Edit question
Status:
Open
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Rikkert Frederix Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

This is a parsing bug in the re-weighting module who fail to correctly understand some syntax in some situation.
This bug is already fixed for sure but I do not remember in which version (I might be incoming for 2.5.3)
Can you check in 2.5.2?

Cheers,

Olivier

> On 24 Feb 2017, at 14:17, senka duric <email address hidden> wrote:
>
> New question #482763 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/482763
>
> Dear experts,
> I am trying to run NLO reweighting for anomalous couplings for WW production. I can generate events and also LO reweighting runs fine. This is my process card:
>
> import model EWdim6NLO-no_cmass_cwwwcbcw
> define j = g u c d s u~ c~ d~ s~
> define p = g u c d s u~ c~ d~ s~
> define ell+ = e+ mu+ ta+
> define ell- = e- mu- ta-
> define V = w+ w-
> define vl = ve vm vt
> define vl~ = ve~ vm~ vt~
> generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
> add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
> add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
> add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3
>
> And this is the output:
>
> <<-----------------------------------
> reweight cmsgrid -from_cards
> Traceback (most recent call last):
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/extended_cmd.py", line 1009, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/extended_cmd.py", line 964, in onecmd_orig
> return func(arg, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/process/bin/internal/common_run_interface.py", line 1179, in do_reweight
> reweight_cmd.import_command_file(path)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1154, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1035, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
> return func(arg, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/various/misc.py", line 169, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/reweight_interface.py", line 427, in do_launch
> self.create_standalone_directory()
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/various/misc.py", line 169, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/reweight_interface.py", line 1444, in create_standalone_directory
> mgcmd.exec_cmd(commandline, precmd=True)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1031, in exec_cmd
> line = current_interface.precmd(line)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 599, in precmd
> stop = self.onecmd_orig(subline)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
> return func(arg, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 263, in do_generate
> return self.cmd.do_generate(self, line, *args, **opts)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/madgraph_interface.py", line 4180, in do_generate
> self.do_add(" ".join(args))
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 214, in do_add
> return self.cmd.do_add(self, line, *args, **opts)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/loop_interface.py", line 738, in do_add
> self.exec_cmd("add process %s" % base_proc.nice_string(prefix=False, print_weighted=True))
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 1035, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
> return func(arg, **opt)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/master_interface.py", line 214, in do_add
> return self.cmd.do_add(self, line, *args, **opts)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/loop_interface.py", line 731, in do_add
> myprocdef = self.extract_process(line)
> File "/nfs_scratch/senka/test_gridpack_WW/WWTolnulnu_01j_aTGC_lep_WWmass-0to400_4f_NLO_FXFX_tarball/mgbasedir/madgraph/interface/madgraph_interface.py", line 4386, in extract_process
> raise self.InvalidCmd, "No particle %s in model" % part_name
> InvalidCmd: No particle qed<=3 in model
> Value of current Options:
> ------------------------------>>
>
> What am I doing wrong?
>
> I am using MG 242.
>
> All cards are here:
>
> https://github.com/senka/aTGC_cards/tree/master/final_Nov18/SMP/WWTolnulnu_01j_aTGC_lep_WWmass_4f_NLO_FXFX
>
> Thank you in advance!
>
> Greetings,
> Senka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
senka duric (senka-duric) said :
#2

Hi Olivier,
I am getting the same error in MG252.

I have seen the post below, but I assume this is a different problem since it is in reweighting and I am already using "=" instead of "<=". Am I right?

https://answers.launchpad.net/mg5amcnlo/+question/406572

Greetings,
Senka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Hi Senka,

Indeed this is a different issue.
I found the way to fix this. Here is the patch:

Cheers,

Olivier

=== modified file 'madgraph/interface/madgraph_interface.py'
--- madgraph/interface/madgraph_interface.py 2017-02-16 14:49:57 +0000
+++ madgraph/interface/madgraph_interface.py 2017-02-27 15:16:37 +0000
@@ -4384,7 +4384,7 @@
         ## Now check for orders/squared orders/constrained orders
         order_pattern = re.compile(\
            "^(?P<before>.+>.+)\s+(?P<name>(\w|(\^2))+)\s*(?P<type>"+\
- "(=|(<=)|(==)|(===)|(!=)|(>=)|<|>))\s*(?P<value>-?\d+)\s*$")
+ "(=|(<=)|(==)|(===)|(!=)|(>=)|<|>))\s*(?P<value>-?\d+)\s*")
         order_re = order_pattern.match(line)
         squared_orders = {}
         orders = {}

> On 25 Feb 2017, at 17:27, senka duric <email address hidden> wrote:
>
> Question #482763 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/482763
>
> Status: Answered => Open
>
> senka duric is still having a problem:
> Hi Olivier,
> I am getting the same error in MG252.
>
> I have seen the post below, but I assume this is a different problem
> since it is in reweighting and I am already using "=" instead of "<=".
> Am I right?
>
> https://answers.launchpad.net/mg5amcnlo/+question/406572
>
> Greetings,
> Senka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
senka duric (senka-duric) said :
#4

Hi Olivier,
sorry for the very late reply. So I implemented your fix and the problem above was fix. Now I menage to get further with the NLO reweighting but it still does not run successfully. What I found is that the reweighting runs for some aTGC points but not for all. This the result of when it fails:

reweight result:

reweight run_04 -from_cards
Traceback (most recent call last):
  File "/nfs_scratch/senka/WW_aTGC_lep_NLO/bin/internal/extended_cmd.py", line 1009, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/nfs_scratch/senka/WW_aTGC_lep_NLO/bin/internal/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/nfs_scratch/senka/WW_aTGC_lep_NLO/bin/internal/common_run_interface.py", line 1179, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/extended_cmd.py", line 1154, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/extended_cmd.py", line 1035, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/extended_cmd.py", line 964, in onecmd_orig
    return func(arg, **opt)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/various/misc.py", line 169, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/reweight_interface.py", line 655, in do_launch
    weight = self.calculate_weight(event)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/reweight_interface.py", line 865, in calculate_weight
    return self.calculate_nlo_weight(event, space)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/reweight_interface.py", line 921, in calculate_nlo_weight
    w_origV = self.calculate_matrix_element(cevent, 'V0', space, scale2=scale2)
  File "/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/reweight_interface.py", line 1068, in calculate_matrix_element
    mymod = __import__('%s.SubProcesses.%s.matrix%spy' % (base, Pname, 2*metag), globals(), locals(), [],-1)
ImportError: dynamic module does not define init function (initmatrix2py)

=============>

I added printout of the problematic line in reweight_interface.py and run in debug mode.
" =======> print out: ",('%s.SubProcesses.%s.matrix%spy' % (base, Pname, 2*metag), globals(), locals(), [],-1)"

Here is the result:

REWEIGHT: starts to compute weight for events with the following modification to the param_card:
REWEIGHT: set param_card dim6 1 -3.0 # orig: 3.0
set param_card dim6 2 -2.0 # orig: 5.0
set param_card dim6 3 -100.0 # orig: 15.0

REWEIGHT: Event nb 0 0.064s
DEBUG: =======> print out: ('rw_me.SubProcesses.P2_uux_emvexwp.matrix2py', {'STDOUT': -2, 'misc': <module 'madgraph.various.misc' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/various/misc.pyc'>, 'master_interface': <module 'madgraph.interface.master_interface' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/master_interface.pyc'>, 'subprocess': <module 'subprocess' from '/cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/python/2.7.6/lib/python2.7/subprocess.pyc'>, 'cluster': <module 'madgraph.various.cluster' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/various/cluster.pyc'>, 'madevent_interface': <module 'madgraph.interface.madevent_interface' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/madevent_interface.pyc'>, '__name__': 'madgraph.interface.reweight_interface', 'shutil': <module 'shutil' from '/cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/python/2.7.6/lib/python2.7/shutil.pyc'>, 'cmd_logger': <logging.Logger object at 0x119f1d0>, 'lhe_parser': <module 'madgraph.various.lhe_parser' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/various/lhe_parser.pyc'>, 'tempfile': <module 'tempfile' from '/cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/python/2.7.6/lib/python2.7/tempfile.pyc'>, 'ReweightInterface': <class 'madgraph.interface.reweight_interface.ReweightInterface'>, 'nb_f2py_module': 0, '__package__': 'madgraph.interface', 'PIPE': -1, 're': <module 're' from '/cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/python/2.7.6/lib/python2.7/re.pyc'>, 'fks_common': <module 'madgraph.fks.fks_common' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/fks/fks_common.pyc'>, 'common_run_interface': <module 'madgraph.interface.common_run_interface' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/interface/common_run_interface.pyc'>, 'logger': <logging.Logger object at 0x1b819d0>, '__doc__': ' Command interface for MadSpin ', 'math': <module 'math' from '/cvmfs/cms.cern.ch/slc6_amd64_gcc481/external/python/2.7.6/lib/python2.7/lib-dynload/math.so'>, 'files': <module 'madgraph.iolibs.files' from '/afs/hep.wisc.edu/cms/senka/genproductions_mg242/genproductions_BRmg240/bin/MadGraph5_aMCatNLO/interactive/interactive_gridpack/work/MG5_aMC_v2_4_2/madgraph/iolibs/files.pyc'>, 'division': _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192), '__builtins__': {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'memoryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright (c) 2001-2013 Python Software Foundation.
...

I put the full output here:

https://www.dropbox.com/s/wkakl5foqszg7t8/debug_output?dl=0

=============>

I have seen the same problem in the past with another process, pp>wll [QCD]. But I did not menage to fix it. There were few suggestions from Olivier and Valentin that I tried out. I document them below for completeness.

===============>

I tried running "make matrix2py.so" in "rw_mevirt/SubProcesses/P8_gu_wpepemd" and it compiled just fine..

=========> On Valentin's suggestion I also tried to see if I can successfully use Python/Fortran f2py cross-talk within the much simpler context of a standalone MadLoop output:

> ./bin/mg5_aMC
MG5aMC> generate u d~ > e+ ve [virt=QCD]
MG5aMC> output MyF2PYTest
MG5aMC> launch -f
MG5aMC> exit
cd MyF2PYTest /SubProcesses/P0_udx_epve
Create the file 'PS.input' (with this exact name) in that directory with a content specifying the PS point (for example what is below within quotes [quotes are not included in the file]):

"5.000000000000000E+002 0.000000000000000E+000 0.000000000000000E+000 5.000000000000000E+002
5.000000000000000E+002 0.000000000000000E+000 0.000000000000000E+000 -5.000000000000000E+002
5.000000000000001E+002 4.510352131035046E+002 6.047968715179463E+001 -2.071459485065961E+002
5.000000000000001E+002 -4.510352131035046E+002 -6.047968715179463E+001 2.071459485065960E+002"

Then create the python module for the loop matrix element with f2py:

> make matrix2py.so

And finally run it with:

> ./check_sa.py

I tried running the exercise above and there was no problem. it runs and I get -1.290055700984246798e-03 as a result, exactly as expected.

===========================>

Please let me know what you suggest to solve this.

Greetings,
Senka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

Hi,

Looks like that the compilation fails for
/nfs_scratch/senka/WW_aTGC_lep_NLO/rw_mevirt/SubProcesses/P58_uux_mumvmxwp

Can you try to compile it? (via make matrix2py.so)
In 2.5.3, I have found some problem in some loop makefile (where the dependencies between the various file was not fully specified)
If this compilation goes trough this might be related to similar problem.

Cheers,

Olivier

Revision history for this message
senka duric (senka-duric) said :
#6

Hi Olivier,
sorry for the late reply. So I compiled the SubProcess with "make matrix2py.so" and that was successful. Then the NLO rw worked. Then I tried NLO rw to some other aTGC points. Some of them worked and others had similar problem as described above. After doing "make matrix2py.so" in particular SubProcess dir, the NLO rw worked fine.
Can this feature be fixed centrally?
Thank you in advance!

Greetings,
Senka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#7

Hi Senka,

So indeed this sounds to be related to a compilation ordering problem.
Did you try with a recent version (at least 2.5.3) since I fix a similar problem in 2.5.3. It is possible that you face a second ordering issue if you run 2.5.3 or later. But before investigating, i would like to be sure that you are indeed using a recent enough version of the code.

Cheers,

Olivier

Revision history for this message
senka duric (senka-duric) said :
#8

Hi Olivier,
so I am testing in newest version, 2.5.5. I manage to generate events for no merging scenario (ickkw=0) but for fxfx merging (ickkw=3) the generation fails with the message as in this question:

https://bugs.launchpad.net/mg5amcnlo/+bug/1406214

In the question and fix it is for LO process, and here I am generating NLO. I had no issues with generating this process with 2.4.2.

Greetings,
Senka

Revision history for this message
senka duric (senka-duric) said :
#9

Here is the log file from one of the failed SubProcesses:

https://www.dropbox.com/s/tfj0hpqihnz5zpp/log.txt?dl=0

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#10

Hi,

I guess the same fix can be applied to the NLO case, but Rikkert will confirm that point.

Cheers,

Olivier

Revision history for this message
Rikkert Frederix (frederix) said :
#11

Hello Senka and Olivier,

In fact, the problem in the FxFx merging was a completely different one. As you can see from the UpdateNotes.txt, there was a bug in the code before version 2.5.5 related to FxFx merging for processes that have configurations of 1->3 decays. (In your process, you can have an off-shell Z boson decaying to the W-boson and the lepton-neutrino pair). Now, the fix introduced in v.2.5.5 turns out not to cover all cases, and therefore another fix is needed. The patch can be downloaded here, and will become part of v.2.5.6:

http://users.ph.tum.de/ga63zot/FxFx_res.patch.gz

Therefore, although the code seemed to be working for versions prior to 2.5.5, the results were actually not totally correct (although, arguably, beyond the accuracy of the NLO merging calculation). In v.2.5.5 this part of the code was improved, but still not fully correct. Contrary to the previous version, the code does not continue, but rather exits with an error message. The patch above should fix that problem.

Best,
Rikkert

Revision history for this message
senka duric (senka-duric) said :
#12

Hi Rikkert, Olivier,
thank you for the fix, I implemented it in MG_2_5_5. So I managed to generate W+W- events without problems.

I tested NLO reweighting for two cases:

1) generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0

2) generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3

In both cases I use 4f, and ell and vl are e/mu/tau.
For the case 1) the reweighting looks ok in the sense that additional weights are in lhe file. But the calculation at the end where it is trying to calculate the cross section fails:

------------------->
...
REWEIGHT: Event nb 80 25.7s
REWEIGHT: Event nb 90 25.7s
REWEIGHT: All event done (nb_event: 100) 25.7s
REWEIGHT: Event /data/senka/MG5/MG_v2_5_5/WW_aTGC_lep_NLO_MG_v2_5_5_fxfxFix_proc0_CMSSW840/Events/run_01/events.lhe have now the additional weight
REWEIGHT: new cross-section is (_nlo): nan pb (indicative error: nan pb)
REWEIGHT: Original cross-section: 23.120466 +- 0.021662808 pb (cross-section from sum of weights: 23.70733464)
REWEIGHT: Computed cross-section:
REWEIGHT: rwgt_4_nlo : nan +- nan pb
REWEIGHT: rwgt_5_nlo : nan +- nan pb
REWEIGHT: rwgt_6_nlo : nan +- nan pb
REWEIGHT: quit rwgt
REWEIGHT: gzipping output file: events.lhe
<-----------------

Is this a problem?

For the second case I get this error when trying to reweight:

------------------>
...
  File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 889, in calculate_weight
    return self.calculate_nlo_weight(event, space)
  File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 947, in calculate_nlo_weight
    w_orig = self.calculate_matrix_element(cevent, 0, space)
  File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 1065, in calculate_matrix_element
    orig_order, Pdir, hel_dict = self.id_to_path[tag]
KeyError: ((-2, 2), (-14, 13, 24))
Value of current Options:
...
<-----------------

Can you please clarify what the problem here is?

My full proc_card is this:

--------------->
import model EWdim6NLO-no_cmass_cwwwcbcw

# 4f:
define j = g u c d s u~ c~ d~ s~
define p = g u c d s u~ c~ d~ s~

define ell+ = e+ mu+ ta+
define ell- = e- mu- ta-
define V = w+ w-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~

generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3
<-------------

Greetings,
Senka

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#13

Can you put your file for the case 1 such that I can take a look at it.
My guess is that one single events returns nan for the weights.
I will take a look why.

For the second, looks like that I miss one matrix element: u~ u > vm~ mu- w+
But since that matrix is present in your first case, this is a bit weird. I will try to reproduce it.

Cheers,

Olivier

> On 21 Jun 2017, at 14:58, senka duric <email address hidden> wrote:
>
> Question #482763 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/482763
>
> Status: Answered => Open
>
> senka duric is still having a problem:
> Hi Rikkert, Olivier,
> thank you for the fix, I implemented it in MG_2_5_5. So I managed to generate W+W- events without problems.
>
> I tested NLO reweighting for two cases:
>
> 1) generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
>
> 2) generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
> add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
> add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
> add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3
>
> In both cases I use 4f, and ell and vl are e/mu/tau.
> For the case 1) the reweighting looks ok in the sense that additional weights are in lhe file. But the calculation at the end where it is trying to calculate the cross section fails:
>
> ------------------->
> ...
> REWEIGHT: Event nb 80 25.7s
> REWEIGHT: Event nb 90 25.7s
> REWEIGHT: All event done (nb_event: 100) 25.7s
> REWEIGHT: Event /data/senka/MG5/MG_v2_5_5/WW_aTGC_lep_NLO_MG_v2_5_5_fxfxFix_proc0_CMSSW840/Events/run_01/events.lhe have now the additional weight
> REWEIGHT: new cross-section is (_nlo): nan pb (indicative error: nan pb)
> REWEIGHT: Original cross-section: 23.120466 +- 0.021662808 pb (cross-section from sum of weights: 23.70733464)
> REWEIGHT: Computed cross-section:
> REWEIGHT: rwgt_4_nlo : nan +- nan pb
> REWEIGHT: rwgt_5_nlo : nan +- nan pb
> REWEIGHT: rwgt_6_nlo : nan +- nan pb
> REWEIGHT: quit rwgt
> REWEIGHT: gzipping output file: events.lhe
> <-----------------
>
> Is this a problem?
>
> For the second case I get this error when trying to reweight:
>
> ------------------>
> ...
> File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 889, in calculate_weight
> return self.calculate_nlo_weight(event, space)
> File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 947, in calculate_nlo_weight
> w_orig = self.calculate_matrix_element(cevent, 0, space)
> File "/afs/cern.ch/work/s/senka/MG5/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 1065, in calculate_matrix_element
> orig_order, Pdir, hel_dict = self.id_to_path[tag]
> KeyError: ((-2, 2), (-14, 13, 24))
> Value of current Options:
> ...
> <-----------------
>
> Can you please clarify what the problem here is?
>
> My full proc_card is this:
>
> --------------->
> import model EWdim6NLO-no_cmass_cwwwcbcw
>
> # 4f:
> define j = g u c d s u~ c~ d~ s~
> define p = g u c d s u~ c~ d~ s~
>
> define ell+ = e+ mu+ ta+
> define ell- = e- mu- ta-
> define V = w+ w-
> define vl = ve vm vt
> define vl~ = ve~ vm~ vt~
>
> generate p p > ell+ vl w- $$ t t~ H QED=3 [QCD] @0
> add process p p > ell+ vl w- j $$ t t~ H QED=3 [QCD] @1
> add process p p > ell- vl~ w+ $$ t t~ H QED=3 [QCD] @2
> add process p p > ell- vl~ w+ j $$ t t~ H QED=3 [QCD] @3
> <-------------
>
> Greetings,
> Senka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
senka duric (senka-duric) said :
#14

Hi Olivier,
for the case 1 I put the lhe file here:

https://www.dropbox.com/s/dguya6qufrphcq4/events.lhe?dl=0

as you suspect, there are 2 events (out of 100 generated) where the rw weight is nan.
Do you need any other file or just the lhe?

Greetings,
Senka

Revision history for this message
senka duric (senka-duric) said :
#15

Dear experts,
any additional information for these two problems?

Greetings,
Senka

Can you help with this problem?

Provide an answer of your own, or ask senka duric for more information if necessary.

To post a message you must log in.