error when set tight cut in matrix*.f

Asked by Rui Zhang

Hi!

Recently, I asked a question about how to use special cut. https://answers.launchpad.net/mg5amcnlo/+question/678667

For simplify, let me also use "b4" to describe my question. b4 is defined as p_{t1}^z*p_{t2}^z/|p_{t1}|/|p_{t2}|. And evidently, -1<=b4<=1.
But I notice there's about 45% in the chosen interval, not all.

I generated event by
--------------------
generate g g > t t~ h
output test
launch
0
0
exit
--------------------
and modified dummy_fct.f
--------------------add function at the beginning
      double precision function P3D(P)
      implicit none

      double precision P(0:3)
      P3D=sqrt(P(1)*P(1)+P(2)*P(2)+P(3)*P(3))

      return
      end
--------------------add some sentences at the beginning of the function "dummy_cuts"
      double precision topp(0:3)
      double precision topm(0:3)
      double precision higgs(0:3)
      double precision b4
      double precision P3D
--------------------add some sentences after "dummy_cuts=.true." in the function "dummy_cuts"
      topp(0:3)=p(0:3,3)
      topm(0:3)=p(0:3,4)
      b4=topp(3)*topm(3)/P3D(topp)/P3D(topm)
      if(b4.gt.-0.9d0) then
          dummy_cuts=.false.
      endif
--------------------
and now the events number with b4<-0.9 is 4542 while the total events number is 10000. And when I change "if(b4.gt.-0.9d0) then" to "if(b4.gt.0.0d0) then", the events number with b4<0 is 3865.

I suppose that's because the histograms of random numbers in MC integral are not the exactly the same given by b4. (or other reasons, but I don't know) So I try to apply cuts before integral, which is not we often do in MC.

As I see the error "rm: cannot remove 'results.dat': No such file or directory" and I notice you mentioned that 2.6.5 should fix the problem in https://answers.launchpad.net/mg5amcnlo/+question/678482 , so I try the version 2.6.5, but the there's the same error.

I generate the same process and modified P1_gg_ttxh/matrix1.f with
--------------------add function at the beginning
      double precision function P3D(P)
      implicit none

      double precision P(0:3)
      P3D=sqrt(P(1)*P(1)+P(2)*P(2)+P(3)*P(3))

      return
      end
--------------------add some sentences at the beginning of the subroutine "SMATRIX1"
      double precision topp(0:3)
      double precision topm(0:3)
      double precision higgs(0:3)
      double precision b4
      double precision P3D
--------------------add some sentences at the end of the subroutine "SMATRIX1"
      topp(0:3)=p(0:3,3)
      topm(0:3)=p(0:3,4)
      b4=topp(3)*topm(3)/P3D(topp)/P3D(topm)
      if(b4.lt.0d0.or.b4.ge.1d0) then
          ANS=0d0
      endif
