Using MadAnalysis on MG5 web server

Asked by Harshal Kulkarni on 2021-05-26

Hi,
     If I have generated a particular process using the MG5 web server and then downloaded the corresponding code, how can I use the online MadAnalysis interface to plot and analyze various distributions? The MadAnalysis interface asks us to upload a specific Gzip file and a proc_card. I kept the proc_card as the default one and uploaded the "madevent.tar.gz" file that I had downloaded after the code was generated online. Uploading this, I got an "Internal server error" but along with it, a "Plot 1" folder was also saved in my Plotting directory. However this directory has a number of files. I don't understand what the contents of these files mean and how I can use them to plot distributions. Could anyone please help?
Thanks.

Question information

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

I was not aware that we had such interface.
Which web link are you speaking about?

Olivier

> On 26 May 2021, at 12:41, Harshal Kulkarni <email address hidden> wrote:
>
> New question #697253 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Hi,
> If I have generated a particular process using the MG5 web server and then downloaded the corresponding code, how can I use the online MadAnalysis interface to plot and analyze various distributions? The MadAnalysis interface asks us to upload a specific Gzip file and a proc_card. I kept the proc_card as the default one and uploaded the "madevent.tar.gz" file that I had downloaded after the code was generated online. Uploading this, I got an "Internal server error" but along with it, a "Plot 1" folder was also saved in my Plotting directory. However this directory has a number of files. I don't understand what the contents of these files mean and how I can use them to plot distributions. Could anyone please help?
> Thanks.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#2

http://madgraph.physics.illinois.edu/plotting_ma.html

This is the link I was talking about. It is an online MadAnalysis interface right?

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

> This is the link I was talking about. It is an online MadAnalysis
> interface right?

Yes, this is sounds like MA4 plotting interface, this is so old that I was not aware that it was existing (and if this still works).

In any case, you have to provide a file in lhe.tar.gz in order to (hope to) have the plot and not the directory generated by the web interface. The error that you quote happens when someone tries to upload too large file which is likely your issue here since you pass the wrong type of file (lhe file are typically quite light)

Cheers,

Olivier

> On 26 May 2021, at 13:50, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> http://madgraph.physics.illinois.edu/plotting_ma.html
>
> This is the link I was talking about. It is an online MadAnalysis
> interface right?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#4

Okay, thank you so much. I don't really know how this works as I am a beginner. Do I need to create an lhe event file (if that is the case, then is there any guide regarding the same?) or is the file present somewhere inside the directory downloaded from the webserver of MG for the particular process ? It would be really helpful if you can elaborate on this.
Thanks.

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

What you have downloaded is the code to allow to generate such type of file.
when unzipping/untarring such directory, you can run the script
./bin/generate_events which will produce many output including one event file.

We are working on a new web-interface/... but for the moment, the easiest is to install MG5aMC and install it locally
on your Mac/ unix machine (using linux subsystem if you are on windows) and then run it via
./bin/mg5_aMC
and then type "tutorial"

Cheers,

Olivier

> On 26 May 2021, at 14:15, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> Okay, thank you so much. I don't really know how this works as I am a beginner. Do I need to create an lhe event file (if that is the case, then is there any guide regarding the same?) or is the file present somewhere inside the directory downloaded from the webserver of MG for the particular process ? It would be really helpful if you can elaborate on this.
> Thanks.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#6

Thank you for the answer.
I have installed MG5aMC on my laptop (it is Windows, but I am using the ubuntu app to enable linux subsytem). But whenever I try to use ./bin/mg5_aMC, I get the error as :

version = "v%(version)s (%(date)s)"%misc.get_pkg_info()
TypeError: format requires a mapping. I don't understand what exactly is the issue here.

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

Which version did you use? 3.1.0 ?

Olivier

> On 26 May 2021, at 14:50, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> Thank you for the answer.
> I have installed MG5aMC on my laptop (it is Windows, but I am using the ubuntu app to enable linux subsytem). But whenever I try to use ./bin/mg5_aMC, I get the error as :
>
> version = "v%(version)s (%(date)s)"%misc.get_pkg_info()
> TypeError: format requires a mapping. I don't understand what exactly is the issue here.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#8

I used 2.9.3.

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

Does it generates a mg5_debug file?
(if yes can you copy/paste it here?)
if not do you have more information in your screen?

Olivier

> On 26 May 2021, at 15:00, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> I used 2.9.3.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#10

It didn't generate a debug file, at least I can't see any such file present in the MG5 directory after extraction.
This is the complete error message:

Traceback (most recent call last):
  File "./bin/mg5_aMC", line 148, in <module>
    import madgraph.interface.master_interface as interface
  File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/interface/master_interface.py", line 44, in <module>
    import madgraph.interface.madgraph_interface as MGcmd
  File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/interface/madgraph_interface.py", line 88, in <module>
    import madgraph.loop.loop_exporters as loop_exporters
  File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/loop_exporters.py", line 233, in <module>
    class LoopProcessExporterFortranSA(LoopExporterFortran,
  File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/loop_exporters.py", line 242, in LoopProcessExporterFortranSA
    MadLoop_banner = MadLoopBannerStyles.get_MadLoop_Banner(
  File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/MadLoopBannerStyles.py", line 254, in get_MadLoop_Banner
    version = "v%(version)s (%(date)s)"%misc.get_pkg_info()
TypeError: format requires a mapping

Thanks.

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

For me to understand why this happens (and potentially fix it for the other user) can I ask you the following question:

1) Do you have a file "VERSION" within the main directory?
If yes what is inside that file?

2) can you try to edit the file
madgraph/various/misc.py line 146
from
        info_dict = files.read_from_file(os.path.join(madgraph.__path__[0],
                                                  "VERSION"),
                                                  parse_info_str,
                                                  print_error=False)

