# How to add cuts to constrain b quark's number in final state.

HI!
I'm using MG5_aMCv2.7.3 generate a process p p > t t~ t t~ ,( t > b w+ , w+ > l+ vl ) ,( t~ > b~ w- , w- > l- vl~ ).
I need at least 3 b quark (or b jet) in final state, but I can,t find cuts to constrain b quark's (or other particle's ) number in run_card.dat.
So I'm trying to add some cuts in cuts.f, but it didn't work and even crashed.
This is the cuts I was added in cuts.f
integer nb, ni
nb=0
do ni=nincoming+1,nexternal
if(is_a_b(ni)) then
nb=nb+1
if(nb.ge.3) then
passcuts=.false.
return
endif
endif
enddo
Any suggestions will be appreciated.
THANKS!!!!!!!!!!

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2020-09-08
Last query:
2020-09-08
2020-09-08
 Olivier Mattelaer (olivier-mattelaer) said on 2020-09-08: #1

You will always have 4 b quark (at parton level) with your syntax.
Those are not the type of cuts that you can impose at parton-level.

Cheers,

Olivier

> On 8 Sep 2020, at 14:50, yinxinyue <email address hidden> wrote:
>
> New question #692806 on MadGraph5_aMC@NLO:
>
> HI!
> I'm using MG5_aMCv2.7.3 generate a process p p > t t~ t t~ ,( t > b w+ , w+ > l+ vl ) ,( t~ > b~ w- , w- > l- vl~ ).
> I need at least 3 b quark (or b jet) in final state, but I can,t find cuts to constrain b quark's (or other particle's ) number in run_card.dat.
> So I'm trying to add some cuts in cuts.f, but it didn't work and even crashed.
> This is the cuts I was added in cuts.f
> integer nb, ni
> nb=0
> do ni=nincoming+1,nexternal
> if(is_a_b(ni)) then
> nb=nb+1
> if(nb.ge.3) then
> passcuts=.false.
> return
> endif
> endif
> enddo
> Any suggestions will be appreciated.
> THANKS!!!!!!!!!!
>
>
> --

 yinxinyue (yinxinyue0420) said on 2020-09-08: #2

Thanks!
But if I type generate p p > t t~ t t~ ,( t > b w+ ) ,( t~ > b~ w- ),and I want at least 2 leptons in final state. How can I achieve it.

 Olivier Mattelaer (olivier-mattelaer) said on 2020-09-08: #3

This is not a cut that you can define at parton-level, you should applied such cut after (at least) parton-shower/hadronization and more likely after reconstructions.

Cheers,

Olivier

> On 8 Sep 2020, at 15:25, yinxinyue <email address hidden> wrote:
>
> Question #692806 on MadGraph5_aMC@NLO changed:
>
>
> yinxinyue is still having a problem:
> Thanks!
> But if I type generate p p > t t~ t t~ ,( t > b w+ ) ,( t~ > b~ w- ),and I want at least 2 leptons in final state. How can I achieve it.
>
> --