# forward-backward asymmetry

Can you please suggest a way for me to plot the forward backward asymmetry of a process, for example p p~ -> mu+ mu- , as a function of the CM energy (which i call s_hat)?

I know how to modify the user.cpp file in the Build directory, but I am having a difficult time collecting subsamples for each s_hat:

I would like to collect a set of events with the *same* s_hat, and separate these events into those where theta < pi/2 and theta > pi/2.

Then of course, I can calculate the asymmetry.

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2017-12-03
2017-12-03
 Benjamin Fuks (fuks) said on 2017-12-03: #1

Hi,

I am not sure to understand the question. It is easy to obtain the theta from MA5 basic methods. Then, the rest is a matter of c++. You can implement two global variables dsigma_plus and dsigma_,minus and compute the AFB in the Finalize method of user.cpp.

Cheers,

Benjamin

 Zboson (911876gev) said on 2017-12-03: #2

Dear Benjamin,

Thanks a lot for replying! here's the relevant part of what I'm currently doing (something similar to what you said):

Within 'Execute':

for (ind=0;ind<_P_muPTorderingfinalstate.size();ind++)
{
float thetavar = _P_muPTorderingfinalstate[ind]->theta();
if (thetavar >= 0 && thetavar <= 0.5*(3.14159))
sf->Fill(PHYSICS->SqrtS(event.mc()),1);
sf2->Fill(PHYSICS->SqrtS(event.mc()),1);
if (thetavar >= 0.5*(3.14159) && thetavar <= 3.14159)
sb->Fill(PHYSICS->SqrtS(event.mc()),1);
}

Within 'Finalize':

//Asymmetry calculation
sf2->Divide(sf);

So sf2 would be my AFB histogram.

 Benjamin Fuks (fuks) said on 2017-12-03: #3

I am not too sure to understand why you would need any histogram here. Why can't this work with just double-precision numbers?

Cheers,

Benjamin

> On 3 Dec 2017, at 14:02 , Zboson <email address hidden> wrote:
>
> Question #661360 on MadAnalysis 5 changed:
>
>
> Zboson is still having a problem:
> Dear Benjamin,
>
> Thanks a lot for replying! here's the relevant part of what I'm
> currently doing (something similar to what you said):
>
> Within 'Execute':
>
> for (ind=0;ind<_P_muPTorderingfinalstate.size();ind++)
> {
> float thetavar = _P_muPTorderingfinalstate[ind]->theta();
> if (thetavar >= 0 && thetavar <= 0.5*(3.14159))
> sf->Fill(PHYSICS->SqrtS(event.mc()),1);
> sf2->Fill(PHYSICS->SqrtS(event.mc()),1);
> if (thetavar >= 0.5*(3.14159) && thetavar <= 3.14159)
> sb->Fill(PHYSICS->SqrtS(event.mc()),1);
> }
>
> Within 'Finalize':
>
> //Asymmetry calculation
> sf2->Divide(sf);
>
> So sf2 would be my AFB histogram.
>
> --