~maddevelopers/mg5amcnlo/aMCatNLO

« back to all changes in this revision

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

  • Committer: Valentin Hirschi
  • Date: 2012-12-18 09:10:58 UTC
  • mfrom: (550.1.11 aMCatNLO)
  • Revision ID: spooner@pb-d-128-141-163-97.cern.ch-20121218091058-x950ogffu0odfard
1. Merged with latest revision of launchpad and made the MadLoop command 
   test safer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
     #     '  -->'
26
26
      write(ifile,'(a)')
27
27
     #     '  <header>'
28
 
      write(ifile,250)nevents
 
28
      write(ifile,250) nevents
29
29
      write(ifile,'(a)')
30
30
     #     '  </header>'
31
31
 250  format(1x,i8)
77
77
      character*72 buffer,buffer2
78
78
c
79
79
      write(ifile,'(a)') '<LesHouchesEvents version="1.0">'
80
 
      write(ifile,'(a)') '  <!--'
81
 
      write(ifile,'(a)') MonteCarlo
82
 
      write(ifile,'(a)') '  -->'
83
80
      write(ifile,'(a)') '  <header>'
84
 
      write(ifile,250) nevents
85
81
      write(ifile,'(a)') '  <MG5ProcCard>'
86
82
      open (unit=92,file=path(1:index(path," ")-1)//'proc_card_mg5.dat'
87
83
     &     ,err=99)
100
96
      enddo
101
97
 88   close(92)
102
98
      write(ifile,'(a)') '  </slha>'
103
 
      write(ifile,'(a)') '  <MG5RunCard>'
 
99
      write(ifile,'(a)') '  <MGRunCard>'
104
100
      open (unit=92,file=path(1:index(path," ")-1)//'run_card.dat'
105
101
     &     ,err=97)
106
102
      do
121
117
 95      write(ifile,'(a)') buffer
122
118
      enddo
123
119
 87   close(92)
124
 
      write(ifile,'(a)') '  </MG5RunCard>'
 
120
      write(ifile,'(a)') '  </MGRunCard>'
125
121
      write(ifile,'(a)') '  <MonteCarloMasses>'
126
122
      call fill_MC_mshell_wrap(MonteCarlo,mcmass)
127
123
      do i=1,5
129
125
      enddo
130
126
      write (ifile,'(2x,i6,3x,e12.6)')21,mcmass(21)
131
127
      write(ifile,'(a)') '  </MonteCarloMasses>'
132
 
      write(ifile,250) nevents
133
128
      write(ifile,'(a)') '  </header>'
134
129
 250  format(1x,i8)
135
130
      return
154
149
      integer ifile,nevents
155
150
      character*10 MonteCarlo
156
151
      character*80 string,string0
 
152
      nevents = -1
 
153
      MonteCarlo = ''
157
154
c
158
155
      string='  '
159
156
      dowhile(string.ne.'  -->')
160
157
        string0=string
 
158
        if (index(string,'</header>').ne.0) return
161
159
        read(ifile,'(a)')string
162
160
      enddo
163
161
c Works only if the name of the MC is the last line of the comments
164
162
      MonteCarlo=string0(1:10)
165
163
c Here we are at the end of (user-defined) comments. Now go to end
166
164
c of headers
167
 
      dowhile(string.ne.'  </header>')
 
165
      dowhile(index(string,'</header>').eq.0)
168
166
        string0=string
169
167
        read(ifile,'(a)')string
170
168
      enddo
171
 
      read(string0,250)nevents
 
169
c if the file is a partial file the header is non-standard   
 
170
      if (MonteCarlo .ne. '') read(string0,250) nevents
172
171
 250  format(1x,i8)
173
172
      return
174
173
      end