SMEFTNLO reweighting problem. KeyError: (((-3, 4), (-6, 6, 24)), 'V')

Bug #1877161 reported by Reza Goldouzian on 2020-05-06
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Undecided
Valentin Hirschi

Bug Description

Dear Experts,

I am trying to generate ttW process with EFT vertices at NLO. I am going to include weights for various combination of EFT coupling in my sample. My process card is like

import model SMEFTatNLO_U2_2_U3_3_cG_4F_LO_UFO-NLO
define j = p
define p = 21 2 4 1 3 -2 -4 -1 -3 5 -5
define WW = w+ w-
generate p p > t t~ WW QCD=2 QED=1 NP=2 [QCD]
output ttW_SMEFTNLOQED1_v1 -nojpeg

everything works when I do reweighting at LO. But for NLO reweighting, I see the following error
KeyError : (((-3, 4), (-6, 6, 24)), 'V')

I do not know what is wrong in my NLO reweighting procedure.

Best regards,

Reza

************************************************
reweight /afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/ttW_SMEFTNLOQED1_v1/Events/run_05/events.lhe.gz_0.lhe -from_cards --multicore=create
Traceback (most recent call last):
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/ttW_SMEFTNLOQED1_v1/bin/internal/extended_cmd.py", line 1514, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/ttW_SMEFTNLOQED1_v1/bin/internal/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/ttW_SMEFTNLOQED1_v1/bin/internal/common_run_interface.py", line 2142, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1660, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1543, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/various/misc.py", line 100, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/reweight_interface.py", line 546, in do_launch
    weight = self.calculate_weight(event)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/reweight_interface.py", line 954, in calculate_weight
    return self.calculate_nlo_weight(event)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/reweight_interface.py", line 1028, in calculate_nlo_weight
    w_origV = self.calculate_matrix_element(cevent, 'V0', scale2=scale2)
  File "/afs/crc.nd.edu/user/r/rgoldouz/gridpacks/MadGraph5/MG5_aMC_v2_6_5/madgraph/interface/reweight_interface.py", line 1155, in calculate_matrix_element
    orig_order, Pdir, hel_dict = self.id_to_path[tag]
KeyError: (((-3, 4), (-6, 6, 24)), 'V')

Reza Goldouzian (rgoldouz) wrote :
Reza Goldouzian (rgoldouz) wrote :
Reza Goldouzian (rgoldouz) wrote :
Reza Goldouzian (rgoldouz) wrote :
Reza Goldouzian (rgoldouz) wrote :
Reza Goldouzian (rgoldouz) wrote :

Thanks,

I can reproduce it now and can start to investigate this.

Olivier

Changed in mg5amcnlo:
status: New → Confirmed

Hi,

The issue seems related to the standalone output of MadLoop.
Some of the metadata are not correctly written in this case.
If I do
import model SMEFTatNLO_U2_2_U3_3_cG_4F_LO_UFO-NLO
generate p p > t t~ w- QCD=2 QED=1 NP=2 [ virt=QCD]
output standalone PROC_SA_TEST --prefix=int

then looking at PROC_SA_TEST/SubProcess/P0_dux_ttxwm/born_matrix.f

you can see the following comment:
C Process: d u~ > t t~ w- NP<=2 QCD<=2 QED<=1 [ virt = QCD ]
C Process: s c~ > t t~ NP<=2 QCD<=2 QED<=1 [ virt = QCD ]

where the second line is missing the w-
This is only a comment not a real issue but this is also linked to the fortran/python issue:
PROC_SA_TEST/SubProcess/all_matrix.f
where you see the following:

      IF (NPDG.EQ.4)THEN
        IF(3.EQ.PDGS(1).AND.-4.EQ.PDGS(2).AND.6.EQ.PDGS(3).AND.
     $ -6.EQ.PDGS(4)) THEN ! 3
          CALL ML5_0_GET_ME(P, ALPHAS, DSQRT(SCALES2), NHEL, ANS,
     $ RETURNCODE)
        ENDIF
      ELSE IF (NPDG.EQ.5)THEN
        IF(1.EQ.PDGS(1).AND.-2.EQ.PDGS(2).AND.6.EQ.PDGS(3).AND.
     $ -6.EQ.PDGS(4).AND.-24.EQ.PDGS(5)) THEN ! 4
          CALL ML5_0_GET_ME(P, ALPHAS, DSQRT(SCALES2), NHEL, ANS,
     $ RETURNCODE)
        ENDIF
      ENDIF

which also indicates that one process does not have a w-.

I will assign this to Valentin to see if he knows what can cause this.

Cheers,

Olivier

Changed in mg5amcnlo:
assignee: nobody → Valentin Hirschi (valentin-hirschi)

More information,

This has been introduced in 2.6.0
before that two different matrix-element/directory were created but only one was created starting with 2.6.0 (but with this issue in the process definition of the second process)

The issue is related to the function
reorder_process
which has wrong size input for the two permutation element.
Those input are given by:
amplitude_tag[-1][0].get_external_numbers()

so the issue is either in the definition of the tag and/or in the get_external_numbers routine ...

Cheers,

Olivier

I do not think that this is the best patch possible but it should do the trick in this case.
Valention should be able to take a deeper look with the information that I gave above and provide a patch valid in all cases.

Reza Goldouzian (rgoldouz) wrote :

Dear Olivier,

Thanks a lot for the reply.
I see only 5756 line in madgraph/core/helas_objects.py file. Should I add these lines at the end of this file? Sorry I am not sure where should I add these lines.

I look forward to Valention reply.

Thanks,
Reza

Hi,
The patch has been created from the latest development version.
You can try to use the patch program to apply it but no guarantee obviously.

Changed in mg5amcnlo:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers