generate several processes and reweight independently

Asked by Béranger Dumont

Hi,

In order to generate two processes at once, e.g. gluino-pair production and chargino-pair production in the MSSM, I am using

import model mssm
generate p p > go go
add process p p > x1+ x1-

and it works very well. However, I would like to separately re-weight these two processes according to (inclusive) NLO+NLL cross sections, or equivalently K factors, that would be found in the literature and given as input to MadGraph 5. As the K factors of these two processes are not the same I can't just take the produced LHE file and re-weight a posteriori.
Is there a way to re-weight each process separately without having to generate one sample per process?
Preferably, the output would be the usual unweighted_events.lhe but with the relative importance of the two processes modified according to the user-defined K factors.

I am aware of the reweight module. However, as far as I understand it re-weights according to different coupling value hypotheses, which is not really practical in the case of SUSY processes.

Best,
Beranger

Question information

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

Dear Beranger,

This starts to be too specific to be automated.
So you need to (slightly) put your hand into the code in order to create a code which does that.
So you need to be able to read/write some python code.

We have a (python) class which reads/writes the lhe file and is able to apply modification to it.
The file is madgraph/various/lhe_parser.py and at the end of the file, you have example of use of
what you can do with this files/classes.

Now the main question is what do you want to do?
I can see two possibilities:

1) Simply pass from a unweighted sample to a weighted sample.
In that case, you just have to loop over all the events and change the weight(s) associate to the events subprocesses
If you are using matching/merging/systematic uncertainty/ (other method using weights).
Please check that the associate weight are scale as well (I do not think that I have put a function which does that automatically).

2) You want to keep an unweighted sample (but you will have less event than the original sample).
And in that case, you need to do the first step and then to re-unweight the file.
If you are using 2.3, a function exists to unweight a file.

They are no example for that function. You can look for it in the code, it should be easy to do. But here is a 1 sec example:
lhe = lhe_parser.EventFile(path)
lhe.unweight(outputpath)

All of this should really be very simple if you have some basic knowledge of python.

Cheers,

Olivier

On 11 May 2015, at 11:01, Béranger Dumont <email address hidden> wrote:

> New question #266764 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/266764
>
> Hi,
>
> In order to generate two processes at once, e.g. gluino-pair production and chargino-pair production in the MSSM, I am using
>
> import model mssm
> generate p p > go go
> add process p p > x1+ x1-
>
> and it works very well. However, I would like to separately re-weight these two processes according to (inclusive) NLO+NLL cross sections, or equivalently K factors, that would be found in the literature and given as input to MadGraph 5. As the K factors of these two processes are not the same I can't just take the produced LHE file and re-weight a posteriori.
> Is there a way to re-weight each process separately without having to generate one sample per process?
> Preferably, the output would be the usual unweighted_events.lhe but with the relative importance of the two processes modified according to the user-defined K factors.
>
> I am aware of the reweight module. However, as far as I understand it re-weights according to different coupling value hypotheses, which is not really practical in the case of SUSY processes.
>
> Best,
> Beranger
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Béranger Dumont (beranger-0) said :
#2

It should solve my problem. Thank you!