1 #ifndef __JPHYSICS__JPDF__ 
    2 #define __JPHYSICS__JPDF__ 
   29 namespace JPP { 
using namespace JPHYSICS; }
 
  298          const double epsilon        = 1e-12) :
 
  307       for (
double x = 0.5*dx; 
x < 
PI; 
x += dx) {
 
  329       const double xmin = 1.0 / 
wmax;
 
  330       const double xmax = 1.0 / 
wmin;
 
  334         const double x  = 0.5 * (xmax + xmin)  +  i->getX() * 0.5 * (xmax - xmin);
 
  335         const double dx = i->getY() * 0.5 * (xmax - xmin);
 
  337         const double w  = 1.0 / 
x;
 
  338         const double dw = dx * w*
w;
 
  359                                   const double phi)
 const 
  363       const double R  =  std::max(R_m, 
getRmin());
 
  366       const double px =  sin(theta)*cos(phi);
 
  367       const double pz =  cos(theta);
 
  372         const double dw = m->getY() * 0.5 * (
wmax - 
wmin);
 
  381         const double ct0 = 1.0 / 
n;
 
  382         const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
  384         const double d  = R / st0;                                 
 
  385         const double ct = st0*px + ct0*pz;                         
 
  388         const double V  = 
exp(-d/l_abs) * 
exp(-d/ls);              
 
  389         const double W  = A / (2.0*
PI*R*st0);                      
 
  391         value += npe * U * V * W;
 
  410                                   const double t_ns)
 const 
  412       static const int    N   = 100;                               
 
  413       static const double eps = 1.0e-6;                            
 
  415       const double R  =  std::max(R_m, 
getRmin());
 
  417       const double a  =  
