31{
34
36
37 string inputFile;
39 double E;
40 double D;
41 double cd;
43 double TTS_ns;
46
47 try {
48
49 JParser<> zap(
"Auxiliary program to draw PDF of Cherenkov light from EM-shower including shower profile using interpolation tables.");
50
53 zap[
'E'] =
make_field(E,
"shower energy [GeV]") = 1.0;
55 zap[
'c'] =
make_field(cd,
"cosine emission angle");
56 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
57 zap[
'T'] =
make_field(TTS_ns,
"PMT time smearing [ns]") = 0.0;
60
61 zap(argc, argv);
62 }
63 catch(const exception &error) {
64 FATAL(error.what() << endl);
65 }
66
67
75
76 JPDF_t pdf;
77
78 try {
79
80 NOTICE(
"loading input from file " << inputFile <<
"... " << flush);
81
82 pdf.load(inputFile.c_str());
83
84 pdf.setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
85
86 if (TTS_ns > 0.0) {
87 pdf.blur(TTS_ns);
88 }
89
91 }
94 }
95
96 const double x = log10(E);
97
99
100 for (double dt; cin >> dt; ) {
101
102 JFunction1D_t::result_type
y = pdf(x, D, cd, dir.
getTheta(), dir.
getPhi(), dt);
103
105 <<
FIXED(5,1) << D <<
' '
106 <<
FIXED(5,2) << cd <<
' '
109 <<
FIXED(5,1) << dt <<
' '
114 }
115
116 return 0;
117 }
118
119
121
122
123 const double t0 = 0.0;
124
126
128
130 }
131
133
134 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
135
136 const double dt = h0.GetBinCenter(i) - t0;
137
138 JFunction1D_t::result_type Y = pdf(x, D, cd, dir.
getTheta(), dir.
getPhi(), dt) * E;
139
140 h0.SetBinContent(i, get_value(Y));
141 }
142
143 out.Write();
144 out.Close();
145}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
virtual const char * what() const override
Get error message.
Utility class to parse command line options.
Multi-dimensional PDF table for arrival time of Cherenkov light.
static const JZero zero
Function object to assign zero value.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Auxiliary data structure for floating point format specification.