~maddevelopers/mg5amcnlo/FKS_EW_granny

« back to all changes in this revision

Viewing changes to Template/NLO/Utilities/select_events.f

  • Committer: Marco Zaro
  • Date: 2018-04-16 14:08:47 UTC
  • mfrom: (78.403.58 2.6.2)
  • Revision ID: marco.zaro@gmail.com-20180416140847-nuz7haj3di3gqqhq
merged with 2.6.2 rev 332

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
      write(*,*)'     3 to keep a subset of events'
41
41
      read(*,*)itype
42
42
      if(itype.lt.3)then
43
 
         write(*,*)'Type the Born multiplicity.'
 
43
         write(*,*)'Enter the Born multiplicity, counting only initial-'
 
44
         write(*,*)'   and final-state particles (no resonances).'
44
45
         write(*,*)'If the line after each event starts'
45
 
         write(*,*)'with a hash, ''#'', this is not used'
 
46
         write(*,*)'with a hash, ''#'', this entry is ignored'
46
47
         read(*,*)nBorn
47
48
      endif
48
49
 
82
83
         write(*,*)'Invalid itype',itype
83
84
         stop
84
85
      endif
85
 
 
86
 
c first round to establish ievts_ok
 
86
c
 
87
c first round to establish ievts_ok (number of accepted events)
 
88
c
87
89
      ifile=34
88
90
      extra=.false.
89
91
      open(unit=ifile,file=event_file,status='unknown')
114
116
     &           wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax
115
117
               if(itype.eq.iSorH_lhe)ievts_ok=ievts_ok+1
116
118
            else
117
 
               if(itype.eq.1+nup-nBorn)ievts_ok=ievts_ok+1
118
 
c Comment the following if-statement if the file has more than two
119
 
c multiplicities (for example when intermediate resonances are not
120
 
c written in all the events)
121
 
               if(nup-nBorn.ne.0.and.nup-nBorn.ne.1)then
 
119
               npart=0
 
120
               do k=1,nup
 
121
                  if(abs(ISTUP(k)).eq.1)npart=npart+1
 
122
               enddo
 
123
               if(npart-nBorn.ne.0.and.npart-nBorn.ne.1)then
122
124
                  write(*,*)'The Born multiplicity seems incorrect:'
123
 
                  write(*,*)'cannot extract S/H events from this file'
 
125
                  write(*,*)'cannot extract S/H events from this file.'
 
126
                  write(*,*)'  Event #',i,pup(4,1),pup(4,2)
 
127
                  write(*,*)npart,nup,nborn
124
128
                  stop
125
129
               endif
 
130
               if(itype.eq.(1+npart-nBorn))ievts_ok=ievts_ok+1
126
131
            endif
127
132
            i=i+1
128
133
         enddo
132
137
      close(34)
133
138
      if(ievts_ok.eq.0)then
134
139
         write(*,*)' '
135
 
         write(*,*)'No events of desired type found in file !'
 
140
         write(*,*)'No events of desired type found in file'
136
141
         write(*,*)' '
137
142
         stop
138
143
      endif
139
 
 
 
144
c
140
145
c second round to write file
 
146
c
141
147
      ifile=34
142
148
      ofile=35
143
149
      open(unit=ifile,file=event_file,status='old')
179
185
         enddo
180
186
         call phspncheck_nocms2(i,npart,xmass,xmom)
181
187
         if( (itype.le.2.and.extra.and.itype.eq.iSorH_lhe).or.
182
 
     &       (itype.eq.1.and..not.extra.and.nup.eq.nBorn).or.
183
 
     &       (itype.eq.2.and..not.extra.and.nup.eq.nBorn+1).or.
 
188
     &       (itype.eq.1.and..not.extra.and.npart.eq.nBorn).or.
 
189
     &       (itype.eq.2.and..not.extra.and.npart.eq.nBorn+1).or.
184
190
     &       (itype.eq.3.and.i.ge.nevmin) )then
 
191
            ievts_ok=ievts_ok+1
185
192
            call write_lhef_event(ofile,
186
193
     &           NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
187
194
     &           IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)
204
211
      write(ofile,*)'</LesHouchesEvents>'
205
212
      if(itype.eq.3)write(*,*)'The sum of the weights is:',sum_wgt
206
213
 
 
214
      write(*,*)'  '
 
215
      write(*,*)'Number of events kept:',ievts_ok
 
216
 
207
217
      close(34)
208
218
      close(35)
209
219