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 shower.");
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 SCATTERED_LIGHT_FROM_MUON_5D,
72 DIRECT_LIGHT_FROM_EMSHOWER,
73 SCATTERED_LIGHT_FROM_EMSHOWER;
81 catch(
const exception &error) {
82 FATAL(error.what() << endl);
86 typedef double (
JPDF::*fcn)(
const double,
95 const double P_atm = NAMESPACE::getAmbientPressure();
96 const double wmin = getMinimalWavelength();
97 const double wmax = getMaximalWavelength();
101 pdf_c(NAMESPACE::getPhotocathodeArea(),
103 NAMESPACE::getAngularAcceptance,
104 JAbsorptionLength::getAbsorptionLength,
105 JScatteringLength::getScatteringLength,
106 JScatteringProbability::getScatteringProbability,
127 NOTICE(
"building multi-dimensional function object <" << function <<
">... " << flush);
129 const double ng[] = {
136 zmap[SCATTERED_LIGHT_FROM_MUON_5D] = make_pair((fcn) &JPDF::getScatteredLightFromMuon, JFunction4DTransformer_t(21.5, 2, ng[0], 0.0,
JGeant(
JGeanx(0.33, -9.5)), 6e-4, NAMESPACE::getAngularAcceptance, 0.06));
137 zmap[DIRECT_LIGHT_FROM_EMSHOWER] = make_pair((fcn) &JPDF::getDirectLightFromEMshower, JFunction4DTransformer_t(21.5, 2, ng[0], ng[1],
JGeant(
JGeanx(0.35, -5.4)), 1e-5, NAMESPACE::getAngularAcceptance, 0.001));
138 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));
140 if (zmap.find(function) == zmap.end()) {
141 FATAL(
"illegal function specifier" << endl);
144 fcn f = zmap[function].first;
145 JFunction4DTransformer_t transformer = zmap[function].second;
188 if (function == DIRECT_LIGHT_FROM_EMSHOWER) {
190 for (
double buffer[] = { 0.0, 0.005, 0.01, 0.015, -1 }, *x = buffer; *x >= 0; ++x) {
195 for (
double x = 0.02; x < 0.99; x += 0.01)
270 const double grid = 7.0;
272 const double alpha = 2.0 * sqrt(1.0 - cos(grid * PI / 180.0));
277 const double D_m = *d;
281 const double cd = *c;
283 const unsigned int number_of_theta_points = max(2u, (
unsigned int) (180.0/(1.4 * grid)));
285 for (
double theta = 0.0; theta <= PI + epsilon; theta += PI/number_of_theta_points) {
287 const unsigned int number_of_phi_points = max(2u, (
unsigned int) (PI * sin(theta) / alpha));
289 for (
double phi = 0.0; phi <= PI + epsilon; phi += PI/number_of_phi_points) {
291 JFunction1D_t& f1 = pdf[D_m][cd][theta][phi];
293 const JArray_t
array(D_m, cd, theta, phi);
295 double t_old = transformer.getXn(
array, *X.begin());
300 const double t = transformer.getXn(
array, *x);
301 const double y = (pdf_c.*f)(D_m, cd, theta, phi, t);
306 WARNING(
"dt < 0 " << *x <<
' ' << D_m <<
' ' << t <<
' ' << y << endl);
330 pdf.transform(transformer);
344 FATAL(error.what() << endl);