13 INTERFACE OPERATOR (.dot.)
18 END INTERFACE OPERATOR (.dot.)
20 INTERFACE OPERATOR (.cross.)
22 END INTERFACE OPERATOR (.cross.)
39 real(8),
intent(in) :: p1(1:3),p2(1:3)
51 real(8),
intent(in) :: p1(1:4),p2(1:4)
62 complex(8),
intent(in) :: p1(1:4),p2(1:4)
73 real(8),
intent(in) :: p1(1:4)
74 complex(8),
intent(in) :: p2(1:4)
85 real(8),
intent(in) :: p2(1:4)
86 complex(8),
intent(in) :: p1(1:4)
108 double complex function et1(e1,e2,e3,e4)
110 complex(8),
intent(in) :: e1(4), e2(4), e3(4), e4(4)
111 et1 = e1(1)*e2(2)*e3(3)*e4(4)-e1(1)*e2(2)*e3(4)*e4(3) &
112 -e1(1)*e2(3)*e3(2)*e4(4)+e1(1)*e2(3)*e3(4)*e4(2) &
113 +e1(1)*e2(4)*e3(2)*e4(3)-e1(1)*e2(4)*e3(3)*e4(2) &
114 -e1(2)*e2(1)*e3(3)*e4(4)+e1(2)*e2(1)*e3(4)*e4(3) &
115 +e1(2)*e2(3)*e3(1)*e4(4)-e1(2)*e2(3)*e3(4)*e4(1) &
116 -e1(2)*e2(4)*e3(1)*e4(3)+e1(2)*e2(4)*e3(3)*e4(1) &
117 +e1(3)*e2(1)*e3(2)*e4(4)-e1(3)*e2(1)*e3(4)*e4(2) &
118 -e1(3)*e2(2)*e3(1)*e4(4)+e1(3)*e2(2)*e3(4)*e4(1) &
119 +e1(3)*e2(4)*e3(1)*e4(2)-e1(3)*e2(4)*e3(2)*e4(1) &
120 -e1(4)*e2(1)*e3(2)*e4(3)+e1(4)*e2(1)*e3(3)*e4(2) &
121 +e1(4)*e2(2)*e3(1)*e4(3)-e1(4)*e2(2)*e3(3)*e4(1) &
122 -e1(4)*e2(3)*e3(1)*e4(2)+e1(4)*e2(3)*e3(2)*e4(1)
126 double complex function sc(q1,q2)
128 complex(8),
intent(in) :: q1(4)
129 complex(8),
intent(in) :: q2(4)
134 double precision function scr(p1,p2)
136 real(8),
intent(in) :: p1(4),p2(4)
141 double complex function scrc(p1,p2)
143 real(8),
intent(in) :: p1(4)
144 complex(8),
intent(in) :: p2(4)
155 get_pt = dsqrt( mom(2)**2 + mom(3)**2 )
165 get_pt2 = mom(2)**2 + mom(3)**2
175 get_minv = dsqrt( dabs(mom(1:4).dot.mom(1:4)) )
193 get_eta = 0.5d0*dlog( dabs((mom(1)+mom(4)+1d-16)/(mom(1)-mom(4) +1d-16) ))
203 get_phi = datan2( mom(3),mom(2) )
215 get_cosalpha = (mom1(2)*mom2(2)+mom1(3)*mom2(3)+mom1(4)*mom2(4))/dsqrt(mom1(2)**2+mom1(3)**2+mom1(4)**2)/dsqrt(mom2(2)**2+mom2(3)**2+mom2(4)**2)
225 get_costheta = mom(4)/dsqrt( mom(2)**2+mom(3)**2+mom(4)**2 +1d-16)
232 FUNCTION get_r(Mom1,Mom2)
234 real(8),
parameter :: pi=3.141592653589793d0
235 real(8) :: mom1(1:4),mom2(1:4),
get_r
236 real(8) :: eta1,eta2,phi1,phi2,deltaphi,r2,delphi
242 deltaphi = dabs(phi1-phi2)
243 if( deltaphi.gt.pi ) deltaphi=2d0*pi-deltaphi
244 get_r = dsqrt((eta1-eta2)**2 + deltaphi**2)
255 real(8) :: Mom(1:4,1:N),Mom_Tmp(1:4,1:N),pTList(1:N)
256 integer :: i,MomOrder(1:N)
261 ptlist(i) =
get_pt(mom(1:4,i))
265 call bublesort(n,ptlist(1:n),momorder(1:n))
267 mom_tmp(1:4,1:n) = mom(1:4,1:n)
269 mom(1:4,i) = mom_tmp(1:4,momorder(i))
276 #define MakeBubleSort(typex, typey, name) \
277 SUBROUTINE name(N,X, IY) ;\
283 integer :: i, j, jmax ;\
285 logical :: keepgoing ;\
287 keepgoing = .true. ;\
290 keepgoing = .false. ;\
292 if(x(j).gt.x(j+1)) cycle ;\
293 keepgoing = .true. ;\
301 if(.not.keepgoing)
return ;\
308 makebublesort(
integer(8),
integer, BubleSort_integerinteger)
309 makebublesort(real(8),
integer, BubleSort_realinteger)
310 makebublesort(
character(len=100),
logical, BubleSort_stringlogical)
311 makebublesort(
character(len=100),
integer, BubleSort_stringinteger)
312 makebublesort(
character(len=100),
real(8), BubleSort_stringreal8)
313 makebublesort(
character(len=100),
complex(8), BubleSort_stringcomplex8)
314 makebublesort(
character(len=100),
character(len=100), BubleSort_stringstring)
330 #define MakeReOrder(typey, typex, name) \
331 SUBROUTINE name(N, iy,x) ;\
335 typex :: temp(1:n) ;\
338 temp(i) = x( iy(i) ) ;\
340 x(1:n) = temp(1:n) ;\
345 makereorder(
integer,
integer, ReOrder_integerinteger)
346 makereorder(
integer,
real(8), ReOrder_integerreal)
356 write (*,
"(A,I2,A,1F20.16,A,1F20.16,A,1F20.16,A,1F20.16,A)")
"Mom(1:4,",n,
")= (/",mom(1,n),
"d0,",mom(2,n),
"d0,",mom(3,n),
"d0,",mom(4,n),
"d0 /)"
365 SUBROUTINE error(Message,ErrNum)
367 character(*) :: Message
368 integer,
optional :: ErrNum
370 if(
present(errnum) )
then
371 print *,
"ERROR: ",message,errnum
373 print *,
"ERROR: ",message
384 isnan = .not.(x.eq.x)
392 SUBROUTINE swapi(i,j)
402 SUBROUTINE swapr(i,j)
412 SUBROUTINE swapc(i,j)
414 complex(8) :: i,j,temp
424 real(8) :: Mom1(1:4),Mom2(1:4),tmp(1:4)
427 mom2(1:4) = mom1(1:4)
435 complex(8) :: Mom1(1:4),Mom2(1:4),tmp(1:4)
438 mom2(1:4) = mom1(1:4)
449 complex(8),
intent(in) :: e1(4), e2(4), e3(4), e4(4)
452 leviciv = e1(1)*e2(2)*e3(3)*e4(4)-e1(1)*e2(2)*e3(4)*e4(3) &
453 -e1(1)*e2(3)*e3(2)*e4(4)+e1(1)*e2(3)*e3(4)*e4(2) &
454 +e1(1)*e2(4)*e3(2)*e4(3)-e1(1)*e2(4)*e3(3)*e4(2) &
455 -e1(2)*e2(1)*e3(3)*e4(4)+e1(2)*e2(1)*e3(4)*e4(3) &
456 +e1(2)*e2(3)*e3(1)*e4(4)-e1(2)*e2(3)*e3(4)*e4(1) &
457 -e1(2)*e2(4)*e3(1)*e4(3)+e1(2)*e2(4)*e3(3)*e4(1) &
458 +e1(3)*e2(1)*e3(2)*e4(4)-e1(3)*e2(1)*e3(4)*e4(2) &
459 -e1(3)*e2(2)*e3(1)*e4(4)+e1(3)*e2(2)*e3(4)*e4(1) &
460 +e1(3)*e2(4)*e3(1)*e4(2)-e1(3)*e2(4)*e3(2)*e4(1) &
461 -e1(4)*e2(1)*e3(2)*e4(3)+e1(4)*e2(1)*e3(3)*e4(2) &
462 +e1(4)*e2(2)*e3(1)*e4(3)-e1(4)*e2(2)*e3(3)*e4(1) &
463 -e1(4)*e2(3)*e3(1)*e4(2)+e1(4)*e2(3)*e3(2)*e4(1)
473 real(8) :: pv,ct,st,cphi,sphi
476 pv=dsqrt(dabs(p(1)**2))
478 st=dsqrt(abs(1.0d0-ct**2))
480 if( st.le.1d-9 )
then
510 real(8):: pf(1:4),pfbar(1:4)
511 complex(8) :: ub(1:4),v(1:4)
518 pol_zff_outgoing(3)=-(0d0,1d0)*(ub(1)*v(4)+v(1)*ub(4)-ub(2)*v(3)-v(2)*ub(3))
530 complex(8) :: fc, fc2
536 if( abs(fc2).gt.1d-9 )
then
542 elseif (hel.eq.-1)
then
554 elseif (hel.eq.-1)
then
571 complex(8) :: fc2, fc
577 if( abs(fc2).gt.1d-9 )
then
581 v_spinor(3)=(p(2)-(0d0,1d0)*p(3))/fc
583 elseif (hel.eq.-1)
then
585 v_spinor(2)=(p(2)+(0d0,1d0)*p(3))/fc
595 elseif (hel.eq.-1)
then
609 double complex :: sp(1:4)
627 complex(8),
intent(in) :: sp1(:), sp2(:)
628 integer,
parameter :: dv=4
631 complex(8) :: rr, va(dv),sp1a(4)
645 rr=sum(sp1a(1:4)*sp2(1:4))
658 complex(8),
intent(in) :: sp(:),v(:)
660 complex(8) :: x0(4,4),xx(4,4),xy(4,4)
661 complex(8) :: xz(4,4),x5(4,4)
662 complex(8) :: y1,y2,y3,y4,bp,bm,cp,cm
663 integer :: i,i1,i2,i3,dv,ds,imax
689 xy(2,i)=-(0d0,1d0)*y3
690 xy(3,i)=-(0d0,1d0)*y2
706 spb2_weyl(i)=v(1)*x0(i,1)-v(2)*xx(i,1)-v(3)*xy(i,1)-v(4)*xz(i,1)
712 complex(8),
intent(in) :: sp(:),v(:)
714 complex(8) :: x0(4,4),xx(4,4),xy(4,4)
715 complex(8) :: xz(4,4),x5(4,4)
716 complex(8) :: y1,y2,y3,y4,bp,bm,cp,cm
717 integer :: i,i1,i2,i3,imax,dv,ds
746 xy(2,i)=-(0d0,1d0)*y3
747 xy(3,i)=-(0d0,1d0)*y2
761 spi2_weyl(i)=v(1)*x0(i,1)-v(2)*xx(i,1) -v(3)*xy(i,1)-v(4)*xz(i,1)
770 character(len=*) :: eventinfoline
772 integer :: i, j, fieldwidth, spaces(1:6)
773 integer :: processidcharacters, weightscaleaqedaqcdcharacters(1:4), weightscaleaqedaqcdafterdecimal(1:4)
774 character(len=40) :: formatparts(1:6)
779 do while (eventinfoline(i:i) .eq.
" ")
781 spaces(1) = spaces(1)+1
785 do while (eventinfoline(i:i) .ne.
" ")
787 fieldwidth = fieldwidth+1
789 spaces(1) = spaces(1) + fieldwidth - 2
795 processidcharacters = -1
797 do while (eventinfoline(i:i) .eq.
" ")
799 processidcharacters = processidcharacters+1
801 do while (eventinfoline(i:i) .ne.
" ")
803 processidcharacters = processidcharacters+1
809 do while (eventinfoline(i:i) .eq.
" ")
811 spaces(j+2) = spaces(j+2)+1
813 if (eventinfoline(i:i) .eq.
"-")
then
815 weightscaleaqedaqcdcharacters(j) = 1
816 else if (spaces(j+2).eq.1)
then
817 weightscaleaqedaqcdcharacters(j) = 0
819 spaces(j+2) = spaces(j+2)-1
820 weightscaleaqedaqcdcharacters(j) = 1
822 do while (eventinfoline(i:i) .ne.
" ")
824 weightscaleaqedaqcdcharacters(j) = weightscaleaqedaqcdcharacters(j)+1
826 weightscaleaqedaqcdafterdecimal(j) = weightscaleaqedaqcdcharacters(j)-7
830 if (spaces(1).eq.0)
then
831 formatparts(1) =
"(I2,"
833 write(formatparts(1),
"(A,I1,A)")
"(", spaces(1),
"X,I2,"
835 if (processidcharacters.lt.10)
then
836 write(formatparts(2),
"(I1,A,I1,A)") spaces(2),
"X,I", processidcharacters
838 write(formatparts(2),
"(I1,A,I2)") spaces(2),
"X,I", processidcharacters
841 if (weightscaleaqedaqcdcharacters(j).lt.10)
then
842 write(formatparts(j+2),
"(A,I1,A,I1,A,I1)")
",", spaces(j+2),
"X,1PE", weightscaleaqedaqcdcharacters(j),
".", weightscaleaqedaqcdafterdecimal(j)
843 elseif (weightscaleaqedaqcdcharacters(j).lt.17)
then
844 write(formatparts(j+2),
"(A,I1,A,I2,A,I1)")
",", spaces(j+2),
"X,1PE", weightscaleaqedaqcdcharacters(j),
".", weightscaleaqedaqcdafterdecimal(j)
846 write(formatparts(j+2),
"(A,I1,A,I2,A,I2)")
",", spaces(j+2),
"X,1PE", weightscaleaqedaqcdcharacters(j),
".", weightscaleaqedaqcdafterdecimal(j)
851 // trim(formatparts(2)) &
852 // trim(formatparts(3)) &
853 // trim(formatparts(4)) &
854 // trim(formatparts(5)) &
855 // trim(formatparts(6)) &
865 character(len=*) :: particleline
866 integer :: i, j, fieldwidth, spaces(1:13)
868 integer :: momentumcharacters(1:5), lifetimecharacters, lifetimedigitsafterdecimal, spincharacters, spindigitsafterdecimal
869 logical :: lifetimeisexponential, spinisexponential
870 character(len=40) :: formatparts(11)
874 do while (particleline(i:i) .eq.
" ")
876 spaces(1) = spaces(1)+1
880 do while (particleline(i:i) .ne.
" ")
882 fieldwidth = fieldwidth+1
884 spaces(1) = spaces(1) + fieldwidth - 3
888 do while (particleline(i:i) .eq.
" ")
890 spaces(2) = spaces(2)+1
894 do while (particleline(i:i) .ne.
" ")
896 fieldwidth = fieldwidth+1
898 spaces(2) = spaces(2) + fieldwidth - 2
902 do while (particleline(i:i) .eq.
" ")
904 spaces(3) = spaces(3)+1
907 do while (particleline(i:i) .ne.
" ")
909 fieldwidth = fieldwidth+1
911 spaces(3) = spaces(3) + fieldwidth - 2
915 do while (particleline(i:i) .eq.
" ")
917 spaces(4) = spaces(4)+1
920 do while (particleline(i:i) .ne.
" ")
922 fieldwidth = fieldwidth+1
924 spaces(4) = spaces(4) + fieldwidth - 2
928 do while (particleline(i:i) .eq.
" ")
930 spaces(5) = spaces(5)+1
933 do while (particleline(i:i) .ne.
" ")
935 fieldwidth = fieldwidth+1
937 spaces(5) = spaces(5) + fieldwidth - 3
941 do while (particleline(i:i) .eq.
" ")
943 spaces(6) = spaces(6)+1
946 do while (particleline(i:i) .ne.
" ")
948 fieldwidth = fieldwidth+1
950 spaces(6) = spaces(6) + fieldwidth - 3
958 do while (particleline(i:i) .eq.
" ")
960 spaces(j) = spaces(j)+1
962 if (particleline(i:i) .eq.
"-")
then
965 spaces(j) = spaces(j)-1
970 momentumcharacters(j-6) = 1
971 do while (particleline(i:i) .ne.
" ")
973 momentumcharacters(j-6) = momentumcharacters(j-6)+1
982 do while (particleline(i:i) .eq.
" ")
984 spaces(12) = spaces(12)+1
988 lifetimecharacters = 0
989 lifetimedigitsafterdecimal = -1
990 lifetimeisexponential = .false.
991 do while (particleline(i:i) .ne.
" ")
992 if ((lifetimedigitsafterdecimal .ge. 0 .and. .not.lifetimeisexponential) &
993 .or. particleline(i:i) .eq.
".")
then
994 lifetimedigitsafterdecimal = lifetimedigitsafterdecimal+1
996 if (particleline(i:i) .eq.
"E" .or. particleline(i:i) .eq.
"e")
then
997 lifetimeisexponential = .true.
1000 lifetimecharacters = lifetimecharacters+1
1006 do while (particleline(i:i) .eq.
" ")
1008 spaces(13) = spaces(13)+1
1010 if (particleline(i:i) .eq.
"-")
then
1013 spaces(13) = spaces(13)-1
1019 spindigitsafterdecimal = -1
1020 spinisexponential = .false.
1021 do while (particleline(i:i) .ne.
" ")
1022 if (spindigitsafterdecimal .ge. 0 .or. particleline(i:i) .eq.
".")
then
1023 spindigitsafterdecimal = spindigitsafterdecimal+1
1025 if (particleline(i:i) .eq.
"E" .or. particleline(i:i) .eq.
"e")
then
1026 spinisexponential = .true.
1029 spincharacters = spincharacters+1
1037 if (spaces(i).eq.0)
then
1039 if (i.ge.7 .and. i.le.11)
then
1040 momentumcharacters(i-6) = momentumcharacters(i-6)-1
1043 spincharacters = spincharacters-1
1050 if (spaces(1).eq.0)
then
1051 formatparts(1) =
"(I3,"
1053 write(formatparts(1),
"(A,I1,A)")
"(", spaces(1),
"X,I3,"
1056 write(formatparts(2),
"(I1,A)") spaces(2),
"X,I2,"
1058 write(formatparts(3),
"(I1,A,I1,A)") spaces(3),
"X,I2,", spaces(4),
"X,I2,"
1060 write(formatparts(4),
"(I1,A,I1,A)") spaces(5),
"X,I3,", spaces(6),
"X,I3,"
1064 if (momentumcharacters(i-4) .lt. 10)
then
1065 write(formatparts(i),
"(I1,A,I1,A,I1,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1066 elseif (momentumcharacters(i-4) .lt. 17)
then
1067 write(formatparts(i),
"(I1,A,I2,A,I1,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1069 write(formatparts(i),
"(I1,A,I2,A,I2,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1074 if (lifetimeisexponential)
then
1075 if (lifetimecharacters .lt. 10)
then
1076 write(formatparts(10),
"(I1,A,I1,A,I1,A)") &
1077 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1078 elseif (lifetimedigitsafterdecimal.lt.10)
then
1079 write(formatparts(10),
"(I1,A,I2,A,I1,A)") &
1080 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1082 write(formatparts(10),
"(I1,A,I2,A,I2,A)") &
1083 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1086 if (lifetimecharacters .lt. 10)
then
1087 write(formatparts(10),
"(I1,A,I1,A,I1,A)") &
1088 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1089 elseif (lifetimedigitsafterdecimal.lt.10)
then
1090 write(formatparts(10),
"(I1,A,I2,A,I1,A)") &
1091 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1093 write(formatparts(10),
"(I1,A,I2,A,I2,A)") &
1094 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1099 if (spinisexponential)
then
1100 if (spincharacters .lt. 10)
then
1101 write(formatparts(11),
"(I1,A,I1,A,I1,A)") &
1102 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1103 elseif (spindigitsafterdecimal.lt.10)
then
1104 write(formatparts(11),
"(I1,A,I2,A,I1,A)") &
1105 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1107 write(formatparts(11),
"(I1,A,I2,A,I2,A)") &
1108 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1111 if (spincharacters .lt. 10)
then
1112 write(formatparts(11),
"(I1,A,I1,A,I1,A)") &
1113 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1114 elseif (spindigitsafterdecimal.lt.10)
then
1115 write(formatparts(11),
"(I1,A,I2,A,I1,A)") &
1116 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1118 write(formatparts(11),
"(I1,A,I2,A,I2,A)") &
1119 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1128 // trim(formatparts(2)) &
1129 // trim(formatparts(3)) &
1130 // trim(formatparts(4)) &
1131 // trim(formatparts(5)) &
1132 // trim(formatparts(6)) &
1133 // trim(formatparts(7)) &
1134 // trim(formatparts(8)) &
1135 // trim(formatparts(9)) &
1136 // trim(formatparts(10)) &
1137 // trim(formatparts(11)))
1145 character(len=150) :: inputstring
1147 character(len=26),
parameter :: lower =
"abcdefghijklmnopqrstuvwxyz"
1148 character(len=26),
parameter :: upper =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1153 do i=1,len(trim(inputstring))
1154 j = index(lower,inputstring(i:i))
1178 real(8) :: totalxsec, CrossSecNormalized(-5:5,-5:5), yRnd
1180 integer,
intent(in) :: TotalNumberOfSeats
1181 real(8),
intent(in) :: XSecArray(-5:5,-5:5)
1182 integer(8),
intent(out) :: NumberOfSeats(-5:5,-5:5)
1184 numberofseats(:,:) = 0
1185 if (totalnumberofseats.lt.1)
return
1189 totalxsec = totalxsec+abs(xsecarray(i,j))
1192 if (totalxsec.eq.0d0)
then
1193 print *,
"HouseOfRepresentatives: Total xsec is 0. Aborting..."
1198 crosssecnormalized(i,j) = abs(xsecarray(i,j)) / totalxsec
1202 do n=1,totalnumberofseats
1204 call random_number(yrnd)
1207 if (yrnd .lt. crosssecnormalized(i,j))
then
1208 numberofseats(i,j) = numberofseats(i,j)+1
1211 yrnd = yrnd - crosssecnormalized(i,j)
1215 print *,
"HouseOfRepresentatives: Warning, rounding error, try again"
1220 if (sum(numberofseats(:,:)).ne.totalnumberofseats)
then
1221 print *,
"HouseOfRepresentatives: Wrong total number of events, shouldn't be able to happen"
1232 real(8),
intent(in) :: XSecArray(:)
1233 real(8) :: totalxsec, CrossSecNormalized(size(XSecArray)), yRnd
1234 integer :: n,i,nchannels
1235 integer,
intent(in) :: TotalNumberOfSeats
1236 integer(8),
intent(out) :: NumberOfSeats(:)
1238 numberofseats(:) = 0
1239 if (totalnumberofseats.lt.1)
return
1241 nchannels =
size(xsecarray)
1244 totalxsec = totalxsec+abs(xsecarray(i))
1246 if (totalxsec.eq.0d0)
then
1247 print *,
"HouseOfRepresentatives2: Total xsec is 0. Aborting..."
1251 crosssecnormalized(i) = abs(xsecarray(i)) / totalxsec
1254 do n=1,totalnumberofseats
1256 call random_number(yrnd)
1258 if (yrnd .lt. crosssecnormalized(i))
then
1259 numberofseats(i) = numberofseats(i)+1
1262 yrnd = yrnd - crosssecnormalized(i)
1264 print *,
"HouseOfRepresentatives2: Warning, rounding error, try again"
1269 if (sum(numberofseats(:)).ne.totalnumberofseats)
then
1270 print *,
"HouseOfRepresentatives2: Wrong total number of events, shouldn't be able to happen"
1283 real(8) :: p(1:4),tmp(1:4)
1284 real(8),
optional :: pout(1:4)
1286 if(
present(pout) )
then
1310 SUBROUTINE evaluatespline(EvalPoint, SplineData, SplineDataLength, TheResult)
1317 INTEGER i,top,gdim,SplineDataLength
1318 REAL(8) u,
value,EvalPoint
1319 REAL(8),
intent(out) :: TheResult
1320 REAL(8),
dimension(SplineDataLength) :: bc,cc,dc
1321 REAL(8) :: SplineData(1:SplineDataLength, 1:2)
1325 gdim= splinedatalength
1327 CALL hto_fmmsplinesingleht(bc,cc,dc,top,gdim,splinedata(1:splinedatalength,1),splinedata(1:splinedatalength,2))
1330 CALL hto_seval3singleht(u,bc,cc,dc,top,gdim,
value,xc=splinedata(1:splinedatalength,1),yc=splinedata(1:splinedatalength,2))
1344 INTEGER k,n,i,top,gdim,l
1346 REAL(8),
dimension(gdim) :: xc,yc
1347 REAL(8),
dimension(gdim) :: x,y
1349 REAL(8),
DIMENSION(gdim) :: b
1352 REAL(8),
DIMENSION(gdim) :: c
1355 REAL(8),
DIMENSION(gdim) :: d
1359 REAL(8),
PARAMETER:: ZERO=0.0, two=2.0, three=3.0
1374 c(2)= (y(2)-y(1))/d(1)
1377 b(k)= two*(d(k-1)+d(k))
1378 c(k+1)= (y(k+1)-y(k))/d(k)
1390 c(1)= c(3)/(x(4)-x(2))-c(2)/(x(3)-x(1))
1391 c(n)= c(n-1)/(x(n)-x(n-2))-c(n-2)/(x(n-1)-x(n-3))
1392 c(1)= c(1)*d(1)*d(1)/(x(4)-x(1))
1393 c(n)= -c(n)*d(n-1)*d(n-1)/(x(n)-x(n-3))
1407 c(k)= (c(k)-d(k)*c(k+1))/b(k)
1412 b(n)= (y(n)-y(n-1))/d(n-1)+d(n-1)*(c(n-1)+c(n)+c(n))
1414 b(k)= (y(k+1)-y(k))/d(k)-d(k)*(c(k+1)+c(k)+c(k))
1415 d(k)= (c(k+1)-c(k))/d(k)
1427 SUBROUTINE hto_seval3singleht(u,b,c,d,top,gdim,f,fp,fpp,fppp,xc,yc)
1431 REAL(8),
INTENT(IN) :: u
1434 INTEGER j,k,n,l,top,gdim
1436 REAL(8),
dimension(gdim) :: xc,yc
1437 REAL(8),
dimension(gdim) :: x,y
1438 REAL(8),
DIMENSION(gdim) :: b,c,d
1441 REAL(8),
INTENT(OUT),
OPTIONAL:: f,fp,fpp,fppp
1444 INTEGER,
SAVE :: i=1
1446 REAL(8),
PARAMETER:: TWO=2.0, three=3.0, six=6.0
1459 IF ( (i<1) .OR. (i >= n) ) i=1
1460 IF ( (u < x(i)) .OR. (u >= x(i+1)) )
THEN
1481 IF (
Present(f)) f= y(i)+dx*(b(i)+dx*(c(i)+dx*d(i)))
1482 IF (
Present(fp)) fp= b(i)+dx*(two*c(i) + dx*three*d(i))
1483 IF (
Present(fpp)) fpp= two*c(i) + dx*six*d(i)
1484 IF (
Present(fppp)) fppp= six*d(i)
1492 function centerwithstars(string, totallength, align, padleft, padright)
1494 character(len=*) :: string
1495 integer :: totallength, nspaces, nleftspaces, nrightspaces
1496 integer,
optional :: align, padleft, padright
1497 integer :: align2, padleft2, padright2
1503 if (
present(align)) align2 = align
1504 if (
present(padleft)) padleft2 = padleft
1505 if (
present(padright)) padright2 = padright
1507 if (len(trim(string))+padleft2+padright2 .gt. totallength-2)
then
1508 call error(
"len(trim(string))+padleft+padright > totallength-2!")
1511 nspaces = totallength - len(trim(string)) - 2
1513 if (align2.eq.1)
then
1514 nleftspaces = padleft2
1515 nrightspaces = nspaces-nleftspaces
1516 elseif (align2.eq.2)
then
1517 nleftspaces = (nspaces+padleft2-padright2)/2
1518 nrightspaces = nspaces-nleftspaces
1519 elseif (align2.eq.3)
then
1520 nrightspaces = padright2
1521 nleftspaces = nspaces-nrightspaces
1523 print *,
"Unknown align value", align2
1526 centerwithstars =
"*" // repeat(
" ", nleftspaces) // trim(string) // repeat(
" ", nrightspaces) //
"*"
1534 integer,
parameter :: linelength = 89
1535 character(len=*) :: title
1537 write(theunit, *)
" "
1538 write(theunit, *)
" ", repeat(
"*", linelength)
1540 write(theunit, *)
" ", repeat(
"*", linelength)
1542 write(theunit, *)
" ",
centerwithstars(
"Spin and parity determination of single-produced resonances at hadron colliders", linelength)
1544 write(theunit, *)
" ",
centerwithstars(
"I. Anderson, S. Bolognesi, F. Caola, J. Davis, Y. Gao, A. V. Gritsan,", linelength)
1545 write(theunit, *)
" ",
centerwithstars(
"L. S. Mandacaru Guerra, Z. Guo, L. Kang, S. Kyriacou, C. B. Martin, T. Martini,", linelength)
1546 write(theunit, *)
" ",
centerwithstars(
"K. Melnikov, R. Pan, M. Panagiotou, R. Rontsch, J. Roskes, U. Sarica,", linelength)
1547 write(theunit, *)
" ",
centerwithstars(
"M. Schulze, M. V. Srivastav, N. V. Tran, A. Whitbeck, M. Xiao, Y. Zhou", linelength)
1548 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D81 (2010) 075022; arXiv:1001.3396 [hep-ph],", linelength)
1549 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D86 (2012) 095031; arXiv:1208.4018 [hep-ph],", linelength)
1550 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D89 (2014) 035007; arXiv:1309.4819 [hep-ph],", linelength)
1551 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D94 (2016) 055023; arXiv:1606.03107 [hep-ph],", linelength)
1552 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D102 (2020) 056022; arXiv:2002.09888 [hep-ph],", linelength)
1553 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D102 (2021) 055045; arXiv:2104.04277 [hep-ph].", linelength)
1554 write(theunit, *)
" ",
centerwithstars(
"Phys.Rev. D105 (2022) 096027; arXiv:2109.13363 [hep-ph].", linelength)
1556 write(theunit, *)
" ", repeat(
"*", linelength)
1557 write(theunit, *)
" "
1574 if (process.le.2)
then
1576 elseif (process.eq.50)
then
1578 elseif (process.ge.51 .and. process.le.52)
then
1580 elseif (process.eq.60)
then
1582 elseif (process.eq.61)
then
1584 elseif (process.eq.62)
then
1586 elseif (process.ge.66 .and. process.le.75)
then
1588 elseif (process.eq.80 .or. process.eq.90)
then
1590 elseif (process.ge.110 .and. process.le.114)
then
1592 elseif (process.ge.115 .and. process.le.117)
then
1595 print *,
"Unknown process in CalculatesXsec", process,
"; setting CalculatesXsec=false."