--------------------
I'm happy to see most (9119) events are in the interval b4>=0. But when I change "if(b4.lt.0d0.or.b4.ge.1d0) then" to "if(b4.lt.0d0.or.b4.ge.1d-1) then", the following error occurs:
--------------------
INFO: Update the dependent parameter of the param_card.dat
Generating 10000 events with run name run_03
survey run_03
INFO: compile directory
compile Source Directory
Using random number seed offset = 48
INFO: Running Survey
Creating Jobs
Working on SubProcesses
INFO: P1_gg_ttxh
INFO: Idle: 1, Running: 1, Completed: 0 [ current time: 02h28 ]
STOP 1
rm: cannot remove 'results.dat': No such file or directory
ERROR DETECTED
INFO: Idle: 0, Running: 1, Completed: 1 [ 4.4s ]
INFO: Idle: 0, Running: 0, Completed: 2 [ 7.9s ]
INFO: Idle: 0, Running: 0, Completed: 2 [ 7.9s ]
INFO: End survey
refine 10000
Creating Jobs
INFO: Refine results to 10000
INFO: Generating 10000.0 unweigthed events.
Error when reading /home/G/rui/MG5_aMC_v2_6_5/bin/test/SubProcesses/P1_gg_ttxh/G7/results.dat
Command "launch " interrupted with error:
Exception : Reported error: End code 1.0
  Full associated log:
  Process in group number 1
  A PDF is used, so alpha_s(MZ) is going to be modified
  Old value of alpha_s from param_card: 0.11799999999999999
   ****************************************

        NNPDFDriver version 1.0.3
    Grid: NNPDF23_lo_as_0130_qed_mem0.grid
   ****************************************
  New value of alpha_s from PDF nn23lo1: 0.13000000000000000
  Define smin to 0.0000000000000000
  *****************************************************
  * MadGraph/MadEvent *
  * -------------------------------- *
  * http://madgraph.hep.uiuc.edu *
  * http://madgraph.phys.ucl.ac.be *
  * http://madgraph.roma2.infn.it *
  * -------------------------------- *
  * *
  * PARAMETER AND COUPLING VALUES *
  * *
  *****************************************************

   External Params
   ---------------------------------

  aEWM1 = 132.50700000000001
  mdl_Gf = 1.1663900000000000E-005
  aS = 0.11799999999999999
  mdl_ymb = 4.7000000000000002
  mdl_ymt = 173.00000000000000
  mdl_ymtau = 1.7769999999999999
  mdl_MZ = 91.188000000000002
  mdl_MT = 173.00000000000000
  mdl_MB = 4.7000000000000002
  mdl_MH = 125.00000000000000
  mdl_MTA = 1.7769999999999999
  mdl_WZ = 2.4414039999999999
  mdl_WW = 2.0476000000000001
  mdl_WT = 1.4915000000000000
  mdl_WH = 6.3823389999999999E-003
   Internal Params
   ---------------------------------

  mdl_conjg__CKM3x3 = 1.0000000000000000
  mdl_CKM3x3 = 1.0000000000000000
  mdl_conjg__CKM1x1 = 1.0000000000000000
  mdl_complexi = ( 0.0000000000000000 , 1.0000000000000000 )
  mdl_MZ__exp__2 = 8315.2513440000002
  mdl_MZ__exp__4 = 69143404.913893804
  mdl_sqrt__2 = 1.4142135623730951
  mdl_MH__exp__2 = 15625.000000000000
  mdl_aEW = 7.5467711139788835E-003
  mdl_MW = 80.419002445756163
  mdl_sqrt__aEW = 8.6872153846781555E-002
  mdl_ee = 0.30795376724436879
  mdl_MW__exp__2 = 6467.2159543705357
  mdl_sw2 = 0.22224648578577766
  mdl_cw = 0.88190334743339216
  mdl_sqrt__sw2 = 0.47143025548407230
  mdl_sw = 0.47143025548407230
  mdl_g1 = 0.34919219678733299
  mdl_gw = 0.65323293034757990
  mdl_vev = 246.21845810181637
  mdl_vev__exp__2 = 60623.529110035903
  mdl_lam = 0.12886910601690263
  mdl_yb = 2.6995554250465490E-002
  mdl_yt = 0.99366614581500623
  mdl_ytau = 1.0206617000654717E-002
  mdl_muH = 88.388347648318430
  mdl_I1x33 = ( 2.6995554250465490E-002, 0.0000000000000000 )
  mdl_I2x33 = ( 0.99366614581500623 , 0.0000000000000000 )
  mdl_I3x33 = ( 0.99366614581500623 , 0.0000000000000000 )
  mdl_I4x33 = ( 2.6995554250465490E-002, 0.0000000000000000 )
  mdl_ee__exp__2 = 9.4835522759998875E-002
  mdl_sw__exp__2 = 0.22224648578577769
  mdl_cw__exp__2 = 0.77775351421422245
   Internal Params evaluated point by point
   ----------------------------------------

  mdl_sqrt__aS = 0.34351128074635334
  mdl_G__exp__2 = 1.4828317324943823
   Couplings of sm
   ---------------------------------

         GC_10 = -0.12177E+01 0.00000E+00
         GC_11 = 0.00000E+00 0.12177E+01
         GC_94 = -0.00000E+00 -0.70263E+00

  Collider parameters:
  --------------------

  Running at P P machine @ 13000.000000000000 GeV
  PDF set = nn23lo1
  alpha_s(Mz)= 0.1300 running at 2 loops.
  alpha_s(Mz)= 0.1300 running at 2 loops.
  Renormalization scale set on event-by-event basis
  Factorization scale set on event-by-event basis

  getting user params
 Enter number of events and max and min iterations:
  Number of events and iterations 1000 5 3
 Enter desired fractional accuracy:
  Desired fractional accuracy: 0.10000000000000001
 Enter 0 for fixed, 2 for adjustable grid:
 Suppress amplitude (0 no, 1 yes)?
  Using suppressed amplitude.
 Exact helicity sum (0 yes, n = number/event)?
  Explicitly summing over helicities
 Enter Configuration Number:
 Running Configuration Number: 7
  Not subdividing B.W.
  Attempting mappinvarients 1 5
  Completed mapping 5
  about to integrate 7 1000 5 3 7 1
  Using non-zero grid deformation.
   7 dimensions 1000 events 7 invarients 5 iterations 1 config(s), (0.99)
  Using h-tuple random number sequence.
  Error opening grid
  Using Uniform Grid! 20
  Using uniform alpha 1.0000000000000000
  Grid defined OK
  Set CM energy to 13000.00
  Mapping Graph 7 to config 7
 Setting grid 1 0.52547E-03 1
 Setting grid 2 0.17709E-03 1
  Transforming s_hat 1/s 6 1.3126686390532547E-003 0.0000000000000000 168999999.99999997
    7 1 2 3 4 5 6 7
  Masses: 0.000E+00 0.000E+00 0.173E+03 0.173E+03 0.125E+03
 Using random seed offsets 7 : 1
   with seed 51
  Ranmar initialization seeds 3816 9427

  ********************************************
  * You are using the DiscreteSampler module *
  * part of the MG5_aMC framework *
  * Author: Valentin Hirschi *
  ********************************************

   Particle 3 4 5
       Et > 0.0 0.0 0.0
        E > 0.0 0.0 0.0
      Eta < -1.0 -1.0 -1.0
    xqcut: 0.0 0.0 0.0
 d R # 3 > -0.0 0.0 0.0
 d R # 4 > -0.0 -0.0 0.0
 s min # 3> 0.0 0.0 0.0
 s min # 4> 0.0 0.0 0.0
 xqcutij # 3> 0.0 0.0 0.0
 xqcutij # 4> 0.0 0.0 0.0
  No cut BW -1 1
  alpha_s for scale 254.95517710991473 is 0.11102126870549521
  Added good helicity 1 0.40236664505701708 in event 1 local: 1
  Added good helicity 2 4.4929646654874222 in event 1 local: 1
  Added good helicity 3 9.6379624946657527E-002 in event 1 local: 1
  Added good helicity 4 0.13741432914401303 in event 1 local: 1
  Added good helicity 5 1.4225462752596849 in event 1 local: 1
  Added good helicity 6 0.99584491391179086 in event 1 local: 1
  Added good helicity 7 0.26677314734036345 in event 1 local: 1
  Added good helicity 8 0.18963127729082896 in event 1 local: 1
  Added good helicity 9 0.18921041431925856 in event 1 local: 1
  Added good helicity 10 0.26591187195006771 in event 1 local: 1
  Added good helicity 11 1.0026156242167239 in event 1 local: 1
  Added good helicity 12 1.4212071640435433 in event 1 local: 1
  Added good helicity 13 0.13647643679147453 in event 1 local: 1
  Added good helicity 14 9.6402607788579661E-002 in event 1 local: 1
  Added good helicity 15 4.4853811655602867 in event 1 local: 1
  Added good helicity 16 0.39887383689228723 in event 1 local: 1
  RESET CUMULATIVE VARIABLE
  RESET CUMULATIVE VARIABLE
  Iteration 1 Mean: 0.1197E-01 Abs mean: 0.1197E-01 Fluctuation: 0.711E-03 0.114E+00 11.5%
   1 0.1197E-01 0.1197E-01 +- 0.7108E-03 1.88
  Writing out events 2.0829047349171445E-005 1.8771235662271024
  Relative summed weights:
   0.4846E+00 0.0000E+00
   0.5154E+00 0.0000E+00
  Relative number of events:
   0.4790E+00 0.0000E+00
   0.5210E+00 0.0000E+00
  Events:
          479 0
          521 0
  DiscreteSampler:: Error, no point could be picked with random variable 0.1720191240310669 using upper bound found of 0.0000000000000000.
 STOP 1

 ls status:
 input_app.txt
 multijob.dat
 run1_app.log
 run_01_log.txt
 run_02_log.txt

Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/home/G/rui/MG5_aMC_v2_6_5/bin/test/run_03_tag_1_debug.log'.
Please attach this file to your report.

-------------------

In case of need, I also attach the log file