C*t/
R;                                    
 
  420       const double px =  sin(theta)*cos(phi);
 
  421       const double pz =  cos(theta);
 
  425       for (
double buffer[] = { 
wmin, 
wmax, 0.0 }, *p = buffer; *p != 0.0; ++p) {
 
  430         const double ct0 = 1.0 / 
n;
 
  431         const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
  433         const double b  = (ng - ct0) / st0;                        
 
  435         if (*p == 
wmin && b < a) { 
return 0.0; }
 
  436         if (*p == 
wmax && b > a) { 
return 0.0; }
 
  443       for (
int i = 0; i != 
N; ++i) {                               
 
  445         const double w  = 0.5 * (umin + umax);
 
  450         const double ct0 = 1.0 / 
n;
 
  451         const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
  453         const double b  = (ng - ct0) / st0;                        
 
  455         if (fabs(b-a) < a*eps) {
 
  463           const double d  = R / st0;                               
 
  464           const double ct = st0*px + ct0*pz;                       
 
  466           const double i3 = ct0*ct0*ct0 / (st0*st0*st0);
 
  469           const double V  = 
exp(-d/l_abs - d/ls);                  
 
  470           const double W  = A / (2.0*
PI*R*st0);                    
 
  472           const double Ja = R * (ngp/st0 + np*(n-ng)*i3) / 
C;      
 
  499                                      const double t_ns)
 const 
  501       static const double eps = 1.0e-10;
 
  505       const double R  =  std::max(R_m, 
getRmin());
 
  509       const double px =  sin(theta)*cos(phi);
 
  510       const double py =  sin(theta)*sin(phi);
 
  511       const double pz =  cos(theta);
 
  515       const double ni = sqrt(R*R + 
C*t*
C*t) / 
R;                   
 
  521       const double nj = std::min(ni,n1);
 
  527         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
  528         const double dn = i->getY() * 0.5 * (nj - n0);
 
  541         if (npe <= 0) { 
continue; }
 
  543         const double Jc  = 1.0 / ls;                               
 
  545         const double ct0 = 1.0 / 
n;                                
 
  546         const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
  552         const double zmin = rz.
first;
 
  553         const double zmax = rz.
second;
 
  555         const double zap  = 1.0 / l_abs;
 
  557         const double xmin = 
exp(zap*zmax);
 
  558         const double xmax = 
exp(zap*zmin);
 
  562           const double x  = 0.5 * (xmax + xmin)  +  
j->getX() * 0.5 * (xmax - xmin);
 
  563           const double dx = 
j->getY() * 0.5 * (xmax - xmin);
 
  565           const double z  = log(x) / zap;
 
  566           const double dz = -dx / (zap*
x);
 
  568           const double D  = sqrt(z*z + R*R);
 
  569           const double cd = -z / 
D;
 
  570           const double sd =  R / 
D;
 
  572           const double d  = (
C*t - z) / ng;                        
 
  576           const double cta  = cd*ct0 + sd*st0;
 
  577           const double dca  = d - 0.5*(d+
D)*(d-D) / (d - D*cta);
 
  578           const double tip  = -log(D*D/(dca*dca) + eps) / 
PI;
 
  580           const double ymin = 
exp(tip*
PI);
 
  581           const double ymax = 1.0;
 
  585             const double y  = 0.5 * (ymax + ymin)  +  
k->getX() * 0.5 * (ymax - ymin);
 
  586             const double dy = 
k->getY() * 0.5 * (ymax - ymin);
 
  588             const double phi = log(y) / tip;
 
  589             const double dp  = -dy / (tip*y);
 
  591             const double cp0 = cos(phi);
 
  592             const double sp0 = sin(phi);
 
  594             const double u  = (R*R + z*z - d*
d) / (2*R*st0*cp0 - 2*z*ct0 - 2*d);
 
  595             const double v  = d - 
u;
 
  597             if (u <= 0) { 
continue; }
 
  598             if (v <= 0) { 
continue; }
 
  600             const double vi  = 1.0 / 
v;
 
  601             const double cts = (R*st0*cp0 - z*ct0 - 
u)*vi;         
 
  605             if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
  607             const double vx  =   R - u*st0*cp0;
 
  608             const double vy  =     - u*st0*sp0;
 
  609             const double vz  =  -z - u*ct0;
 
  611             const double ct[]  = {                                 
 
  612               (vx*px + vy*py + vz*pz) * vi,
 
  613               (vx*px - vy*py + vz*pz) * vi
 
  619             const double W  = std::min(A*vi*vi, 2.0*PI);           
 
  622             const double Jd = ng * (1.0 - cts) / 
C;                
 
  624             value += (npe * dz * dp / (2*
PI)) * U * V * W * Ja * Jc / fabs(Jd);
 
  645                                        const double t_ns)
 const 
  649       const double R  =  std::max(R_m, 
getRmin());
 
  652       const double D  =  2.0*sqrt(A/
PI);
 
  654       const double px =  sin(theta)*cos(phi);
 
  656       const double pz =  cos(theta);
 
  660       const double ni = sqrt(R*R + 
C*t*
C*t) / 
R;                   
 
  666       const double nj = std::min(n1, ni);
 
  672         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
  673         const double dn = i->getY() * 0.5 * (nj - n0);
 
  690         for (
int j = 0; 
j != 2; ++
j) {
 
  692           const double z = rz[
j];
 
  694           if (
C*t <= z) 
continue;
 
  696           const double d  = sqrt(z*z + R*R);                       
 
  698           const double ct0 = -z / 
d;
 
  699           const double st0 =  R / 
d;
 
  701           const double dz = D / st0;                               
 
  703           const double ct = st0*px + ct0*pz;                       
 
  706           const double V  = 
exp(-d/l_abs - d/ls);                  
 
  707           const double W  = A/(d*
d);                               
 
  709           const double Ja = 
geant(n,ct0);                          
 
  710           const double Jd = (1.0 - ng*ct0) / 
C;                    
 
  711           const double Je = ng*st0*st0*st0 / (R*
C);                
 
  713           value += 
gWater() * npe * U * V * W * Ja / (fabs(Jd) + 0.5*Je*dz);
 
  733                                           const double t_ns)
 const 
  737       const double R  =  std::max(R_m, 
getRmin());
 
  741       const double px =  sin(theta)*cos(phi);
 
  742       const double py =  sin(theta)*sin(phi);
 
  743       const double pz =  cos(theta);
 
  747       const double ni = sqrt(R*R + 
C*t*
C*t) / 
R;                   
 
  753       const double nj = std::min(ni,n1);
 
  759         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
  760         const double dn = i->getY() * 0.5 * (nj - n0);
 
  773         if (npe <= 0) { 
continue; }
 
  775         const double Jc = 1.0 / ls;                                
 
  781         const double zmin = rz.
first;
 
  782         const double zmax = rz.
second;
 
  784         const double zap  = 1.0 / l_abs;
 
  786         const double xmin = 
exp(zap*zmax);
 
  787         const double xmax = 
exp(zap*zmin);
 
  791           const double x  = 0.5 * (xmax + xmin)  +  
j->getX() * 0.5 * (xmax - xmin);
 
  792           const double dx = 
j->getY() * 0.5 * (xmax - xmin);
 
  794           const double z  = log(x) / zap;
 
  795           const double dz = -dx / (zap*
x);
 
  797           const double D  = sqrt(z*z + R*R);
 
  798           const double cd = -z / 
D;
 
  799           const double sd =  R / 
D;
 
  801           const double qx = cd*px +  0  - sd*pz;
 
  802           const double qy =         1*py;
 
  803           const double qz = sd*px +  0  + cd*pz;
 
  805           const double d = (
C*t - z) / ng;                         
 
  809           const double ds = 2.0 / (size() + 1);
 
  811           for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
 
  813             for (
int buffer[] = { -1, +1, 0}, *
k = buffer; *
k != 0; ++
k) {
 
  815               const double cb  = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
 
  816               const double dcb = (*k) * ds*sb/cb;
 
  818               const double v  = 0.5 * (d + 
D) * (d - D) / (d - D*cb);
 
  819               const double u  = d - 
v;
 
  821               if (u <= 0) { 
continue; }
 
  822               if (v <= 0) { 
continue; }
 
  824               const double cts = (D*cb - 
v) / u;                   
 
  828               if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
  830               const double W  = std::min(A/(v*v), 2.0*
PI);         
 
  832               const double Jd = ng * (1.0 - cts) / 
C;              
 
  834               const double ca = (D - v*cb) / u;
 
  835               const double sa =      v*sb  / 
u;
 
  837               const double dp  = 
PI / 
phd.size();
 
  838               const double dom = dcb*dp * v*v / (u*
u);
 
  842                 const double cp  = l->getX();
 
  843                 const double sp  = l->getY();
 
  845                 const double ct0 = cd*ca - sd*sa*
cp;
 
  847                 const double vx  = sb*cp * qx;
 
  848                 const double vy  = sb*sp * qy;
 
  849                 const double vz  = cb    * qz;
 
  855                 const double Jb = 
geant(n,ct0);                    
 
  857                 value += dom * 
gWater() * npe * dz * U * V * W * Ja * Jb * Jc / fabs(Jd);
 
  882                                      const double t_ns)
 const 
  884       static const double eps = 1.0e-10;
 
  888       const double sd =  sqrt((1.0 + cd)*(1.0 - cd));
 
  889       const double D  =  std::max(D_m, 
getRmin());
 
  890       const double R  =  sd * 
D;                                   
 
  891       const double Z  = -cd * 
D;                                   
 
  896       const double px =  sin(theta)*cos(phi);
 
  897       const double py =  sin(theta)*sin(phi);
 
  898       const double pz =  cos(theta);
 
  903       const double ni = 
C*t / L;                                   
 
  909       const double nj = std::min(ni,n1);
 
  915         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
  916         const double dn = i->getY() * 0.5 * (nj - n0);
 
  929         if (npe <= 0) { 
continue; }
 
  931         const double Jc    = 1.0 / ls;                             
 
  933         const double ct0 = 1.0 / 
n;                                
 
  934         const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
  936         const double d =  
C*t / ng;                                
 
  940         const double cta  = cd*ct0 + sd*st0;
 
  941         const double dca  = d - 0.5*(d+L)*(d-L) / (d - L*cta);
 
  942         const double tip  = -log(L*L/(dca*dca) + eps) / 
PI;
 
  944         const double ymin = 
exp(tip*
PI);
 
  945         const double ymax = 1.0;
 
  949           const double y  = 0.5 * (ymax + ymin)  +  
j->getX() * 0.5 * (ymax - ymin);
 
  950           const double dy = 
j->getY() * 0.5 * (ymax - ymin);
 
  952           const double phi = log(y) / tip;
 
  953           const double dp  = -dy / (tip*y);
 
  955           const double cp0 = cos(phi);
 
  956           const double sp0 = sin(phi);
 
  958           const double u  = (R*R + Z*Z - d*
d) / (2*R*st0*cp0 - 2*Z*ct0 - 2*d);
 
  959           const double v  = d - 
u;
 
  961           if (u <= 0) { 
continue; }
 
  962           if (v <= 0) { 
continue; }
 
  964           const double vi  = 1.0 / 
v;
 
  965           const double cts = (R*st0*cp0 - Z*ct0 - 
u)*vi;         
 
  969           if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
  971           const double vx  =   R - u*st0*cp0;
 
  972           const double vy  =     - u*st0*sp0;
 
  973           const double vz  =  -Z - u*ct0;
 
  975           const double ct[]  = {                                 
 
  976             (vx*px + vy*py + vz*pz) * vi,
 
  977             (vx*px - vy*py + vz*pz) * vi
 
  983           const double W  = std::min(A*vi*vi, 2.0*PI);           
 
  986           const double Jd = ng * (1.0 - cts) / 
C;                
 
  988           value += (npe * dp / (2*
PI)) * U * V * W * Ja * Jc / fabs(Jd);
 
 1010                                       const double t_ns)
 const 
 1012       const double ct0 = cd;
 
 1013       const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
 
 1015       const double D  =  std::max(D_m, 
getRmin());
 
 1019       const double px =  sin(theta)*cos(phi);
 
 1020       const double pz =  cos(theta);
 
 1024       const double ng = 
C*t/
D;                                     
 
 1026       if (n0 >= ng) { 
return 0.0; }
 
 1027       if (n1 <= ng) { 
return 0.0; }
 
 1037       const double ct = st0*px + ct0*pz;                           
 
 1040       const double V  = 
exp(-D/l_abs - D/ls);                      
 
 1041       const double W  = A/(D*
D);                                   
 
 1045       const double Ja = D * ngp / 
C;                               
 
 1046       const double Jb = 
geant(n,ct0);                              
 
 1048       return npe * 
geanc() * U * V * W * Jb / fabs(Ja);
 
 1066                                          const double t_ns)
 const 
 1070       const double sd =  sqrt((1.0 + cd)*(1.0 - cd));
 
 1071       const double D  =  std::max(D_m, 
getRmin());
 
 1077       const double px =  sin(theta)*cos(phi);
 
 1078       const double py =  sin(theta)*sin(phi);
 
 1079       const double pz =  cos(theta);
 
 1081       const double qx = cd*px +  0  - sd*pz;
 
 1082       const double qy =         1*py;
 
 1083       const double qz = sd*px +  0  + cd*pz;
 
 1088       const double ni = 
C*t / L;                                   
 
 1094       const double nj = std::min(ni,n1);
 
 1100         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
 1101         const double dn = i->getY() * 0.5 * (nj - n0);
 
 1114         if (npe <= 0) { 
continue; }
 
 1116         const double Jc    = 1.0 / ls;                             
 
 1118         const double d =  
C*t / ng;                                
 
 1122         const double ds = 2.0 / (size() + 1);
 
 1124         for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
 
 1126           for (
int buffer[] = { -1, +1, 0}, *
k = buffer; *
k != 0; ++
k) {
 
 1128             const double cb  = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
 
 1129             const double dcb = (*k) * ds*sb/cb;
 
 1131             const double v  = 0.5 * (d + L) * (d - L) / (d - L*cb);
 
 1132             const double u  = d - 
v;
 
 1134             if (u <= 0) { 
continue; }
 
 1135             if (v <= 0) { 
continue; }
 
 1137             const double cts = (L*cb - 
v) / u;                     
 
 1141             if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
 1143             const double W  = std::min(A/(v*v), 2.0*
PI);           
 
 1145             const double Jd = ng * (1.0 - cts) / 
C;                
 
 1147             const double ca = (L - v*cb) / u;
 
 1148             const double sa =      v*sb  / 
u;
 
 1150             const double dp  = 
PI / 
phd.size();
 
 1151             const double dom = dcb*dp * v*v / (u*
u);
 
 1152             const double dos = sqrt(dom);
 
 1156               const double cp = l->getX();
 
 1157               const double sp = l->getY();
 
 1159               const double ct0 = cd*ca - sd*sa*
cp;
 
 1161               const double vx  = -sb*cp * qx;
 
 1162               const double vy  = -sb*sp * qy;
 
 1163               const double vz  =  cb    * qz;
 
 1173               const double Jb = 
geant(n, 
 
 1177               value += npe * 
geanc() * dos * U * V * W * Ja * Jb * Jc / fabs(Jd);
 
 1203                                       const double t_ns)
 const 
 1207       const double sd =  sqrt((1.0 + cd)*(1.0 - cd));
 
 1208       const double D  =  std::max(D_m, 
getRmin());
 
 1209       const double R  =  D * sd;                                   
 
 1210       const double Z  = -D * cd;
 
 1219       const double d  = sqrt((Z+zmax)*(Z+zmax) + R*R);
 
 1221       if (
C*t > std::max(n1*D, zmax + n1*d)) {
 
 1227         JRoot rz(R, n0, t + Z/
C);                                  
 
 1239         JRoot rz(R, n1, t + Z/
C);                                  
 
 1249       if (
C*t < zmax + n0*d) {
 
 1251         JRoot rz(R, n0, t + Z/
C);                                  
 
 1269         const double dy    =  (ymax - ymin) / size();
 
 1271         if (dy > 2*std::numeric_limits<double>::epsilon()) {
 
 1273           for (
double y = ymin + 0.5*dy; y < ymax; y += dy) {
 
 1276             const double d   =  sqrt(R*R + z*z);
 
 1305                                          const double t_ns)
 const 
 1309       const double sd =  sqrt((1.0 + cd)*(1.0 - cd));
 
 1310       const double D  =  std::max(D_m, 
getRmin());
 
 1311       const double R  =  D * sd;                                   
 
 1312       const double Z  = -D * cd;
 
 1320       const double d  =  sqrt((Z+zmax)*(Z+zmax) + R*R);
 
 1324         JRoot rz(R, n0, t + Z/
C);                                  
 
 1334       if (
C*t < zmax + n0*d) {
 
 1336         JRoot rz(R, n0, t + Z/
C);                                  
 
 1348       const double dy    =  (ymax - ymin) / size();
 
 1350       if (dy > 2*std::numeric_limits<double>::epsilon()) {
 
 1352         for (
double y = ymin + 0.5*dy; y < ymax; y += dy) {
 
 1355           const double d  =  sqrt(R*R + z*z);
 
 1378                                        const double t_ns)
 const 
 1382       const double R  =  std::max(R_m, 
getRmin());
 
 1385       const double D  =  2.0*sqrt(A/
PI);
 
 1387       const double px =  sin(theta)*cos(phi);
 
 1388       const double pz =  cos(theta);
 
 1392       const double ni = sqrt(R*R + 
C*t*
C*t) / 
R;                   
 
 1398       const double nj = std::min(n1, ni);
 
 1404         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
 1405         const double dn = i->getY() * 0.5 * (nj - n0);
 
 1422         for (
int j = 0; 
j != 2; ++
j) {
 
 1424           const double z = rz[
j];
 
 1426           if (
C*t <= z) 
continue;
 
 1428           const double d  = sqrt(z*z + R*R);                       
 
 1430           const double ct0 = -z / 
d;
 
 1431           const double st0 =  R / 
d;
 
 1433           const double dz = D / st0;                               
 
 1434           const double ct = st0*px + ct0*pz;                       
 
 1437           const double V  = 
exp(-d/l_abs - d/ls);                  
 
 1438           const double W  = A/(d*
d);                               
 
 1440           const double Ja = 1.0/(4*
PI);                            
 
 1441           const double Jd = (1.0 - ng*ct0) / 
C;                    
 
 1442           const double Je = ng*st0*st0*st0 / (R*
C);                
 
 1444           value += npe * 
geanc() * U * V * W * Ja / (fabs(Jd) + 0.5*Je*dz);
 
 1464                                           const double t_ns)
 const 
 1468       const double R  =  std::max(R_m, 
getRmin());
 
 1472       const double px =  sin(theta)*cos(phi);
 
 1473       const double py =  sin(theta)*sin(phi);
 
 1474       const double pz =  cos(theta);
 
 1478       const double ni = sqrt(R*R + 
C*t*
C*t) / 
R;                   
 
 1484       const double nj = std::min(ni,n1);
 
 1490         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
 1491         const double dn = i->getY() * 0.5 * (nj - n0);
 
 1504         if (npe <= 0) { 
continue; }
 
 1506         const double Jc = 1.0 / ls;                                
 
 1512         const double zmin = rz.
first;
 
 1513         const double zmax = rz.
second;
 
 1515         const double zap  = 1.0 / l_abs;
 
 1517         const double xmin = 
exp(zap*zmax);
 
 1518         const double xmax = 
exp(zap*zmin);
 
 1522           const double x  = 0.5 * (xmax + xmin)  +  
j->getX() * 0.5 * (xmax - xmin);
 
 1523           const double dx = 
j->getY() * 0.5 * (xmax - xmin);
 
 1525           const double z  = log(x) / zap;
 
 1526           const double dz = -dx / (zap*
x);
 
 1528           const double D  = sqrt(z*z + R*R);
 
 1529           const double cd = -z / 
D;
 
 1530           const double sd =  R / 
D;
 
 1532           const double qx = cd*px +  0  - sd*pz;
 
 1533           const double qy =         1*py;
 
 1534           const double qz = sd*px +  0  + cd*pz;
 
 1536           const double d = (
C*t - z) / ng;                         
 
 1540           const double ds = 2.0 / (size() + 1);
 
 1542           for (
double sb = 0.5*ds; sb < 1.0 - 0.25*ds; sb += ds) {
 
 1544             for (
int buffer[] = { -1, +1, 0}, *
k = buffer; *
k != 0; ++
k) {
 
 1546               const double cb  = (*k) * sqrt((1.0 + sb)*(1.0 - sb));
 
 1547               const double dcb = (*k) * ds*sb/cb;
 
 1549               const double v  = 0.5 * (d + 
D) * (d - D) / (d - D*cb);
 
 1550               const double u  = d - 
v;
 
 1552               if (u <= 0) { 
continue; }
 
 1553               if (v <= 0) { 
continue; }
 
 1555               const double cts = (D*cb - 
v) / u;                   
 
 1559               if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
 1561               const double W  = std::min(A/(v*v), 2.0*
PI);         
 
 1563               const double Jd = ng * (1.0 - cts) / 
C;              
 
 1565               const double dp  = 
PI / 
phd.size();
 
 1566               const double dom = dcb*dp * v*v / (u*
u);
 
 1570                 const double cp  = l->getX();
 
 1571                 const double sp  = l->getY();
 
 1573                 const double vx  = sb*cp * qx;
 
 1574                 const double vy  = sb*sp * qy;
 
 1575                 const double vz  = cb    * qz;
 
 1581                 const double Jb = 1.0/(4*
PI);                      
 
 1583                 value += dom * npe * 
geanc() * dz * U * V * W * Ja * Jb * Jc / fabs(Jd);
 
 1604                                          const double t_ns)
 const 
 1606       const double D  =  std::max(D_m, 
getRmin());
 
 1612       const double ng = 
C*t/
D;                                     
 
 1614       if (n0 >= ng) { 
return 0.0; }
 
 1615       if (n1 <= ng) { 
return 0.0; }
 
 1626       const double V  = 
exp(-D/l_abs - D/ls);                      
 
 1627       const double W  = A/(D*
D);                                   
 
 1631       const double Ja = D * ngp / 
C;                               
 
 1632       const double Jb = 1.0 / (4.0*
PI);                            
 
 1634       return npe * 
geanc() * U * V * W * Jb / fabs(Ja);
 
 1648                                             const double t_ns)
 const 
 1652       const double D  =  std::max(D_m, 
getRmin());
 
 1654       const double st =  sqrt((1.0 + ct)*(1.0 - ct));
 
 1661       const double ni = 
C*t / 
D;                                   
 
 1667       const double nj = std::min(ni,n1);
 
 1673         const double ng = 0.5 * (nj + n0)  +  i->getX() * 0.5 * (nj - n0);
 
 1674         const double dn = i->getY() * 0.5 * (nj - n0);
 
 1684         if (npe <= 0) { 
continue; }
 
 1689         const double Jc    = 1.0 / ls;                             
 
 1690         const double Jb    = 1.0 / (4.0*
PI);                       
 
 1692         const double d =  
C*t / ng;                                
 
 1694         const double dcb = 2.0 / (size() + 1);
 
 1696         for (
double cb = -1.0 + 0.5*dcb; cb < +1.0; cb += dcb) {
 
 1698           const double sb = sqrt((1.0 + cb)*(1.0 - cb));
 
 1700           const double v  = 0.5 * (d + 
D) * (d - D) / (d - D*cb);
 
 1701           const double u  = d - 
v;
 
 1703           if (u <= 0) { 
continue; }
 
 1704           if (v <= 0) { 
continue; }
 
 1706           const double cts = (D*cb - 
v) / u;                     
 
 1710           if (cts < 0.0 && v * sqrt((1.0 + cts) * (1.0 - cts)) < 
MODULE_RADIUS_M) { 
continue; }
 
 1712           const double W  = std::min(A/(v*v), 2.0*
PI);           
 
 1714           const double Jd = ng * (1.0 - cts) / 
C;                
 
 1716           const double dp  = 
PI / 
phd.size();
 
 1717           const double dom = dcb*dp * v*v / (u*
u);               
 
 1721             const double cp  = l->getX();
 
 1722             const double dot = cb*ct + sb*cp*st;
 
 1726             value += npe * 
geanc() * dom * U * V * W * Ja * Jb * Jc / fabs(Jd);
 
 1751                             const double t_ns)
 const 
 1793                             const double t_ns)
 const 
 1820                                 const double t_ns)
 const 
 1850                                 const double t_ns)
 const 
 1875                                 const double t_ns)
 const 
 1907                                 const double t_ns)
 const 
 1926                                    const double t_ns)
 const 
 1952                                    const double t_ns)
 const 
 1982         const double a  =  n*n        -  1.0;
 
 1983         const double b  =  2*
