LHAPDF + Pythia

Asked by Benjamin Fuks

Hi everybody,

I am interested in generating event files in the MSSM under the following conditions
  - stable neutralinos and charginos
  - I focus on x1- n2 production
  - I want to include matching with the samples containing one extra jet
  - I want to use MSTW pdfs.

Here is what I have done
  - Edit the paramcard to put the n2 et x1 particles with a zero width
  - Generate the following process
     define p = p b b~
     define j = j b b~
     generate p p > x1- n2
     #add process p p > x1- n2 j
     output
  - Fill out the run card as usual (with ckkw = 1 and xqcut = 50)
  - I run madevent

Now the results. For the moment, the piece of the process with the extra jet is commented since the issue is already there with the lowest-order subprocess only. Firstly, If I am using the CTEQ6L1 standard pdfs, everything is fine. Secondly, when I switch to LHAPDF and the set 21000 (mstw2008lo68cl) in the run_card, it fails at the level of pythia. The HEP file is not generated, the plots are not generated, etc... (I did a ./bin/cleanall before generating events)

You can find in attachment
  - the run_card
  - the pythia_card
  - the plot_card
  - the file run_03_tag_1_debug.log

From the debug file, for some reasons, madevent is looking for pgs (I have ever asked to run pgs) and for the hep file which has not been created. I can also find in hep2lhe.log that the hep file was not found. Do you have an idea about what's going on?

If you need anything else, feel free to ask. Thanks in advance!

Cheers,

Benj

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1009047.

Revision history for this message
Johan Alwall (johan-alwall) said :
#1

This is something that needs to be taken care of by the user.

Revision history for this message
Johan Alwall (johan-alwall) said :
#2

Hello Benj,

In fact this has nothing to do with matching, so I will change the title. The problem is simply that Pythia is using the old fortran PDF library with a limited number of PDFs. If you want to use a newer PDF, you need to either
1. link the new LHAPDF also in Pythia, and include the relevant PDF file where Pythia can find it, or
2. Use some other PDF in Pythia by overriding line 172-185 in pythia-pgs/src/ME2pythia.f:

C...Set PDFLIB or LHAPDF pdf number for Pythia

      IF(PDFSUP(1).NE.19070.AND.(PDFSUP(1).NE.0.OR.PDFSUP(2).NE.0))THEN
c Not CTEQ5L, which is standard in Pythia
         CALL PYGIVE('MSTP(52)=2')
c The following works for both PDFLIB and LHAPDF (where PDFGUP(1)=0)
c But note that the MadEvent output uses the LHAPDF numbering scheme
        IF(PDFSUP(1).NE.0)THEN
           MSTP(51)=1000*PDFGUP(1)+PDFSUP(1)
        ELSE
           MSTP(51)=1000*PDFGUP(2)+PDFSUP(2)
        ENDIF
      ENDIF

(e.g., set PDFSUP(1) to CTEQ6l1, i.e. 10042)

All the best,
Johan

Revision history for this message
Johan Alwall (johan-alwall) said :
#3

Benjamin Fuks (fuks) wrote:

Hi Johan,

Now it is perfectly working. I have linked pythia to a more recent version of LHAPDF and it works roughly out of the box. Many thanks,

Cheers,

Benjamin

Revision history for this message
Goutam Das (gkdgoutam) said :
#4

Dear Johan and Benjamin,
                     I have experienced the same problem with the latest version 2.2.1 . I am using lhapdf in run_card with lhaid = 21000 and in pythia_card LHAID= 21000.
So I followed the way you prescribed i.e. changing the no 19070 to 21000 in line 192 of pythia-pgs/src/ME2pythia.f .
So now it looks like :

      IF(PDFSUP(1).NE.21000.AND.(PDFSUP(1).NE.0.OR.PDFSUP(2).NE.0))THEN
c Not CTEQ5L, which is standard in Pythia
         CALL PYGIVE('MSTP(52)=2')
c The following works for both PDFLIB and LHAPDF (where PDFGUP(1)=0)
c But note that the MadEvent output uses the LHAPDF numbering scheme
        IF(PDFSUP(1).NE.0)THEN
           MSTP(51)=1000*PDFGUP(1)+PDFSUP(1)
        ELSE
           MSTP(51)=1000*PDFGUP(2)+PDFSUP(2)
        ENDIF
      ENDIF

