~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/NLO/SubProcesses/driver_mintFO.f

  • Committer: olivier Mattelaer
  • Date: 2015-03-05 00:14:16 UTC
  • mfrom: (258.1.9 2.3)
  • mto: (258.8.1 2.3)
  • mto: This revision was merged to the branch mainline in revision 259.
  • Revision ID: olivier.mattelaer@uclouvain.be-20150305001416-y9mzeykfzwnl9t0j
partial merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
      common/to_unwgt/twgt, maxwgt, swgt, lun, nw
43
43
 
44
44
c Vegas stuff
45
 
      integer ipole
46
 
      common/tosigint/ndim,ipole
 
45
      common/tosigint/ndim
47
46
 
48
47
      real*8 sigint
49
48
      external sigint
54
53
      logical            flat_grid
55
54
      common/to_readgrid/flat_grid                !Tells if grid read from file
56
55
 
57
 
      external initplot
58
 
 
59
 
 
60
 
c For tests
61
 
      real*8 fksmaxwgt,xisave,ysave
62
 
      common/cfksmaxwgt/fksmaxwgt,xisave,ysave
63
 
 
64
 
      integer itotalpoints
65
 
      common/ctotalpoints/itotalpoints
66
 
 
67
56
      integer i_momcmp_count
68
57
      double precision xratmax
69
58
      common/ccheckcnt/i_momcmp_count,xratmax
70
59
 
71
 
c For tests of virtuals
72
 
      integer ivirtpoints,ivirtpointsExcept
73
 
      double precision  virtmax,virtmin,virtsum
74
 
      common/cvirt3test/virtmax,virtmin,virtsum,ivirtpoints,
75
 
     &     ivirtpointsExcept
76
 
      double precision total_wgt_sum,total_wgt_sum_max,
77
 
     &                 total_wgt_sum_min
78
 
      common/csum_of_wgts/total_wgt_sum,total_wgt_sum_max,
79
 
     &                 total_wgt_sum_min
80
 
 
81
60
      integer n_mp, n_disc
82
61
c For MINT:
83
62
      include "mint.inc"
126
105
      integer iappl
127
106
      common /for_applgrid/ iappl
128
107
 
 
108
      logical              fixed_order,nlo_ps
 
109
      common /c_fnlo_nlops/fixed_order,nlo_ps
 
110
 
 
111
 
129
112
C-----
130
113
C  BEGIN CODE
131
114
C-----  
133
116
c     Setup the timing variable
134
117
c
135
118
      call cpu_time(tBefore)
 
119
      fixed_order=.true.
 
120
      nlo_ps=.false.
136
121
 
137
122
c     Read general MadFKS parameters
138
123
c
209
194
         call find_iproc_map
210
195
         write(6,*) "   ... done."
211
196
      endif
212
 
 
213
 
      itotalpoints=0
214
 
      ivirtpoints=0
215
 
      ivirtpointsExcept=0
216
 
      total_wgt_sum=0d0
217
 
      total_wgt_sum_max=0d0
218
 
      total_wgt_sum_min=0d0
219
197
      i_momcmp_count=0
220
198
      xratmax=0.d0
221
199
      unwgt=.false.
295
273
         stop
296
274
      endif
297
275
 
298
 
      write (*,*) ''
299
 
      write (*,*) '----------------------------------------------------'
300
 
      if (irestart.eq.1 .or. irestart.eq.3) then
301
 
         write (*,*) 'Total points tried:                   ',
302
 
     &        ncall*itmax
303
 
         write (*,*) 'Total points passing generation cuts: ',
304
 
     &        itotalpoints
305
 
         write (*,*) 'Efficiency of events passing cuts:    ',
306
 
     &        dble(itotalpoints)/dble(ncall*itmax)
307
 
      else
308
 
         write (*,*)
309
 
     &       'Run has been restarted, next line is only for current run'
310
 
         write (*,*) 'Total points passing cuts: ',itotalpoints
