JHUGen MELA  v2.4.1
Matrix element calculations as used in JHUGen. MELA is an important tool that was used for the Higgs boson discovery and for precise measurements of its structure and interactions. Please see the website https://spin.pha.jhu.edu/ and papers cited there for more details, and kindly cite those papers when using this code.
Data Types | Modules | Macros | Functions/Subroutines
mod_Misc.F90 File Reference

Go to the source code of this file.

Data Types

interface  modmisc::swap
 
interface  modmisc::operator(.dot.)
 
interface  modmisc::operator(.cross.)
 
interface  modmisc::bublesort
 
interface  modmisc::reorder
 

Modules

module  modmisc
 

Macros

#define MakeBubleSort(typex, typey, name)
 
#define MakeReOrder(typey, typex, name)
 

Functions/Subroutines

real(8) function, dimension(1:3) modmisc::vectorcross (p1, p2)
 
real(8) function modmisc::minkowskyproduct (p1, p2)
 
complex(8) function modmisc::minkowskyproductc (p1, p2)
 
complex(8) function modmisc::minkowskyproductrc (p1, p2)
 
complex(8) function modmisc::minkowskyproductcr (p1, p2)
 
integer function modmisc::logicaltointeger (var)
 
double complex function modmisc::et1 (e1, e2, e3, e4)
 
double complex function modmisc::sc (q1, q2)
 
double precision function modmisc::scr (p1, p2)
 
double complex function modmisc::scrc (p1, p2)
 
real(8) function modmisc::get_pt (Mom)
 
real(8) function modmisc::get_pt2 (Mom)
 
real(8) function modmisc::get_minv (Mom)
 
real(8) function modmisc::get_minv2 (Mom)
 
real(8) function modmisc::get_eta (Mom)
 
real(8) function modmisc::get_phi (Mom)
 
real(8) function modmisc::get_cosalpha (Mom1, Mom2)
 
real(8) function modmisc::get_costheta (Mom)
 
real(8) function modmisc::get_r (Mom1, Mom2)
 
subroutine modmisc::pt_order (N, Mom)
 
subroutine modmisc::printmom (Mom)
 
subroutine modmisc::error (Message, ErrNum)
 
logical function modmisc::isnan (x)
 
subroutine modmisc::swapi (i, j)
 
subroutine modmisc::swapr (i, j)
 
subroutine modmisc::swapc (i, j)
 
subroutine modmisc::swap_mom (Mom1, Mom2)
 
subroutine modmisc::swap_cmom (Mom1, Mom2)
 
complex(8) function modmisc::leviciv (e1, e2, e3, e4)
 
complex(8) function, dimension(1:4) modmisc::pol_gluon_incoming (p, hel)
 
complex(8) function, dimension(4) modmisc::pol_zff_outgoing (pf, pfbar, hel)
 
complex(8) function, dimension(1:4) modmisc::ubar_spinor (p, hel)
 
complex(8) function, dimension(1:4) modmisc::v_spinor (p, hel)
 
double complex function, dimension(1:4) modmisc::chir_weyl (sign, sp)
 
complex(8) function, dimension(dv) modmisc::vbqq_weyl (sp1, sp2)
 
complex(8) function, dimension(4) modmisc::spb2_weyl (sp, v)
 
complex(8) function, dimension(4) modmisc::spi2_weyl (v, sp)
 
character(len=150) function modmisc::findinputfmt0 (EventInfoLine)
 
character(len=150) function modmisc::findinputfmt1 (ParticleLine)
 
character(len=150) function modmisc::capitalize (InputString)
 
subroutine modmisc::houseofrepresentatives (XSecArray, NumberOfSeats, TotalNumberOfSeats)
 
subroutine modmisc::houseofrepresentatives2 (XSecArray, NumberOfSeats, TotalNumberOfSeats)
 
subroutine modmisc::convert_to_mcfm (p, pout)
 