C*t;
 
 1984         const double c  =  R*n * R*n  -  
C*t * 
C*t;
 
 1986         const double q  =  b*b - 4*a*
c;
 
 1990           first    = (-b - sqrt(q)) / (2*a);
 
 1991           second   = (-b + sqrt(q)) / (2*a);
 
 2015           throw JException(
"JRoot::operator[] invalid index");
 
 2034                                  const double eps = 1.0e-10)
 const 
 2041       for (
int i = 0; i != 1000; ++i) {
 
 2043         const double v = 0.5 * (vmin + vmax); 
 
 2046         if (fabs(y - n) < eps) {
 
 2056       return 0.5 * (vmin + vmax);
 
 2073                                  const double eps)
 const 
 2083         if (fabs(y - n) < eps) {
 
 2111         const int    nx   = 100000;
 
 2112         const double xmin =   -1.0;
 
 2113         const double xmax =   +1.0;
 
 2115         const double dx   = (xmax - xmin) / (nx - 1);
 
 2117         for (
double x = xmin, W = 0.0; 
x < xmax; 
x += dx) {
 
 2130       return 1.0/l_abs  +  f1(cts)/ls;
 
 2167                  const double epsilon        = 1e-12) :
 
 2201            double (*pF_qe)   (
const double),
 
 2202            double (*pF_pmt)  (
const double),
 
 2203            double (*pF_l_abs)(
const double),
 
 2204            double (*pF_ls)   (
const double),
 
 2205            double (*pF_ps)   (
const double),
 
 2213            const double epsilon        = 1e-12) :
 
 2241     virtual double getQE(
const double lambda)
 const override  
 2267       return l_abs(lambda);
 
 2307     double (*
qe)(
const double lambda);
 
 2323     double (*
ls)(
const double lambda);
 
 2331     double (*
pmt)(
const double ct);
 
 2339     double (*
ps)(
const double ct);
 
Photon emission profile EM-shower. 
 
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. 
 
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
 
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 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 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. 
 
JTOOLS::JElement2D< double, double > element_type
 
double(* ls)(const double lambda)
Scattering length. 
 
double second
most downstream solution 
 
double getNumberOfPhotons() const 
Number of Cherenkov photons per unit track length. 
 
double geanc()
Equivalent muon track length per unit shower energy. 
 
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity. 
 
Probability Density Functions of the time response of a PMT with an implementation for the JDispersio...
 
scattered light from EM shower 
 
Implementation of dispersion for water in deep sea. 
 
double getDirectLightFromMuon(const double R_m, const double theta, const double phi) const 
Number of photo-electrons from direct Cherenkov light from muon. 
 
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. 
 
JRoot(const double R, const double n, const double t)
Determine solution(s) of quadratic equation. 
 
direct light from EM showers 
 
virtual double getAbsorptionLength(const double lambda) const override
Absorption length. 
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
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. 
 
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. 
 
virtual double getDispersionGroup(const double lambda) const =0
Dispersion of light for group velocity. 
 
static const JGeaneWater gWater
Function object for energy loss of muon in sea water. 
 
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 ~JPDF()
Virtual destructor. 
 
direct light from bright point 
 
virtual double getPhotocathodeArea() const override
Photo-cathode area of PMT. 
 
virtual double getQE(const double lambda) const override
Quantum efficiency of PMT (incl. 
 
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcoustics.sh -- typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
 
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
 
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. 
 
JAbstractPDF(const double P_atm, const double Wmin, const double Wmax, const int numberOfPoints=20, const double epsilon=1e-12)
Constructor. 
 
Numbering scheme for PDF types. 
 
double operator[](const int i) const 
Get result by index. 
 
Auxiliary class to find solution(s) to  of the square root expression:  where  is the index of refrac...
 
double getLightFromBrightPoint(const double D_m, const double ct, const double t_ns) const 
Probability density function for direct light from isotropic light source. 
 
static const double C
Physics constants. 
 
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. 
 
std::vector< element_type > phd
fast evaluation of phi integral 
 
scattered light from muon 
 
static double MODULE_RADIUS_M
Radius of optical module [m]. 
 
Compiler version dependent expressions, macros, etc. 
 
double(* pmt)(const double ct)
Angular acceptance of PMT. 
 
double(* l_abs)(const double lambda)
Absorption length. 
 
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. 
 
virtual double getScatteringLength(const double lambda) const =0
Scattering length. 
 
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile. 
 
Probability Density Functions of the time response of a PMT with an implementation of the JAbstractPM...
 
scattered light from delta-rays 
 
virtual double getAbsorptionLength(const double lambda) const =0
Absorption length. 
 
direct light from EM shower 
 
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. 
 
static const double PI
Mathematical constants. 
 
scattered light from EM showers 
 
virtual double getIndexOfRefractionPhase(const double lambda) const =0
Index of refraction for phase velocity. 
 
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. 
 
virtual double getPhotocathodeArea() const =0
Photo-cathode area of PMT. 
 
then usage $script[distance] fi case set_variable R
 
scattered light from bright point 
 
bool is_valid
validity of solutions 
 
double(* ps)(const double ct)
Model specific function to describe light scattering in water. 
 
direct light from delta-rays 
 
static double getRmin()
minimal distance of approach of muon to PMT [m] 
 
const double wmax
maximal wavelength for integration [nm] 
 
double cherenkov(const double lambda, const double n)
Number of Cherenkov photons per unit track length and per unit wavelength. 
 
Auxiliary classes for numerical integration. 
 
virtual double getIndexOfRefractionGroup(const double lambda) const 
Index of refraction for group velocity. 
 
double getIntegral(const double E, const double z) const 
Integral of PDF (starting from 0). 
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
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. 
 
virtual double getInverseAttenuationLength(const double l_abs, const double ls, const double cts) const 
Get the inverse of the attenuation length. 
 
double getScatteredLightFromBrightPoint(const double D_m, const double ct, const double t_ns) const 
Probability density function for scattered light from isotropic light source. 
 
const double wmin
Integration limits. 
 
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 getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length. 
 
virtual double getAngularAcceptance(const double ct) const =0
Angular acceptence of PMT. 
 
double getScatteredLightFromDeltaRays(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 getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity. 
 
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. 
 
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
 
virtual double getScatteringProbability(const double ct) const override
Model specific function to describe light scattering in water (integral over full solid angle normali...
 
$WORKDIR ev_configure_domsimulator txt echo process $DOM_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DOM_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
 
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. 
 
Longitudinal emission profile EM-shower. 
 
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 getLength(const double E, const double P, const double eps=1.0e-3) const 
Get shower length for a given integrated probability. 
 
virtual double getQE(const double lambda) const =0
Quantum efficiency of PMT (incl. 
 
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. 
 
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. 
 
Light dispersion inteface. 
 
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
 
virtual double getScatteringLength(const double lambda) const override
Scattering length. 
 
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. 
 
do echo Generating $dir eval D
 
virtual double getDispersionPhase(const double lambda) const =0
Dispersion of light for phase velocity. 
 
virtual double getScatteringProbability(const double ct) const =0
Model specific function to describe light scattering in water (integral over full solid angle normali...
 
double first
most upstream solution 
 
JPDF(const double Wmin, const double Wmax, const int numberOfPoints=20, const double epsilon=1e-12)
Constructor. 
 
double(* qe)(const double lambda)
Quantum efficiency of PMT (incl. 
 
const double A
photo-cathode area [m2] 
 
virtual double getAngularAcceptance(const double ct) const override
Angular acceptance of PMT. 
 
Low level interface for the calculation of the Probability Density Functions (PDFs) of the arrival ti...