2
c Example analysis for "p p > h j j [QCD]" process.
4
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
5
subroutine analysis_begin(nwgt,weights_info)
6
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
9
character*(*) weights_info(*)
12
data cc/' ','vbfcuts '/
14
PARAMETER (PI=3.14159265358979312D0)
16
real*8 vetomin, vetomax
18
common /to_veto_hist/vetomin,vetomax,nbinveto
20
call HwU_inithist(nwgt,weights_info)
26
call HwU_book(l+ 1,'total ' //cc(i),5,0.5d0,5.5d0)
28
call HwU_book(l+ 2,'Higgs pT ' //cc(i),50,0.d0,400.d0)
29
call HwU_book(l+ 3,'Higgs pT ' //cc(i),50,0.d0,800.d0)
30
call HwU_book(l+ 4,'Higgs logpT ' //cc(i),50,0.d0,4.d0)
31
call HwU_book(l+ 5,'Higgs eta ' //cc(i),50,-6.d0,6.d0)
32
call HwU_book(l+ 6,'Higgs y ' //cc(i),50,-6.d0,6.d0)
34
call HwU_book(l+ 7,'j1 pT ' //cc(i),50,0.d0,400.d0)
35
call HwU_book(l+ 8,'j1 pT ' //cc(i),50,0.d0,800.d0)
36
call HwU_book(l+ 9,'j1 logpT ' //cc(i),50,0.d0,4.d0)
37
call HwU_book(l+ 10,'j1 eta ' //cc(i),50,-6.d0,6.d0)
38
call HwU_book(l+ 11,'j1 y ' //cc(i),50,-6.d0,6.d0)
40
call HwU_book(l+ 12,'j2 pT ' //cc(i),50,0.d0,400.d0)
41
call HwU_book(l+ 13,'j2 pT ' //cc(i),50,0.d0,800.d0)
42
call HwU_book(l+ 14,'j2 logpT ' //cc(i),50,0.d0,4.d0)
43
call HwU_book(l+ 15,'j2 eta ' //cc(i),50,-6.d0,6.d0)
44
call HwU_book(l+ 16,'j2 y ' //cc(i),50,-6.d0,6.d0)
46
call HwU_book(l+ 17,'j3 pT ' //cc(i),50,0.d0,400.d0)
47
call HwU_book(l+ 18,'j3 pT ' //cc(i),50,0.d0,800.d0)
48
call HwU_book(l+ 19,'j3 logpT ' //cc(i),50,0.d0,4.d0)
49
call HwU_book(l+ 20,'j3 eta ' //cc(i),50,-6.d0,6.d0)
50
call HwU_book(l+ 21,'j3 y ' //cc(i),50,-6.d0,6.d0)
52
call HwU_book(l+ 22,'H+j1 pT ' //cc(i),50,0.d0,400.d0)
53
call HwU_book(l+ 23,'H+j1 pT ' //cc(i),50,0.d0,800.d0)
54
call HwU_book(l+ 24,'H+j1 logpT ' //cc(i),50,0.d0,4.d0)
55
call HwU_book(l+ 25,'H+j1 eta ' //cc(i),50,-6.d0,6.d0)
56
call HwU_book(l+ 26,'H+j1 y ' //cc(i),50,-6.d0,6.d0)
58
call HwU_book(l+ 27,'j1+j2 pT ' //cc(i),50,0.d0,400.d0)
59
call HwU_book(l+ 28,'j1+j2 pT ' //cc(i),50,0.d0,800.d0)
60
call HwU_book(l+ 29,'j1+j2 logpT ' //cc(i),50,0.d0,4.d0)
61
call HwU_book(l+ 30,'j1+j2 eta ' //cc(i),50,-6.d0,6.d0)
62
call HwU_book(l+ 31,'j1+j2 y ' //cc(i),50,-6.d0,6.d0)
64
call HwU_book(l+ 32,'syst pT ' //cc(i),50,0.d0,400.d0)
65
call HwU_book(l+ 33,'syst pT ' //cc(i),50,0.d0,800.d0)
66
call HwU_book(l+ 34,'syst logpT ' //cc(i),50,0.d0,4.d0)
67
call HwU_book(l+ 35,'syst eta ' //cc(i),50,-10.d0,10.d0)
68
call HwU_book(l+ 36,'syst y ' //cc(i),50,-6.d0,6.d0)
70
call HwU_book(l+ 37,'Dphi H-j1 ' //cc(i),50,0d0,pi)
71
call HwU_book(l+ 38,'Dphi H-j2 ' //cc(i),50,0d0,pi)
72
call HwU_book(l+ 39,'Dphi j1-j2 ' //cc(i),50,0d0,pi)
74
call HwU_book(l+ 40,'DR H-j1 ' //cc(i),50,0d0,10.d0)
75
call HwU_book(l+ 41,'DR H-j2 ' //cc(i),50,0d0,10.d0)
76
call HwU_book(l+ 42,'DR j1-j2 ' //cc(i),50,0d0,10.d0)
78
call HwU_book(l+ 43,'mj1j2 ' //cc(i),50,0d0,3000.d0)
80
c Nason-Oleari plots (hep-ph/0911.5299)
81
call HwU_book(l+ 44,'|yj1-yj2| ' //cc(i),25,0.d0,10.d0)
82
call HwU_book(l+ 45,'yj3_rel ' //cc(i),50,-6.d0,6.d0)
83
call HwU_book(l+ 46,'njets ' //cc(i),100,-0.5d0,9.5d0)
84
call HwU_book(l+ 47,'ptrel_j1 ' //cc(i),50,0.d0,200.d0)
85
call HwU_book(l+ 48,'ptrel_j2 ' //cc(i),50,0.d0,200.d0)
86
call HwU_book(l+ 49,'P-veto ' //cc(i), dble(nbinveto),vetomin
88
call HwU_book(l+ 50,'jveto pT ' //cc(i), dble(nbinveto),vetomin
90
call HwU_book(l+ 51,'jveto pT ' //cc(i), dble(nbinveto),
91
& vetomin,2d0*vetomax)
92
call HwU_book(l+ 52,'jveto logpT ' //cc(i),50,0.d0,4.d0)
93
call HwU_book(l+ 53,'jveto eta ' //cc(i),50,-6.d0,6.d0)
94
call HwU_book(l+ 54,'jveto y ' //cc(i),50,-6.d0,6.d0)
103
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
104
subroutine analysis_end(dummy)
105
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
107
double precision dummy
113
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
114
subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)
115
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
117
include 'nexternal.inc'
118
integer istatus(nexternal)
119
integer iPDG(nexternal)
120
double precision p(0:4,nexternal)
121
double precision wgts(*)
123
double precision wgt,var
125
double precision www,pQCD(0:3,nexternal),palg,rfj,sycut,yjmax
126
$ ,pjet(0:3,nexternal),ptjet(nexternal),yjet(nexternal)
127
$ ,etajet(nexternal),ptj_tag,deltay12,mj1j2min,ph(0:3),pj1(0:3)
128
$ ,pj2(0:3),pj3(0:3),pjj(0:3),pHj(0:3),psyst(0:3),pjveto(0:3)
129
$ ,ptH,etaH,yH,njdble,ptj1,etaj1,yj1,ptHj,etaHj,yHj,DphiHj1
130
$ ,DRHj1,ptj2,etaj2,yj2,ptjj,etajj,yjj,ptsyst,etasyst,ysyst
131
$ ,DphiHj2,Dphij1j2,DRHj2,DRj1j2,mj1j2,Dyj1j2,ptj3,etaj3,yj3
132
$ ,yj3rel,chy1,shy1,chy1mo,chy2,shy2,chy2mo,ptrel_j1,ptrel_j2
133
$ ,ppboost(0:3,nexternal),prel_j1(0:3),prel_j2(0:3)
134
$ ,pj1boost(0:3),pj2boost(0:3),pt_veto,xsecup2
135
logical pass_tag_cuts,flag
136
integer nQCD,jet(nexternal),ij1y,ij2y,ij3y,njet,njety,ijveto
137
$ ,ijvetoy,ij1,ij2,ij3
138
double precision getptv4,getrapidityv4,getpseudorapv4,getdelphiv4
139
$ ,getdrv4,getinvmv4,getmod
140
external getptv4,getrapidityv4,getpseudorapv4,getdelphiv4,getdrv4
142
real*8 vetomin, vetomax
144
common /to_veto_hist/vetomin,vetomax,nbinveto
146
data (xd(i),i=1,3)/0d0,0d0,1d0/
147
if (nexternal.ne.6) then
148
write (*,*) 'error #1 in analysis_fill: '/
149
& /'only for process "p p > h j j [QCD]"'
152
if (.not. (abs(ipdg(1)).le.5 .or. ipdg(1).eq.21)) then
153
write (*,*) 'error #2 in analysis_fill: '/
154
& /'only for process "p p > h j j [QCD]"'
157
if (.not. (abs(ipdg(2)).le.5 .or. ipdg(2).eq.21)) then
158
write (*,*) 'error #3 in analysis_fill: '/
159
& /'only for process "p p > h j j [QCD]"'
162
if (.not. (abs(ipdg(4)).le.5 .or. ipdg(4).eq.21)) then
163
write (*,*) 'error #4 in analysis_fill: '/
164
& /'only for process "p p > h j j [QCD]"'
167
if (.not. (abs(ipdg(5)).le.5 .or. ipdg(5).eq.21)) then
168
write (*,*) 'error #5 in analysis_fill: '/
169
& /'only for process "p p > h j j [QCD]"'
172
if (.not. (abs(ipdg(6)).le.5 .or. ipdg(6).eq.21)) then
173
write (*,*) 'error #6 in analysis_fill: '/
174
& /'only for process "p p > h j j [QCD]"'
177
if (ipdg(3).ne.25) then
178
write (*,*) 'error #7 in analysis_fill: '/
179
& /'only for process "p p > h j j [QCD]"'
184
c Put all (light) QCD partons in momentum array for jet clustering.
186
do j=nincoming+1,nexternal
187
if (abs(ipdg(j)).le.5 .or. ipdg(j).eq.21) then
195
C---CLUSTER THE EVENT
218
c******************************************************************************
219
c call FASTJET to get all the jets
222
c input momenta: pQCD(0:3,nexternal), energy is 0th component
223
c number of input momenta: nQCD
224
c radius parameter: rfj
225
c minumum jet pt: sycut
226
c jet algorithm: palg, 1.0=kt, 0.0=C/A, -1.0 = anti-kt
229
c jet momenta: pjet(0:3,nexternal), E is 0th cmpnt
230
c the number of jets (with pt > SYCUT): njet
231
c the jet for a given particle 'i': jet(i), note that this is
232
c the particle in pQCD, which doesn't necessarily correspond to the particle
233
c label in the process
235
call amcatnlo_fastjetppgenkt(pQCD,nQCD,rfj,sycut,palg,pjet,njet
238
c******************************************************************************
240
ptjet(i)=getptv4(pjet(0,i))
242
if (ptjet(i).gt.ptjet(i-1)) then
243
write (*,*) "Error 1: jets should be ordered in pt"
247
yjet(i)=getrapidityv4(pjet(0,i))
248
etajet(i)=getpseudorapv4(pjet(0,i))
249
c look for veto jet without y cuts
250
if (i.gt.2.and.yjet(i).gt.min(yjet(1),yjet(2)).and.
251
& yjet(i).lt.max(yjet(1),yjet(2)).and.ijveto.eq.0) ijveto=i
253
C now look for jets within the rapidity cuts
254
if (dabs(yjet(i)).lt.yjmax) then
258
else if (ij2y.eq.0) then
260
else if (ij3y.eq.0) then
263
c look for veto jet with y cuts
265
& yjet(i).gt.min(yjet(ij1y),yjet(ij2y)).and.
266
& yjet(i).lt.max(yjet(ij1y),yjet(ij2y)).and.ijvetoy.eq.0)
271
c Nason-Oleari cuts (hep-ph/0911.5299)
276
c this is the loop for w-o / w vbf cuts
298
pjj(k) =pjet(k,ij1)+pjet(k,ij2)
299
pHj(k) =pjet(k,ij1)+pH(k)
300
psyst(k)=pjet(k,ij1)+pjet(k,ij2)+pH(k)
301
pjveto(k)=pjet(k,ijveto)
307
etaH = getpseudorapv4(pH)
308
yH = getrapidityv4(pH)
313
etaj1 = getpseudorapv4(pj1)
314
yj1 = getrapidityv4(pj1)
316
etaHj = getpseudorapv4(pHj)
317
yHj = getrapidityv4(pHj)
318
DphiHj1 = getdelphiv4(pH,pj1)
319
DRHj1 = getdrv4(pH,pj1)
324
etaj2 = getpseudorapv4(pj2)
325
yj2 = getrapidityv4(pj2)
327
etajj = getpseudorapv4(pjj)
328
yjj = getrapidityv4(pjj)
329
ptsyst = getptv4(psyst)
330
etasyst = getpseudorapv4(psyst)
331
ysyst = getrapidityv4(psyst)
332
DphiHj2 = getdelphiv4(pH,pj2)
333
Dphij1j2= getdelphiv4(pj1,pj2)
334
DRHj2 = getdrv4(pH,pj2)
335
DRj1j2 = getdrv4(pj1,pj2)
336
mj1j2 = getinvmv4(pjj)
337
Dyj1j2 = abs(yj1-yj2)
339
c At least three jets
342
etaj3 = getpseudorapv4(pj3)
343
yj3 = getrapidityv4(pj3)
344
yj3rel = yj3-(yj1+yj2)/2d0
354
call boostwdir2(chy1,shy1,chy1mo,xd,pj1,pj1boost)
355
call boostwdir2(chy2,shy2,chy2mo,xd,pj2,pj2boost)
359
pass_tag_cuts = njety.ge.2 .and.
360
& ptj1.ge.ptj_tag .and.
361
& ptj2.ge.ptj_tag .and.
362
& abs(yj1-yj2).ge.deltay12 .and.
363
& yj1*yj2.le.0d0 .and.
376
if(njet.ge.1.and.jet(j).eq.1)then
377
call boostwdir2(chy1,shy1,chy1mo,xd,pQCD(0,j),ppboost(0,j))
378
call getwedge(ppboost(0,j),pj1boost,prel_j1)
379
ptrel_j1=ptrel_j1+getmod(prel_j1)/getmod(pj1boost)
380
elseif(njet.ge.2.and.jet(j).eq.2)then
381
call boostwdir2(chy2,shy2,chy2mo,xd,pQCD(0,j),ppboost(0,j))
382
call getwedge(ppboost(0,j),pj2boost,prel_j2)
383
ptrel_j2=ptrel_j2+getmod(prel_j2)/getmod(pj2boost)
389
call HwU_fill(l+ 1,1d0,wgts)
390
call HwU_fill(l+ 2,ptH,wgts)
391
call HwU_fill(l+ 3,ptH,wgts)
392
if(ptH.gt.0d0) call HwU_fill(l+ 4,log10(ptH),wgts)
393
call HwU_fill(l+ 5,etaH,wgts)
394
call HwU_fill(l+ 6,yH,wgts)
395
call HwU_fill(l+ 46,njdble,wgts)
398
call HwU_fill(l+ 7,ptj1,wgts)
399
call HwU_fill(l+ 8,ptj1,wgts)
400
if (ptj1.gt.0d0) call HwU_fill(l+ 9,log10(ptj1),wgts)
401
call HwU_fill(l+ 10,etaj1,wgts)
402
call HwU_fill(l+ 11,yj1,wgts)
403
call HwU_fill(l+ 22,ptHj,wgts)
404
call HwU_fill(l+ 23,ptHj,wgts)
405
if(ptHj.gt.0d0) call HwU_fill(l+ 24,log10(ptHj),wgts)
406
call HwU_fill(l+ 25,etaHj,wgts)
407
call HwU_fill(l+ 26,yHj,wgts)
408
call HwU_fill(l+ 37,DphiHj1,wgts)
409
call HwU_fill(l+ 40,DRHj1,wgts)
410
call HwU_fill(l+ 47,ptrel_j1,wgts)
414
call HwU_fill(l+ 12,ptj2,wgts)
415
call HwU_fill(l+ 13,ptj2,wgts)
416
if (ptj2.gt.0d0) call HwU_fill(l+ 14,log10(ptj2),wgts)
417
call HwU_fill(l+ 15,etaj2,wgts)
418
call HwU_fill(l+ 16,yj2,wgts)
419
call HwU_fill(l+ 27,ptjj,wgts)
420
call HwU_fill(l+ 28,ptjj,wgts)
421
if(ptjj.gt.0d0) call HwU_fill(l+ 29,log10(ptjj),wgts)
422
call HwU_fill(l+ 30,etajj,wgts)
423
call HwU_fill(l+ 31,yjj,wgts)
424
call HwU_fill(l+ 32,ptsyst,wgts)
425
call HwU_fill(l+ 33,ptsyst,wgts)
426
if(ptsyst.gt.0d0) call HwU_fill(l+ 34,log10(ptsyst),wgts)
427
call HwU_fill(l+ 35,etasyst,wgts)
428
call HwU_fill(l+ 36,ysyst,wgts)
429
call HwU_fill(l+ 38,DphiHj2,wgts)
430
call HwU_fill(l+ 39,Dphij1j2,wgts)
431
call HwU_fill(l+ 41,DRHj2,wgts)
432
call HwU_fill(l+ 42,DRj1j2,wgts)
433
call HwU_fill(l+ 43,mj1j2,wgts)
434
call HwU_fill(l+ 44,Dyj1j2,wgts)
435
call HwU_fill(l+ 48,ptrel_j2,wgts)
439
call HwU_fill(l+ 17,ptj3,wgts)
440
call HwU_fill(l+ 18,ptj3,wgts)
441
if(ptj3.gt.0d0) call HwU_fill(l+ 19,log10(ptj3),wgts)
442
call HwU_fill(l+ 20,etaj3,wgts)
443
call HwU_fill(l+ 21,yj3,wgts)
444
call HwU_fill(l+ 45,yj3rel,wgts)
446
if (ijveto.gt.0) then
447
pt_veto = getptv4(pjveto)
449
if (pt_veto.gt. (vetomin+(vetomax-vetomin)*dble(k-1)
450
$ /dble(nbinveto))) then
451
call HwU_fill(l+49, (vetomax-vetomin)* dble(k)
452
$ /dble(nbinveto)*0.99, wgts/xsecup2)
455
call HwU_fill(l+50,pt_veto,wgts)
456
call HwU_fill(l+51,pt_veto,wgts)
457
if (pt_veto.gt.0d0) call HwU_fill(l+52,dlog10(pt_veto),wgts)
458
call HwU_fill(l+53,getpseudorapv4(pjveto),wgts)
459
call HwU_fill(l+54,getrapidityv4(pjveto),wgts)
468
function getrapidity(en,pl)
470
real*8 getrapidity,en,pl,tiny,xplus,xminus,y
471
parameter (tiny=1.d-8)
475
if(xplus.gt.tiny.and.xminus.gt.tiny)then
476
if( (xplus/xminus).gt.tiny.and.(xminus/xplus).gt.tiny )then
477
y=0.5d0*log( xplus/xminus )
489
function getpseudorap(en,ptx,pty,pl)
491
real*8 getpseudorap,en,ptx,pty,pl,tiny,pt,eta,th
492
parameter (tiny=1.d-5)
494
pt=sqrt(ptx**2+pty**2)
495
if(pt.lt.tiny.and.abs(pl).lt.tiny)then
496
eta=sign(1.d0,pl)*1.d8
499
eta=-log(tan(th/2.d0))
506
function getinvm(en,ptx,pty,pl)
508
real*8 getinvm,en,ptx,pty,pl,tiny,tmp
509
parameter (tiny=1.d-5)
511
tmp=en**2-ptx**2-pty**2-pl**2
514
elseif(tmp.gt.-tiny)then
517
write(*,*)'Attempt to compute a negative mass'
525
function getdelphi(ptx1,pty1,ptx2,pty2)
527
real*8 getdelphi,ptx1,pty1,ptx2,pty2,tiny,pt1,pt2,tmp
528
parameter (tiny=1.d-5)
530
pt1=sqrt(ptx1**2+pty1**2)
531
pt2=sqrt(ptx2**2+pty2**2)
532
if(pt1.ne.0.d0.and.pt2.ne.0.d0)then
533
tmp=ptx1*ptx2+pty1*pty2
535
if(abs(tmp).gt.1.d0+tiny)then
536
write(*,*)'Cosine larger than 1'
538
elseif(abs(tmp).ge.1.d0)then
550
function getdr(en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2)
552
real*8 getdr,en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2,deta,dphi,
553
# getpseudorap,getdelphi
555
deta=getpseudorap(en1,ptx1,pty1,pl1)-
556
# getpseudorap(en2,ptx2,pty2,pl2)
557
dphi=getdelphi(ptx1,pty1,ptx2,pty2)
558
getdr=sqrt(dphi**2+deta**2)
563
function getdry(en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2)
565
real*8 getdry,en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2,deta,dphi,
566
# getrapidity,getdelphi
568
deta=getrapidity(en1,pl1)-
569
# getrapidity(en2,pl2)
570
dphi=getdelphi(ptx1,pty1,ptx2,pty2)
571
getdry=sqrt(dphi**2+deta**2)
580
getptv=sqrt(p(1)**2+p(2)**2)
585
function getpseudorapv(p)
587
real*8 getpseudorapv,p(5)
590
getpseudorapv=getpseudorap(p(4),p(1),p(2),p(3))
595
function getrapidityv(p)
597
real*8 getrapidityv,p(5)
600
getrapidityv=getrapidity(p(4),p(3))
605
function getdrv(p1,p2)
607
real*8 getdrv,p1(5),p2(5)
610
getdrv=getdr(p1(4),p1(1),p1(2),p1(3),
611
# p2(4),p2(1),p2(2),p2(3))
621
getinvmv=getinvm(p(4),p(1),p(2),p(3))
626
function getdelphiv(p1,p2)
628
real*8 getdelphiv,p1(5),p2(5)
631
getdelphiv=getdelphi(p1(1),p1(2),
639
real*8 getptv4,p(0:3)
641
getptv4=sqrt(p(1)**2+p(2)**2)
646
function getpseudorapv4(p)
648
real*8 getpseudorapv4,p(0:3)
651
getpseudorapv4=getpseudorap(p(0),p(1),p(2),p(3))
656
function getrapidityv4(p)
658
real*8 getrapidityv4,p(0:3)
661
getrapidityv4=getrapidity(p(0),p(3))
666
function getdrv4(p1,p2)
668
real*8 getdrv4,p1(0:3),p2(0:3)
671
getdrv4=getdr(p1(0),p1(1),p1(2),p1(3),
672
# p2(0),p2(1),p2(2),p2(3))
677
function getinvmv4(p)
679
real*8 getinvmv4,p(0:3)
682
getinvmv4=getinvm(p(0),p(1),p(2),p(3))
687
function getdelphiv4(p1,p2)
689
real*8 getdelphiv4,p1(0:3),p2(0:3)
692
getdelphiv4=getdelphi(p1(1),p1(2),
698
function getcosv4(q1,q2)
700
real*8 getcosv4,q1(0:3),q2(0:3)
701
real*8 xnorm1,xnorm2,tmp
703
if(q1(0).lt.0.d0.or.q2(0).lt.0.d0)then
707
xnorm1=sqrt(q1(1)**2+q1(2)**2+q1(3)**2)
708
xnorm2=sqrt(q2(1)**2+q2(2)**2+q2(3)**2)
709
if(xnorm1.lt.1.d-6.or.xnorm2.lt.1.d-6)then
712
tmp=q1(1)*q2(1)+q1(2)*q2(2)+q1(3)*q2(3)
713
tmp=tmp/(xnorm1*xnorm2)
714
if(abs(tmp).gt.1.d0.and.abs(tmp).le.1.001d0)then
716
elseif(abs(tmp).gt.1.001d0)then
717
write(*,*)'Error in getcosv4',tmp
729
double precision p(0:3),getmod
731
getmod=sqrt(p(1)**2+p(2)**2+p(3)**2)
738
subroutine getperpenv4(q1,q2,qperp)
739
c Normal to the plane defined by \vec{q1},\vec{q2}
741
real*8 q1(0:3),q2(0:3),qperp(0:3)
745
xnorm1=sqrt(q1(1)**2+q1(2)**2+q1(3)**2)
746
xnorm2=sqrt(q2(1)**2+q2(2)**2+q2(3)**2)
747
if(xnorm1.lt.1.d-6.or.xnorm2.lt.1.d-6)then
752
qperp(1)=q1(2)*q2(3)-q1(3)*q2(2)
753
qperp(2)=q1(3)*q2(1)-q1(1)*q2(3)
754
qperp(3)=q1(1)*q2(2)-q1(2)*q2(1)
756
qperp(i)=qperp(i)/(xnorm1*xnorm2)
766
subroutine getwedge(p1,p2,pout)
768
real*8 p1(0:3),p2(0:3),pout(0:3)
770
pout(1)=p1(2)*p2(3)-p1(3)*p2(2)
771
pout(2)=p1(3)*p2(1)-p1(1)*p2(3)
772
pout(3)=p1(1)*p2(2)-p1(2)*p2(1)