# No particle --diagram_filter in model

Dear experts,

I have defined the following user_filter.py

def remove_diag(diag,model=None):
"""remove all diagrams which are not QCD==2"""
if diag.get('orders')['QCD'] != 2:
return True
return False

and copied it into the madgraph/PLUGIN folder of the MG version I am using.
The generation string I am trying to use is:

generate p p > z w- j j QCD=99 SMHLOOP=0 NP=1 --diagram_filter, z > l+ l- NP=1, w- > j j NP=1 @0 NP=1

but I get the following error:

Command "import /public/genproductions/bin/MadGraph5_aMCatNLO/ZWmQCD_cHq1_SM_LI_QU/ZWmQCD_cHq1_SM_LI_QU_gridpack/work/ZWmQCD_cHq1_SM_LI_QU_proc_card.dat" interrupted in sub-command:
"generate p p > z w- j j QCD=99 SMHLOOP=0 NP=1 --diagram_filter, z > l+ l- NP=1, w- > j j NP=1 @0 NP=1" with error:
InvalidCmd : No particle --diagram_filter in model

Riccardo

## Question information

Language:
English Edit question
Status:
For:
Assignee:
Valentin Hirschi Edit question
Last query:
 Olivier Mattelaer (olivier-mattelaer) said on 2021-04-13: #1

You should do
generate p p > z w- j j QCD=99 SMHLOOP=0 NP=1 , z > l+ l- NP=1, w- > j j NP=1 @0 NP=1 --diagram_filter
but then it obviously not doing what you want since it will apply on each pieces. (which is not a big issue since you can add a condition on the number of initial state to distinguish production from decay)

Now I will assign this to Valentin, since I do not see why,
generate p p > z w- j j QCD==2 SMHLOOP=0 NP=1 , z > l+ l- NP=1, w- > j j NP=1 @0 NP=1
should not be allowed/working here...

 Riccardo (ricbrs) said on 2021-04-13: #2

With QCD==2 I get this error:
MadGraph5Error : Decay processes cannot specify squared orders constraints

 Riccardo (ricbrs) said on 2021-04-13: #3

How can I write the condition on the number of initial state?

 Olivier Mattelaer (olivier-mattelaer) said on 2021-04-14: #4

You can use the drawned representation mode and check how many vertex you have at level 0.
They might exists other method but this is the likely the easiest to explain/find.

 Riccardo (ricbrs) said on 2021-04-14: #5

I am sorry but I have not understood what I should do. Could you please show me the code that have to be implemented as an additional condition?

Thanks a lot.

 Olivier Mattelaer (olivier-mattelaer) said on 2021-04-14: #6

Never done that but with the example you should be able to twek it no?

Cheers,

Olivier

> On 14 Apr 2021, at 23:02, Riccardo <email address hidden> wrote:
>
> Question #696554 on MadGraph5_aMC@NLO changed:
>
>
> Riccardo is still having a problem:
> I am sorry but I have not understood what I should do. Could you please
> show me the code that have to be implemented as an additional condition?
>
> Thanks a lot.
>
> --