35 typedef JAbstractHistogram<double> JHistogram_t;
43 JHistogram_t histogram;
48 JParser<> zap(
"Program to plot PDF of Cherenkov light from muon using interpolation tables.");
52 zap[
'E'] =
make_field(E,
"muon energy [GeV]") = 1.0;
53 zap[
'R'] =
make_field(R,
"distance of approach [m]");
54 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
55 zap[
'T'] =
make_field(TTS_ns,
"PMT time smearing [ns]") = 0.0;
56 zap[
'H'] =
make_field(histogram,
"histogram binning") = JHistogram_t();
61 catch(
const exception &error) {
62 FATAL(error.what() << endl);
66 typedef JSplineFunction1S_t JFunction1D_t;
68 typedef JMAPLIST<JPolint1FunctionalMap,
69 JPolint1FunctionalGridMap,
70 JPolint1FunctionalGridMap>::maplist JMapList_t;
71 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
73 const int N = inputFile.size();
80 for (
int i = 0; i != N; ++i) {
82 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
86 pdf [i].load(inputFile[i].c_str());
88 pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
97 catch(
const JException& error) {
98 FATAL(error.what() << endl);
104 for (
double dt; cin >> dt; ) {
106 for (
int i = 0; i != N; ++i) {
108 JFunction1D_t::result_type y = pdf[i](R, dir.getTheta(), dir.getPhi(), dt);
116 cout << setw(2) << type[i] <<
' '
118 <<
FIXED(5,1) << R <<
' '
119 <<
FIXED(5,2) << dir.getTheta() <<
' '
120 <<
FIXED(5,2) << dir.getPhi() <<
' '
121 <<
FIXED(5,1) << dt <<
' '
140 const double t0 = 0.0;
142 if (!histogram.is_valid()) {
146 histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
148 histogram.setBinWidth(0.1);
152 histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
154 histogram.setBinWidth(0.5);
158 TH1D h0(
"h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
159 TH1D h1(
"h1", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
160 TH1D h2(
"h2", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
162 for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
164 const double dt = h0.GetBinCenter(i) - t0;
168 for (
int j = 0;
j != N; ++
j) {
170 JFunction1D_t::result_type y = pdf[
j](R, dir.getTheta(), dir.getPhi(), dt);