Now the run is completed but how can I be sure that it actually worked. In the pythia log file no such error is coming.
Benjamin, can you tell me how did you link pythia to LHAPDF?
Thank you for any help.

Regards,
Goutam

Revision history for this message
Benjamin Fuks (fuks) said :
#5

Hi Goutam,

I have followed the instructions in the readme file.

Cheers,

Benjamin

Revision history for this message
Goutam Das (gkdgoutam) said :
#6

Dear Johan,
                          I have experienced the same problem with the latest version of MadGraph. I followed your suggestion and made a series of tests.
So when I include this line :
IF(PDFSUP(1).NE.21000.AND.(PDFSUP(1).NE.0.OR.PDFSUP(2).NE.0))THEN
it does not matter which PDF I am using in pythia_card.dat. In the pythia_log file under Events/run**/ , no message regarding LHAPDF is coming. Even it runs without error when there is no LHAID in pythia_card.
This seems strange.
Can you please help me out.

Many regards,
Goutam

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

Dear Goutam,

The LHAID should be define in the run_card not in the pythia_card

Cheers,

Olivier

Revision history for this message
Goutam Das (gkdgoutam) said :
#8

Dear Olivier,
                          Thank you for your quick response. But I am still confused.

The following line is there in the pythia_card_default.dat :

!...PDFset if MG set not supported by pythia-pgs package (set in lhapdf5 or higher)
      LHAID= 10041

What is this for?

Initially I used lhapdf in the run_card.dat like :
lhapdf = pdlabel
21000 = lhaid

but then pythia did not run.

Then I followed the prescription 2 by Johan
i.e. modifying this line
IF(PDFSUP(1).NE.21000.AND.(PDFSUP(1).NE.0.OR.PDFSUP(2).NE.0))THEN in pythia-pgs/src/ME2pythia.f

Previously the follwing message came in the pythia log file :

Note that in ME generation, qcut = 50.000000000000000
     MSTP(98) changed from 0 to 1
 ==== PYTHIA WILL USE LHAPDF ====
 WRONG LHAPDF set number = 200400 given! STOP EXE!
 WILL USE 10041 INSTEAD
 *************************************
 * LHAPDF Version 4.0 *
 *************************************

 >>>>>> PDF description: <<<<<<
 CTEQ6L - LO with NLO alpha_s
 Reference:
 J. Pumplin, D.R. Stump, J. Huston, H.L. Lai, P. Nadolsky,
 W.K. Tung
 hep-ph/0201195
 >>>>>> <<<<<<

and the run finishes without error.

But now with Johan's suggestion no such messages are coming in the pythia log file but still run finishes without error even if I comment out the line LHAID from pythia_card.

Kindly enlighten me.

Many regards,
Goutam

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

Dear Goutam,

Actually, the fix of Johan is independant of the LHAID method.
The LHAID is designed to allow to run the shower with a different pdf than the computation of the matrix element if the pdf is not supported by the pythia-pgs package. Actually this option is not fully working (so it depends of the value that you set in the run_card if it works or not).

Cheers,

Olivier

Revision history for this message
Goutam Das (gkdgoutam) said :
#10

Dear Olivier,
                      Thank you for your reply. So if I understood it correctly, what you are saying is that if I use lhapdf (MSTW68LO 21000) in run_card.dat with no other changes pythia fails to run since it can not recognize lhapdf.

And so the way out of that is Johan's suggestion #2 . Then pythia will use the same lhapdf as in run_card during showering. Is that right?

Now what about if I want to use different PDF (other than what is used in run_card) for showering purpose in pythia?
Then do I have to put the right LHAID no (leg as I did for 21000) in that line of
IF(PDFSUP(1).NE.21000.AND.(PDFSUP(1).NE.0.OR.PDFSUP(2).NE.0))THEN in pythia-pgs/src/ ???

One more question which really bothers me is that how should I know that lhapdf is taken by pythia during showering?
With Johan's suggestion no message regarding lhapdf is coming in the pythia log file.

Thanks for helping.

Many regards,
Goutam

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