-------------------
#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.5 20xx-xx-xx *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *
#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
launch
Traceback (most recent call last):
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/extended_cmd.py", line 1514, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/madevent_interface.py", line 2623, in do_launch
    self.do_generate_events(line, *args, **opt)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/madevent_interface.py", line 2469, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/common_run_interface.py", line 6869, in new_fct
    original_fct(obj, *args, **opts)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/madevent_interface.py", line 2511, in run_generate_events
    self.exec_cmd('refine %s' % nb_event, postcmd=False)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/extended_cmd.py", line 1543, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/madevent_interface.py", line 3421, in do_refine
    x_improve.launch() # create the ajob for the refinment.
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/gen_ximprove.py", line 860, in launch
    main_dir=pjoin(self.cmd.me_dir,'SubProcesses')) #main_dir is for gridpack readonly mode
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/sum_html.py", line 747, in collect_result
    P_comb.add_results(os.path.basename(G), path, mfactors[G])
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/sum_html.py", line 425, in add_results
    oneresult.read_results(filepath)
  File "/home/G/rui/MG5_aMC_v2_6_5/bin/test/bin/internal/sum_html.py", line 315, in read_results
    % (error_code, open(log).read())
Exception: Reported error: End code 1.0
 Full associated log:
 Process in group number 1
 A PDF is used, so alpha_s(MZ) is going to be modified
 Old value of alpha_s from param_card: 0.11799999999999999
  ****************************************

       NNPDFDriver version 1.0.3
   Grid: NNPDF23_lo_as_0130_qed_mem0.grid
  ****************************************
 New value of alpha_s from PDF nn23lo1: 0.13000000000000000
 Define smin to 0.0000000000000000
 *****************************************************
 * MadGraph/MadEvent *
 * -------------------------------- *
 * http://madgraph.hep.uiuc.edu *
 * http://madgraph.phys.ucl.ac.be *
 * http://madgraph.roma2.infn.it *
 * -------------------------------- *
 * *
 * PARAMETER AND COUPLING VALUES *
 * *
 *****************************************************

  External Params
  ---------------------------------

 aEWM1 = 132.50700000000001
 mdl_Gf = 1.1663900000000000E-005
 aS = 0.11799999999999999
 mdl_ymb = 4.7000000000000002
 mdl_ymt = 173.00000000000000
 mdl_ymtau = 1.7769999999999999
 mdl_MZ = 91.188000000000002
 mdl_MT = 173.00000000000000
 mdl_MB = 4.7000000000000002
 mdl_MH = 125.00000000000000
 mdl_MTA = 1.7769999999999999
 mdl_WZ = 2.4414039999999999
 mdl_WW = 2.0476000000000001
 mdl_WT = 1.4915000000000000
 mdl_WH = 6.3823389999999999E-003
  Internal Params
  ---------------------------------

 mdl_conjg__CKM3x3 = 1.0000000000000000
 mdl_CKM3x3 = 1.0000000000000000
 mdl_conjg__CKM1x1 = 1.0000000000000000
 mdl_complexi = ( 0.0000000000000000 , 1.0000000000000000 )
 mdl_MZ__exp__2 = 8315.2513440000002
 mdl_MZ__exp__4 = 69143404.913893804
 mdl_sqrt__2 = 1.4142135623730951
 mdl_MH__exp__2 = 15625.000000000000
 mdl_aEW = 7.5467711139788835E-003
 mdl_MW = 80.419002445756163
 mdl_sqrt__aEW = 8.6872153846781555E-002
 mdl_ee = 0.30795376724436879
 mdl_MW__exp__2 = 6467.2159543705357
 mdl_sw2 = 0.22224648578577766
 mdl_cw = 0.88190334743339216
 mdl_sqrt__sw2 = 0.47143025548407230
 mdl_sw = 0.47143025548407230
 mdl_g1 = 0.34919219678733299
 mdl_gw = 0.65323293034757990
 mdl_vev = 246.21845810181637
 mdl_vev__exp__2 = 60623.529110035903
 mdl_lam = 0.12886910601690263
 mdl_yb = 2.6995554250465490E-002
 mdl_yt = 0.99366614581500623
 mdl_ytau = 1.0206617000654717E-002
 mdl_muH = 88.388347648318430
 mdl_I1x33 = ( 2.6995554250465490E-002, 0.0000000000000000 )
 mdl_I2x33 = ( 0.99366614581500623 , 0.0000000000000000 )
 mdl_I3x33 = ( 0.99366614581500623 , 0.0000000000000000 )
 mdl_I4x33 = ( 2.6995554250465490E-002, 0.0000000000000000 )
 mdl_ee__exp__2 = 9.4835522759998875E-002
 mdl_sw__exp__2 = 0.22224648578577769
 mdl_cw__exp__2 = 0.77775351421422245
  Internal Params evaluated point by point
  ----------------------------------------

 mdl_sqrt__aS = 0.34351128074635334
 mdl_G__exp__2 = 1.4828317324943823
  Couplings of sm
  ---------------------------------

        GC_10 = -0.12177E+01 0.00000E+00
        GC_11 = 0.00000E+00 0.12177E+01
        GC_94 = -0.00000E+00 -0.70263E+00

 Collider parameters:
 --------------------

 Running at P P machine @ 13000.000000000000 GeV
 PDF set = nn23lo1
 alpha_s(Mz)= 0.1300 running at 2 loops.
 alpha_s(Mz)= 0.1300 running at 2 loops.
 Renormalization scale set on event-by-event basis
 Factorization scale set on event-by-event basis

 getting user params
Enter number of events and max and min iterations:
 Number of events and iterations 1000 5 3
Enter desired fractional accuracy:
 Desired fractional accuracy: 0.10000000000000001
Enter 0 for fixed, 2 for adjustable grid:
Suppress amplitude (0 no, 1 yes)?
 Using suppressed amplitude.
Exact helicity sum (0 yes, n = number/event)?
 Explicitly summing over helicities
Enter Configuration Number:
Running Configuration Number: 3
 Not subdividing B.W.
 Attempting mappinvarients 1 5
 Completed mapping 5
 about to integrate 7 1000 5 3 7 1
 Using non-zero grid deformation.
  7 dimensions 1000 events 7 invarients 5 iterations 1 config(s), (0.99)
 Using h-tuple random number sequence.
 Error opening grid
 Using Uniform Grid! 20
 Using uniform alpha 1.0000000000000000
 Grid defined OK
 Set CM energy to 13000.00
 Mapping Graph 3 to config 3
Setting grid 1 0.92456E-04 1
Setting grid 2 0.17709E-03 1
 Transforming s_hat 1/s 6 1.3126686390532547E-003 0.0000000000000000 168999999.99999997
   3 1 2 3 4 5 6 7
 Masses: 0.000E+00 0.000E+00 0.173E+03 0.173E+03 0.125E+03