subroutine modmisc::evaluatespline (EvalPoint, SplineData, SplineDataLength, TheResult)
 
subroutine hto_fmmsplinesingleht (b, c, d, top, gdim, xc, yc)
 
subroutine hto_seval3singleht (u, b, c, d, top, gdim, f, fp, fpp, fppp, xc, yc)
 
character(len=totallength) function modmisc::centerwithstars (string, totallength, align, padleft, padright)
 
subroutine modmisc::printlogo (TheUnit, title)
 
real function modmisc::infinity ()
 
logical function modmisc::calculatesxsec (Process)
 

Macro Definition Documentation

◆ MakeBubleSort

#define MakeBubleSort (   typex,
  typey,
  name 
)
Value:
1 SUBROUTINE name(N,X, IY) ;\
2 IMPLICIT NONE ;\
3 integer n ;\
4 typex :: x(1:n) ;\
5 typey :: iy(1:n) ;\
6 typex :: temp ;\
7 integer :: i, j, jmax ;\
8 typey :: itemp ;\
9 logical :: keepgoing ;\
10  ;\
11  keepgoing = .true. ;\
12  jmax=n-1 ;\
13  do i=1,n-1 ;\
14  keepgoing = .false. ;\
15  do j=1,jmax ;\
16  if(x(j).gt.x(j+1)) cycle ;\
17  keepgoing = .true. ;\
18  temp=x(j) ;\
19  x(j)=x(j+1) ;\
20  x(j+1)=temp ;\
21  itemp=iy(j) ;\
22  iy(j)=iy(j+1) ;\
23  iy(j+1)=itemp ;\
24  enddo ;\
25  if(.not.keepgoing) return ;\
26  jmax=jmax-1 ;\
27  enddo ;\
28  ;\
29 RETURN ;\
30 END SUBROUTINE

◆ MakeReOrder

#define MakeReOrder (   typey,
  typex,
  name 
)
Value:
1 SUBROUTINE name(N, iy,x) ;\
2 integer :: n,i ;\
3 typex :: x(1:n) ;\
4 typey :: iy(1:n) ;\
5 typex :: temp(1:n) ;\
6  ;\
7  do i=1,n ;\
8  temp(i) = x( iy(i) ) ;\
9  enddo ;\
10  x(1:n) = temp(1:n) ;\
11  ;\
12 RETURN ;\
13 END SUBROUTINE ;\

Function/Subroutine Documentation

◆ hto_fmmsplinesingleht()

subroutine evaluatespline::hto_fmmsplinesingleht ( real(8), dimension(gdim)  b,
real(8), dimension(gdim)  c,
real(8), dimension(gdim)  d,
integer  top,
integer  gdim,
real(8), dimension(gdim)  xc,
real(8), dimension(gdim)  yc 
)

Definition at line 1341 of file mod_Misc.F90.

