~alifson/chiralityflow/trunk

« back to all changes in this revision

Viewing changes to vendor/StdHEP/mcfio/example/t3.F

  • Committer: andrew.lifson at lu
  • Date: 2021-09-01 15:34:39 UTC
  • Revision ID: andrew.lifson@thep.lu.se-20210901153439-7fasjhav4cp4m88r
testing a new repository of a madgraph folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
        program t3
 
2
c
 
3
c       Example program for mcfio. Simple case. Read the file produced by t1
 
4
c
 
5
        implicit none
 
6
#include "mcfio.inc"
 
7
        integer ostr_all, ostr_sel, istr_old, nopen, istr(10), length
 
8
        integer inum, iblki(5)
 
9
        integer numblocks, blkids(3)
 
10
        integer i, irun, ievt, istore, itrig
 
11
        integer NUMTRIES
 
12
        PARAMETER (NUMTRIES = 50)
 
13
        integer xdr_stdhep_multi
 
14
        external xdr_stdhep_multi
 
15
        
 
16
c
 
17
c       Initialization phase.
 
18
c
 
19
        call mcfio_Init
 
20
        istr_old = mcfio_OpenReadDirect('test1.dat')
 
21
        
 
22
        irun = 0
 
23
        istore = 0
 
24
        ievt = 0
 
25
        itrig = 255
 
26
        if (
 
27
     &    mcfio_SpecificEvent(istr_old, ievt, istore, irun, itrig)
 
28
     &      .eq. -1) then 
 
29
          print *, ' Magic event not found, stop '
 
30
          stop
 
31
        end if
 
32
        call mcfio_InfoEventInt(istr_old, MCFIO_EVENTNUMBER, inum)
 
33
        print *, ' Event number for magic trigger ', inum
 
34
        if (mcfio_block(istr_old, MCFIO_STDHEPM, xdr_stdhep_multi)
 
35
     &        .eq. -1) then 
 
36
             print *, ' Error reading STDHEP block '
 
37
             STOP
 
38
          end if
 
39
        call study_stdhep
 
40
        itrig = 0 
 
41
        istore = 3
 
42
        if (
 
43
     &    mcfio_NextSpecificEvent(istr_old, ievt, istore, irun, itrig)
 
44
     &      .eq. -1) then 
 
45
          print *, ' First event of magic spill not found, stop '
 
46
          stop
 
47
        end if
 
48
        call mcfio_InfoEventInt(istr_old, MCFIO_EVENTNUMBER, inum)
 
49
        print *, ' Event number for 1st evt from magic spill', inum
 
50
c
 
51
        call mcfio_Close(istr_old)
 
52
        stop
 
53
        end
 
54
        subroutine study_stdhep
 
55
        implicit none
 
56
        integer i, io, nn
 
57
#include "stdhep.inc"
 
58
        
 
59
        print  *, ' Number of tracks ', nhep
 
60
        nn = nhep
 
61
        if (nn .gt. 3 ) nn = 3
 
62
        do i = 1, nn
 
63
         print *, ' Pz, Py, Pz, ', (phep(io,i), io = 1,3)
 
64
         print *, '   Mass ', phep(5,i)
 
65
         print *, ' Y position, Z position ', vhep(2,i), vhep(3,i)
 
66
        end do
 
67
        return
 
68
        end