analysis_lhe.f does not seem to compile

Asked by Claudio Severi

Good morning everyone,

I can not get fixed order analyses at NLO to run with
    FO_ANALYSIS_FORMAT = LHE
in recent versions of madgraph.

Compilation of analysis_lhe.f fails with "Rank mismatch in array reference" when the weights array is accessed as wgtxsecmu(jj,ii,kk).

I believe the issue is with versions >= 3.1.0, where LHE events store weights for the individual coupling combinations.

This is what a loop over weights looks like in reweight_xsec_events.f, that compiles ok:

     if(do_rwgt_scale)then
        do oo=0,n_orderstags
           do kk=1,dyn_scale(0)
              if (lscalevar(kk)) then
                 do ii=1,nint(scalevarF(0))
                    do jj=1,nint(scalevarR(0))
                     (do stuff with wgtxsecmu(oo,jj,ii,kk))

This is the loop over weights currently present in analysis_lhe.f, that does not compile:

     if (do_rwgt_scale) then
         do kk=1,dyn_scale(0)
            if (lscalevar(kk)) then
               do ii=1,nint(scalevarF(0))
                  do jj=1,nint(scalevarR(0))
                    (do stuff with wgtxsecmu(jj,ii,kk))

A similar issue was noted in https://answers.launchpad.net/mg5amcnlo/+question/699423

It seems like a straightforward edit, but I'd like to confirm with you first.

Thank you,
Claudio

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
Claudio Severi (claudio-severi) said :
#1

My proposed fix is:

1. Add
 integer n_orderstags
 integer orderstags_glob(maxorders)
 common /c_orderstags_glob/n_orderstags, orderstags_glob
after line 89 of /Template/NLO/SubProcesses/analysis_lhe.f

2. Change the loop over weights as above, adding
 do oo=0,n_orderstags
 (...)
 enddo
between lines 132 and 145,
with line 138 changed to
 wgtxsecmu(oo,jj,ii,kk)= wwgts(i_wgt)
and line 143 changed to
 wgtxsecmu(oo,1,1,kk)= wwgts(i_wgt)

3. Edit the makefile /Template/NLO/SubProcesses/makefile_fks_dir
adding after line 136:
analysis_lhe.o: mint_module.o

As a sidenote, I think the same makefile is missing a few dependences, POLES, TEST and SYM (lines 55, 58, 61) should also depend on handling_lhe_events.o, but right now (v 3.3.2) they don't.

Claudio

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

@Rikkert,

I do assign this to you because i know that you are working on this with the madspin link. But I can also fix this myself obviously (in that case, please re-assign this to me)

Cheers,

Olivier

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

Hello Claudio,

Thanks for your detailed investigation. Your proposed fix makes certainly sense and will become part of one of the next releases of the code.

About your point 3, (adding "analysis_lhe.o: mint_module.o" to the makefile). I do not see why you say this is necessary. The analysis_lhe.o file does not depend on the module created by compiling mint_module.f90, so I do not think this line is needed.

Similarly, POLES, TEST and SYM (in the makefile) should not need to the handling_lhe_events.o since in those codes there shouldn't be any calls to subroutines/functions present in the handling_lhe_events.f file. Why do you say they also depend on it?

best,
Rikkert

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

Ahh.. sorry, I take my comments about the POLES, TEST and SYM back. Of course they are going to depend on handling_lhe_events if the analysis uses the LHE interface...

The question about adding "analysis_lhe.o: mint_module.o" to the makefile remains, though...

Best,
Rikkert

Revision history for this message
Claudio Severi (claudio-severi) said :
#5

Thanks for spending some time on this Rikkert,

> The question about adding "analysis_lhe.o: mint_module.o" to the makefile remains, though...

This is absolutely my bad, it is write_event.o that depends on mint, not analysis_lhe.o

It's weird, I would assume that it already links, but without explicitely putting
 write_event.o: mint_module.o
in the makefile, it does not work, at least on my computer (centos 7, gcc 10.1)

Claudio

Revision history for this message
Claudio Severi (claudio-severi) said (last edit ):
#6

Rikkert, just to add something that I hadn't noticed before.
With the changes above the fixed order analysis does compile, but I don't think the reweighting of split orders happens in the way it is currently coded in the file.
The function fill_plots calls analysis_fill once for every splitorder, whereas now analysis_lhe.f assumes that all splitorders are available at the same time, to fill the reweight block in the lhe file.

Claudio

Can you help with this problem?

Provide an answer of your own, or ask Claudio Severi for more information if necessary.

To post a message you must log in.