36int main(
int argc,
char **argv)
59 JParser<> zap(
"Program to create interpolation tables of the PDF of the arrival time of the Cherenkov light from a muon.");
62 <<
"possible options absorptionLength: " << get_keys(absorptionLength) << endl
63 <<
"possible options scatteringLength: " << get_keys(scatteringLength) << endl
64 <<
"possible options scatteringProbability: " << get_keys(scatteringProbability) << endl) =
JPARSER::initialised();
67 zap[
'e'] =
make_field(epsilon,
"precision for integration") = 1.0e-10;
69 DIRECT_LIGHT_FROM_MUON,
70 DIRECT_LIGHT_FROM_EMSHOWERS,
71 DIRECT_LIGHT_FROM_DELTARAYS,
72 SCATTERED_LIGHT_FROM_MUON,
73 SCATTERED_LIGHT_FROM_EMSHOWERS,
74 SCATTERED_LIGHT_FROM_DELTARAYS;
82 catch(
const exception &error) {
83 FATAL(error.what() << endl);
87 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,
126 NOTICE(
"building multi-dimensional function object <" << function <<
">... " << flush);
129 const double kmin = pdf_c.
getKappa(wmax);
130 const double kmax = pdf_c.
getKappa(wmin);
131 const double cmin = pdf_c.
getKmin (wmax);
135 zmap[DIRECT_LIGHT_FROM_MUON] = make_pair((fcn) &JPDF::getDirectLightFromMuon, JFunction3DTransformer_t(21.5, 2, kmin, kmax, NAMESPACE::getAngularAcceptance, 0.001));
136 zmap[SCATTERED_LIGHT_FROM_MUON] = make_pair((fcn) &JPDF::getScatteredLightFromMuon, JFunction3DTransformer_t(35.0, 2, cmin, 0.0, NAMESPACE::getAngularAcceptance, 0.10));
137 zmap[DIRECT_LIGHT_FROM_EMSHOWERS] = make_pair((fcn) &JPDF::getDirectLightFromEMshowers, JFunction3DTransformer_t(21.5, 2, cmin, 0.0, NAMESPACE::getAngularAcceptance, 0.10));
138 zmap[SCATTERED_LIGHT_FROM_EMSHOWERS] = make_pair((fcn) &JPDF::getScatteredLightFromEMshowers, JFunction3DTransformer_t(35.0, 2, cmin, 0.0, NAMESPACE::getAngularAcceptance, 0.10));
139 zmap[DIRECT_LIGHT_FROM_DELTARAYS] = make_pair((fcn) &JPDF::getDirectLightFromDeltaRays, JFunction3DTransformer_t(21.5, 2, cmin, 0.0, NAMESPACE::getAngularAcceptance, 0.10));
140 zmap[SCATTERED_LIGHT_FROM_DELTARAYS] = make_pair((fcn) &JPDF::getScatteredLightFromDeltaRays, JFunction3DTransformer_t(35.0, 2, cmin, 0.0, NAMESPACE::getAngularAcceptance, 0.10));
142 if (zmap.find(function) == zmap.end()) {
143 FATAL(
"illegal function specifier" << endl);
146 fcn f = zmap[function].first;
147 JFunction3DTransformer_t transformer = zmap[function].second;
212 if (function == DIRECT_LIGHT_FROM_MUON) {
214 for (
double buffer[] = { -0.01, -0.005, 0.0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, -1.0 }, *x = buffer; *x != -1.0; ++x) {
219 for (
double x = 0.01; x < 0.1; x += 0.0025) {
224 for (
double x = 0.10; x < 0.5; x += 0.010) {
316 const double grid = 5.0;
318 const double alpha = 2.0 * sqrt(1.0 - cos(grid * PI / 180.0));
323 const double R_m = *r;
325 const unsigned int number_of_theta_points = max(2u, (
unsigned int) (180.0/(1.4 * grid)));
327 for (
double theta = 0.0; theta <= PI + epsilon; theta += PI/number_of_theta_points) {
329 const unsigned int number_of_phi_points = max(2u, (
unsigned int) (PI * sin(theta) / alpha));
331 for (
double phi = 0.0; phi <= PI + epsilon; phi += PI/number_of_phi_points) {
333 JFunction1D_t& f1 = pdf[R_m][theta][phi];
335 const JArray_t
array(R_m, theta, phi);
337 double t_old = transformer.getXn(
array, *X.begin());
342 const double t = transformer.getXn(
array, *x);
343 const double y = (pdf_c.*f)(R_m, theta, phi, t);
348 WARNING(
"dt < 0 " << *x <<
' ' << R_m <<
' ' << t <<
' ' << y << endl);
371 pdf.transform(transformer);
385 FATAL(error.what() << endl);