~maddevelopers/mg5amcnlo/FO_madspin_fixed

« back to all changes in this revision

Viewing changes to MadSpin/interface_madspin.py

  • Committer: olivier-mattelaer
  • Date: 2018-11-09 08:51:47 UTC
  • mfrom: (78.407.36 2.6.4)
  • Revision ID: olivier-mattelaer-20181109085147-2ejradawdrp5xwk5
last merge with 2.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1008
1008
                    cumul = 0
1009
1009
                    for j,events in evt_decayfile[particle.pdg].items():
1010
1010
                        cumul += events.cross
1011
 
                        if r < cumul:
 
1011
                        if r <= cumul:
1012
1012
                            decay_file = events
1013
1013
                            decay_file_nb = j
1014
 
                        else:
1015
1014
                            break
 
1015
                    else:
 
1016
                        # security for numerical accuracy issue... (unlikely but better safe)
 
1017
                        if (cumul-tot)/tot < 1e-5:
 
1018
                            decay_file = events
 
1019
                            decay_file_nb = j
 
1020
                        else:
 
1021
                            misc.sprint(j,cumul, events.cross, tot, (tot-cumul)/tot)
 
1022
                            raise Exception
1016
1023
                
1017
1024
                if self.options['new_wgt'] == 'BR':
1018
1025
                    tot_width = float(self.banner.get('param', 'decay', abs(pdg)).value)