bias reweight

Asked by Meng Lu

Dear experts,

i am trying to understanding the bias reweight method in new MG, and i am stuck in a very beginning in the twiki https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias, "In that case the bias function should not impact the physical results obtained, but rather only affect the distribution of the events generated or, in other words, the phase-space sampling", is MG sampling like "hit-and-miss" method? so when the sampling was affected, does the event distribution still according to the differential Xsection? and how this bias method do no effect on the total Xsection? thanks in advance.

Best,
Meng

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:

This question was reopened

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

Hi,

Let me try to be extremelly pedagogical in this case.
To illustrate the idea, I will take a simple function to integrate

f(x) = 0.5 for 0 <=x<0.5
f(x) = 1.5 for 0.5<=x<=1

It is clear that such integral is one (0.5*0.5 + 1.5*0.5)
A normal generation of 100 events, would have
25 events in the first interval and 75 in the second.
each event in that case will have a weight of 1 (since the average of the weight should be the cross-section and distributed like that they will all have the same weight)
In this case they are distributed like the function.

Now if you introduced the following bias
b(x) = 4, 0 <=x<0.5
b(x) = 4/3 for 0.5<=x<=1

In madgraph you can decide to either simply integrate b(x)*f(x). This is the choice that you can do with the parameter "impact_xsec/.True./". (this is the case b of the page that explain the method)
In that case, we will have the integral equal to 2 (4*0.5*0.5 + 4/3(1.5*0.5)
and for a generation of 100 events, we would have
50 events in each bin. Their weight would be 2 for all events.
In this case they are distributed like the function.

You can also decide to integrate f(x) but want to have your events distributed in the phase-space like f(x)*b(x) (This is the case a), you can do that by choosing "impact_xsec/.False./"
In that case you will have the cross-section equal to one (the cross-section of f(x)) but you will have
50 events in each bin (events distributed like b(x)*f(x))
The weight of each events is now 2/g(x). 2 being the integral of b(x)*f(x).

So now they are not distributed like the function (as we want them distributed like another function) but they have not constant weight to be able to preserve the distribution and the total cross-section
Let check that :
1) the integral computed from the weight is in that case (I remind this is the average of the weight):
1/100* (50 * 2/4+ 50*2/(4/3)) = 1/2(2/4+6/4) =1
so this is indeed equal to one (as requested)

2) If i want to plot the contribution of each bin (i.e differential cross-section). I have to take the average of the weight in each bin:
so for the first bin: 1/100(50*2/4)= 0.25 #note that for the correct normalisation, you still have to average over the full sample
and for the second bin: 1/100(50*2/(4/3))= 0.75
So you can still plot all the differential distribution but you have to include the weight of each event when doing your histogram.

So how do we succeed to do that for more complicated case? This is actually simple. We use standard integration method for f(x)*b(x)(i.e. importance sampling/hit and miss,...) and then modify the weights of each events in the sample generated. Before such modification they all have the same weight (the cross-section of f(x)*b(x)). so to reach our goal, we just need to divide each weight by b(x).

Hope this clarify the idea,

Cheers,

Olivier

> On 30 Sep 2017, at 16:37, Meng Lu <email address hidden> wrote:
>
> New question #658795 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/658795
>
> Dear experts,
>
> i am trying to understanding the bias reweight method in new MG, and i am stuck in a very beginning in the twiki https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias, "In that case the bias function should not impact the physical results obtained, but rather only affect the distribution of the events generated or, in other words, the phase-space sampling", is MG sampling like "hit-and-miss" method? so when the sampling was affected, does the event distribution still according to the differential Xsection? and how this bias method do no effect on the total Xsection? thanks in advance.
>
> Best,
> Meng
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Meng Lu (meng-lu) said :
#2

Dear Oliver,

thank you very much for your instructive reply, it really helps. i still have a small question, "since the average of the weight should be the cross-section", does this have a physical cause or just a convention?

Best,
Meng

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

That's a convention.
I personally prefer to use another convention where the cross-section is the sum of the weight. (which is simpler when you do apply cut)

You can actually choose such convention in the run_card.dat by choosing the "event_norm" parameter

Cheers,

Olivier

> On 6 Oct 2017, at 08:54, Meng Lu <email address hidden> wrote:
>
> Question #658795 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/658795
>
> Status: Answered => Open
>
> Meng Lu is still having a problem:
> Dear Oliver,
>
> thank you very much for your instructive reply, it really helps. i still
> have a small question, "since the average of the weight should be the
> cross-section", does this have a physical cause or just a convention?
>
> Best,
> Meng
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Meng Lu (meng-lu) said :
#4

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Meng Lu (meng-lu) said :
#5

Hi Olivier,

thanks very much.

best,
Meng

Revision history for this message
Meng Lu (meng-lu) said :
#6

Dear Olivier,

may i ask how to do the bias reweighting in NLO?

best,
Meng

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

Hi,

All the instructions for the NLO reweighting are in the files cuts.f.
Be careful that your reweighting function need to be infra-red safe otherwise your result will not make any sense.

Cheers,

Olivier

Revision history for this message
Meng Lu (meng-lu) said :
#8

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Meng Lu (meng-lu) said :
#9

Dear Olivier,

i came across a new question, the subroutine bias_weight_function have two input parameters, 'p' and 'ipdg', if i want to use the 'istatus', what else i need to modify as it throw exception when i change bias_weight_function(p,ipdg,bias_wgt) to bias_weight_function(p,ipdg,istatus,bias_wgt).

best,
Meng

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

Hi,

I'm afraid that the istatus is not define in that part of the code.

Cheers,

Olivier

Revision history for this message
Meng Lu (meng-lu) said :
#11

Dear Olivier,

i mean the subroutine in the cuts.f, and there is 'istatus' in the cuts.f of some functions, e.g. the first function in the cuts.f 'passcuts_user(p,istatus,ipdg)'.

best,
Meng

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

Hi,

Yes i understood that.

But you do not have access to that information for the bias. (and you should not use those kind of information anyway)

Cheers,

Olivier

Revision history for this message
Meng Lu (meng-lu) said :
#13

Dear Olivier,

i see, thank you very much.

best,
Meng

Revision history for this message
Meng Lu (meng-lu) said :
#14

Thanks Olivier Mattelaer, that solved my question.