Using random seed offsets 3 : 1
  with seed 57
 Ranmar initialization seeds 11126 9433

 ********************************************
 * You are using the DiscreteSampler module *
 * part of the MG5_aMC framework *
 * Author: Valentin Hirschi *
 ********************************************

  Particle 3 4 5
      Et > 0.0 0.0 0.0
       E > 0.0 0.0 0.0
     Eta < -1.0 -1.0 -1.0
   xqcut: 0.0 0.0 0.0
d R # 3 > -0.0 0.0 0.0
d R # 4 > -0.0 -0.0 0.0
s min # 3> 0.0 0.0 0.0
s min # 4> 0.0 0.0 0.0
xqcutij # 3> 0.0 0.0 0.0
xqcutij # 4> 0.0 0.0 0.0
 No cut BW -2 1
 alpha_s for scale 319.82016673044740 is 0.10757320794440017
 Added good helicity 1 7.4545574821217556E-002 in event 1 local: 1
 Added good helicity 2 5.1223882976737487 in event 1 local: 1
 Added good helicity 3 0.35439971536222864 in event 1 local: 1
 Added good helicity 4 1.7475274546209472E-002 in event 1 local: 1
 Added good helicity 5 0.82435751470603402 in event 1 local: 1
 Added good helicity 6 0.50795889649451076 in event 1 local: 1
 Added good helicity 7 0.46673443957405247 in event 1 local: 1
 Added good helicity 8 0.63195327556701641 in event 1 local: 1
 Added good helicity 9 0.63202787806949634 in event 1 local: 1
 Added good helicity 10 0.46687305919963373 in event 1 local: 1
 Added good helicity 11 0.50821026893570420 in event 1 local: 1
 Added good helicity 12 0.82447802254357916 in event 1 local: 1
 Added good helicity 13 1.7441579635473631E-002 in event 1 local: 1
 Added good helicity 14 0.35440404870040676 in event 1 local: 1
 Added good helicity 15 5.1222827679788683 in event 1 local: 1
 Added good helicity 16 7.4469386191819420E-002 in event 1 local: 1
 RESET CUMULATIVE VARIABLE
 RESET CUMULATIVE VARIABLE
 Iteration 1 Mean: 0.7799E-02 Abs mean: 0.7799E-02 Fluctuation: 0.468E-03 0.788E-01 10.2%
  1 0.7799E-02 0.7799E-02 +- 0.4680E-03 1.90
 Writing out events 1.5280385253917563E-005 1.8977852635938028
 Relative summed weights:
  0.4739E+00 0.0000E+00
  0.5261E+00 0.0000E+00
 Relative number of events:
  0.5195E+00 0.0000E+00
  0.4805E+00 0.0000E+00
 Events:
         520 0
         481 0
 DiscreteSampler:: Error, no point could be picked with random variable 0.7555375099182129 using upper bound found of 0.0000000000000000.
STOP 1

ls status:
events.lhe
input_app.txt
log.txt
multijob.dat
run1_app.log
run_01_log.txt
run_02_log.txt

                              Run Options
                              -----------
               stdout_level : None

                         MadEvent Options
                         ----------------
     automatic_html_opening : False (user set)
        notification_center : True
          cluster_temp_path : None
             cluster_memory : None
               cluster_size : 100
              cluster_queue : None
                    nb_core : 32 (user set)
               cluster_time : None
                   run_mode : 2

                      Configuration Options
                      ---------------------
                text_editor : None
         cluster_local_path : None
      cluster_status_update : (600, 30)
               pythia8_path : None (user set)
                  hwpp_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
                thepeg_path : None (user set)
               cluster_type : condor
          madanalysis5_path : None (user set)
           cluster_nb_retry : 1
                 eps_viewer : None
                web_browser : None
               syscalc_path : None (user set)
           madanalysis_path : None (user set)
                     lhapdf : lhapdf-config
              f2py_compiler : None
                 hepmc_path : None (user set)
         cluster_retry_wait : 300
           fortran_compiler : None
                auto_update : 7 (user set)
        exrootanalysis_path : None (user set)
                    timeout : 60
               cpp_compiler : None
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.6.5 2018-02-03 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************
set default_unset_couplings 99
set group_subprocesses Auto
set ignore_six_quark_processes False
set loop_optimized_output True
set low_mem_multicore_nlo_generation False
set loop_color_flows False
set gauge unitary
set complex_mass_scheme False
set max_npoint_for_channel 0
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate g g > t t~ h
output test
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####
######################################################################
## ##
## Width set on Auto will be computed following the information ##
## present in the decay.py files of the model. ##
## See arXiv:1402.1178 for more details. ##
## ##
######################################################################

###################################
## INFORMATION FOR MASS
###################################
Block mass
    5 4.700000e+00 # MB
    6 1.730000e+02 # MT
   15 1.777000e+00 # MTA
   23 9.118800e+01 # MZ
   25 1.250000e+02 # MH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
  1 0.000000 # d : 0.0
  2 0.000000 # u : 0.0
  3 0.000000 # s : 0.0
  4 0.000000 # c : 0.0
  11 0.000000 # e- : 0.0
  12 0.000000 # ve : 0.0
  13 0.000000 # mu- : 0.0
  14 0.000000 # vm : 0.0
  16 0.000000 # vt : 0.0
  21 0.000000 # g : 0.0
  22 0.000000 # a : 0.0
  24 80.419002 # w+ : cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - (aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2)))

###################################
## INFORMATION FOR SMINPUTS
###################################
Block sminputs
    1 1.325070e+02 # aEWM1
    2 1.166390e-05 # Gf
    3 1.180000e-01 # aS

###################################
## INFORMATION FOR YUKAWA
###################################
Block yukawa
    5 4.700000e+00 # ymb
    6 1.730000e+02 # ymt
   15 1.777000e+00 # ymtau