311
 
      endif
312
 
      write (*,*) '----------------------------------------------------'
313
 
      write (*,*) ''
314
 
      write (*,*) ''
315
 
      write (*,*) '----------------------------------------------------'
316
 
 
317
276
      if (ntot.ne.0) then
318
277
         write(*,*) "Satistics from MadLoop:"
319
278
         write(*,*)
348
307
      call cpu_time(tAfter)
349
308
      tTot = tAfter-tBefore
350
309
      tOther = tTot - (tBorn+tGenPS+tReal+tCount+tIS+tFxFx+tf_nb+tf_all
351
 
     &     +t_as+tr_s+tr_pdf+t_plot+t_cuts)
 
310
     &     +t_as+tr_s+tr_pdf+t_plot+t_cuts+t_MC_subt+t_isum+t_p_unw
 
311
     $     +t_write)
352
312
      write(*,*) 'Time spent in Born : ',tBorn
353
313
      write(*,*) 'Time spent in PS_Generation : ',tGenPS
354
314
      write(*,*) 'Time spent in Reals_evaluation: ',tReal
 
315
      write(*,*) 'Time spent in MCsubtraction : ',t_MC_subt
355
316
      write(*,*) 'Time spent in Counter_terms : ',tCount
356
317
      write(*,*) 'Time spent in Integrated_CT : ',tIS-tOLP
357
318
      write(*,*) 'Time spent in Virtuals : ',tOLP      
363
324
      write(*,*) 'Time spent in Reweight_pdf : ',tr_pdf
364
325
      write(*,*) 'Time spent in Filling_plots : ',t_plot
365
326
      write(*,*) 'Time spent in Applying_cuts : ',t_cuts
 
327
      write(*,*) 'Time spent in Sum_ident_contr : ',t_isum
 
328
      write(*,*) 'Time spent in Pick_unwgt : ',t_p_unw
 
329
      write(*,*) 'Time spent in Write_events : ',t_write
366
330
      write(*,*) 'Time spent in Other_tasks : ',tOther
367
331
      write(*,*) 'Time spent in Total : ',tTot
368
332
 
395
359
      data tr_s/0.0/
396
360
      data tr_pdf/0.0/
397
361
      data t_plot/0.0/
 
362
      data t_cuts/0.0/
 
363
      data t_MC_subt/0.0/
 
364
      data t_isum/0.0/
 
365
      data t_p_unw/0.0/
 
366
      data t_write/0.0/
398
367
      end
399
368
 
400
369
 
413
382
      parameter (izero=0,ione=1,itwo=2,mohdr=-100)
414
383
      logical passcuts,passcuts_nbody,passcuts_n1body,sum
415
384
      external passcuts
416
 
      parameter (sum=.false.)
417
 
      integer         ndim,ipole
418
 
      common/tosigint/ndim,ipole
 
385
      data sum /.false./
 
386
      integer         ndim
 
387
      common/tosigint/ndim
419
388
      logical       nbody
420
389
      common/cnbody/nbody
421
390
      integer           iconfig
439
408
         write (*,*) 'ERROR ifl not equal to zero in sigint',ifl
440
409
         stop 1
441
410
      endif
 
411
      if (iappl.ne.0 .and. sum) then
 
412
         write (*,*) 'WARNING: applgrid only possible '/
 
413
     &        /'with MC over FKS directories',iappl,sum
 
414
         write (*,*) 'Switching to MC over FKS directories'
 
415
         sum=.false.
 
416
      endif
442
417
      sigint=0d0
443
418
      icontr=0
444
419
      virt_wgt_mint=0d0
445
420
      born_wgt_mint=0d0
446
421
      virtual_over_born=0d0
447
 
      if (ickkw.eq.3) call set_FxFx_scale(-1,p)
 
422
      if (ickkw.eq.3) call set_FxFx_scale(0,p)
448
423
      call update_vegas_x(xx,x)
