1#ifndef __JPHYSICS__JPDF__
2#define __JPHYSICS__JPDF__
299 const double epsilon = 1e-12) :
308 for (
double x = 0.5*dx; x < PI; x += dx) {
330 const double xmin = 1.0 /
wmax;
331 const double xmax = 1.0 /
wmin;
335 const double x = 0.5 * (xmax + xmin) + i->getX() * 0.5 * (xmax - xmin);
336 const double dx = i->getY() * 0.5 * (xmax - xmin);
338 const double w = 1.0 / x;
339 const double dw = dx * w*w;
360 const double phi)
const
364 const double R = std::max(R_m,
getRmin());
367 const double px = sin(theta)*cos(phi);
368 const double pz = cos(theta);
373 const double dw = m->getY() * 0.5 * (
wmax -
wmin);
382 const double ct0 = 1.0 / n;
383 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
385 const double d = R / st0;
386 const double ct = st0*px + ct0*pz;
389 const double V = exp(-d/l_abs) * exp(-d/ls);
390 const double W = A / (2.0*PI*R*st0);
392 value += npe * U * V * W;
411 const double t_ns)
const
413 static const int N = 100;
414 static const double eps = 1.0e-6;
416 const double R = std::max(R_m,
getRmin());
418 const double a = C*t/R;
421 const double px = sin(theta)*cos(phi);
422 const double pz = cos(theta);
426 for (
double buffer[] = {
wmin,
wmax, 0.0 }, *p = buffer; *p != 0.0; ++p) {
431 const double ct0 = 1.0 / n;
432 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
434 const double b = (ng - ct0) / st0;
436 if (*p ==
wmin && b < a) {
return 0.0; }
437 if (*p ==
wmax && b > a) {
return 0.0; }
444 for (
int i = 0; i != N; ++i) {
446 const double w = 0.5 * (umin + umax);
451 const double ct0 = 1.0 / n;
452 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
454 const double b = (ng - ct0) / st0;
456 if (fabs(b-a) < a*eps) {
464 const double d = R / st0;
465 const double ct = st0*px + ct0*pz;
467 const double i3 = ct0*ct0*ct0 / (st0*st0*st0);
470 const double V = exp(-d/l_abs - d/ls);
471 const double W = A / (2.0*PI*R*st0);
473 const double Ja = R * (ngp/st0 + np*(n-ng)*i3) / C;
500 const double t_ns)
const
502 static const double eps = 1.0e-10;
506 const double R = std::max(R_m,
getRmin());
510 const double px = sin(theta)*cos(phi);
511 const double py = sin(theta)*sin(phi);
512 const double pz = cos(theta);
516 const double ni = sqrt(R*R + C*t*C*t) / R;
522 const double nj = std::min(ni,n1);
528 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
529 const double dn = i->getY() * 0.5 * (nj - n0);
542 if (npe <= 0) {
continue; }
544 const double Jc = 1.0 / ls;
546 const double ct0 = 1.0 / n;
547 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
553 const double zmin = rz.
first;
554 const double zmax = rz.
second;
556 const double zap = 1.0 / l_abs;
558 const double xmin = exp(zap*zmax);
559 const double xmax = exp(zap*zmin);
563 const double x = 0.5 * (xmax + xmin) + j->getX() * 0.5 * (xmax - xmin);
564 const double dx = j->getY() * 0.5 * (xmax - xmin);
566 const double z = log(x) / zap;
567 const double dz = -dx / (zap*x);
569 const double D = sqrt(z*z + R*R);
570 const double cd = -z / D;
571 const double sd = R / D;
573 const double d = (C*t - z) / ng;
577 const double cta = cd*ct0 + sd*st0;
578 const double dca = d - 0.5*(d+D)*(d-D) / (d - D*cta);
579 const double tip = -log(D*D/(dca*dca) + eps) / PI;
581 const double ymin = exp(tip*PI);
582 const double ymax = 1.0;
586 const double y = 0.5 * (ymax + ymin) + k->getX() * 0.5 * (ymax - ymin);
587 const double dy = k->getY() * 0.5 * (ymax - ymin);
589 const double phi = log(y) / tip;
590 const double dp = -dy / (tip*y);
592 const double cp0 = cos(phi);
593 const double sp0 = sin(phi);
595 const double u = (R*R + z*z - d*d) / (2*R*st0*cp0 - 2*z*ct0 - 2*d);
596 const double v = d - u;
598 if (u <= 0) {
continue; }
599 if (v <= 0) {
continue; }
601 const double vi = 1.0 / v;
602 const double cts = (R*st0*cp0 - z*ct0 - u)*vi;
606 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
608 const double vx = R - u*st0*cp0;
609 const double vy = - u*st0*sp0;
610 const double vz = -z - u*ct0;
612 const double ct[] = {
613 (vx*px + vy*py + vz*pz) * vi,
614 (vx*px - vy*py + vz*pz) * vi
620 const double W = std::min(A*vi*vi, 2.0*PI);
623 const double Jd = ng * (1.0 - cts) / C;
625 value += (npe * dz * dp / (2*PI)) * U * V * W * Ja * Jc / fabs(Jd);
646 const double t_ns)
const
650 const double R = std::max(R_m,
getRmin());
653 const double D = 2.0*sqrt(A/PI);
655 const double px = sin(theta)*cos(phi);
657 const double pz = cos(theta);
661 const double ni = sqrt(R*R + C*t*C*t) / R;
667 const double nj = std::min(n1, ni);
673 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
674 const double dn = i->getY() * 0.5 * (nj - n0);
691 for (
int j = 0; j != 2; ++j) {
693 const double z = rz[j];
695 if (C*t <= z)
continue;
697 const double d = sqrt(z*z + R*R);
699 const double ct0 = -z / d;
700 const double st0 = R / d;
702 const double dz = D / st0;
704 const double ct = st0*px + ct0*pz;
707 const double V = exp(-d/l_abs - d/ls);
708 const double W = A/(d*d);
710 const double Ja =
geant(n,ct0);
711 const double Jd = (1.0 - ng*ct0) / C;
712 const double Je = ng*st0*st0*st0 / (R*
C);
714 value +=
gWater() * npe * U * V * W * Ja / (fabs(Jd) + 0.5*Je*dz);
734 const double t_ns)
const
738 const double R = std::max(R_m,
getRmin());
742 const double px = sin(theta)*cos(phi);
743 const double py = sin(theta)*sin(phi);
744 const double pz = cos(theta);
748 const double ni = sqrt(R*R + C*t*C*t) / R;
754 const double nj = std::min(ni,n1);
760 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
761 const double dn = i->getY() * 0.5 * (nj - n0);
774 if (npe <= 0) {
continue; }
776 const double Jc = 1.0 / ls;
782 const double zmin = rz.
first;
783 const double zmax = rz.
second;
785 const double zap = 1.0 / l_abs;
787 const double xmin = exp(zap*zmax);
788 const double xmax = exp(zap*zmin);
792 const double x = 0.5 * (xmax + xmin) + j->getX() * 0.5 * (xmax - xmin);
793 const double dx = j->getY() * 0.5 * (xmax - xmin);
795 const double z = log(x) / zap;
796 const double dz = -dx / (zap*x);
798 const double D = sqrt(z*z + R*R);
799 const double cd = -z / D;
800 const double sd = R / D;
802 const double qx = cd*px + 0 - sd*pz;
803 const double qy = 1*py;
804 const double qz = sd*px + 0 + cd*pz;
806 const double d = (C*t - z) / ng;
810 const double ds = 2.0 / (size() + 1);
812 for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
814 for (
int buffer[] = { -1, +1, 0}, *k = buffer; *k != 0; ++k) {
816 const double cb = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
817 const double dcb = (*k) * ds*sb/cb;
819 const double v = 0.5 * (d + D) * (d - D) / (d - D*cb);
820 const double u = d - v;
822 if (u <= 0) {
continue; }
823 if (v <= 0) {
continue; }
825 const double cts = (D*cb - v) / u;
829 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
831 const double W = std::min(A/(v*v), 2.0*PI);
833 const double Jd = ng * (1.0 - cts) / C;
835 const double ca = (D - v*cb) / u;
836 const double sa = v*sb / u;
838 const double dp = PI /
phd.size();
839 const double dom = dcb*dp * v*v / (u*u);
843 const double cp = l->getX();
844 const double sp = l->getY();
846 const double ct0 = cd*ca - sd*sa*cp;
848 const double vx = sb*cp * qx;
849 const double vy = sb*sp * qy;
850 const double vz = cb * qz;
856 const double Jb =
geant(n,ct0);
858 value += dom *
gWater() * npe * dz * U * V * W * Ja * Jb * Jc / fabs(Jd);
883 const double t_ns)
const
885 static const double eps = 1.0e-10;
889 const double sd = sqrt((1.0 + cd)*(1.0 - cd));
890 const double D = std::max(D_m,
getRmin());
891 const double R = sd * D;
892 const double Z = -cd * D;
897 const double px = sin(theta)*cos(phi);
898 const double py = sin(theta)*sin(phi);
899 const double pz = cos(theta);
904 const double ni = C*t / L;
910 const double nj = std::min(ni,n1);
916 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
917 const double dn = i->getY() * 0.5 * (nj - n0);
930 if (npe <= 0) {
continue; }
932 const double Jc = 1.0 / ls;
934 const double ct0 = 1.0 / n;
935 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
937 const double d = C*t / ng;
941 const double cta = cd*ct0 + sd*st0;
942 const double dca = d - 0.5*(d+L)*(d-L) / (d - L*cta);
943 const double tip = -log(L*L/(dca*dca) + eps) / PI;
945 const double ymin = exp(tip*PI);
946 const double ymax = 1.0;
950 const double y = 0.5 * (ymax + ymin) + j->getX() * 0.5 * (ymax - ymin);
951 const double dy = j->getY() * 0.5 * (ymax - ymin);
953 const double phi = log(y) / tip;
954 const double dp = -dy / (tip*y);
956 const double cp0 = cos(phi);
957 const double sp0 = sin(phi);
959 const double u = (R*R + Z*Z - d*d) / (2*R*st0*cp0 - 2*Z*ct0 - 2*d);
960 const double v = d - u;
962 if (u <= 0) {
continue; }
963 if (v <= 0) {
continue; }
965 const double vi = 1.0 / v;
966 const double cts = (R*st0*cp0 - Z*ct0 - u)*vi;
970 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
972 const double vx = R - u*st0*cp0;
973 const double vy = - u*st0*sp0;
974 const double vz = -Z - u*ct0;
976 const double ct[] = {
977 (vx*px + vy*py + vz*pz) * vi,
978 (vx*px - vy*py + vz*pz) * vi
984 const double W = std::min(A*vi*vi, 2.0*PI);
987 const double Jd = ng * (1.0 - cts) / C;
989 value += (npe * dp / (2*PI)) * U * V * W * Ja * Jc / fabs(Jd);
1011 const double t_ns)
const
1013 const double ct0 = cd;
1014 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
1016 const double D = std::max(D_m,
getRmin());
1020 const double px = sin(theta)*cos(phi);
1021 const double pz = cos(theta);
1025 const double ng = C*t/D;
1027 if (n0 >= ng) {
return 0.0; }
1028 if (n1 <= ng) {
return 0.0; }
1038 const double ct = st0*px + ct0*pz;
1041 const double V = exp(-D/l_abs - D/ls);
1042 const double W = A/(D*D);
1046 const double Ja = D * ngp /
C;
1047 const double Jb =
geant(n,ct0);
1049 return npe *
geanc() * U * V * W * Jb / fabs(Ja);
1067 const double t_ns)
const
1071 const double sd = sqrt((1.0 + cd)*(1.0 - cd));
1072 const double D = std::max(D_m,
getRmin());
1078 const double px = sin(theta)*cos(phi);
1079 const double py = sin(theta)*sin(phi);
1080 const double pz = cos(theta);
1082 const double qx = cd*px + 0 - sd*pz;
1083 const double qy = 1*py;
1084 const double qz = sd*px + 0 + cd*pz;
1089 const double ni = C*t / L;
1095 const double nj = std::min(ni,n1);
1101 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
1102 const double dn = i->getY() * 0.5 * (nj - n0);
1115 if (npe <= 0) {
continue; }
1117 const double Jc = 1.0 / ls;
1119 const double d = C*t / ng;
1123 const double ds = 2.0 / (size() + 1);
1125 for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
1127 for (
int buffer[] = { -1, +1, 0}, *k = buffer; *k != 0; ++k) {
1129 const double cb = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
1130 const double dcb = (*k) * ds*sb/cb;
1132 const double v = 0.5 * (d + L) * (d - L) / (d - L*cb);
1133 const double u = d - v;
1135 if (u <= 0) {
continue; }
1136 if (v <= 0) {
continue; }
1138 const double cts = (L*cb - v) / u;
1142 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
1144 const double W = std::min(A/(v*v), 2.0*PI);
1146 const double Jd = ng * (1.0 - cts) / C;
1148 const double ca = (L - v*cb) / u;
1149 const double sa = v*sb / u;
1151 const double dp = PI /
phd.size();
1152 const double dom = dcb*dp * v*v / (u*u);
1153 const double dos = sqrt(dom);
1157 const double cp = l->getX();
1158 const double sp = l->getY();
1160 const double ct0 = cd*ca - sd*sa*cp;
1162 const double vx = -sb*cp * qx;
1163 const double vy = -sb*sp * qy;
1164 const double vz = cb * qz;
1174 const double Jb =
geant(n,
1178 value += npe *
geanc() * dos * U * V * W * Ja * Jb * Jc / fabs(Jd);
1204 const double t_ns)
const
1208 const double sd = sqrt((1.0 + cd)*(1.0 - cd));
1209 const double D = std::max(D_m,
getRmin());
1210 const double R = D * sd;
1211 const double Z = -D * cd;
1220 const double d = sqrt((Z+zmax)*(Z+zmax) + R*R);
1222 if (C*t > std::max(n1*D, zmax + n1*d)) {
1228 JRoot rz(R, n0, t + Z/C);
1240 JRoot rz(R, n1, t + Z/C);
1250 if (C*t < zmax + n0*d) {
1252 JRoot rz(R, n0, t + Z/C);
1270 const double dy = (ymax - ymin) / size();
1272 if (dy > 2*std::numeric_limits<double>::epsilon()) {
1274 for (
double y = ymin + 0.5*dy; y < ymax; y += dy) {
1277 const double d = sqrt(R*R + z*z);
1306 const double t_ns)
const
1310 const double sd = sqrt((1.0 + cd)*(1.0 - cd));
1311 const double D = std::max(D_m,
getRmin());
1312 const double R = D * sd;
1313 const double Z = -D * cd;
1321 const double d = sqrt((Z+zmax)*(Z+zmax) + R*R);
1325 JRoot rz(R, n0, t + Z/C);
1335 if (C*t < zmax + n0*d) {
1337 JRoot rz(R, n0, t + Z/C);
1349 const double dy = (ymax - ymin) / size();
1351 if (dy > 2*std::numeric_limits<double>::epsilon()) {
1353 for (
double y = ymin + 0.5*dy; y < ymax; y += dy) {
1356 const double d = sqrt(R*R + z*z);
1379 const double t_ns)
const
1383 const double R = std::max(R_m,
getRmin());
1386 const double D = 2.0*sqrt(A/PI);
1388 const double px = sin(theta)*cos(phi);
1389 const double pz = cos(theta);
1393 const double ni = sqrt(R*R + C*t*C*t) / R;
1399 const double nj = std::min(n1, ni);
1405 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
1406 const double dn = i->getY() * 0.5 * (nj - n0);
1423 for (
int j = 0; j != 2; ++j) {
1425 const double z = rz[j];
1427 if (C*t <= z)
continue;
1429 const double d = sqrt(z*z + R*R);
1431 const double ct0 = -z / d;
1432 const double st0 = R / d;
1434 const double dz = D / st0;
1435 const double ct = st0*px + ct0*pz;
1438 const double V = exp(-d/l_abs - d/ls);
1439 const double W = A/(d*d);
1442 const double Jd = (1.0 - ng*ct0) / C;
1443 const double Je = ng*st0*st0*st0 / (R*
C);
1445 value += npe *
geanc() * U * V * W * Ja / (fabs(Jd) + 0.5*Je*dz);
1465 const double t_ns)
const
1469 const double R = std::max(R_m,
getRmin());
1473 const double px = sin(theta)*cos(phi);
1474 const double py = sin(theta)*sin(phi);
1475 const double pz = cos(theta);
1479 const double ni = sqrt(R*R + C*t*C*t) / R;
1485 const double nj = std::min(ni,n1);
1491 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
1492 const double dn = i->getY() * 0.5 * (nj - n0);
1505 if (npe <= 0) {
continue; }
1507 const double Jc = 1.0 / ls;
1513 const double zmin = rz.
first;
1514 const double zmax = rz.
second;
1516 const double zap = 1.0 / l_abs;
1518 const double xmin = exp(zap*zmax);
1519 const double xmax = exp(zap*zmin);
1523 const double x = 0.5 * (xmax + xmin) + j->getX() * 0.5 * (xmax - xmin);
1524 const double dx = j->getY() * 0.5 * (xmax - xmin);
1526 const double z = log(x) / zap;
1527 const double dz = -dx / (zap*x);
1529 const double D = sqrt(z*z + R*R);
1530 const double cd = -z / D;
1531 const double sd = R / D;
1533 const double qx = cd*px + 0 - sd*pz;
1534 const double qy = 1*py;
1535 const double qz = sd*px + 0 + cd*pz;
1537 const double d = (C*t - z) / ng;
1541 const double ds = 2.0 / (size() + 1);
1543 for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
1545 for (
int buffer[] = { -1, +1, 0}, *k = buffer; *k != 0; ++k) {
1547 const double cb = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
1548 const double dcb = (*k) * ds*sb/cb;
1550 const double v = 0.5 * (d + D) * (d - D) / (d - D*cb);
1551 const double u = d - v;
1553 if (u <= 0) {
continue; }
1554 if (v <= 0) {
continue; }
1556 const double cts = (D*cb - v) / u;
1560 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
1562 const double W = std::min(A/(v*v), 2.0*PI);
1564 const double Jd = ng * (1.0 - cts) / C;
1566 const double ca = (D - v*cb) / u;
1567 const double sa = v*sb / u;
1569 const double dp = PI /
phd.size();
1570 const double dom = dcb*dp * v*v / (u*u);
1574 const double cp = l->getX();
1575 const double sp = l->getY();
1577 const double ct0 = cd*ca - sd*sa*cp;
1579 const double vx = sb*cp * qx;
1580 const double vy = sb*sp * qy;
1581 const double vz = cb * qz;
1589 value += dom * npe *
geanc() * dz * U * V * W * Ja * Jb * Jc / fabs(Jd);
1610 const double t_ns)
const
1612 const double D = std::max(D_m,
getRmin());
1618 const double ng = C*t/D;
1620 if (n0 >= ng) {
return 0.0; }
1621 if (n1 <= ng) {
return 0.0; }
1632 const double V = exp(-D/l_abs - D/ls);
1633 const double W = A/(D*D);
1637 const double Ja = D * ngp /
C;
1638 const double Jb = 1.0 / (4.0*PI);
1640 return npe *
geanc() * U * V * W * Jb / fabs(Ja);
1654 const double t_ns)
const
1658 const double D = std::max(D_m,
getRmin());
1660 const double st = sqrt((1.0 + ct)*(1.0 - ct));
1667 const double ni = C*t / D;
1673 const double nj = std::min(ni,n1);
1679 const double ng = 0.5 * (nj + n0) + i->getX() * 0.5 * (nj - n0);
1680 const double dn = i->getY() * 0.5 * (nj - n0);
1690 if (npe <= 0) {
continue; }
1695 const double Jc = 1.0 / ls;
1696 const double Jb = 1.0 / (4.0*PI);
1698 const double d = C*t / ng;
1700 const double dcb = 2.0 / (size() + 1);
1702 for (
double cb = -1.0 + 0.5*dcb; cb < +1.0; cb += dcb) {
1704 const double sb = sqrt((1.0 + cb)*(1.0 - cb));
1706 const double v = 0.5 * (d + D) * (d - D) / (d - D*cb);
1707 const double u = d - v;
1709 if (u <= 0) {
continue; }
1710 if (v <= 0) {
continue; }
1712 const double cts = (D*cb - v) / u;
1716 if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) <
MODULE_RADIUS_M) {
continue; }
1718 const double W = std::min(A/(v*v), 2.0*PI);
1720 const double Jd = ng * (1.0 - cts) / C;
1722 const double dp = PI /
phd.size();
1723 const double dom = dcb*dp * v*v / (u*u);
1727 const double cp = l->getX();
1728 const double dot = cb*ct + sb*cp*st;
1732 value += npe *
geanc() * dom * U * V * W * Ja * Jb * Jc / fabs(Jd);
1757 const double t_ns)
const
1799 const double t_ns)
const
1826 const double t_ns)
const
1856 const double t_ns)
const
1881 const double t_ns)
const
1913 const double t_ns)
const
1932 const double t_ns)
const
1958 const double t_ns)
const
1988 const double a = n*n - 1.0;
1989 const double b = 2*C*t;
1990 const double c = R*n * R*n - C*t * C*t;
1992 const double q = b*b - 4*a*c;
1996 first = (-b - sqrt(q)) / (2*a);
1997 second = (-b + sqrt(q)) / (2*a);
2040 const double eps = 1.0e-10)
const
2047 for (
int i = 0; i != 1000; ++i) {
2049 const double v = 0.5 * (vmin + vmax);
2052 if (fabs(y - n) < eps) {
2062 return 0.5 * (vmin + vmax);
2079 const double eps)
const
2089 if (fabs(y - n) < eps) {
2117 const int nx = 100000;
2118 const double xmin = -1.0;
2119 const double xmax = +1.0;
2121 const double dx = (xmax - xmin) / (nx - 1);
2123 for (
double x = xmin, W = 0.0; x < xmax; x += dx) {
2136 return 1.0/l_abs + f1(cts)/ls;
2173 const double epsilon = 1e-12) :
2207 double (*pF_qe) (
const double),
2208 double (*pF_pmt) (
const double),
2209 double (*pF_l_abs)(
const double),
2210 double (*pF_ls) (
const double),
2211 double (*pF_ps) (
const double),
2219 const double epsilon = 1e-12) :
2247 virtual double getQE(
const double lambda)
const override
2273 return l_abs(lambda);
2313 double (*
qe)(
const double lambda);
2329 double (*
ls)(
const double lambda);
2337 double (*
pmt)(
const double ct);
2345 double (*
ps)(
const double ct);
Compiler version dependent expressions, macros, etc.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Photon emission profile EM-shower.
Longitudinal emission profile EM-shower.
Numbering scheme for PDF types.
Auxiliary classes for numerical integration.
virtual double getAbsorptionLength(const double lambda) const =0
Absorption length.
virtual double getScatteringLength(const double lambda) const =0
Scattering length.
virtual double getScatteringProbability(const double ct) const =0
Model specific function to describe light scattering in water (integral over full solid angle normali...
Probability Density Functions of the time response of a PMT with an implementation for the JDispersio...
JAbstractPDF(const double P_atm, const double Wmin, const double Wmax, const int numberOfPoints=20, const double epsilon=1e-12)
Constructor.
virtual double getPhotocathodeArea() const =0
Photo-cathode area of PMT.
virtual double getQE(const double lambda) const =0
Quantum efficiency of PMT (incl.
virtual double getAngularAcceptance(const double ct) const =0
Angular acceptence of PMT.
Light dispersion inteface.
virtual double getIndexOfRefractionGroup(const double lambda) const
Index of refraction for group velocity.
virtual double getDispersionGroup(const double lambda) const =0
Dispersion of light for group velocity.
virtual double getDispersionPhase(const double lambda) const =0
Dispersion of light for phase velocity.
Implementation of dispersion for water in deep sea.
double getLength(const double E, const double P, const double eps=1.0e-5) const
Get shower length for a given integrated probability.
double getIntegral(const double E, const double z) const
Integral of PDF (starting from 0).
Auxiliary class to find solution(s) to of the square root expression:
double first
most upstream solution
bool is_valid
validity of solutions
double second
most downstream solution
double operator[](const int i) const
Get result by index.
JRoot(const double R, const double n, const double t)
Determine solution(s) of quadratic equation.
Probability Density Functions of the time response of a PMT with an implementation of the JAbstractPM...
JPDF_C(const double Apmt, double(*pF_qe)(const double), double(*pF_pmt)(const double), double(*pF_l_abs)(const double), double(*pF_ls)(const double), double(*pF_ps)(const double), const double P_atm, const double Wmin, const double Wmax, const int numberOfPoints=20, const double epsilon=1e-12)
Constructor.
virtual double getScatteringProbability(const double ct) const override
Model specific function to describe light scattering in water (integral over full solid angle normali...
const double A
photo-cathode area [m2]
virtual double getQE(const double lambda) const override
Quantum efficiency of PMT (incl.
double(* ls)(const double lambda)
Scattering length.
double(* pmt)(const double ct)
Angular acceptance of PMT.
double(* qe)(const double lambda)
Quantum efficiency of PMT (incl.
virtual double getScatteringLength(const double lambda) const override
Scattering length.
virtual double getPhotocathodeArea() const override
Photo-cathode area of PMT.
virtual double getAbsorptionLength(const double lambda) const override
Absorption length.
virtual double getAngularAcceptance(const double ct) const override
Angular acceptance of PMT.
double(* l_abs)(const double lambda)
Absorption length.
double(* ps)(const double ct)
Model specific function to describe light scattering in water.
Low level interface for the calculation of the Probability Density Functions (PDFs) of the arrival ti...
double getScatteredLightFromMuon(const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from muon.
double getScatteredLightFromEMshower(const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from EM-shower.
double getLightFromEMshower(const double E_GeV, const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for light from EM-shower.
double getLightFromBrightPoint(const double D_m, const double ct, const double t_ns) const
Probability density function for direct light from isotropic light source.
double getLightFromEMshower(const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for light from EM-shower.
double getLightFromMuon(const int type, const double E_GeV, const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for light from muon.
double getLightFromMuon(const double E_GeV, const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for light from muon.
const double wmax
maximal wavelength for integration [nm]
double getScatteredLightFromBrightPoint(const double D_m, const double ct, const double t_ns) const
Probability density function for scattered light from isotropic light source.
double getLightFromBrightPoint(const int type, const double D_m, const double ct, const double t_ns) const
Probability density function for direct light from isotropic light source.
virtual ~JPDF()
Virtual destructor.
virtual double getWavelength(const double n, const double w, const double eps) const
Determine wavelength for a given index of refraction corresponding to the group velocity.
double getDirectLightFromMuon(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for direct light from muon.
double getDirectLightFromEMshower(const double E, const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for direct light from EM-shower.
double getLightFromEMshower(const int type, const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for light from EM-shower.
double getScatteredLightFromDeltaRays(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from delta-rays.
JTOOLS::JElement2D< double, double > element_type
virtual double getInverseAttenuationLength(const double l_abs, const double ls, const double cts) const
Get the inverse of the attenuation length.
static double getRmin()
minimal distance of approach of muon to PMT [m]
virtual double getWavelength(const double n, const double eps=1.0e-10) const
Determine wavelength for a given index of refraction corresponding to the group velocity.
std::vector< element_type > phd
fast evaluation of phi integral
double getScatteredLightFromEMshower(const double E, const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from EM-shower.
double getDirectLightFromMuon(const double R_m, const double theta, const double phi) const
Number of photo-electrons from direct Cherenkov light from muon.
JPDF(const double Wmin, const double Wmax, const int numberOfPoints=20, const double epsilon=1e-12)
Constructor.
double getNumberOfPhotons() const
Number of Cherenkov photons per unit track length.
double getDirectLightFromDeltaRays(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for direct light from delta-rays.
double getDirectLightFromBrightPoint(const double D_m, const double ct, const double t_ns) const
Probability density function for direct light from isotropic light source.
double getScatteredLightFromEMshowers(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from EM-showers.
double getLightFromEMshower(const int type, const double E_GeV, const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for light from EM-shower.
const double wmin
Integration limits.
double getDirectLightFromEMshower(const double D_m, const double cd, const double theta, const double phi, const double t_ns) const
Probability density function for direct light from EM-shower.
double getScatteredLightFromMuon(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for scattered light from muon.
double getDirectLightFromEMshowers(const double R_m, const double theta, const double phi, const double t_ns) const
Probability density function for direct light from EM-showers.
Auxiliary methods for light properties of deep-sea water.
static double MODULE_RADIUS_M
Radius of optical module [m].
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile.
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
double cherenkov(const double lambda, const double n)
Number of Cherenkov photons per unit track length and per unit wavelength.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle.
@ SCATTERED_LIGHT_FROM_EMSHOWER
scattered light from EM shower
@ SCATTERED_LIGHT_FROM_BRIGHT_POINT
scattered light from bright point
@ SCATTERED_LIGHT_FROM_DELTARAYS
scattered light from delta-rays
@ DIRECT_LIGHT_FROM_EMSHOWERS
direct light from EM showers
@ SCATTERED_LIGHT_FROM_EMSHOWERS
scattered light from EM showers
@ DIRECT_LIGHT_FROM_BRIGHT_POINT
direct light from bright point
@ SCATTERED_LIGHT_FROM_MUON
scattered light from muon
@ DIRECT_LIGHT_FROM_EMSHOWER
direct light from EM shower
@ DIRECT_LIGHT_FROM_DELTARAYS
direct light from delta-rays
@ DIRECT_LIGHT_FROM_MUON
direct light from muon
double geanc()
Equivalent muon track length per unit shower energy.
double getIndexOfRefractionPhase()
Get average index of refraction of water corresponding to phase velocity.
static const double C
Physics constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static double getEnergyLossFromMuon(const double E, const JEnergyRange T_GeV=JEnergyRange(TMIN_GEV, TMAX_GEV))
Equivalent EM-shower energy loss due to delta-rays per unit muon track length in sea water.
static double getProbability(const double x)
Emission profile of photons from delta-rays.