55{
   58 
   62  int                 function;
   65  
   66  try {
   67 
   68    JParser<> zap(
"Program to create interpolation tables of the PDF of the arrival time of the Cherenkov light from a bright point.");
 
   69 
   72    zap[
'e'] = 
make_field(epsilon,                
"precision for integration")  = 1.0e-10;
 
   76      DIRECT_LIGHT_FROM_BRIGHT_POINT,
   77      SCATTERED_LIGHT_FROM_BRIGHT_POINT;
   80 
   82 
   83    zap(argc, argv);
   84  }
   85  catch(const exception &error) {
   86    FATAL(error.what() << endl);
 
   87  }
   88 
   89 
   90  typedef double (
JPDF::*fcn)(
const double,
 
   91                              const double,
   92                              const double) const;
   93 
   94 
   95  
   96 
   97  const double P_atm = NAMESPACE::getAmbientPressure();
  100  
  101 
  103    pdf_c(NAMESPACE::getPhotocathodeArea(),
  104          NAMESPACE::getQE,
  105          NAMESPACE::getAngularAcceptance,
  108          NAMESPACE::getScatteringProbability,
  109          P_atm,
  110          wmin,
  111          wmax,
  113          epsilon);
  114 
  115 
  120 
  123 
  124  JPDF_t pdf;
  125 
  126 
  127  NOTICE(
"building multi-dimensional function object <" << function << 
">... " << flush);
 
  128  
  129  const double ng[] = { pdf_c.getIndexOfRefractionGroup(wmax),
  130                        pdf_c.getIndexOfRefractionGroup(wmin) };
  131  
  133 
  134  zmap[DIRECT_LIGHT_FROM_BRIGHT_POINT]    = make_pair((fcn) &JPDF::getDirectLightFromBrightPoint,    JFunction2DTransformer_t(21.5, 2, ng[0], ng[1]));
  135  zmap[SCATTERED_LIGHT_FROM_BRIGHT_POINT] = make_pair((fcn) &JPDF::getScatteredLightFromBrightPoint, JFunction2DTransformer_t(21.5, 2, ng[0], 0.0));
  136 
  137  if (zmap.find(function) == zmap.end()) {
  138    FATAL(
"illegal function specifier" << endl);
 
  139  }
  140 
  141  fcn                      f           = zmap[function].first;    
  142  JFunction2DTransformer_t transformer = zmap[function].second;   
  143 
  144 
  145  if (D.empty()) {
  146    D.insert(  0.10);
  147    D.insert(  0.50);
  148    D.insert(  1.00);
  149    D.insert(  5.00);
  150    D.insert( 10.00);
  151    D.insert( 20.00);
  152    D.insert( 30.00);
  153    D.insert( 40.00);
  154    D.insert( 50.00);
  155    D.insert( 60.00);
  156    D.insert( 70.00);
  157    D.insert( 80.00);
  158    D.insert( 90.00);
  159    D.insert(100.00);
  160  }
  161 
  163 
  164  if (function == DIRECT_LIGHT_FROM_BRIGHT_POINT) {
  165 
  166    for (
double buffer[] = { 0.0, 0.005, 0.01, 0.015, -1 }, *
x = buffer; *
x >= 0; ++
x) {
 
  167      X.insert(0.0 + *x);
  168      X.insert(1.0 - *x);
  169    }
  170 
  171    for (
double x = 0.02; 
x < 0.99; 
x += 0.01)
 
  172      X.insert(x);
  173 
  174  } else {
  175 
  176    X.insert(  0.00);
  177    X.insert(  0.10);
  178    X.insert(  0.20);
  179    X.insert(  0.30);
  180    X.insert(  0.40);
  181    X.insert(  0.50);
  182    X.insert(  0.60);
  183    X.insert(  0.70);
  184    X.insert(  0.80);
  185    X.insert(  0.90);
  186    X.insert(  1.00);
  187    X.insert(  1.00);
  188    X.insert(  1.10);
  189    X.insert(  1.20);
  190    X.insert(  1.30);
  191    X.insert(  1.40);
  192    X.insert(  1.50);
  193    X.insert(  1.60);
  194    X.insert(  1.70);
  195    X.insert(  1.80);
  196    X.insert(  1.90);
  197    X.insert(  2.00);
  198    X.insert(  2.20);
  199    X.insert(  2.40);
  200    X.insert(  2.60);
  201    X.insert(  2.80);
  202    X.insert(  3.00);
  203    X.insert(  3.25);
  204    X.insert(  3.50);
  205    X.insert(  3.75);
  206    X.insert(  4.00);
  207    X.insert(  4.25);
  208    X.insert(  4.50);
  209    X.insert(  4.75);
  210    X.insert(  5.0);
  211    X.insert(  6.0);
  212    X.insert(  7.0);
  213    X.insert(  8.0);
  214    X.insert(  9.0);
  215    X.insert( 10.0);
  216    X.insert( 15.0);
  217    X.insert( 20.0);
  218    X.insert( 25.0);
  219    X.insert( 30.0);
  220    X.insert( 40.0);
  221    X.insert( 50.0);
  222    X.insert( 60.0);
  223    X.insert( 70.0);
  224    X.insert( 80.0);
  225    X.insert( 90.0);
  226    X.insert(100.0);
  227    X.insert(120.0);
  228    X.insert(140.0);
  229    X.insert(160.0);
  230    X.insert(180.0);
  231    X.insert(200.0);
  232  }
  233    
  234 
  236 
  237    const double D_m = *d;
  238 
  239    for (double dc = 0.1, ct = -1.0; ct < +1.0 + 0.5*dc; ct += dc) {
  240 
  241      JFunction1D_t& 
f1 = pdf[D_m][ct];
 
  242 
  243      const JArray_t 
array(D_m, ct);
 
  244 
  245      double t_old = transformer.getXn(
array, *X.begin());
 
  246      double y_old = 0.0;
  247 
  249          
  250        const double t = transformer.getXn(
array, *x);
 
  251        const double y = (pdf_c.*f)(D_m, ct, t);
 
  252 
  253        if (y != 0.0) {
  254 
  255          if (*x < 0.0) {
  256            WARNING(
"dt < 0 " << *x << 
' ' << D_m << 
' ' << t << 
' ' << y << endl);
 
  257          }
  258 
  259          if (y_old == 0.0) {
  261          }
  262 
  264              
  265        } else {
  266              
  267          if (y_old != 0.0) {
  269          }
  270        }
  271            
  272        t_old = t;
  274      }
  275    }
  276  }
  277 
  278  pdf.transform(transformer);
  279  pdf.compile();
  280 
  282 
  283  try {
  284 
  286 
  288 
  290  }
  293  }
  294}
double getAbsorptionLength(const double lambda)
 
double getScatteringLength(const double lambda)
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
virtual const char * what() const override
Get error message.
 
Utility class to parse command line options.
 
Multi-dimensional PDF table for arrival time of Cherenkov light.
 
Probability Density Functions of the time response of a PMT with an implementation of the JAbstractPM...
 
const JPolynome f1(1.0, 2.0, 3.0)
Function.
 
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
 
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
 
Auxiliary data structure for muon PDF.