~maddevelopers/mg5amcnlo/2.9.4

« back to all changes in this revision

Viewing changes to vendor/StdHEP/example/readPythia.F

pass to v2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      program readPythia
 
2
C
 
3
C      read in events and histogram contents
 
4
C
 
5
#include "stdlun.inc"
 
6
#include "stdcm1.inc"
 
7
 
 
8
      integer lok,ifl,istr,ntries,i
 
9
      character*20 filrd
 
10
 
 
11
      data filrd/'pythiaExample.io'/
 
12
 
 
13
C initialize HEP logical units
 
14
      lnhwrt=0
 
15
      lnhrd=23
 
16
      lnhdcy=0
 
17
      lnhout=22
 
18
      lnhpdf=0
 
19
      lnhdmp=0
 
20
      open(unit=lnhout,file='readPythia.lpt',status='new')
 
21
      call tstbkem(20)
 
22
C...initialize MCFio once only
 
23
      call mcfio_init()
 
24
C...now open and read events
 
25
      call stdxropen(filrd,ntries,istr,lok)
 
26
      if(lok.ne.0) write(lnhout,1001) filrd
 
27
      if(lok.ne.0) go to 200
 
28
      write(lnhout,1002) filrd
 
29
      lok = 0
 
30
      do while( lok .eq. 0 ) 
 
31
          call stdxrd(ifl,istr,lok)
 
32
          if(lok.eq.0)then
 
33
C... keep looping if this is not a STDHEP record
 
34
              if(ifl.eq.1) call tstflem(20)
 
35
              if(ifl.eq.100) write(lnhout,1003) filrd, generatorname
 
36
          endif
 
37
      enddo
 
38
      call stdxend(istr)
 
39
 200  continue
 
40
C...print histograms
 
41
      call houtpu(lnhout)
 
42
      call histdo
 
43
1001  format(' could not open file ',a20)
 
44
1002  format(' file ',a20,' has been opened')
 
45
1003  format(/' file ',a20,' was generated by ',a20)
 
46
      end
 
47