# Definition of rapidity in run_card.dat

Asked by Laura Moreno on 2018-11-01

Dear all,

I am working with the process p p > H t j, and I try to reproduce the results from Madgraph with a code that takes the matrix elements and then performs the necessary integrals and applies cuts to obtain the same result. Up to now everything worked well, but when I try to apply cuts on the rapidity (eta) problems arise.

In my program, the pseudorapidity eta is defined as:

>> eta = atanh(p_z/|p|)

but then I don't get the same result as with Madgraph. Therefore I took a look at the definition of this parameter in Madgraph cards.

Now I am trying to understand the definition of the rapidity cut on Madgraph. I went to the file ./Source/kin_functions.f, where it says that for CM frame (in my case) we have:

>> rap = 0.5*log((p0 + p3)/(p0 - p3)) + cm_rap

the first term corresponds to the expression I knew and that I am using, i.e. atanh(p_z/|p|) given that I am dealing with a massless particle. But I cannot find the definition of the second term.

If I modify the definition of this parameter for simply the first term, then the results from my code reproduce perfectly (within uncertainties) the results from Madgraph, so the problem comes with the second term.

Could someone tell me what is exactly this second term and its mathematical expression? Thank you!

Best,
L.

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2019-05-15
Last query:
2019-05-15
2019-05-06
 Olivier Mattelaer (olivier-mattelaer) said on 2018-11-01: #1

Dear Laura,

cm_rap is the rapidity of the center of mass-frame in the lab frame.
For pp collision those two frame are NOT the same due to the PDF.

Cheers,

Olivier

> On 1 Nov 2018, at 14:42, Laura Moreno <email address hidden> wrote:
>
> New question #675845 on MadGraph5_aMC@NLO:
>
> Dear all,
>
> I am working with the process p p > H t j, and I try to reproduce the results from Madgraph with a code that takes the matrix elements and then performs the necessary integrals and applies cuts to obtain the same result. Up to now everything worked well, but when I try to apply cuts on the rapidity (eta) problems arise.
>
> In my program, the pseudorapidity eta is defined as:
>
>>> eta = atanh(p_z/|p|)
>
> but then I don't get the same result as with Madgraph. Therefore I took a look at the definition of this parameter in Madgraph cards.
>
> Now I am trying to understand the definition of the rapidity cut on Madgraph. I went to the file ./Source/kin_functions.f, where it says that for CM frame (in my case) we have:
>
>>> rap = 0.5*log((p0 + p3)/(p0 - p3)) + cm_rap
>
> the first term corresponds to the expression I knew and that I am using, i.e. atanh(p_z/|p|) given that I am dealing with a massless particle. But I cannot find the definition of the second term.
>
> If I modify the definition of this parameter for simply the first term, then the results from my code reproduce perfectly (within uncertainties) the results from Madgraph, so the problem comes with the second term.
>
> Could someone tell me what is exactly this second term and its mathematical expression? Thank you!
>
> Best,
> L.
>
> --

 Laura Moreno (laumova) said on 2018-11-01: #2

Dear Olivier,

So, you mean the expression used for the cut is then:

rap = 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in LAB frame)
+ 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in CM frame)

Is it like this? Because I have been working the whole time with the CM frame (where the sum of the momenta for the three final state particles is 0) and I use this momentum to get the values of the matrix elements for the phase space integration. But now I am confused by your statement, so could you please explain it a bit more? It would be really helpful, thanks.

I checked again the definition of rap in the ./Source/kin_functions.f, but it says that the first term is also computed with p being the momentum in the CM frame, so then what I said above makes no sense at all. Could you please tell me exactly how are both terms computed? Because they are not the same, but if the first is the rapidity using the CM momentum, shouldn't it be the same as the second term? I am sorry if I am asking some really easy stuff, but I am really confused right now.

Sorry for possible inconvenience and thank you again,
L.

 Olivier Mattelaer (olivier-mattelaer) said on 2018-11-01: #3

No,

we compute the rapidity in the lab frame
so this is equal to
> rap = 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in LAB frame)

but since we actually have (available) the momenta in the CM frame we use the formula
> rap = 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in CM frame)
+ rap_cm (rapidity of the CM frame in the lab frame)

the rap_cm is given by 0.5*log((p0 + p3)/(p0 - p3) *where those momenta are the one of the frame and not of the particle.

Cheers,

Olivier

> On 1 Nov 2018, at 21:52, Laura Moreno <email address hidden> wrote:
>
> Question #675845 on MadGraph5_aMC@NLO changed:
>
>
> Laura Moreno is still having a problem:
> Dear Olivier,
>
> thank you for your answer, but I still have some doubts.
>
> So, you mean the expression used for the cut is then:
>
> rap = 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in LAB frame)
> + 0.5*log((p0 + p3)/(p0 - p3)) (using momentum in CM frame)
>
> Is it like this? Because I have been working the whole time with the CM
> frame (where the sum of the momenta for the three final state particles
> is 0) and I use this momentum to get the values of the matrix elements
> for the phase space integration. But now I am confused by your
> statement, so could you please explain it a bit more? It would be really
>
> I checked again the definition of rap in the ./Source/kin_functions.f,
> but it says that the first term is also computed with p being the
> momentum in the CM frame, so then what I said above makes no sense at
> all. Could you please tell me exactly how are both terms computed?
> Because they are not the same, but if the first is the rapidity using
> the CM momentum, shouldn't it be the same as the second term? I am sorry
> if I am asking some really easy stuff, but I am really confused right
> now.
>
> Sorry for possible inconvenience and thank you again,
> L.
>
> --

 Laura Moreno (laumova) said on 2018-11-02: #4