1341 
1342 !---------------------------------------------------------------------------
1343 
1344 INTEGER k,n,i,top,gdim,l
1345 
1346 REAL(8), dimension(gdim) :: xc,yc
1347 REAL(8), dimension(gdim) :: x,y
1348 
1349 REAL(8), DIMENSION(gdim) :: b
1350 ! linear coeff
1351 
1352 REAL(8), DIMENSION(gdim) :: c
1353 ! quadratic coeff.
1354 
1355 REAL(8), DIMENSION(gdim) :: d
1356 ! cubic coeff.
1357 
1358 REAL(8) :: t
1359 REAL(8),PARAMETER:: ZERO=0.0, two=2.0, three=3.0
1360 
1361 ! The grid
1362 
1363 
1364 n= gdim
1365 FORALL(l=1:gdim)
1366 x(l)= xc(l)
1367 y(l)= yc(l)
1368 ENDFORALL
1369 
1370 !.....Set up tridiagonal system.........................................
1371 ! b=diagonal, d=offdiagonal, c=right-hand side
1372 
1373 d(1)= x(2)-x(1)
1374 c(2)= (y(2)-y(1))/d(1)
1375 DO k= 2,n-1
1376 d(k)= x(k+1)-x(k)
1377 b(k)= two*(d(k-1)+d(k))
1378 c(k+1)= (y(k+1)-y(k))/d(k)
1379 c(k)= c(k+1)-c(k)
1380 END DO
1381 
1382 !.....End conditions. third derivatives at x(1) and x(n) obtained
1383 ! from divided differences.......................................
1384 
1385 b(1)= -d(1)
1386 b(n)= -d(n-1)
1387 c(1)= zero
1388 c(n)= zero
1389 IF (n > 3) THEN
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))
1394 END IF
1395 
1396 DO k=2,n ! forward elimination
1397 t= d(k-1)/b(k-1)
1398 b(k)= b(k)-t*d(k-1)
1399 c(k)= c(k)-t*c(k-1)
1400 END DO
1401 
1402 c(n)= c(n)/b(n)
1403 
1404 ! back substitution ( makes c the sigma of text)
1405 
1406 DO k=n-1,1,-1
1407 c(k)= (c(k)-d(k)*c(k+1))/b(k)
1408 END DO
1409 
1410 !.....Compute polynomial coefficients...................................
1411 
1412 b(n)= (y(n)-y(n-1))/d(n-1)+d(n-1)*(c(n-1)+c(n)+c(n))
1413 DO k=1,n-1
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)
1416 c(k)= three*c(k)
1417 END DO
1418 c(n)= three*c(n)
1419 d(n)= d(n-1)
1420 
1421 RETURN
1422 

◆ hto_seval3singleht()

subroutine evaluatespline::hto_seval3singleht ( real(8), intent(in)  u,
real(8), dimension(gdim)  b,
real(8), dimension(gdim)  c,
real(8), dimension(gdim)  d,
integer  top,
integer  gdim,
real(8), intent(out), optional  f,
real(8), intent(out), optional  fp,
real(8), intent(out), optional  fpp,
real(8), intent(out), optional  fppp,
real(8), dimension(gdim)  xc,
real(8), dimension(gdim)  yc 
)

Definition at line 1428 of file mod_Misc.F90.

1428 
1429 ! ---------------------------------------------------------------------------
1430 
1431 REAL(8),INTENT(IN) :: u
1432 ! abscissa at which the spline is to be evaluated
1433 
1434 INTEGER j,k,n,l,top,gdim
1435 
1436 REAL(8), dimension(gdim) :: xc,yc
1437 REAL(8), dimension(gdim) :: x,y
1438 REAL(8), DIMENSION(gdim) :: b,c,d
1439 ! linear,quadratic,cubic coeff
1440 
1441 REAL(8),INTENT(OUT),OPTIONAL:: f,fp,fpp,fppp
1442 ! function, 1st,2nd,3rd deriv
1443 
1444 INTEGER, SAVE :: i=1
1445 REAL(8) :: dx
1446 REAL(8),PARAMETER:: TWO=2.0, three=3.0, six=6.0
1447 
1448 ! The grid
1449 
1450 n= gdim
1451 FORALL(l=1:gdim)
1452 x(l)= xc(l)
1453 y(l)= yc(l)
1454 ENDFORALL
1455 
1456 !.....First check if u is in the same interval found on the
1457 ! last call to Seval.............................................
1458 
1459 IF ( (i<1) .OR. (i >= n) ) i=1
1460 IF ( (u < x(i)) .OR. (u >= x(i+1)) ) THEN
1461 i=1
1462 
1463 ! binary search
1464 
1465 j= n+1
1466 DO
1467 k= (i+j)/2
1468 IF (u < x(k)) THEN
1469 j= k
1470 ELSE
1471 i= k
1472 ENDIF
1473 IF (j <= i+1) EXIT
1474 ENDDO
1475 ENDIF
1476 
1477 dx= u-x(i)
1478 
1479 ! evaluate the spline
1480 
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)
1485 
1486 RETURN
1487