38int main(
int argc,
char **argv)
61 JParser<> zap(
"Program to create interpolation tables of the PDF of the arrival time of the Cherenkov light from a bright point.");
64 <<
"possible options absorptionLength: " << get_keys(absorptionLength) << endl
65 <<
"possible options scatteringLength: " << get_keys(scatteringLength) << endl
66 <<
"possible options scatteringProbability: " << get_keys(scatteringProbability) << endl) =
JPARSER::initialised();
69 zap[
'e'] =
make_field(epsilon,
"precision for integration") = 1.0e-10;
71 DIRECT_LIGHT_FROM_BRIGHT_POINT,
72 SCATTERED_LIGHT_FROM_BRIGHT_POINT;
80 catch(
const exception &error) {
81 FATAL(error.what() << endl);
85 typedef double (
JPDF::*fcn)(
const double,
92 const double P_atm = NAMESPACE::getAmbientPressure();
93 const double wmin = getMinimalWavelength();
94 const double wmax = getMaximalWavelength();
98 pdf_c(NAMESPACE::getPhotocathodeArea(),
100 NAMESPACE::getAngularAcceptance,
101 JAbsorptionLength::getAbsorptionLength,
102 JScatteringLength::getScatteringLength,
103 JScatteringProbability::getScatteringProbability,
122 NOTICE(
"building multi-dimensional function object <" << function <<
">... " << flush);
124 const double ng[] = {
131 zmap[DIRECT_LIGHT_FROM_BRIGHT_POINT] = make_pair((fcn) &JPDF::getDirectLightFromBrightPoint, JFunction2DTransformer_t(21.5, 2, ng[0], ng[1]));
132 zmap[SCATTERED_LIGHT_FROM_BRIGHT_POINT] = make_pair((fcn) &JPDF::getScatteredLightFromBrightPoint, JFunction2DTransformer_t(21.5, 2, ng[0], 0.0));
134 if (zmap.find(function) == zmap.end()) {
135 FATAL(
"illegal function specifier" << endl);
138 fcn f = zmap[function].first;
139 JFunction2DTransformer_t transformer = zmap[function].second;
161 if (function == DIRECT_LIGHT_FROM_BRIGHT_POINT) {
163 for (
double buffer[] = { 0.0, 0.005, 0.01, 0.015, -1 }, *x = buffer; *x >= 0; ++x) {
168 for (
double x = 0.02; x < 0.99; x += 0.01)
234 const double D_m = *d;
236 for (
double dc = 0.1, ct = -1.0; ct < +1.0 + 0.5*dc; ct += dc) {
238 JFunction1D_t& f1 = pdf[D_m][ct];
240 const JArray_t
array(D_m, ct);
242 double t_old = transformer.getXn(
array, *X.begin());
247 const double t = transformer.getXn(
array, *x);
248 const double y = (pdf_c.*f)(D_m, ct, t);
253 WARNING(
"dt < 0 " << *x <<
' ' << D_m <<
' ' << t <<
' ' << y << endl);
275 pdf.transform(transformer);
289 FATAL(error.what() << endl);