Dear Olivier,

thank you for your answer. Still I have some doubts. I found in the file ./SubProcesses/genps.f the definition of the rap_cm, and it turns out to be:

rap_cm = 0.5D0*log((xbk(1)*ebeam(1))/(xbk(2)*ebeam(2))

I understand the parameters ebeam(i) that in the case of two colliding protons each of 6500 GeV (set in run_card.dat) both ebeam(1) and ebeam(2) take the same value. But I am confused about the meaning of the variable xbk(i). I guess it is the fraction of momenta that the parton takes from the initial proton.

If I check the cross-section for some given conditions using only the rapidity of the jet in the CM frame, I get the same result as with Madgraph. If I only consider the term rap_cm, I also get the same result as in Madgraph (modifying the corresponding line in the code). The problem comes when considering both of them simultaneosly, I do:

>> rap = 0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) +
* 0.5D0*LOG(x1/x2)

and I impose the cut using ABS(rap). But then I don't get the result that Madgraph yields. Is there any other thing I am missing and I don't see? Thank you and sorry for possible inconvenience.

Best,
L.

 Laura Moreno (laumova) said on 2018-11-07: #5

update:

I have also tried considering simply a constant addition to the rapidity in each case, so for example when I compute the value for the rapidity in both MadGraph and my code as:
>> rap = 0.5*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) + 1.0D0

again there is the mismatch between Madgraph and the results for my code. I would like to know which if the expression for the rapidity is indeed:
>> rap = 0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) +
* 0.5D0*LOG(x1/x2)

and in this case, does it consider the absolute value in some case? Thank you in advance!

Best,
L.

 Olivier Mattelaer (olivier-mattelaer) said on 2018-11-08: #6

Hi,

I confirm that we use the following formula:
rap = 0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) +
* 0.5D0*LOG(x1/x2)
when both beam have the same energy.
In that case the momentum of P are taken in the rest-frame of the collision (not the one of the beam/lab frame)

Cheers,

Olivier

 Laura Moreno (laumova) said on 2019-04-11: #7

Dear Olivier,

first of all thanks for all the answers. Unfortunately, I still have the problem. I have been trying to understand the Madgraph code related to the rapidity cut, and I understand how they compute it, but still I have some problems when calculating the cross section with cuts and compare it to the results I obtain with my own code.

The situation is the following: I have a code that computes the cross section for the pp > Htj and also applies some cuts to the jet. I run my code and then run Madgraph with all the same settings and conditions. Focusing on LO, when no cuts are applied, I get the same result for the cross section with my code and with Madgraph. If I apply cuts on the pT or energy, everything is also in agreement. The problem comes when I apply cuts to the rapidity of the jet.

In this case, and as we talked some months ago, the expression Madgraph uses (and that I also implemented in my code) is:
rap = 0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) +
* 0.5D0*LOG(x1/x2)
given that both beams have the same energy. I checked that for a given phase space point I get the same result both for the first and second term and also for the sum of them. However, when computing the whole cross section I get different results from both programmes.

Something that confuses me is that if I modify the code also in Madgraph and compute both in Madgraph and my code the following expression for the pseudorapidity
rap = ABS(0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5)))) +
ABS(0.5D0*LOG(x1/x2))
then I get the same result for the cross section with both programmes.

And it also works if I just consider one term at a time for the cut, everything seems to work except when I consider the sum of them.

My question is therefore, can it be that there is any if-clause in Madgraph or some condition about the different terms and their sign hidden in the code that maybe I haven't found?

Best,
L.

 Olivier Mattelaer (olivier-mattelaer) said on 2019-04-11: #8

I am in Holliday now
And can not check anything but I would advise to plot the rapidity and see if the cut value is where you expect it. And maybe use standard tools to use such plots to avoid any issue with the definition of the variable.’

Cheers

Olivier

Get Outlook for iOS<https://aka.ms/o0ukef>