###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.491500e+00 # WT
DECAY 23 2.441404e+00 # WZ
DECAY 24 2.047600e+00 # WW
DECAY 25 6.382339e-03 # WH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
DECAY 1 0.000000 # d : 0.0
DECAY 2 0.000000 # u : 0.0
DECAY 3 0.000000 # s : 0.0
DECAY 4 0.000000 # c : 0.0
DECAY 5 0.000000 # b : 0.0
DECAY 11 0.000000 # e- : 0.0
DECAY 12 0.000000 # ve : 0.0
DECAY 13 0.000000 # mu- : 0.0
DECAY 14 0.000000 # vm : 0.0
DECAY 15 0.000000 # ta- : 0.0
DECAY 16 0.000000 # vt : 0.0
DECAY 21 0.000000 # g : 0.0
DECAY 22 0.000000 # a : 0.0
#*********************************************************************
# MadGraph5_aMC@NLO *
# *
# run_card.dat MadEvent *
# *
# This file is used to set the parameters of the run. *
# *
# Some notation/conventions: *
# *
# Lines starting with a '# ' are info or comments *
# *
# mind the format: value = variable ! comment *
# *
# To display more options, you can type the command: *
# update full_run_card *
#*********************************************************************
#
#*******************
# Running parameters
#*******************
#
#*********************************************************************
# Tag name for the run (one word) *
#*********************************************************************
  tag_1 = run_tag ! name of the run
#*********************************************************************
# Number of events and rnd seed *
# Warning: Do not generate more than 1M events in a single run *
# If you want to run Pythia, avoid more than 50k events in a run. *
#*********************************************************************
  1000000 = nevents ! Number of unweighted events requested
  0 = iseed ! rnd seed (0=assigned automatically=default))
#*********************************************************************
# Collider type and energy *
# lpp: 0=No PDF, 1=proton, -1=antiproton, 2=photon from proton, *
# 3=photon from electron *
#*********************************************************************
  1 = lpp1 ! beam 1 type
  1 = lpp2 ! beam 2 type
  6500.0 = ebeam1 ! beam 1 total energy in GeV
  6500.0 = ebeam2 ! beam 2 total energy in GeV
# To see polarised beam options: type "update beam_pol"
#*********************************************************************
# PDF CHOICE: this automatically fixes also alpha_s and its evol. *
#*********************************************************************
  nn23lo1 = pdlabel ! PDF set
  230000 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number
# To see heavy ion options: type "update ion_pdf"
#*********************************************************************
# Renormalization and factorization scales *
#*********************************************************************
  False = fixed_ren_scale ! if .true. use fixed ren scale
  False = fixed_fac_scale ! if .true. use fixed fac scale
  91.188 = scale ! fixed ren scale
  91.188 = dsqrt_q2fact1 ! fixed fact scale for pdf1
  91.188 = dsqrt_q2fact2 ! fixed fact scale for pdf2
  -1 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
  1.0 = scalefact ! scale factor for event-by-event scales
#*********************************************************************
# Type and output format
#*********************************************************************
  False = gridpack !True = setting up the grid pack
  -1.0 = time_of_flight ! threshold (in mm) below which the invariant livetime is not written (-1 means not written)
  3.0 = lhe_version ! Change the way clustering information pass to shower.
  True = clusinfo ! include clustering tag in output
  average = event_norm ! average/sum. Normalization of the weight in the LHEF

#*********************************************************************
# Matching parameter (MLM only)
#*********************************************************************
  0 = ickkw ! 0 no matching, 1 MLM
  1.0 = alpsfact ! scale factor for QCD emission vx
  False = chcluster ! cluster only according to channel diag
  4 = asrwgtflavor ! highest quark flavor for a_s reweight
  False = auto_ptj_mjj ! Automatic setting of ptj and mjj if xqcut >0
                                   ! (turn off for VBF and single top processes)
  0.0 = xqcut ! minimum kt jet measure between partons
#*********************************************************************
#
#*********************************************************************
# handling of the helicities:
# 0: sum over all helicities
# 1: importance sampling over helicities
#*********************************************************************
  0 = nhel ! using helicities importance sampling or not.
#*********************************************************************
# Generation bias, check the wiki page below for more information: *
# 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' *
#*********************************************************************
  None = bias_module ! Bias type of bias, [None, ptj_bias, -custom_folder-]
  {} = bias_parameters ! Specifies the parameters of the module.
#
#*******************************
# Parton level cuts definition *
#*******************************
#
#
#*********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
#*********************************************************************
  15.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
#*********************************************************************
# Apply pt/E/eta/dr/mij/kt_durham cuts on decay products or not
# (note that etmiss/ptll/ptheavy/ht/sorted cuts always apply)
#*********************************************************************
  False = cut_decays ! Cut decay products
