Implementing cut on the mediator pt in NLO computation

Asked by Siew Yan HOH


I would like to do a NLO event generation with a pt cut on the new boson. In this case, the spin-0 mediator Y0 decays into a pair of Dark Matter. I am using the model file from here ( Usually in the LO computation, i am able to override the parameter ptllmin in the run_card.dat via setcut.f to impose the cut on the mediator pt. However , in NLO, the run_card.dat structure is entirely different from the LO's. (the parameter ptllmin is absence)

Is it possible to implement a user defined pt cut just like what i did in LO for NLO computation? If it can be done, could you please advise how could i proceed to achieve this?

Many Thanks!


Siew Yan

Question information

English Edit question
MadGraph5_aMC@NLO Edit question
marco zaro Edit question
Last query:
Last reply:
Revision history for this message
Rikkert Frederix (frederix) said :

Dear Siew Yan,

As written in the run_card.dat: "More specific cuts can be specified in SubProcesses/cuts.f". It should be relatively straight-forward adding cuts on the dark-matter pair pT. There are ample comments in that file, but if there is something not clear, let me know and I'll try to help.


Revision history for this message
Siew Yan HOH (siew-yan-hoh) said :

Dear Rikkert,

Thanks for highlighting the section in cuts.f. I managed to implement a user cut on the dark matter pair pt. However i have encountered another issue. The compilation is successful which i assume my implemented block of code is fine but i have this error message "OSError: [Errno 26] Text file busy" occasionally but the event generation frozen...

Below show the first part of the debug report, please advise how should i fix this..


Siew Yan

#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 20xx-xx-xx *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* *
#* and *
#* *
#* *
#* *
#* Command File for aMCatNLO *
#* *
#* run as ./bin/ filename *
#* *
Traceback (most recent call last):
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 908, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 897, in onecmd_orig
    return func(arg, **opt)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 1210, in do_launch
    evt_file =, options)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 1430, in run
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 1631, in run_all_jobs
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 3652, in wait_for_complete
    self.cluster.wait(self.me_dir, update_status)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 611, in worker
    proc = misc.Popen([exe] + arg, **opt)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 676, in deco_f
    return f(arg, *args, **opt)
  File "/mnt/siew/DM_simp/MG5_aMC_v2_3_3/bin/NLO_SPIN0/bbbar_NLO_4f_matching/bin/internal/", line 715, in Popen
    return subprocess.Popen(arg, *args, **opt)
  File "/usr/lib64/python2.6/", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/", line 1238, in _execute_child
    raise child_exception
OSError: [Errno 26] Text file busy
Value of current Options:
              text_editor : emacs -nw
              web_browser : None
        cluster_temp_path : /mnt/tmp/
                  timeout : 60
       cluster_local_path : /cvmfs/
            cluster_queue : madgraph
         madanalysis_path : /mnt/siew/DM_simp/MG5_aMC_v2_3_3/MadAnalysis
                   lhapdf : lhapdf-config
             cluster_size : 100
           cluster_memory : None
    cluster_status_update : (600, 30)
             cluster_time : None
            f2py_compiler : None
               hepmc_path : None
             pythia8_path : None
                hwpp_path : None
   automatic_html_opening : False
       cluster_retry_wait : 300
             stdout_level : None
          pythia-pgs_path : None
                 mg5_path : /mnt/siew/DM_simp/MG5_aMC_v2_3_3
                  td_path : /mnt/siew/DM_simp/MG5_aMC_v2_3_3/td
             delphes_path : None
              thepeg_path : None
             cluster_type : condor
         cluster_nb_retry : 1
         fortran_compiler : None
                  nb_core : 2
              auto_update : 7
      exrootanalysis_path : None
               eps_viewer : None
             syscalc_path : None
                  fastjet : fastjet-config
             cpp_compiler : None
      notification_center : True
                 run_mode : 2

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


This sounds like a machine dependent problem since the Garbage collector do not act in the exact same way depending of the system. In your case, one file is not close as it should.
I assign this to Marco, who might know which file is not explicitely close.



Revision history for this message
marco zaro (marco-zaro) said :

I don't really know what the error can be due to...
I see you are using python2.6. Does the error still occur with 2.7, if you can try it?
at which stage exactly do you get that error?

Thanks a lot!


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

Hi Siew,

I have look more in details with Marco and we can propose the following patch:

Since this behavior is machine dependent, we are not able to reproduce your behavior and consequently, we are not able to check
if the above patch fix the problem or not.

However, in addition to a likely patch, we also have improve the debug file such that it can provide more useful information for that type of bug. So if it does not solve your problem could you give us the debug file again?



Can you help with this problem?

Provide an answer of your own, or ask Siew Yan HOH for more information if necessary.

To post a message you must log in.