________________________________
From: <email address hidden> on behalf of Laura Moreno <email address hidden>
Sent: Thursday, April 11, 2019 10:48 AM
To: Olivier Mattelaer
Subject: Re: [Question #675845]: Definition of rapidity in run_card.dat

Laura Moreno is still having a problem:
Dear Olivier,

first of all thanks for all the answers. Unfortunately, I still have the
problem. I have been trying to understand the Madgraph code related to
the rapidity cut, and I understand how they compute it, but still I have
some problems when calculating the cross section with cuts and compare
it to the results I obtain with my own code.

The situation is the following: I have a code that computes the cross
section for the pp > Htj and also applies some cuts to the jet. I run my
code and then run Madgraph with all the same settings and conditions.
Focusing on LO, when no cuts are applied, I get the same result for the
cross section with my code and with Madgraph. If I apply cuts on the pT
or energy, everything is also in agreement. The problem comes when I
apply cuts to the rapidity of the jet.

In this case, and as we talked some months ago, the expression Madgraph uses (and that I also implemented in my code) is:
rap = 0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5))) +
* 0.5D0*LOG(x1/x2)
given that both beams have the same energy. I checked that for a given phase space point I get the same result both for the first and second term and also for the sum of them. However, when computing the whole cross section I get different results from both programmes.

Something that confuses me is that if I modify the code also in Madgraph and compute both in Madgraph and my code the following expression for the pseudorapidity
rap = ABS(0.5D0*LOG((P(0,5)+P(3,5))/(P(0,5)-P(3,5)))) +
ABS(0.5D0*LOG(x1/x2))
then I get the same result for the cross section with both programmes.

And it also works if I just consider one term at a time for the cut,
everything seems to work except when I consider the sum of them.

My question is therefore, can it be that there is any if-clause in
hidden in the code that maybe I haven't found?

Best,
L.

--

 Laura Moreno (laumova) said on 2019-04-29: #9

Dear Olivier,

thanks for the answer. I have already plotted it and the result is the one expected: the accepted and rejected points are computed correctly, both in my code and with Madgraph. I also compared the phase space points generated by Madgraph (if they were accepted or rejected, and their numerical value for the rapidity) with my code. Using the same phase space points I get the same value for the rapidity and if it is accepted or rejected. However when I consider the whole result (integration over the whole phase space) I get different results for the cross-section.

Moreover, I was trying to perform another check: if I only consider the 3rd component of the jet momentum to be positive (or negative) and see if the discrepancy between the rapidities in both programmes is lower or not. Therefore, I wanted to implement a cut in my programme that excludes any point with pj_z < 0. I did it also on Madgraph, but probably wrong, because I implemented it in ./SubProcesses/dummy_fct.f as (inside FUNCTION dummy_cuts(P))

>> if (P(3,5).gt.0.0d0) dummy_cuts=.false.

however, if I compute the cross section for pj_z < 0 and for pj_z >= 0 I would expect that the sum of those two yields the total cross section when no cut on this momenta is done. But this is not the case in Madgraph, so I bet the implementation of my cut is not proper. Is it in the wrong file? Or in the wrong function?

Solving this problem I might be able to know where the problem with the rapidity lies.

L.

 Olivier Mattelaer (olivier-mattelaer) said on 2019-04-29: #10

Hi,

Indeed a PZ cut is not possible if you do not deactivate some phase-space symmetry.
I will show that in p p > t t~ process:

If you keep the default optimization setting you will get:
tt~ no cut: 505.7
PZ>0 : 76.88
PZ<0: 198.8 +- 0.723 pb

Which is the proof that something goes wrong.

Now if you deactivate the symmetry: (set group_subprocesses False -- before the generation of the diagram--)
then you get reasonable results:
tt~ not cuts: 504.1 +- 0.5931 pb
PZ>0: 251.495 +- 2.30931175496
PZ<=0: 251.2 +- 0.5972 pb

Cheers,

Olivier

 Laura Moreno (laumova) said on 2019-05-06: #11

Hi Olivier,

Thank you for the answer, I tried to apply the same example as in your answer but for the pp -> Htj production, and now indeed I get something which at least corresponds to

sigma(pj_z < 0) + sigma(pj_z > 0) = sigma_total

However, I am surprised that I get the same value for both elements in the left hand side, which is not what I get with my own code. About it, I am not sure if I should get a symmetric result or not, because I haven't computed the analytic expression for the matrix element. I will keep on trying to solve this problem, and see if I can solve with it the problem with rapidity.

Best,
L.

 Olivier Mattelaer (olivier-mattelaer) said on 2019-05-06: #12

Dear Laura,

If you do not have symmetric value, this is clearly an error in your code.
Since you are running at p p collider. You will always have another symmetric contribution (u~u matrix-element will symetrise with uu~ and so on).
So the matrix-element does not matter in this case (and can be asyymetric as much as you want)

Cheers,

Olivier

 Laura Moreno (laumova) said on 2019-05-15: #13

Dear Olivier,

Thank you for the answer. I have been working on trying to find the error in my code these days and I found it. To compute the cross section I was using the matrix elements generated by the standalone output from Madgraph. However, those files had been generated without the statement: set group_subprocesses False.

After changing that and multiplying the matrix elements of the different subprocesses by the corresponding pdfs and integrating (adding the other factors for the cross section, such as flux factor, etc) over the phase space, I get the code to work properly. This is, when I apply the different cuts in the momenta and rapidity I get the same results as Madgraph.

So now all the problems discussed here are solved. Thank you so much for the help again.

Best,
Laura

 Laura Moreno (laumova) said on 2019-05-15: #14

Thanks Olivier Mattelaer, that solved my question.