#*********************************************************************
# Standard Cuts *
#*********************************************************************
# Minimum and maximum pt's (for max, -1 means no cut) *
#*********************************************************************
  20.0 = ptj ! minimum pt for the jets
  0.0 = ptb ! minimum pt for the b
  10.0 = pta ! minimum pt for the photons
  10.0 = ptl ! minimum pt for the charged leptons
  0.0 = misset ! minimum missing Et (sum of neutrino's momenta)
  -1.0 = ptjmax ! maximum pt for the jets
  -1.0 = ptbmax ! maximum pt for the b
  -1.0 = ptamax ! maximum pt for the photons
  -1.0 = ptlmax ! maximum pt for the charged leptons
  -1.0 = missetmax ! maximum missing Et (sum of neutrino's momenta)
  {} = pt_min_pdg ! pt cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = pt_max_pdg ! pt cut for other particles (syntax e.g. {6: 100, 25: 50})
#*********************************************************************
# Minimum and maximum E's (in the center of mass frame) *
#*********************************************************************
  0.0 = ej ! minimum E for the jets
  0.0 = eb ! minimum E for the b
  0.0 = ea ! minimum E for the photons
  0.0 = el ! minimum E for the charged leptons
  -1.0 = ejmax ! maximum E for the jets
  -1.0 = ebmax ! maximum E for the b
  -1.0 = eamax ! maximum E for the photons
  -1.0 = elmax ! maximum E for the charged leptons
  {} = e_min_pdg ! E cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = e_max_pdg ! E cut for other particles (syntax e.g. {6: 100, 25: 50})
#*********************************************************************
# Maximum and minimum absolute rapidity (for max, -1 means no cut) *
#*********************************************************************
  5.0 = etaj ! max rap for the jets
  -1.0 = etab ! max rap for the b
  2.5 = etaa ! max rap for the photons
  2.5 = etal ! max rap for the charged leptons
  0.0 = etajmin ! min rap for the jets
  0.0 = etabmin ! min rap for the b
  0.0 = etaamin ! min rap for the photons
  0.0 = etalmin ! main rap for the charged leptons
  {} = eta_min_pdg ! rap cut for other particles (use pdg code). Applied on particle and anti-particle
  {} = eta_max_pdg ! rap cut for other particles (syntax e.g. {6: 2.5, 23: 5})
#*********************************************************************
# Minimum and maximum DeltaR distance *
#*********************************************************************
  0.4 = drjj ! min distance between jets
  0.0 = drbb ! min distance between b's
  0.4 = drll ! min distance between leptons
  0.4 = draa ! min distance between gammas
  0.0 = drbj ! min distance between b and jet
  0.4 = draj ! min distance between gamma and jet
  0.4 = drjl ! min distance between jet and lepton
  0.0 = drab ! min distance between gamma and b
  0.0 = drbl ! min distance between b and lepton
  0.4 = dral ! min distance between gamma and lepton
  -1.0 = drjjmax ! max distance between jets
  -1.0 = drbbmax ! max distance between b's
  -1.0 = drllmax ! max distance between leptons
  -1.0 = draamax ! max distance between gammas
  -1.0 = drbjmax ! max distance between b and jet
  -1.0 = drajmax ! max distance between gamma and jet
  -1.0 = drjlmax ! max distance between jet and lepton
  -1.0 = drabmax ! max distance between gamma and b
  -1.0 = drblmax ! max distance between b and lepton
  -1.0 = dralmax ! maxdistance between gamma and lepton
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
# WARNING: for four lepton final state mmll cut require to have *
# different lepton masses for each flavor! *
#*********************************************************************
  0.0 = mmjj ! min invariant mass of a jet pair
  0.0 = mmbb ! min invariant mass of a b pair
  0.0 = mmaa ! min invariant mass of gamma gamma pair
  0.0 = mmll ! min invariant mass of l+l- (same flavour) lepton pair
  -1.0 = mmjjmax ! max invariant mass of a jet pair
  -1.0 = mmbbmax ! max invariant mass of a b pair
  -1.0 = mmaamax ! max invariant mass of gamma gamma pair
  -1.0 = mmllmax ! max invariant mass of l+l- (same flavour) lepton pair
  {} = mxx_min_pdg ! min invariant mass of a pair of particles X/X~ (e.g. {6:250})
  {'default': False} = mxx_only_part_antipart ! if True the invariant mass is applied only
                       ! to pairs of particle/antiparticle and not to pairs of the same pdg codes.
#*********************************************************************
# Minimum and maximum invariant mass for all letpons *
#*********************************************************************
  0.0 = mmnl ! min invariant mass for all letpons (l+- and vl)
  -1.0 = mmnlmax ! max invariant mass for all letpons (l+- and vl)
#*********************************************************************
# Minimum and maximum pt for 4-momenta sum of leptons *
#*********************************************************************
  0.0 = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
  -1.0 = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
  0.0 = ptheavy ! minimum pt for at least one heavy final state
  0.0 = xptj ! minimum pt for at least one jet
  0.0 = xptb ! minimum pt for at least one b
  0.0 = xpta ! minimum pt for at least one photon
  0.0 = xptl ! minimum pt for at least one charged lepton
#*********************************************************************
# Control the pt's of the jets sorted by pt *
#*********************************************************************
  0.0 = ptj1min ! minimum pt for the leading jet in pt
  0.0 = ptj2min ! minimum pt for the second jet in pt
  0.0 = ptj3min ! minimum pt for the third jet in pt
  0.0 = ptj4min ! minimum pt for the fourth jet in pt
  -1.0 = ptj1max ! maximum pt for the leading jet in pt
  -1.0 = ptj2max ! maximum pt for the second jet in pt
  -1.0 = ptj3max ! maximum pt for the third jet in pt
  -1.0 = ptj4max ! maximum pt for the fourth jet in pt
  0 = cutuse ! reject event if fails any (0) / all (1) jet pt cuts
#*********************************************************************
# Control the pt's of leptons sorted by pt *
#*********************************************************************
  0.0 = ptl1min ! minimum pt for the leading lepton in pt
  0.0 = ptl2min ! minimum pt for the second lepton in pt
  0.0 = ptl3min ! minimum pt for the third lepton in pt
  0.0 = ptl4min ! minimum pt for the fourth lepton in pt
  -1.0 = ptl1max ! maximum pt for the leading lepton in pt
  -1.0 = ptl2max ! maximum pt for the second lepton in pt
  -1.0 = ptl3max ! maximum pt for the third lepton in pt
  -1.0 = ptl4max ! maximum pt for the fourth lepton in pt
#*********************************************************************
# Control the Ht(k)=Sum of k leading jets *
#*********************************************************************
  0.0 = htjmin ! minimum jet HT=Sum(jet pt)
  -1.0 = htjmax ! maximum jet HT=Sum(jet pt)
  0.0 = ihtmin !inclusive Ht for all partons (including b)
  -1.0 = ihtmax !inclusive Ht for all partons (including b)
  0.0 = ht2min ! minimum Ht for the two leading jets
  0.0 = ht3min ! minimum Ht for the three leading jets
  0.0 = ht4min ! minimum Ht for the four leading jets
  -1.0 = ht2max ! maximum Ht for the two leading jets
  -1.0 = ht3max ! maximum Ht for the three leading jets
  -1.0 = ht4max ! maximum Ht for the four leading jets
#***********************************************************************
# Photon-isolation cuts, according to hep-ph/9801442 *
# When ptgmin=0, all the other parameters are ignored *
# When ptgmin>0, pta and draj are not going to be used *
#***********************************************************************
  0.0 = ptgmin ! Min photon transverse momentum
  0.4 = r0gamma ! Radius of isolation code
  1.0 = xn ! n parameter of eq.(3.4) in hep-ph/9801442
  1.0 = epsgamma ! epsilon_gamma parameter of eq.(3.4) in hep-ph/9801442
  True = isoem ! isolate photons from EM energy (photons and leptons)
#*********************************************************************
# WBF cuts *
#*********************************************************************
  0.0 = xetamin ! minimum rapidity for two jets in the WBF case
  0.0 = deltaeta ! minimum rapidity for two jets in the WBF case
#***********************************************************************
# Turn on either the ktdurham or ptlund cut to activate *
# CKKW(L) merging with Pythia8 [arXiv:1410.3012, arXiv:1109.4829] *
#***********************************************************************
  -1.0 = ktdurham
  0.4 = dparameter
  -1.0 = ptlund
  1, 2, 3, 4, 5, 6, 21 = pdgs_for_merging_cut ! PDGs for two cuts above
#*********************************************************************
# maximal pdg code for quark to be considered as a light jet *
# (otherwise b cuts are applied) *
#*********************************************************************
  4 = maxjetflavor ! Maximum jet pdg code
#*********************************************************************
#
#*********************************************************************
# Store info for systematics studies *
# WARNING: Do not use for interference type of computation *
#*********************************************************************
  True = use_syst ! Enable systematics studies
#
  systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule
# Syscalc is deprecated but to see the associate options type'update syscalc'#*********************************************************************
# Additional hidden parameters
#*********************************************************************
  ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments # Choose the argment to pass to the systematics command. like --mur=0.25,1,4. Look at the help of the systematics function for more details.

-------------------

We can also see the error "rm: cannot remove 'results.dat': No such file or directory". I don't know what happens. I supposed that's 10000 events are not enough to describe the small interval, so I tried "set nevents 1000000", and it unfortunately failed.

Can you offer some suggestion? Thank you!

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

Could you clarify what you mean by:
 1) "But I notice there's about 45% in the chosen interval, not all."?
      Do you mean that such value is not between -1 and 1?

2)"and now the events number with b4<-0.9 is 4542 while the total events number is 10000. And when I change "if(b4.gt.-0.9d0) then" to "if(b4.gt.0.0d0) then", the events number with b4<0 is 3865."

