Command for cross section

Asked by Kuntal Pal on 2020-12-01

Hi

I wanted to know if there is some command to get the value of a cross section after a run is completed. I want to use it as a loop variable in a script file to accept and discard certain values.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2020-12-02
Last query:
2020-12-02
Last reply:
2020-12-01

You will see one example in this FAQ:
You are looking at the print_results command

FAQ #2186: “How to script MG5 run?”.

Kuntal Pal (kpal1995) said : #2

Thank you

The print_results is fine. Prints to a file, that's great. But I was wondering if there is some command which just gives the crosssection value without printing it to a file. I mean let's say I define a variable x_cross and assign it with the cross section value from the last run.

x_cross = somehow(last_run cross section)

If you want that in bash, then you have to cat the file and assign the value to a variable.
from the python interface where you call the "print_results" command (so ./bin/madevent)
you have access to the internal variable that you can display via:
display variable self.results['run_01'][0]['cross']

If you have your own python wrapper around ./bin/madevent, you can use that value directly.
You also have that value store in a pickle file which might be difficult to read outside of MG5aMC (but not impossible)
HTML/results.pkl

Cheers,

Olivier

Kuntal Pal (kpal1995) said : #4

Thanks Olivier Mattelaer, that solved my question.