By reading back Johan option number 2, you do not use lhapdf, but just force to use a built-in pdf set.
Only his first suggestion is handling with the lhapdf correctly.

in order to not use the pdf defined in the run_card, the easiest is to modify
libraries/lhapdf/src/lhaglue.f
to enforce the use of one of the supported pdf.

Cheers,

olivier

Revision history for this message
Swasti Belwal (swasti) said :
#12

Hi Developers,

I am also having a similar issue in linking LHAPDF PDF 'MSTW2008LO' , lhaid=21000 to Pythia-PGS in Madgraph.

I have linked my lhapdf-config to Madgraph and did 'make' again in pythia-pgs folder.. The event generation occurs smoothly but in my pythia.log I get an error like:

==== PYTHIA WILL USE LHAPDF ====
 WRONG LHAPDF set number = 21000 given! STOP EXE!
 WILL USE 10041 INSTEAD

As the first suggestion in this post https://bugs.launchpad.net/mg5amcnlo/+bug/1009047 by Johan says 'to link lhapdf to pythia separately', I don't completely understand how to do that. So please guide me here.

I tried adding the following lines to my pythia_card.dat apart from changing the lhaid in my run_card.dat but to no help. :

!...Parton showering on or off
      MSTP(61)=1
      MSTP(71)=1
 !...Fragmentation/hadronization on or off
      MSTJ(1)=1
 !...Multiple interactions on or off
      MSTP(81)=20
!...Don't stop execution after 10 errors
      MSTU(21)=1
!...PDFset if MG set not supported by pythia-pgs package (set in lhapdf5 or higher)
      LHAID= 21000
     LHAPDF=/PATH/TO/LHAPDF

I also tried the second solution which Johan gave, which seems to work without any error in pythia.log but then as stated by Goutam above, how will I know what PDF is used by Pythia here ? Also, Olivier mentions that it works for in-built PDF's and not for the external ones, which then doesn't solve this issue.

Kindly please help me out in this if there is a solution to this and if I am doing something erroneous in between.

Regards,
Swasti

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

Hi,

Actually the only safe suggestion concerning pythia is to switch to pythia8.
since pythia6 is not supported by the associate author anymore.

Cheers,

Olivier

Revision history for this message
Swasti Belwal (swasti) said :
#14

Hi Olivier,

I can understand that but right now I am not willing to do it as it might take some time to change the framework. If somehow Pythia6 can work it will be helpful.

As version 5 of LHAPDF should definitely work with PYTHIA6, I tried with LHAPDF-5.9.1 , downloaded the PDFset 21000 in lhapdf/share and also in pythia-pgs/src/lhapdf/PDFsets.

I am now getting the following error while generating events:

----------------------------------------------------Error detected in "generate_events run_01"
write debug file /home/swasti/Programs/MG5_aMC_v2_2_3/demo2/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/madgraph5
MadGraph5Error : A compilation Error occurs when trying to compile /home/swasti/Programs/MG5_aMC_v2_2_3/demo2/Source.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o combine_events.o combine_events.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o alfas_functions.o alfas_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -o ../bin/internal/combine_events combine_events.o rw_events.o ranmar.o kin_functions.o open_file.o rw_routines.o alfas_functions.o setrun.o -L../lib/ -lmodel -lpdf -lLHAPDF -lstdc++
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit6g_':
     wrapwhitg.f:(.text+0x8): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi6_':
     wrapwhitg.f:(.text+0x98a): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     wrapwhitg.f:(.text+0xddb): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     wrapwhitg.f:(.text+0xead): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit5g_':
     wrapwhitg.f:(.text+0x1758): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi5_':
     wrapwhitg.f:(.text+0x20ca): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     wrapwhitg.f:(.text+0x251b): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     wrapwhitg.f:(.text+0x25ed): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit4g_':
     wrapwhitg.f:(.text+0x2e98): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi4_':
     wrapwhitg.f:(.text+0x381a): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
     wrapwhitg.f:(.text+0x3c6b): additional relocation overflows omitted from the output
     collect2: error: ld returned 1 exit status
     make: *** [../bin/internal/combine_events] Error 1

 Please try to fix this compilations issue and retry.
 Help might be found at https://answers.launchpad.net/madgraph5.
 If you think that this is a bug, you can report this at https://bugs.launchpad.net/madgraph5