What do you mean here, that MG5aMC fails to generate the 10k events that you request or is it something else (like your cut is not correctly applied?)

Concerning this:

>I suppose that's because the histograms of random numbers in MC integral are not the exactly the same given by b4. (or other reasons, but I don't know) So I try to apply cuts before integral, which is not we often do in MC.

The cuts are always evaluated before the evaluation of the PS point.
The reason for this is that evaluating a matrix-element is typically quite slow and this is pointless to evaluate it if it fails the cut.
If you have issue with your cut, adding them in matrix.f will not help in any way. (You can only create issue if you do that)

> I suppose that's because the histograms of random numbers in MC integral are not the exactly the same given by b4.

Here it seems that you have events, that are written that you expect to not be written due to your cut.
That's technically possible if your cut are not compatible with some of the symmetry of the matrix-element that we use for the speed-up of the code (we discuss already the flavor which are not unique, we also have to take into account the symmetry over the initial state (corresponding to pz-> -pz for some of the events).

If you want to reduce the amount of optimisation performed by MG5aMC (in order to reduce such problem),
you can generate your code with "set group_subprocesses False". Note that it will likely affect the definition of some of the object that you are using right now (in particular the idup variable should have one less index in that case)

Cheers,

Olivier

Revision history for this message
Rui Zhang (ruirui) said :
#2

Thank you!

1. 1) and 2) are the same problem. At least I wrote them in order to describe the same problem. Let me try to explain again.

      I modified dummy_fct.f to generate the events of b4<-0.9, and I also use a c++ code to check if it's correct. I assume the code is correct because it is almost ok when I only modified matrix.f. If needed, I can send it to you, but it needs time because I should at least let you know where I write my file path. But only 45% of the events have b4<-0.9. And I also tried b4<0.

2. Do you mean that I should still use dummy_fct.f and the problem "rm: cannot remove 'results.dat': No such file or directory" is because the cut is not invariant under some operation? I just can't imagine some symmetry like parity or boost will cause such large difference. Now it seems using dummy_fct.f is not such good. Actually, I also have noticed that when I divide the phase space into several bins, the cross section decrease. i.e. I divide a 0.4 pb process into two bins, the cross section of each bin is 0.2 pb, but when I divide it into 20 bins, that of each bin may be 0.002 pb or less, which is too small. The distribution may be not flat but you can also see the magnitude.

3. I tried
--------------------
set group_subprocesses False
generate p p > t t~ h
output test
launch
0
0
exit
--------------------
Is that correct? I can see idup(*,*) as well as idup(*,*,*) in the codes. Which one should I use? Or just use idup(i,1,1)?

Revision history for this message
Rui Zhang (ruirui) said :
#3

Maybe I didn't use dummy_fct.f correctly? Both two method(1. the double loop 2. directly use the external particle number 3,4,5...) do not generate the correct events...

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

Hi,

Ok, so your issue is indeed that you observe events in your lhe file, that you expect should not be present due to your cut.
Now from the code that you wrote above, you are looking at the angle between the three-vector. (actually the cosine of that angle)
Now angles are not Lorentz invariant. So I do not expect the cut to do the job that you want.

For the pz -> -pz flipping, your variable seems indeed fine. So you should be able to do in your function dummy a boost of the top and anti-top momenta such that you can applied that cut in the lab-frame.

Now, applying tight cut (like your 20 bin) is changing the function of integration which can lead to un-efficiency of the phase-space integrator, if those un-efficiency are too big, this can also lead to bias. This might be what happens to your 20 bin case.

Cheers,

Olivier

Revision history for this message
Rui Zhang (ruirui) said :
#5

I don't understand that boost, do you mean that P is not the momentum in the lab-frame? There's also some parameters that are boost invariant. If needed, I can use them as example.

If the momenta are in the rest frame, I don't know which momentum I should choose to boost. So, I use the deltaphi of top and antitop in the rest frame of Higgs at following.

I modified dummy_fct.f to set this deltaphi <Pi/2. And 9555 events meet this cut, which is better and not perfect. Also, if I don't do the boost and directly use the delta phi of top and antitop, the cut is ok.

Now I can accept that
1. P is not the momentum in the lab frame, so before I changed P to zero and didn't see any momentum is zero in lhe file.
2. The cuts don't work perfectly as it will break some symmetry especially when I use other frame. So I need to use "set group_subprocesses False" if I want to add some special cuts.

But when I use "set group_subprocesses False", the events number pass cut is 9568, not 10000.

Did I use it correctly? I use it as
--------------------
set group_subprocesses False
generate g g > t t~ h
output test
launch
0
0
exit
--------------------
Also, "generate p p > t t~ h" do not help.

I'm also confused about what you said about idup. Which one should I use? Can you explain more?

Thanks, Olivier!

Revision history for this message
Rui Zhang (ruirui) said :
#6

I attach dummy_fct.f here just to claim what I do is correct...
--------------------
      subroutine BoostVector(P, R, Q)
      implicit none

      double precision P(0:3), R(0:3), Q(0:3), beta(0:3), gamma, X, Y
      integer i

      do i=0,3
          Q(i)=0
      end do
      X=0
      Y=0

      if (R(0).ne.0) then
          beta=R/R(0)
          Y=beta(1)**2+beta(2)**2+beta(3)**2
          gamma=1.d0/sqrt(1.d0-Y)
          X=beta(1)*P(1)+beta(2)*P(2)+beta(3)*P(3)
          if ((Y.gt.0).and.(Y.lt.1)) then
              Q(1)=P(1)+beta(1)*(X/Y*(gamma-1)+gamma*P(0))
              Q(2)=P(2)+beta(2)*(X/Y*(gamma-1)+gamma*P(0))
              Q(3)=P(3)+beta(3)*(X/Y*(gamma-1)+gamma*P(0))
              Q(0)=gamma*(P(0)+X)
          endif
      endif

      end

      double precision function Dot2D(P,Q)
      implicit none

      double precision P(0:3)
      double precision Q(0:3)
      Dot2D=P(1)*Q(1)+P(2)*Q(2)

      return
      end
      double precision function deltaphi(P,Q)
      implicit none

      double precision P(0:3)
      double precision Q(0:3)
      double precision Dot2D
      deltaphi=dacos(Dot2D(P,Q)/sqrt(Dot2D(P,P))/sqrt(Dot2D(Q,Q)))

      return
      end

      logical FUNCTION dummy_cuts(P)
