38int main(
int argc,
char **argv)
55 JParser<> zap(
"Program to create interpolation tables of the PDF of the arrival time of the Cherenkov light from a shower.");
60 zap[
'e'] =
make_field(epsilon,
"precision for integration") = 1.0e-10;
62 SCATTERED_LIGHT_FROM_MUON_5D,
63 DIRECT_LIGHT_FROM_EMSHOWER,
64 SCATTERED_LIGHT_FROM_EMSHOWER;
72 catch(
const exception &error) {
73 FATAL(error.what() << endl);
77 typedef double (
JPDF::*fcn)(
const double,
86 const double P_atm = NAMESPACE::getAmbientPressure();
87 const double wmin = getMinimalWavelength();
88 const double wmax = getMaximalWavelength();
92 pdf_c(NAMESPACE::getPhotocathodeArea(),
94 PDF::getAngularAcceptance,
95 PDF::getAbsorptionLength,
96 PDF::getScatteringLength,
97 PDF::getScatteringProbability,
118 NOTICE(
"building multi-dimensional function object <" << function <<
">... " << flush);
120 const double ng[] = {
129 zmap[SCATTERED_LIGHT_FROM_EMSHOWER] = make_pair((fcn) &JPDF::getScatteredLightFromEMshower, JFunction4DTransformer_t(21.5, 2, ng[0], 0.0,
JGeant(
JGeanx(0.55, -4.5)), 1e-2,
NAMESPACE::getAngularAcceptance, 0.05));
131 if (zmap.find(function) == zmap.end()) {
132 FATAL(
"illegal function specifier" << endl);
135 fcn f = zmap[function].first;
136 JFunction4DTransformer_t transformer = zmap[function].second;
179 if (function == DIRECT_LIGHT_FROM_EMSHOWER) {
181 for (
double buffer[] = { 0.0, 0.005, 0.01, 0.015, -1 }, *x = buffer; *x >= 0; ++x) {
186 for (
double x = 0.02; x < 0.99; x += 0.01)
261 const double grid = 7.0;
263 const double alpha = 2.0 * sqrt(1.0 - cos(grid * PI / 180.0));
268 const double D_m = *d;
272 const double cd = *c;
274 const unsigned int number_of_theta_points = max(2u, (
unsigned int) (180.0/(1.4 * grid)));
276 for (
double theta = 0.0; theta <= PI + epsilon; theta += PI/number_of_theta_points) {
278 const unsigned int number_of_phi_points = max(2u, (
unsigned int) (PI * sin(theta) / alpha));
280 for (
double phi = 0.0; phi <= PI + epsilon; phi += PI/number_of_phi_points) {
282 JFunction1D_t& f1 = pdf[D_m][cd][theta][phi];
284 const JArray_t
array(D_m, cd, theta, phi);
286 double t_old = transformer.getXn(
array, *X.begin());
291 const double t = transformer.getXn(
array, *x);
292 const double y = (pdf_c.*f)(D_m, cd, theta, phi, t);
297 WARNING(
"dt < 0 " << *x <<
' ' << D_m <<
' ' << t <<
' ' << y << endl);
321 pdf.transform(transformer);
335 FATAL(error.what() << endl);