29{
32
34
37 double E;
38 double D;
39 double ct;
40 double TTS_ns;
43
44 try {
45
46 JParser<> zap(
"Program to plot PDF of Cherenkov light from bright point using interpolation tables.");
47
50 zap[
'E'] =
make_field(E,
"shower energy [GeV]") = 1.0;
53 zap[
'T'] =
make_field(TTS_ns,
"PMT time smearing [ns]") = 0.0;
56
57 zap(argc, argv);
58 }
59 catch(const exception &error) {
60 FATAL(error.what() << endl);
61 }
62
64
69
70 const int N = inputFile.size();
71
72 int type[N];
73 JPDF_t pdf [N];
74
75 try {
76
77 for (int i = 0; i != N; ++i) {
78
79 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
80
82
83 pdf [i].load(inputFile[i].c_str());
84
85 pdf [i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
86
87 if (TTS_ns > 0.0) {
88 pdf[i].blur(TTS_ns);
89 }
90
92 }
93 }
96 }
97
98
100
101 cout << "enter time (^C to exit) > " << flush;
102
103 for (double dt; cin >> dt; ) {
104
105 for (int i = 0; i != N; ++i) {
106
107 JFunction1D_t::result_type
y = pdf[i](D, ct, dt);
108
109 cout << setw(2) << type[i] << ' '
111 <<
FIXED(5,1) << D <<
' '
112 <<
FIXED(5,2) << ct <<
' '
113 <<
FIXED(5,1) << dt <<
' '
118 }
119 }
120
121 return 0;
122 }
123
124
126
127 int function = 0;
128
129 if (inputFile.size() == 1 &&
130 inputFile.begin()->find(
getLabel(SCATTERED_LIGHT_FROM_BRIGHT_POINT)) == string::npos) {
131 function = 1;
132 }
133
134
135 const double t0 = 0.0;
136
138
139 if (function == 1) {
140
142
144
145 } else {
146
148
150 }
151 }
152
154
155 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
156
157 const double dt = h0.GetBinCenter(i) - t0;
158
160
161 for (
int j = 0;
j != N; ++
j) {
162 Y += pdf[
j](D, ct, dt) * E;
163 }
164
165 h0.SetBinContent(i, get_value(Y));
166 }
167
168 out.Write();
169 out.Close();
170}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
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.
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
static const JZero zero
Function object to assign zero value.
int getPDFType(const std::string &file_name)
Get PDF type.
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.