C**************************************************************************
C INPUT:
C P(0:3,1) MOMENTUM OF INCOMING PARTON
C P(0:3,2) MOMENTUM OF INCOMING PARTON
C P(0:3,3) MOMENTUM OF ...
C ALL MOMENTA ARE IN THE REST FRAME!!
C COMMON/JETCUTS/ CUTS ON JETS
C OUTPUT:
C TRUE IF EVENTS PASSES ALL CUTS LISTED
C**************************************************************************
      IMPLICIT NONE
c
c Constants
c
      include 'genps.inc'
      include 'nexternal.inc'
C
C ARGUMENTS
C
      REAL*8 P(0:3,nexternal)
C
C PARAMETERS
C
      real*8 PI
      parameter( PI = 3.14159265358979323846d0 )
      double precision topp(0:3)
      double precision topm(0:3)
      double precision boosttopp(0:3)
      double precision boosttopm(0:3)
      double precision higgs(0:3)
      double precision testpara
      double precision deltaphi
      include 'maxamps.inc'
      integer idup(nexternal,maxproc,maxsproc)
      integer mothup(2,nexternal)
      integer icolup(2,nexternal,maxflow,maxsproc)
      include 'leshouche.inc'
      integer iproc,i
c
c particle identification
c
      LOGICAL IS_A_J(NEXTERNAL),IS_A_L(NEXTERNAL)
      LOGICAL IS_A_B(NEXTERNAL),IS_A_A(NEXTERNAL),IS_A_ONIUM(NEXTERNAL)
      LOGICAL IS_A_NU(NEXTERNAL),IS_HEAVY(NEXTERNAL)
      logical do_cuts(nexternal)
      COMMON /TO_SPECISA/IS_A_J,IS_A_A,IS_A_L,IS_A_B,IS_A_NU,IS_HEAVY,
     . IS_A_ONIUM, do_cuts

      dummy_cuts=.true.
      topp(0:3)=p(0:3,3)
      topm(0:3)=p(0:3,4)
      higgs(0:3)=p(0:3,5)
      higgs(1:3)=-higgs(1:3)
      Call BoostVector(topp,higgs,boosttopp)
      Call BoostVector(topm,higgs,boosttopm)
      testpara=deltaphi(boosttopp,boosttopm)
      if(testpara.lt.0.or.testpara.gt.Pi*0.5d0) then
          dummy_cuts=.false.
      endif

      return
      end

      subroutine get_dummy_x1(sjac, X1, R, pbeam1, pbeam2, stot, shat)
      implicit none
      include 'maxparticles.inc'
      include 'run.inc'
c include 'genps.inc'
      double precision sjac ! jacobian. should be updated not reinit
      double precision X1 ! bjorken X. output
      double precision R ! random value after grid transfrormation. between 0 and 1
      double precision pbeam1(0:3) ! momentum of the first beam (input and/or output)
      double precision pbeam2(0:3) ! momentum of the second beam (input and/or output)
      double precision stot ! total energy (input and /or output)
      double precision shat ! output

c global variable to set (or not)
      double precision cm_rap
      logical set_cm_rap
      common/to_cm_rap/set_cm_rap,cm_rap

      set_cm_rap=.false. ! then cm_rap will be set as .5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
                         ! ebeam(1) and ebeam(2) are defined here thanks to 'run.inc'
      shat = x1*ebeam(1)*ebeam(2)
      return
      end

      subroutine get_dummy_x1_x2(sjac, X, R, pbeam1, pbeam2, stot,shat)
      implicit none
      include 'maxparticles.inc'
      include 'run.inc'
c include 'genps.inc'
      double precision sjac ! jacobian. should be updated not reinit
      double precision X(2) ! bjorken X. output
      double precision R(2) ! random value after grid transfrormation. between 0 and 1
      double precision pbeam1(0:3) ! momentum of the first beam
      double precision pbeam2(0:3) ! momentum of the second beam
      double precision stot ! total energy
      double precision shat ! output

c global variable to set (or not)
      double precision cm_rap
      logical set_cm_rap
      common/to_cm_rap/set_cm_rap,cm_rap

      set_cm_rap=.false. ! then cm_rap will be set as .5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
                         ! ebeam(1) and ebeam(2) are defined here thanks to 'run.inc'
      shat = x(1)*x(2)*ebeam(1)*ebeam(2)
      return
      end

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

I don't understand that boost, do you mean that P is not the momentum in
the lab-frame? There's also some parameters that are boost invariant. If
needed, I can use them as example.

P is not in the lab-frame.

I'm also confused about what you said about idup. Which one should I
use? Can you explain more?

I was just worried that the code would have change the definition of the idup variable between the two modes. But looks like it is not the case. So you can forget that comment.

Cheers,

Olivier

If the momenta are in the rest frame, I don't know which momentum I
should choose to boost. So, I use the deltaphi of top and antitop in the
rest frame of Higgs at following.

I modified dummy_fct.f to set this deltaphi <Pi/2. And 9555 events meet
this cut, which is better and not perfect. Also, if I don't do the boost
and directly use the delta phi of top and antitop, the cut is ok.

Now I can accept that
1. P is not the momentum in the lab frame, so before I changed P to zero and didn't see any momentum is zero in lhe file.
2. The cuts don't work perfectly as it will break some symmetry especially when I use other frame. So I need to use "set group_subprocesses False" if I want to add some special cuts.

But when I use "set group_subprocesses False", the events number pass
cut is 9568, not 10000.

Did I use it correctly? I use it as
--------------------
set group_subprocesses False
generate g g > t t~ h
output test
launch
0
0
exit
--------------------
Also, "generate p p > t t~ h" do not help.

I'm also confused about what you said about idup. Which one should I
use? Can you explain more?

Thanks, Olivier!

Can you help with this problem?

Provide an answer of your own, or ask Rui Zhang for more information if necessary.

To post a message you must log in.