Orders_tag_plot in NLO lhe file

Asked by matteo maltoni on 2021-05-11

Dear MadGraph experts,

I would like to plot the K-factors for some double differential distributions, for the process (p p > e+ ve mu+ mu- NP=2 [QCD]), using the model SMEFTatNLO.

I have two questions concerning this:

1) Is there a way to make double distributions plots in the analysis_HwU_*.f file, at fixed order?

2) If I generate a lhe file with some events at NLO, either at fixed order or not, is there a way to separate the interference from the SM and the quadratic terms, like it's done in the HwU analysis through orders_tag_plot?

Thank you,

Matteo

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
marco zaro Edit question
Solved by:
marco zaro
Solved:
Last query:
Last reply:
Revision history for this message
marco zaro (marco-zaro) said :
#1

Hi Matteo,
to answer your questions
1) not out of the box. What I typically do here is to slice the 2-dimensional distributions (let us say m x n bins) into m 1d histograms with n bins each
2) yes, as from version 3.1, the LHE event files include in the scale-variation weights all the infos related to the different order tags.
Just check inside any lhe event file generated by the NLO code. You have inside the intrwgt block the infos for the different order tags, and each event has its own rwgt block with all the weights. For what I could see, you even get the various contributions plotted automatically if you use the HwU analyses provided with the code (you do not need to change anything in the analysis and/or in the pythia8 driver)

Let me know if you need further infos.

Cheers,

Marco

Revision history for this message
matteo maltoni (matteo-maltoni) said :
#2

Hi Marco,

Thank you for your answer, it's getting clearer.

Can you please tell me how to access the different weights in the rwgt block of each event, or point me to some examples?
Is it possible to do it in a python code, like it's done at LO, after the event generation?

Best,

Matteo

Revision history for this message
marco zaro (marco-zaro) said :
#3

Hi Matteo,
if you use python (importing the lhe_parser module shipped with MG5_aMC, I suppose), then it is very easy.
>>> import madgraph.various.lhe_parser as lhe
>>> evtfile=lhe.EventFile("PROCNLO_loop_sm_1/Events/run_01/events.lhe”)
>>> evtfile.get_banner()['initrwgt’] # gives you the informations on the initrwgt block, which can be further parsed to get the different tags
>>> event=evtfile.next()
>>> event.parse_reweight()
{'1018': 167.85, '1019': 1026.2, '1014': 100.21, '1015': 145.15, '1016': 138.22, '1017': 115.87, '1010': 129.26, '1011': 108.36, '1012': 156.97, '1013': 119.53, '1025': 900.15, '1024': 1469.5, '1027': 1164.1, '1026': 713.6, '1021': 1335.4, '1020': 808.87, '1023': 882.61, '1022': 1124.3, '1009': 1331.9, '1008': 829.48, '1007': 1038.4, '1006': 1614.7, '1005': 982.8, '1004': 1243.9, '1003': 1492.4, '1002': 917.24, '1001': 1155.4}

With this last command you have a dictionary, where the key are the weight id as specified in the initrwgt, and the values the actual weights.

Let me know if you need more

Cheers,

Marco

> On 11 May 2021, at 15:25, matteo maltoni <email address hidden> wrote:
>
> Question #697007 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697007
>
> Status: Answered => Open
>
> matteo maltoni is still having a problem:
> Hi Marco,
>
> Thank you for your answer, it's getting clearer.
>
> Can you please tell me how to access the different weights in the rwgt block of each event, or point me to some examples?
> Is it possible to do it in a python code, like it's done at LO, after the event generation?
>
> Best,
>
> Matteo
>
> --
> You received this question notification because you are subscribed to
> the question.

Revision history for this message
matteo maltoni (matteo-maltoni) said :
#4

Hi Marco,

Thank you for your explanation, it's extremely clear.

I'd like to make a last question, to be sure I'm doing it right.
If I want to build the histogram of a certain variable, like pT [e+], for the interference at LO, I need to implement a function that takes the value of pT [e+] for each event, checks in which bin of my histogram it falls, and adds the event weight corresponding to the LO interference (taken from the dictionary) to that particular bin, is it right?

Please let me know if I'm doing correctly, or if there's a simpler way to do it, or an implemented function already existing for that.

Thank you again,

Matteo

Revision history for this message
Best marco zaro (marco-zaro) said :
#5

Hi Matteo,

> On 11 May 2021, at 17:40, matteo maltoni <email address hidden> wrote:
>
> Question #697007 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/697007
>
> Status: Answered => Open
>
> matteo maltoni is still having a problem:
> Hi Marco,
>
> Thank you for your explanation, it's extremely clear.
>
> I'd like to make a last question, to be sure I'm doing it right.
> If I want to build the histogram of a certain variable, like pT [e+], for the interference at LO, I need to implement a function that takes the value of pT [e+] for each event, checks in which bin of my histogram it falls, and adds the event weight corresponding to the LO interference (taken from the dictionary) to that particular bin, is it right?
This is exactly what needs to be done
>
> Please let me know if I'm doing correctly, or if there's a simpler way
> to do it, or an implemented function already existing for that.
afaik, in MG5_AMC there are some pre-defined analyses written in fortran, not in python. There are analyses that can be used at FixedOrder, and other that can be used when the PS matching is considered. With these analyses you already have a decent template to start with, and you do not have to bother about the histogramming as it is done by a built in module.

Ciao,

Marco
>
> Thank you again,
>
> Matteo
>
> --
> You received this question notification because you are subscribed to
> the question.

Revision history for this message
matteo maltoni (matteo-maltoni) said :
#6

Thanks marco zaro, that solved my question.