449
424
      call get_MC_integer(1,fks_configs,nFKS_picked,vol)
450
425
 
461
436
      call set_cms_stuff(izero)
462
437
      passcuts_nbody=passcuts(p1_cnt(0,1,0),rwgt)
463
438
      if (passcuts_nbody) then
464
 
         if (ickkw.eq.3) call set_FxFx_scale(izero,p1_cnt(0,1,0))
 
439
         if (ickkw.eq.3) call set_FxFx_scale(1,p1_cnt(0,1,0))
465
440
         call set_alphaS(p1_cnt(0,1,0))
466
441
         if (abrv(1:2).ne.'vi') then
467
442
            call compute_born
496
471
         passcuts_n1body=passcuts(p,rwgt)
497
472
         if (passcuts_nbody .and. abrv.ne.'real') then
498
473
            call set_cms_stuff(izero)
499
 
            if (ickkw.eq.3) call set_FxFx_scale(izero,p1_cnt(0,1,0))
 
474
            if (ickkw.eq.3) call set_FxFx_scale(2,p1_cnt(0,1,0))
500
475
            call set_alphaS(p1_cnt(0,1,0))
501
 
            call compute_soft_counter_term
 
476
            call compute_soft_counter_term(0d0)
502
477
            call set_cms_stuff(ione)
503
 
            call compute_collinear_counter_term
 
478
            call compute_collinear_counter_term(0d0)
504
479
            call set_cms_stuff(itwo)
505
 
            call compute_soft_collinear_counter_term
 
480
            call compute_soft_collinear_counter_term(0d0)
506
481
         endif
507
482
         if (passcuts_n1body) then
508
483
            call set_cms_stuff(mohdr)
509
 
            if (ickkw.eq.3) call set_FxFx_scale(mohdr,p)
 
484
            if (ickkw.eq.3) call set_FxFx_scale(3,p)
510
485
            call set_alphaS(p)
511
 
            call compute_real_emission(p)
 
486
            call compute_real_emission(p,1d0)
512
487
         endif
513
488
      enddo
514
489
      
520
495
         if (do_rwgt_pdf) call reweight_pdf
521
496
      endif
522
497
      
523
 
      if (iappl.ne.0) then
524
 
         if (sum) then
525
 
            write (*,*) 'ERROR: applgrid only possible '/
526
 
     &           /'with MC over FKS directories',iappl,sum
527
 
            stop 1
528
 
         endif
529
 
         call fill_applgrid_weights(vegas_wgt)
530
 
      endif
 
498
      if (iappl.ne.0) call fill_applgrid_weights(vegas_wgt)
531
499
 
532
500
c Importance sampling for FKS configurations
533
501
      if (sum) then
612
580
      integer i
613
581
      double precision xx(ndimmax),x(99),ran2
614
582
      external ran2
615
 
      integer ndim,ipole
616
 
      common/tosigint/ndim,ipole
 
583
      integer ndim
 
584
      common/tosigint/ndim
617
585
      character*4 abrv
618
586
      common /to_abrv/ abrv
619
587
      do i=1,99
677
645
      logical nbody
678
646
      common/cnbody/nbody
679
647
 
680
 
      integer nvtozero
681
 
      logical doVirtTest
682
 
      common/cvirt2test/nvtozero,doVirtTest
683
648
c
684
649
c To convert diagram number to configuration
685
650
c
711
676
c-----
712
677
c  Begin Code
713
678
c-----
714
 
      doVirtTest=.true.
715
679
      mint=.true.
716
680
      unwgt=.false.
717
681
      write(*,'(a)') 'Enter number of events and iterations: '
806
770
      else
807
771
        write (*,*) "Normal integration (Sfunction != 1)"
808
772
      endif
809
 
 
810
 
      doVirtTest=doVirtTest.and.abrv(1:2).eq.'vi'
811
773
c
812
774
c
813
775
c     Here I want to set up with B.W. we map and which we don't