to
        info_dict = files.read_from_file(os.path.join(madgraph.__path__[0],
                                                  "VERSION"),
                                                  parse_info_str,
                                                  print_error=True)

This will likely give a more specific error on why this happens

Otherwise if this is not a windows specific issue with file formatting, the solution might be to hack this part by changing around line 254 of madgraph/loop/MadLoopBannerStyle.py from

version = "v%(version)s (%(date)s)"%misc.get_pkg_info()

to
version = "vunknown"

What I'm worried is that issue is related to some formatting of your disk (or similar in a way) that will then re-occur at the next time MG5aMC is trying to read some file on disk.

Cheers,

Olivier

> On 26 May 2021, at 15:20, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> It didn't generate a debug file, at least I can't see any such file present in the MG5 directory after extraction.
> This is the complete error message:
>
> Traceback (most recent call last):
> File "./bin/mg5_aMC", line 148, in <module>
> import madgraph.interface.master_interface as interface
> File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/interface/master_interface.py", line 44, in <module>
> import madgraph.interface.madgraph_interface as MGcmd
> File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/interface/madgraph_interface.py", line 88, in <module>
> import madgraph.loop.loop_exporters as loop_exporters
> File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/loop_exporters.py", line 233, in <module>
> class LoopProcessExporterFortranSA(LoopExporterFortran,
> File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/loop_exporters.py", line 242, in LoopProcessExporterFortranSA
> MadLoop_banner = MadLoopBannerStyles.get_MadLoop_Banner(
> File "/mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/loop/MadLoopBannerStyles.py", line 254, in get_MadLoop_Banner
> version = "v%(version)s (%(date)s)"%misc.get_pkg_info()
> TypeError: format requires a mapping
>
> Thanks.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#12

Thank you so much for your help. This is what I did and it worked:

1. Yes, there was a file VERSION in the main directory.
2. I edited the .py as you suggested. After that I still got the following error (along with the same error message occurring earlier)-

ERROR: I/O error on file /mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/VERSION (2): No such file or directory

Then I changed the version = "v%(version)s (%(date)s)"%misc.get_pkg_info() line to version = "vunknown".
But still the error persisted, however it was a different error message now.

So I simply copy-pasted the file VERSION from the main directory to the sub-directory madgraph inside the main directory, and then it worked.

However while installing MadAnalysis, I received the following error again:

syntax: install Delphes|MadAnalysis4|ExRootAnalysis|update|Golem95|QCDLoop|maddm|maddump|looptools|MadSTR|pythia8|zlib|boost|lhapdf6|lhapdf5|collier|hepmc|mg5amc_py8_interface|ninja|oneloop|MadAnalysis5
-- Download the last version of the program and install it
   locally in the current MadGraph5_aMC@NLO version. In order to have
   a successful installation, you will need to have an up-to-date
   F77 and/or C and Root compiler.

Do I need Root for MadAnalysis too ?

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

> So I simply copy-pasted the file VERSION from the main directory to the
> sub-directory madgraph inside the main directory, and then it worked.

Probably some issue with symlink on windows machine.

> syntax: install Delphes|MadAnalysis4|ExRootAnalysis|update|Golem95|QCDLoop|maddm|maddump|looptools|MadSTR|pythia8|zlib|boost|lhapdf6|lhapdf5|collier|hepmc|mg5amc_py8_interface|ninja|oneloop|MadAnalysis5
> -- Download the last version of the program and install it
> locally in the current MadGraph5_aMC@NLO version. In order to have
> a successful installation, you will need to have an up-to-date
> F77 and/or C and Root compiler.
>
> Do I need Root for MadAnalysis too ?

It is better yes. In principle MA5 can also do plot with only matplotlib.
But since root binaries exists for WSL now (even if still beta0 this should not be an issue to install root.

Cheers,

Olivier

> On 27 May 2021, at 10:11, Harshal Kulkarni <email address hidden> wrote:
>
> Question #697253 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697253
>
> Harshal Kulkarni posted a new comment:
> Thank you so much for your help. This is what I did and it worked:
>
> 1. Yes, there was a file VERSION in the main directory.
> 2. I edited the .py as you suggested. After that I still got the following error (along with the same error message occurring earlier)-
>
> ERROR: I/O error on file
> /mnt/c/Users/Harshal.Kulkarni/MG/MG5_aMC_v2_9_3/madgraph/VERSION (2): No
> such file or directory
>
> Then I changed the version = "v%(version)s (%(date)s)"%misc.get_pkg_info() line to version = "vunknown".
> But still the error persisted, however it was a different error message now.
>
> So I simply copy-pasted the file VERSION from the main directory to the
> sub-directory madgraph inside the main directory, and then it worked.
>
> However while installing MadAnalysis, I received the following error
> again:
>
> syntax: install Delphes|MadAnalysis4|ExRootAnalysis|update|Golem95|QCDLoop|maddm|maddump|looptools|MadSTR|pythia8|zlib|boost|lhapdf6|lhapdf5|collier|hepmc|mg5amc_py8_interface|ninja|oneloop|MadAnalysis5
> -- Download the last version of the program and install it
> locally in the current MadGraph5_aMC@NLO version. In order to have
> a successful installation, you will need to have an up-to-date
> F77 and/or C and Root compiler.
>
> Do I need Root for MadAnalysis too ?
>
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#14

Thanks Olivier Mattelaer, that solved my question.