File indexing completed on 2024-04-06 12:13:16
0001
0002
0003 SUBROUTINE ALVETO(IPVETO)
0004
0005
0006
0007 IMPLICIT NONE
0008
0009 INTEGER MAXNUP
0010 PARAMETER (MAXNUP=500)
0011 INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
0012 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
0013 COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
0014 & IDUP(MAXNUP),ISTUP(MAXNUP),MOTHUP(2,MAXNUP),
0015 & ICOLUP(2,MAXNUP),PUP(5,MAXNUP),VTIMUP(MAXNUP),
0016 & SPINUP(MAXNUP)
0017
0018 INTEGER NMXHEP,NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP
0019 PARAMETER (NMXHEP=4000)
0020 COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
0021 &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
0022 DOUBLE PRECISION PHEP,VHEP
0023 SAVE /HEPEVT/
0024
0025 integer ihrd
0026 integer itopprc
0027
0028 integer Nunit,NunitOut,NunitIni
0029 character*512 filename,tmpstr
0030
0031 common/AHio/Nunit,NunitOut,NunitIni,filename
0032
0033 integer iexc,npfst,nplst,nljets,njstart,njlast
0034 $ ,ickkw
0035 double precision etclus,rclus,etaclmax
0036 common/AHopts/etclus,rclus,etaclmax,iexc,npfst
0037 $ ,nplst,nljets,njstart,njlast,ickkw
0038
0039 double precision mc,mb,mt,mw,mz,mh
0040 double precision ebeam
0041 integer ndns,ih1,ih2
0042 integer nw,nz,nh,nph
0043 integer ihvy,ihvy2
0044
0045 character pdftyp*25
0046
0047 integer npart
0048 common/AHppara/mc,mb,mt,mw,mz,mh,
0049 & ebeam,ih1,ih2,
0050 & ihrd,itopprc,
0051 & nw,nz,nh,nph,
0052 & ihvy,ihvy2,
0053 & npart,ndns,pdftyp
0054
0055 real *8 maxwgt,avgwgt,errwgt,totlum
0056 integer unwev
0057 common/AHwgts/maxwgt,avgwgt,errwgt,totlum,unwev
0058
0059 integer nparam
0060 parameter (nparam=200)
0061 integer parlen,partyp
0062 character chpar*8,chpdes*70
0063 double precision parval
0064 common/AHpars/parval(nparam),chpar(nparam),chpdes(nparam)
0065 $ ,parlen(nparam),partyp(nparam)
0066
0067 double precision ptjmin,ptjmax,etajmax,drjmin,
0068 + ptbmin,ptbmax,etabmax,drbmin,
0069 + ptcmin,ptcmax,etacmax,drcmin,
0070 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0071 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0072 common/AHcuts/ptjmin,ptjmax,etajmax,drjmin,
0073 + ptbmin,ptbmax,etabmax,drbmin,
0074 + ptcmin,ptcmax,etacmax,drcmin,
0075 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0076 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0077 INTEGER IPVETO
0078
0079 INTEGER NCY,NCPHI,NJMAX,JETNO,NCJET
0080 DOUBLE PRECISION YCMIN,YCMAX,PI,ET,DELPHI,CPHCAL,SPHCAL,DELY,
0081 & CTHCAL,STHCAL,PCJET,ETJET
0082 PARAMETER (NCY=100)
0083 PARAMETER (NCPHI=60,PI=3.141593D0)
0084 COMMON/CALOR/DELY,DELPHI,ET(NCY,NCPHI),
0085 $ CTHCAL(NCY),STHCAL(NCY),CPHCAL(NCPHI),SPHCAL(NCPHI),YCMIN
0086 $ ,YCMAX
0087 PARAMETER (NJMAX=500)
0088 COMMON/GETCOM/PCJET(4,NJMAX),ETJET(NJMAX),JETNO(NCY,NCPHI),NCJET
0089
0090 DOUBLE PRECISION PSERAP
0091 INTEGER K(NJMAX),KP(NJMAX),KPJ(NJMAX)
0092
0093 INTEGER I,J,IHEP,NMATCH,JRMIN
0094 DOUBLE PRECISION ETAJET,PHIJET,DELR,DPHI,DELRMIN
0095 DOUBLE PRECISION P(4,10),PT(10),ETA(10),PHI(10)
0096
0097 INTEGER IHVQ(10),NHVQ,NMJET,ID
0098 DOUBLE PRECISION ETAHVQ(10),PHIHVQ(10)
0099 INTEGER IEND,INORAD
0100 COMMON/SHVETO/IEND,INORAD(MAXNUP)
0101
0102
0103 INTEGER IDBG
0104 PARAMETER (IDBG=0)
0105 DOUBLE PRECISION PTPART,PTJETS,ETAPART,ETAJETS
0106 INTEGER NMAX
0107 COMMON/MTCHDBG/PTPART(10),PTJETS(10),ETAPART(10),ETAJETS(10),NMAX
0108
0109 DOUBLE PRECISION ETMIN,ETMAX
0110 DOUBLE PRECISION TINY
0111 PARAMETER (TINY=1D-3)
0112 INTEGER ICOUNT
0113 DATA ICOUNT/0/
0114
0115 IPVETO=0
0116 IF(ICKKW.EQ.0) RETURN
0117 IF(IHRD.EQ.7.OR.IHRD.EQ.8.OR.IHRD.EQ.13) THEN
0118 WRITE(*,*) 'JET MATCHING FOR HARD PROCESS ',IHRD
0119 $ ,' NOT IMPLEMENTED, STOP'
0120 STOP
0121 ENDIF
0122 IF(NLJETS.EQ.0.AND.IEXC.EQ.0) RETURN
0123
0124 I=0
0125
0126
0127 IF(I.EQ.1) RETURN
0128
0129
0130 IF(IDBG.EQ.1) THEN
0131 WRITE(1,*) ' '
0132 WRITE(1,*) 'NEW EVENT '
0133 WRITE(1,*) 'PARTONS'
0134 ENDIF
0135 IF(IDBG.EQ.2) THEN
0136 DO I=1,10
0137 PTPART(I)=0D0
0138 ETAPART(I)=0D0
0139 PTJETS(I)=0D0
0140 ETAJETS(I)=0D0
0141 ENDDO
0142 NMAX=0
0143 ENDIF
0144
0145
0146
0147
0148 DO I=1,NLJETS
0149 IHEP=I+NJSTART
0150 DO J=1,4
0151 P(J,I)=PUP(J,IHEP)
0152 ENDDO
0153 PT(I)=SQRT(P(1,I)**2+P(2,I)**2)
0154 ETA(I)=-LOG(TAN(0.5D0*ATAN2(PT(I)+TINY,P(3,I))))
0155 PHI(I)=ATAN2(P(2,I),P(1,I))
0156 IF(IDBG.EQ.1) THEN
0157 WRITE(1,*) PT(I),ETA(I),PHI(I)
0158 ENDIF
0159 ENDDO
0160 IF(NLJETS.GT.0) CALL ALPSOR(PT,NLJETS,KP,2)
0161
0162
0163
0164 IF(IDBG.EQ.1) THEN
0165 DO I=1,NHEP
0166 WRITE(1,111) I,ISTHEP(I),IDHEP(I),JMOHEP(1,I),JMOHEP(2,I)
0167 $ ,PHEP(1,I),PHEP(2,I),PHEP(3,I)
0168 ENDDO
0169 111 FORMAT(5(I4,1X),3(F12.5,1X))
0170 ENDIF
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182 CALL CALINI
0183 CALL CALDEL(NPFST,NPLST,NJLAST)
0184 CALL GETJET(RCLUS,ETCLUS,ETACLMAX)
0185 IF(NCJET.GT.0) CALL ALPSOR(ETJET,NCJET,K,2)
0186 IF(IDBG.EQ.1) THEN
0187 WRITE(1,*) 'JETS'
0188 DO I=1,NCJET
0189 J=K(NCJET+1-I)
0190 ETAJET=PSERAP(PCJET(1,J))
0191 PHIJET=ATAN2(PCJET(2,J),PCJET(1,J))
0192 WRITE(1,*) ETJET(J),ETAJET,PHIJET
0193 ENDDO
0194 ENDIF
0195
0196 IF(NCJET.LT.NLJETS) GOTO 999
0197
0198 NMATCH=0
0199 DO I=1,NCJET
0200 KPJ(I)=0
0201 ENDDO
0202 DO I=1,NLJETS
0203 DELRMIN=1D5
0204 DO 110 J=1,NCJET
0205 IF(KPJ(J).NE.0) GO TO 110
0206 ETAJET=PSERAP(PCJET(1,J))
0207 PHIJET=ATAN2(PCJET(2,J),PCJET(1,J))
0208 DPHI=ABS(PHI(KP(NLJETS-I+1))-PHIJET)
0209 IF(DPHI.GT.PI) DPHI=2.*PI-DPHI
0210 DELR=SQRT((ETA(KP(NLJETS-I+1))-ETAJET)**2+(DPHI)**2)
0211 IF(DELR.LT.DELRMIN) THEN
0212 DELRMIN=DELR
0213 JRMIN=J
0214 ENDIF
0215 110 CONTINUE
0216 ETMIN=1D10
0217 IF(DELRMIN.LT.1.5*RCLUS) THEN
0218 NMATCH=NMATCH+1
0219 KPJ(JRMIN)=I
0220 ETMIN=MIN(ETMIN,ETJET(JRMIN))
0221
0222 IF(IDBG.EQ.2) THEN
0223 PTPART(I)=PT(KP(NLJETS-I+1))
0224 ETAPART(I)=ETA(KP(NLJETS-I+1))
0225 PTJETS(I)=ETJET(JRMIN)
0226 ETAJETS(I)=PSERAP(PCJET(1,JRMIN))
0227 NMAX=NCJET
0228 ENDIF
0229
0230
0231 ENDIF
0232 ENDDO
0233 IF(NMATCH.LT.NLJETS) GOTO 999
0234
0235 IF(NCJET.GT.NLJETS.AND.IEXC.EQ.1) GOTO 999
0236
0237 IF(IEXC.NE.1) THEN
0238 J=NCJET
0239 DO I=1,NLJETS
0240 IF(KPJ(K(J)).EQ.0) GOTO 999
0241 J=J-1
0242 ENDDO
0243 ENDIF
0244
0245
0246 IF(IHRD.LE.2.OR.IHRD.EQ.6.OR.IHRD.EQ.10.OR.IHRD.EQ.15) THEN
0247 CALL CALINI
0248
0249 CALL CALDEL_HVQ(NPFST,NPLST,NJLAST)
0250 CALL GETJET(RCLUS,ETCLUS,ETACLMAX)
0251
0252 IF(NCJET.EQ.0) RETURN
0253
0254
0255
0256 NHVQ=0
0257 DO I=1,NHEP
0258 ID=IDHEP(I)
0259 IF(INORAD(I).EQ.1.AND.ABS(ID).LE.5.AND.ABS(ID)
0260 $ .GE.4) THEN
0261 NHVQ=NHVQ+1
0262 IHVQ(NHVQ)=I
0263 ETAHVQ(NHVQ)=PSERAP(PHEP(1,I))
0264 PHIHVQ(NHVQ)=ATAN2(PHEP(2,I),PHEP(1,I))
0265 ENDIF
0266 ENDDO
0267 NMJET=NCJET
0268 DO I=1,NCJET
0269 ETAJET=PSERAP(PCJET(1,I))
0270 PHIJET=ATAN2(PCJET(2,I),PCJET(1,I))
0271 DO J=1,NHVQ
0272 DPHI=ABS(PHIHVQ(J)-PHIJET)
0273 IF(DPHI.GT.PI) DPHI=ABS(DPHI-2*PI)
0274 DELR=SQRT(DPHI**2+(ETAJET-ETAHVQ(J))**2)
0275 IF(DELR.LT.DRJMIN) THEN
0276 NMJET=NMJET-1
0277 ETJET(I)=0D0
0278 ENDIF
0279 ENDDO
0280 ENDDO
0281
0282 IF(NMJET.EQ.0) RETURN
0283
0284 IF(IEXC.EQ.1) GOTO 999
0285
0286 ETMAX=0D0
0287 DO I=1,NCJET
0288 ETMAX=MAX(ETMAX,ETJET(I))
0289 ENDDO
0290 IF(ETMAX.GT.ETMIN) GOTO 999
0291 ENDIF
0292 RETURN
0293
0294 999 CALL ALSHEN
0295 IPVETO=1
0296 END
0297
0298
0299
0300 SUBROUTINE ALSETP
0301
0302
0303
0304 IMPLICIT NONE
0305
0306 integer ihrd
0307 integer itopprc
0308
0309 integer iexc,npfst,nplst,nljets,njstart,njlast
0310 $ ,ickkw
0311 double precision etclus,rclus,etaclmax
0312 common/AHopts/etclus,rclus,etaclmax,iexc,npfst
0313 $ ,nplst,nljets,njstart,njlast,ickkw
0314
0315 double precision mc,mb,mt,mw,mz,mh
0316 double precision ebeam
0317 integer ndns,ih1,ih2
0318 integer nw,nz,nh,nph
0319 integer ihvy,ihvy2
0320
0321 character pdftyp*25
0322
0323 integer npart
0324 common/AHppara/mc,mb,mt,mw,mz,mh,
0325 & ebeam,ih1,ih2,
0326 & ihrd,itopprc,
0327 & nw,nz,nh,nph,
0328 & ihvy,ihvy2,
0329 & npart,ndns,pdftyp
0330
0331 integer nparam
0332 parameter (nparam=200)
0333 integer parlen,partyp
0334 character chpar*8,chpdes*70
0335 double precision parval
0336 common/AHpars/parval(nparam),chpar(nparam),chpdes(nparam)
0337 $ ,parlen(nparam),partyp(nparam)
0338
0339 double precision ptjmin,ptjmax,etajmax,drjmin,
0340 + ptbmin,ptbmax,etabmax,drbmin,
0341 + ptcmin,ptcmax,etacmax,drcmin,
0342 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0343 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0344 common/AHcuts/ptjmin,ptjmax,etajmax,drjmin,
0345 + ptbmin,ptbmax,etabmax,drbmin,
0346 + ptcmin,ptcmax,etacmax,drcmin,
0347 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0348 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0349 CHARACTER *3 CSHO
0350
0351 INTEGER NCY,NCPHI,NJMAX,JETNO,NCJET
0352 DOUBLE PRECISION YCMIN,YCMAX,PI,ET,DELPHI,CPHCAL,SPHCAL,DELY,
0353 & CTHCAL,STHCAL,PCJET,ETJET
0354 PARAMETER (NCY=100)
0355 PARAMETER (NCPHI=60,PI=3.141593D0)
0356 COMMON/CALOR/DELY,DELPHI,ET(NCY,NCPHI),
0357 $ CTHCAL(NCY),STHCAL(NCY),CPHCAL(NCPHI),SPHCAL(NCPHI),YCMIN
0358 $ ,YCMAX
0359
0360 INTEGER MAXNUP
0361 PARAMETER (MAXNUP=500)
0362 INTEGER IEND,INORAD
0363 COMMON/SHVETO/IEND,INORAD(MAXNUP)
0364
0365
0366 CHARACTER*70 STDUMMY
0367 INTEGER I,NTMP,IHEPMIN
0368 DOUBLE PRECISION TMP
0369
0370 INTEGER IUSRMAT
0371 PARAMETER (IUSRMAT=1)
0372
0373
0374
0375
0376
0377
0378 CALL AHSPAR
0379 IH1=1
0380
0381 CALL PDFCONVH(NDNS,NTMP,PDFTYP)
0382
0383 NLJETS=PARVAL(10) ! NJETS
0384 DO I=1,MAXNUP
0385 INORAD(I)=0
0386 ENDDO
0387 CALL ALSHCD(CSHO)
0388 IF(CSHO.EQ.'HER') THEN
0389 NPFST=149
0390 NPLST=149
0391
0392 IEND=6
0393
0394 IHEPMIN=6
0395 ELSE
0396 NPFST=1
0397 NPLST=1
0398
0399 IEND=0
0400
0401 IHEPMIN=6
0402 ENDIF
0403 IF(IHRD.LE.2) THEN
0404
0405 NJSTART=4
0406 NJLAST=155
0407
0408 INORAD(IHEPMIN+2+NLJETS+1)=1
0409
0410
0411 INORAD(IHEPMIN+1)=1
0412 INORAD(IHEPMIN+2)=1
0413 ELSEIF(IHRD.LE.4) THEN
0414
0415 NJSTART=2
0416 NJLAST=155
0417
0418 IF(CSHO.EQ.'HER'.AND.NLJETS.EQ.0) THEN
0419
0420 INORAD(IHEPMIN+NLJETS+1)=0
0421 ELSE
0422 INORAD(IHEPMIN+NLJETS+1)=1
0423 ENDIF
0424 ELSEIF(IHRD.EQ.5) THEN
0425
0426 NJSTART=2
0427 NJLAST=155
0428
0429 IF(CSHO.EQ.'HER'.AND.NLJETS.EQ.0.AND.(NW+NZ+NH+NPH).EQ.1) THEN
0430
0431
0432 INORAD(IHEPMIN+NLJETS+1)=0
0433 ELSE
0434 DO I=1,NW+NZ+NH+NPH
0435 INORAD(IHEPMIN+NLJETS+I)=1
0436 ENDDO
0437 ENDIF
0438 ELSEIF(IHRD.EQ.6) THEN
0439
0440
0441
0442 INORAD(IHEPMIN+1)=1
0443 INORAD(IHEPMIN+2)=1
0444 NJSTART=4
0445 NJLAST=155
0446 ELSEIF(IHRD.EQ.9) THEN
0447
0448 NJSTART=2
0449 NJLAST=155
0450 ELSEIF(IHRD.EQ.10) THEN
0451
0452 NJSTART=3
0453 NJLAST=155
0454
0455 INORAD(IHEPMIN+NLJETS+1+1)=1
0456
0457 INORAD(IHEPMIN+1)=1
0458 ELSEIF(IHRD.EQ.11) THEN
0459
0460 NJSTART=2
0461 NJLAST=155
0462
0463 DO I=1,NPH
0464 INORAD(IHEPMIN+NLJETS+I)=1
0465 ENDDO
0466 ELSEIF(IHRD.EQ.12) THEN
0467
0468 NJSTART=2
0469 NJLAST=155
0470
0471 IF(NLJETS+NH.GT.1) THEN
0472 DO I=1,NH
0473 INORAD(IHEPMIN+NLJETS+I)=1
0474 ENDDO
0475 ELSE
0476 IF(CSHO.EQ.'HER'.AND.NLJETS.EQ.0) THEN
0477
0478 INORAD(IHEPMIN+1)=0
0479 ELSE
0480 INORAD(IHEPMIN+NLJETS+1)=1
0481 ENDIF
0482 ENDIF
0483 ELSEIF(IHRD.EQ.14) THEN
0484
0485 NJSTART=2
0486 NJLAST=155
0487
0488 IF(CSHO.EQ.'HER'.AND.NLJETS.EQ.0.AND.NPH.EQ.0) THEN
0489
0490 INORAD(IHEPMIN+NLJETS+1)=0
0491 ELSE
0492 INORAD(IHEPMIN+NLJETS+1)=1
0493 ENDIF
0494 ELSEIF(IHRD.EQ.15) THEN
0495
0496 NJSTART=2
0497 NJLAST=155
0498
0499 INORAD(IHEPMIN+2+NLJETS+NPH+1)=1
0500
0501
0502
0503 INORAD(IHEPMIN+NLJETS+1)=1
0504 INORAD(IHEPMIN+NLJETS+2)=1
0505 ENDIF
0506
0507
0508
0509 IF(ICKKW.EQ.1) THEN
0510
0511
0512
0513
0514
0515
0516 WRITE(*,*) ' IEXC = ',IEXC
0517 IF(NLJETS.GT.0) THEN
0518 WRITE(*,*) 'INPUT ET(CLUS), R(CLUS)'
0519
0520
0521
0522
0523
0524
0525 ETACLMAX = ETAJMAX
0526 ELSEIF(NLJETS.EQ.0) THEN
0527 WRITE(*,*) 'INPUT ET(CLUS), R(CLUS)'
0528 WRITE(*,*) '(MUST MATCH VALUES USED IN PROCESSING',
0529 + ' OF NJET>0 EVENTS; THESE DEFAULT TO:'
0530 WRITE(*,*)
0531 + 'ETCLUS=MAX(PTJMIN+5,1.2*PTJMIN) RCLUS=DRJMIN, ',
0532 + ' ETACLMAX=ETAJMAX)'
0533
0534
0535
0536 ETACLMAX = ETAJMAX
0537 ENDIF
0538 WRITE(*,*) ' '
0539 WRITE(*,*) 'JET PARAMETERS FOR MATCHING:'
0540 WRITE(*,*) 'ET >',ETCLUS,' ETACLUS <',ETACLMAX,' R =',RCLUS
0541 WRITE(*,*) 'DR(PARTON-JET) <',1.5*RCLUS
0542 ENDIF
0543
0544
0545
0546 YCMAX=ETACLMAX+RCLUS ! MLM August 24
0547 YCMIN=-YCMAX
0548 END
0549
0550
0551 subroutine AHspar
0552
0553
0554 implicit none
0555
0556 integer ihrd
0557 integer itopprc
0558
0559 integer Nunit,NunitOut,NunitIni
0560 character*512 filename,tmpstr
0561
0562 common/AHio/Nunit,NunitOut,NunitIni,filename
0563
0564 integer iexc,npfst,nplst,nljets,njstart,njlast
0565 $ ,ickkw
0566 double precision etclus,rclus,etaclmax
0567 common/AHopts/etclus,rclus,etaclmax,iexc,npfst
0568 $ ,nplst,nljets,njstart,njlast,ickkw
0569
0570 double precision mc,mb,mt,mw,mz,mh
0571 double precision ebeam
0572 integer ndns,ih1,ih2
0573 integer nw,nz,nh,nph
0574 integer ihvy,ihvy2
0575
0576 character pdftyp*25
0577
0578 integer npart
0579 common/AHppara/mc,mb,mt,mw,mz,mh,
0580 & ebeam,ih1,ih2,
0581 & ihrd,itopprc,
0582 & nw,nz,nh,nph,
0583 & ihvy,ihvy2,
0584 & npart,ndns,pdftyp
0585
0586 real *8 maxwgt,avgwgt,errwgt,totlum
0587 integer unwev
0588 common/AHwgts/maxwgt,avgwgt,errwgt,totlum,unwev
0589
0590 integer nparam
0591 parameter (nparam=200)
0592 integer parlen,partyp
0593 character chpar*8,chpdes*70
0594 double precision parval
0595 common/AHpars/parval(nparam),chpar(nparam),chpdes(nparam)
0596 $ ,parlen(nparam),partyp(nparam)
0597
0598 double precision ptjmin,ptjmax,etajmax,drjmin,
0599 + ptbmin,ptbmax,etabmax,drbmin,
0600 + ptcmin,ptcmax,etacmax,drcmin,
0601 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0602 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0603 common/AHcuts/ptjmin,ptjmax,etajmax,drjmin,
0604 + ptbmin,ptbmax,etabmax,drbmin,
0605 + ptcmin,ptcmax,etacmax,drcmin,
0606 + ptphmin,etaphmax,drphjmin,drphmin,drphlmin,
0607 + ptlmin,etalmax,drlmin,metmin,mllmin,mllmax
0608
0609 ih2=parval(2)
0610 ebeam=parval(3)
0611 ndns=parval(4)
0612 ickkw=parval(7)
0613 ihvy=parval(11)
0614 ihvy2=parval(12)
0615 nw=parval(13)
0616 nz=parval(14)
0617 nh=parval(15)
0618 nph=parval(16)
0619 ptjmin=parval(30)
0620 ptbmin=parval(31)
0621 ptcmin=parval(32)
0622 ptlmin=parval(33)
0623 metmin=parval(34)
0624 ptphmin=parval(35)
0625 etajmax=parval(40)
0626 etabmax=parval(41)
0627 etacmax=parval(42)
0628 etalmax=parval(43)
0629 etaphmax=parval(44)
0630 drjmin=parval(50)
0631 drbmin=parval(51)
0632 drcmin=parval(52)
0633 drlmin=parval(55)
0634 drphjmin=parval(56)
0635 drphlmin=parval(57)
0636 drphmin=parval(58)
0637 mllmin=parval(61)
0638 mllmax=parval(62)
0639 itopprc=parval(102)
0640
0641 end
0642
0643
0644 subroutine pdfconvH(nin,nout,type)
0645
0646
0647 implicit none
0648 integer nin,nout
0649 character*25 type
0650 character*25 pdftyp(20,2)
0651 data pdftyp/
0652
0653 $ 'CTEQ4M ','CTEQ4L ','CTEQ4HJ',
0654 $ 'CTEQ5M ','CTEQ5L ','CTEQ5HJ',
0655 $ 'CTEQ6M ','CTEQ6L ',12*' ',
0656
0657 $ 'MRST99 ',
0658 $ 'MRST01; as=0.119','MRST01; as=0.117','MRST01; as=0.121'
0659 $ ,'MRST01J; as=0.121','MRST02LO',14*' '/
0660 integer pdfmap(20,2)
0661 data pdfmap/
0662 $ 81,83,88, 101,103, 104, 131,133, 12*0,
0663 $ 111, 185,186,187,188,189, 14*0/
0664
0665 nout=pdfmap(mod(nin ,100),1+nin /100)
0666 type=pdftyp(mod(nin ,100),1+nin /100)
0667
0668 end
0669
0670
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683
0684
0685
0686
0687
0688
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700 SUBROUTINE CALINI
0701
0702
0703
0704
0705
0706 IMPLICIT NONE
0707 INTEGER NCY,NCPHI,NJMAX,IPHI,IY,JETNO,NCJET
0708 DOUBLE PRECISION YCMIN,YCMAX,PI,ET,DELPHI,PHIX,CPHCAL,SPHCAL,DELY,
0709 & YX,THX,CTHCAL,STHCAL,PCJET,ETJET
0710 PARAMETER (NCY=100)
0711 PARAMETER (NCPHI=60,PI=3.141593D0)
0712 COMMON/CALOR/DELY,DELPHI,ET(NCY,NCPHI),
0713 $CTHCAL(NCY),STHCAL(NCY),CPHCAL(NCPHI),SPHCAL(NCPHI),YCMIN,YCMAX
0714 PARAMETER (NJMAX=500)
0715 COMMON/GETCOM/PCJET(4,NJMAX),ETJET(NJMAX),JETNO(NCY,NCPHI),NCJET
0716 LOGICAL FSTCAL
0717 DATA FSTCAL/.TRUE./
0718
0719
0720 DO 100 IPHI=1,NCPHI
0721 DO 100 IY=1,NCY
0722 100 ET(IY,IPHI)=0.
0723
0724 IF (FSTCAL) THEN
0725
0726 DELPHI=2.*PI/FLOAT(NCPHI)
0727 DO 200 IPHI=1,NCPHI
0728 PHIX=DELPHI*(IPHI-.5)
0729 CPHCAL(IPHI)=COS(PHIX)
0730 SPHCAL(IPHI)=SIN(PHIX)
0731 200 CONTINUE
0732 DELY=(YCMAX-YCMIN)/FLOAT(NCY)
0733 DO 300 IY=1,NCY
0734 YX=DELY*(IY-.5)+YCMIN
0735 THX=2.*ATAN(EXP(-YX))
0736 CTHCAL(IY)=COS(THX)
0737 STHCAL(IY)=SIN(THX)
0738 300 CONTINUE
0739 FSTCAL=.FALSE.
0740 ENDIF
0741 END
0742
0743 SUBROUTINE CALSIM
0744
0745
0746
0747
0748 INTEGER NMXHEP,NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP
0749 PARAMETER (NMXHEP=4000)
0750 COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
0751 &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
0752 DOUBLE PRECISION PHEP,VHEP
0753 SAVE /HEPEVT/
0754 INTEGER NCY,NCPHI,NJMAX,IHEP,ID,IY,IPHI,JETNO,NCJET
0755 DOUBLE PRECISION YCMIN,YCMAX,PI,YIP,PSERAP,
0756 & PHIIP,DELY,DELPHI,EIP,ET,STHCAL,CTHCAL,CPHCAL,SPHCAL,
0757 & PCJET,ETJET
0758 PARAMETER (NCY=100)
0759 PARAMETER (NCPHI=60,PI=3.141593D0)
0760 COMMON/CALOR/DELY,DELPHI,ET(NCY,NCPHI),
0761 $CTHCAL(NCY),STHCAL(NCY),CPHCAL(NCPHI),SPHCAL(NCPHI),YCMIN,YCMAX
0762 PARAMETER (NJMAX=500)
0763 COMMON/GETCOM/PCJET(4,NJMAX),ETJET(NJMAX),JETNO(NCY,NCPHI),NCJET
0764
0765
0766
0767 DO 200 IHEP=1,NHEP
0768 IF (ISTHEP(IHEP).EQ.1) THEN
0769 YIP=PSERAP(PHEP(1,IHEP))
0770 IF(YIP.LT.YCMIN.OR.YIP.GT.YCMAX) GOTO 200
0771 ID=ABS(IDHEP(IHEP))
0772
0773 IF ((ID.GE.11.AND.ID.LE.16).OR.ID.EQ.6.OR.ID.EQ.22) GOTO 200
0774
0775 PHIIP=ATAN2(PHEP(2,IHEP),PHEP(1,IHEP))
0776 IF(PHIIP.LT.0.) PHIIP=PHIIP+2.*PI
0777 IY=INT((YIP-YCMIN)/DELY)+1
0778 IPHI=INT(PHIIP/DELPHI)+1
0779 EIP=PHEP(4,IHEP)
0780
0781 ET(IY,IPHI)=ET(IY,IPHI)+EIP*STHCAL(IY)
0782 ENDIF
0783 200 CONTINUE
0784 999 END
0785 SUBROUTINE GETJET(RJET,EJCUT,ETAJCUT)
0786
0787
0788
0789
0790
0791
0792
0793
0794
0795
0796 IMPLICIT NONE
0797 INTEGER NCY,NCPHI,NJMAX,IPHI,IY,JETNO,J,K,NCJET,NPHI1,NPHI2,NY1,
0798 & NY2,IPASS,IYMX,IPHIMX,ITLIS,IPHI1,IPHIX,IY1,IYX
0799 DOUBLE PRECISION YCMIN,YCMAX,PI,ETJET,PCJET,RJET,DELPHI,DELY,
0800 & ETMAX,ET,ETSTOP,RR,ECCUT,PX,STHCAL,CPHCAL,SPHCAL,CTHCAL,EJCUT
0801 PARAMETER (NCY=100)
0802 PARAMETER (NCPHI=60,PI=3.141593D0)
0803 COMMON/CALOR/DELY,DELPHI,ET(NCY,NCPHI),
0804 &CTHCAL(NCY),STHCAL(NCY),CPHCAL(NCPHI),SPHCAL(NCPHI),YCMIN,YCMAX
0805 PARAMETER (NJMAX=500)
0806 COMMON/GETCOM/PCJET(4,NJMAX),ETJET(NJMAX),JETNO(NCY,NCPHI),NCJET
0807 DOUBLE PRECISION ETAJCUT,PSERAP
0808
0809
0810 DATA ECCUT/0.1D0/
0811 DATA ETSTOP/1.5D0/
0812 DATA ITLIS/6/
0813
0814
0815
0816 DO 100 IPHI=1,NCPHI
0817 DO 100 IY=1,NCY
0818 100 JETNO(IY,IPHI)=0
0819 DO 110 J=1,NJMAX
0820 ETJET(J)=0.
0821 DO 110 K=1,4
0822 110 PCJET(K,J)=0.
0823 NCJET=0
0824 NPHI1=RJET/DELPHI
0825 NPHI2=2*NPHI1+1
0826 NY1=RJET/DELY
0827 NY2=2*NY1+1
0828 IPASS=0
0829
0830
0831
0832 1 ETMAX=0.
0833 DO 200 IPHI=1,NCPHI
0834 DO 210 IY=1,NCY
0835 IF(ET(IY,IPHI).LT.ETMAX) GOTO 210
0836 IF(JETNO(IY,IPHI).NE.0) GOTO 210
0837 ETMAX=ET(IY,IPHI)
0838 IYMX=IY
0839 IPHIMX=IPHI
0840 210 CONTINUE
0841 200 CONTINUE
0842 IF(ETMAX.LT.ETSTOP) RETURN
0843
0844
0845
0846 IPASS=IPASS+1
0847 IF(IPASS.GT.NCY*NCPHI) THEN
0848 WRITE(ITLIS,8888) IPASS
0849 8888 FORMAT(//' ERROR IN GETJET...IPASS > ',I6)
0850 RETURN
0851 ENDIF
0852 NCJET=NCJET+1
0853 IF(NCJET.GT.NJMAX) THEN
0854 WRITE(ITLIS,9999) NCJET
0855 9999 FORMAT(//' ERROR IN GETJET...NCJET > ',I5)
0856 RETURN
0857 ENDIF
0858 DO 300 IPHI1=1,NPHI2
0859 IPHIX=IPHIMX-NPHI1-1+IPHI1
0860 IF(IPHIX.LE.0) IPHIX=IPHIX+NCPHI
0861 IF(IPHIX.GT.NCPHI) IPHIX=IPHIX-NCPHI
0862 DO 310 IY1=1,NY2
0863 IYX=IYMX-NY1-1+IY1
0864 IF(IYX.LE.0) GOTO 310
0865 IF(IYX.GT.NCY) GOTO 310
0866 IF(JETNO(IYX,IPHIX).NE.0) GOTO 310
0867 RR=(DELY*(IY1-NY1-1))**2+(DELPHI*(IPHI1-NPHI1-1))**2
0868 IF(RR.GT.RJET**2) GOTO 310
0869 IF(ET(IYX,IPHIX).LT.ECCUT) GOTO 310
0870 PX=ET(IYX,IPHIX)/STHCAL(IYX)
0871
0872 PCJET(1,NCJET)=PCJET(1,NCJET)+PX*STHCAL(IYX)*CPHCAL(IPHIX)
0873 PCJET(2,NCJET)=PCJET(2,NCJET)+PX*STHCAL(IYX)*SPHCAL(IPHIX)
0874 PCJET(3,NCJET)=PCJET(3,NCJET)+PX*CTHCAL(IYX)
0875 PCJET(4,NCJET)=PCJET(4,NCJET)+PX
0876 ETJET(NCJET)=ETJET(NCJET)+ET(IYX,IPHIX)
0877 JETNO(IYX,IPHIX)=NCJET
0878 310 CONTINUE
0879 300 CONTINUE
0880
0881
0882
0883 IF(ETJET(NCJET).GT.EJCUT.AND.ABS(PSERAP(PCJET(1,NCJET))).LT
0884 $ .ETAJCUT) GOTO 1
0885 ETJET(NCJET)=0.
0886 DO 400 K=1,4
0887 400 PCJET(K,NCJET)=0.
0888 NCJET=NCJET-1
0889 GOTO 1
0890 END
0891
0892 SUBROUTINE CALDEL(ISTLO,ISTHI,ISTOP)
0893
0894
0895
0896
0897
0898
0899
0900 IMPLICIT NONE
0901 INTEGER MAXNUP
0902 PARAMETER(MAXNUP=500)
0903 INTEGER IEND,INORAD
0904 COMMON/SHVETO/IEND,INORAD(MAXNUP)
0905
0906 INTEGER NMXHEP,NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP
0907 PARAMETER (NMXHEP=4000)
0908 COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
0909 &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
0910 DOUBLE PRECISION PHEP,VHEP
0911 SAVE /HEPEVT/
0912 INTEGER ISTOLD(NMXHEP),IHEP,IST,ISTLO,ISTHI,ISTOP,IMO
0913 LOGICAL FOUND
0914
0915 FOUND=.FALSE.
0916 DO 10 IHEP=1,NHEP
0917 IST=ISTHEP(IHEP)
0918 ISTOLD(IHEP)=IST
0919 IF (IST.EQ.ISTOP) FOUND=.TRUE.
0920 IF (IST.GE.ISTLO.AND.IST.LE.ISTHI.AND..NOT.FOUND) THEN
0921
0922 IMO=IHEP
0923 1 IMO=JMOHEP(1,IMO)
0924 IF(IMO.EQ.IEND) THEN
0925
0926 IST=1
0927
0928 GOTO 9
0929 ENDIF
0930 IF(INORAD(IMO).EQ.1) THEN
0931
0932 IST=0
0933 GOTO 9
0934 ELSE
0935
0936 GOTO 1
0937 ENDIF
0938 ELSE
0939 IST=0
0940 ENDIF
0941 9 ISTHEP(IHEP)=IST
0942 10 CONTINUE
0943
0944
0945
0946
0947
0948 CALL CALSIM
0949 DO 20 IHEP=1,NHEP
0950 ISTHEP(IHEP)=ISTOLD(IHEP)
0951 20 CONTINUE
0952 END
0953
0954 SUBROUTINE CALDEL_HVQ(ISTLO,ISTHI,ISTOP)
0955
0956
0957
0958
0959
0960
0961
0962
0963 IMPLICIT NONE
0964 INTEGER MAXNUP
0965 PARAMETER(MAXNUP=500)
0966 INTEGER IEND,INORAD
0967 COMMON/SHVETO/IEND,INORAD(MAXNUP)
0968
0969 INTEGER NMXHEP,NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP
0970 PARAMETER (NMXHEP=4000)
0971 COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
0972 &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
0973 DOUBLE PRECISION PHEP,VHEP
0974 SAVE /HEPEVT/
0975 INTEGER ISTOLD(NMXHEP),IHEP,IST,ISTLO,ISTHI,ISTOP,IMO
0976 INTEGER IDMOTH,IDDAUG
0977 LOGICAL FOUND
0978 FOUND=.FALSE.
0979
0980 DO IHEP=1,NHEP
0981 IMO=JMOHEP(1,IHEP)
0982 IDMOTH=ABS(IDHEP(IMO))
0983 IDDAUG=ABS(IDHEP(IHEP))
0984 IF(IDMOTH.EQ.6.AND.(IDDAUG.EQ.5.OR.IDDAUG.EQ.24)) INORAD(IHEP)=2
0985 ENDDO
0986
0987 DO 10 IHEP=1,NHEP
0988 IST=ISTHEP(IHEP)
0989 ISTOLD(IHEP)=IST
0990 IF (IST.EQ.ISTOP) FOUND=.TRUE.
0991 IF (IST.GE.ISTLO.AND.IST.LE.ISTHI.AND..NOT.FOUND) THEN
0992
0993 IMO=IHEP
0994 1 IMO=JMOHEP(1,IMO)
0995 IF(IMO.EQ.IEND) THEN
0996
0997 IST=0
0998 GOTO 9
0999 ENDIF
1000 IF(INORAD(IMO).EQ.1) THEN
1001 IDMOTH=ABS(IDHEP(IMO))
1002 IDDAUG=ABS(IDHEP(IHEP))
1003
1004 IF(IDMOTH.GE.4.AND.IDMOTH.LE.6) THEN
1005
1006
1007 IF(IDMOTH.NE.IDDAUG) THEN
1008 IST=1
1009 GOTO 9
1010 ELSE
1011 IST=0
1012 ENDIF
1013 ELSE
1014
1015 IST=0
1016 ENDIF
1017 ELSEIF(INORAD(IMO).EQ.2) THEN
1018
1019 IST=0
1020 ELSE
1021
1022 GOTO 1
1023 ENDIF
1024 ELSE
1025 IST=0
1026 ENDIF
1027 9 ISTHEP(IHEP)=IST
1028 10 CONTINUE
1029 CALL CALSIM
1030 DO 20 IHEP=1,NHEP
1031 ISTHEP(IHEP)=ISTOLD(IHEP)
1032 20 CONTINUE
1033 END
1034
1035 FUNCTION PSERAP(P)
1036
1037
1038 DOUBLE PRECISION PSERAP,P(3),PT,PL,TINY,THETA
1039 PARAMETER (TINY=1D-3)
1040 PT=SQRT(P(1)**2+P(2)**2)+TINY
1041 PL=P(3)
1042 THETA=ATAN2(PT,PL)
1043 PSERAP=-LOG(TAN(0.5*THETA))
1044 END
1045
1046
1047 SUBROUTINE ALPSOR(A,N,K,IOPT)
1048
1049
1050
1051
1052
1053 DOUBLE PRECISION A(N),B(5000)
1054 INTEGER N,I,J,IOPT,K(N),IL(5000),IR(5000)
1055 IF (N.GT.5000) then
1056 write(*,*) 'Too many entries to sort in alpsrt, stop'
1057 stop
1058 endif
1059 if(n.le.0) return
1060 IL(1)=0
1061 IR(1)=0
1062 DO 10 I=2,N
1063 IL(I)=0
1064 IR(I)=0
1065 J=1
1066 2 IF(A(I).GT.A(J)) GOTO 5
1067 3 IF(IL(J).EQ.0) GOTO 4
1068 J=IL(J)
1069 GOTO 2
1070 4 IR(I)=-J
1071 IL(J)=I
1072 GOTO 10
1073 5 IF(IR(J).LE.0) GOTO 6
1074 J=IR(J)
1075 GOTO 2
1076 6 IR(I)=IR(J)
1077 IR(J)=I
1078 10 CONTINUE
1079 I=1
1080 J=1
1081 GOTO 8
1082 20 J=IL(J)
1083 8 IF(IL(J).GT.0) GOTO 20
1084 9 K(I)=J
1085 B(I)=A(J)
1086 I=I+1
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096 IF (IR(J).GT.0) THEN
1097 J=IR(J)
1098 GOTO 8
1099 ELSEIF (IR(J).LT.0) then
1100 J=-IR(J)
1101 GOTO 9
1102 ENDIF
1103 IF (IOPT.EQ.2) RETURN
1104
1105 DO 31 I=1,N
1106 31 A(I)=B(I)
1107 999 END
1108
1109
1110 subroutine getunit(n)
1111 implicit none
1112 integer n,i
1113 logical yes
1114 WRITE(*,*)'CALLED GETUNIT'
1115 do i=10,100
1116 inquire(unit=i,opened=yes)
1117 if(.not.yes) goto 10
1118 enddo
1119 write(*,*) 'no free units to write to available, stop'
1120 stop
1121 10 n=i
1122 end