forked from alisw/POWHEG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lhef_analysis.f
75 lines (70 loc) · 1.81 KB
/
lhef_analysis.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
program leshouchesanal
implicit none
include 'LesHouches.h'
integer j,nev
character * 6 WHCPRG
common/cWHCPRG/WHCPRG
c let the analysis subroutine know that it is run by this program
WHCPRG='LHE '
call opencount(nev)
call upinit
call init_hist
do j=1,nev
call upevnt
if(nup.eq.0) then
write(*,*) ' nup = 0 skipping event'
goto 111
endif
call lhuptohepevt(j)
if(abs(idwtup).eq.3) xwgtup=xwgtup*xsecup(1)
call analysis(xwgtup)
call pwhgaccumup
if (mod(j,20000).eq.0) then
write(*,*) "# of events processed =",j
call lheanend
endif
111 continue
enddo
call lheanend
write(*,*) 'EVENTS FOUND : ',nev
end
subroutine lheanend
character * 20 pwgprefix
character * 100 filename
integer lprefix
common/cpwgprefix/pwgprefix,lprefix
include 'pwhg_rnd.h'
if(rnd_cwhichseed.ne.'none') then
filename=pwgprefix(1:lprefix)//'LHEF_analysis-'
1 //rnd_cwhichseed
else
filename=pwgprefix(1:lprefix)//'LHEF_analysis'
endif
call pwhgsetout
call pwhgtopout(filename)
end
subroutine UPINIT
implicit none
call lhefreadhdr(97)
end
subroutine UPEVNT
call lhefreadev(97)
end
subroutine lhuptohepevt(n)
implicit none
include 'hepevt.h'
include 'LesHouches.h'
integer ihep,mu,n
nhep=nup
nevhep=n
do ihep=1,nhep
isthep(ihep)=istup(ihep)
idhep(ihep)=idup(ihep)
do mu=1,2
jmohep(mu,ihep)=mothup(mu,ihep)
enddo
do mu=1,5
phep(mu,ihep)=pup(mu,ihep)
enddo
enddo
end