3
c Example program for mcfio. Simple case for Ntuple
7
integer ostr_all, ostr_sel, istr_old
10
integer numblocks, blkids(3)
13
PARAMETER (NUMTRIES = 50)
18
c Initialization phase.
21
c filename = '/home/focus/scr1/pltmp/mcfio_mcfio/testN1_l.dat'
22
filename = 'testN1_l.dat'
23
title = ' First Simple test '
25
ostr_all = mcfio_OpenWriteDirect(filename, title, %val(0),
26
& NUMTRIES, blkids, 0)
27
if (ostr_all .eq. -1) then
28
print *, ' Can t open output file, give up '
31
blkids(1) = mcfio_DeclareNtuple(22, 'Global Super_22', 'Top',
32
& ostr_all, 'glob22.db')
34
blkids(2) = mcfio_DeclareNtuple(23, 'Global Super_23', 'Top',
35
& ostr_all, 'glo23.db')
37
blkids(3) = mcfio_DeclareNtuple(1,
38
& 'Global Super_Charm', 'Charming',
39
& ostr_all, 'glob22.db')
40
if (mcfio_EndDeclNTuples(ostr_all) .ne. 3) then
41
print *, 'Problem with stream initialisation '
45
c Set the version token. We must do this..
47
glob_c.version = '1.10'
48
version_glo23 = '1.00'
50
call mcfio_SetEventInfo(ostr_all, MCFIO_RUNNUMBER, ivalue)
53
if (mcfio_NTuple(ostr_all,blkids(1), glob_c.version)
55
print *, 'Problem with Encoding glob22 '
59
if (mcfio_NTuple(ostr_all,blkids(2), version_glo23)
61
print *, 'Problem with Encoding glo23 '
64
if (mcfio_NextEvent(ostr_all) .eq. -1) then
65
print *,' Error writing next event, Stop '
68
print *,' Written evt number ',i
70
call mcfio_close(ostr_all)
73
subroutine fill_glob22(ievt)
76
c Dummy fill for now..
81
glob_c.eventnumber(1) = mod(ievt,64)
83
glob_c.Missinget = 578.9 - ievt*1.
84
glob_c.something = 123.5 +ievt*7.
85
glob_c.nglob = mod(ievt, 10)
86
if (ievt .eq. 1) glob_c.nglob = 12
87
if (glob_c.nglob .eq. 0) return
89
glob_c.glob_var(i).missingEtphi = 'Not too much '
91
& glob_c.glob_var(i).missingEtphi = 'Quite a bit'
93
glob_c.glob_var(i).v6_new(j) = j + mod(ievt,2)
97
glob_c.glob_var(i).v5_new(k,j) = 0.0
100
glob_c.glob_var(i).v7_now2 = ievt*10 + i
101
glob_c.glob_var(i).missingetnomuon = ievt*100. + i*10.
102
glob_c.glob_var(i).v7_now = ievt/10. + i
103
glob_c.glob_var(i).v7_now_last = i*1.d0
108
subroutine fill_glo23(ievt)
111
c Dummy fill for now..
115
integer ievt, i,j,k,iseed
126
ngl23 = ifix(ngl23_max*rand()/10.)
128
ngl23 = ifix(ngl23_max*ran(iseed)/10.)
132
triggerbit1(1) = .false.
133
triggerbit1(2) = .false.
145
Amtrack(j,k,i) = 1.0 *(j + k + i)
155
missingetnomuon(i) = 0.