----------------------------------------------------------------

If somehow this error could be solved it will great!

Cheers!
Swasti

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

Hi,

That error is a typical gfrortran error when the code do not have enough memory to compile.
Never face that with lhapdf, but i guess that you will need to compile your lhapdf5 with the low memory option.

Cheers,

Olivier

On 23 Jul 2015, at 16:21, Swasti Belwal <email address hidden> wrote:

> Question #199787 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/199787
>
> Swasti Belwal posted a new comment:
> Hi Olivier,
>
> I can understand that but right now I am not willing to do it as it
> might take some time to change the framework. If somehow Pythia6 can
> work it will be helpful.
>
> As version 5 of LHAPDF should definitely work with PYTHIA6, I tried with
> LHAPDF-5.9.1 , downloaded the PDFset 21000 in lhapdf/share and also in
> pythia-pgs/src/lhapdf/PDFsets.
>
> I am now getting the following error while generating events:
>
> ----------------------------------------------------Error detected in "generate_events run_01"
> write debug file /home/swasti/Programs/MG5_aMC_v2_2_3/demo2/run_01_tag_1_debug.log
> If you need help with this issue please contact us on https://answers.launchpad.net/madgraph5
> MadGraph5Error : A compilation Error occurs when trying to compile /home/swasti/Programs/MG5_aMC_v2_2_3/demo2/Source.
> The compilation fails with the following output message:
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o combine_events.o combine_events.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o alfas_functions.o alfas_functions.f
> gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -o ../bin/internal/combine_events combine_events.o rw_events.o ranmar.o kin_functions.o open_file.o rw_routines.o alfas_functions.o setrun.o -L../lib/ -lmodel -lpdf -lLHAPDF -lstdc++
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit6g_':
> wrapwhitg.f:(.text+0x8): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi6_':
> wrapwhitg.f:(.text+0x98a): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> wrapwhitg.f:(.text+0xddb): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> wrapwhitg.f:(.text+0xead): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit5g_':
> wrapwhitg.f:(.text+0x1758): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi5_':
> wrapwhitg.f:(.text+0x20ca): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> wrapwhitg.f:(.text+0x251b): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> wrapwhitg.f:(.text+0x25ed): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `whit4g_':
> wrapwhitg.f:(.text+0x2e98): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> ../lib//libLHAPDF.a(wrapwhitg.o): In function `sfwhi4_':
> wrapwhitg.f:(.text+0x381a): relocation truncated to fit: R_X86_64_PC32 against symbol `scale_' defined in COMMON section in ../lib//libLHAPDF.a(wrapwhitg.o)
> wrapwhitg.f:(.text+0x3c6b): additional relocation overflows omitted from the output
> collect2: error: ld returned 1 exit status
> make: *** [../bin/internal/combine_events] Error 1
>
> Please try to fix this compilations issue and retry.
> Help might be found at https://answers.launchpad.net/madgraph5.
> If you think that this is a bug, you can report this at https://bugs.launchpad.net/madgraph5
> ----------------------------------------------------------------
>
> If somehow this error could be solved it will great!
>
> Cheers!
> Swasti
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Swasti Belwal (swasti) said :
#16

Thanks for the suggestion Olivier. Enabling low memory installation solved the previous error but I am still unable to use the PDF 21000. Is there any hack that might work for this?

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

Actually I do not know,

did you modify the file:pythia-pgs/src/ME2pythia.f
I guess that you need to add an entry for your pdfset.

Cheers,

Olivier

Revision history for this message
Feyza Baspehlivan (feyzabaspehl) said :
#19

Hello everyone,

I am new in using MadGraph, where can I find pythia-pgs/src/ME2pythia.f as Johan mentioned in answer #2?

Best,

Feyza

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

This is a 2012 question.

Pythia-pgs interface is deprecated since 2014 and out of support/... since 2016.
Note that the associate pythia6 is out of support since ~2010 and pgs since 2006.

So if you are new to madgraph, my suggestion would be to use Pythia8 as replacement of pythia6 and Delphes as replacement of PGS.

Cheers,

Olivier