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 cout << "enter time (^C to exit) > " << flush;
101
102 for (double dt; cin >> dt; ) {
103
104 JFunction1D_t::result_type
y = pdf(x, D, cd, dir.
getTheta(), dir.
getPhi(), dt);
105
107 <<
FIXED(5,1) << D <<
' '
108 <<
FIXED(5,2) << cd <<
' '
111 <<
FIXED(5,1) << dt <<
' '
116 }
117
118 return 0;
119 }
120
121
123
124
125 const double t0 = 0.0;
126
128
130
132 }
133
135
136 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
137
138 const double dt = h0.GetBinCenter(i) - t0;
139
140 JFunction1D_t::result_type Y = pdf(x, D, cd, dir.
getTheta(), dir.
getPhi(), dt) * E;
141
142 h0.SetBinContent(i, get_value(Y));
143 }
144
145 out.Write();
146 out.Close();
147}
#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.