33{
36
38
44 double E;
47
48 try {
49
50 JParser<> zap(
"Program to plot PDF of Cherenkov light from EM-shower using interpolation tables.");
51
54 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
57 zap[
'E'] =
make_field(E,
"Energy [GeV]") = 0.0;
60
61 zap(argc, argv);
62 }
63 catch(const exception &error) {
64 FATAL(error.what() << endl);
65 }
66
67
69
70 if (E > 0.0) {
72 Z.push_back(geanz.getLength(E, (i + 0.5) / (
double)
numberOfPoints));
73 }
74 }
75
76
78 typedef
85
87
88 const int N = inputFile.size();
89
90 JPDF_t pdf[N];
91 JNPE_t npe[N];
92
93 try {
94
95 for (int i = 0; i != N; ++i) {
96
97 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
98
99 pdf[i].load(inputFile[i].c_str());
100
101 pdf[i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
102
103 npe[i] = JNPE_t(pdf[i]);
104
106 }
107 }
110 }
111
112
114
117
118 TH2D h0("h0", "PDF Projection; D [m]; cos #theta_{0}",
119 x.getNumberOfBins(),
x.getLowerLimit(),
x.getUpperLimit(),
120 y.getNumberOfBins(),
y.getLowerLimit(),
y.getUpperLimit());
121
122 for (int ix = 1; ix <= h0.GetNbinsX(); ++ix) {
123 for (int iy = 1; iy <= h0.GetNbinsY(); ++iy) {
124
125 const double cd = h0.GetYaxis()->GetBinCenter(iy);
126 const double D = h0.GetXaxis()->GetBinCenter(ix);
127
128 double Y = 0.0;
129
130 if (!Z.empty()) {
131
132 const double W = 1.0 / (double) Z.size();
133
134 for (vector<double>::const_iterator z = Z.begin(); z != Z.end(); ++z) {
135
136 const double __D = sqrt(D*D - 2.0*(D*cd)*(*z) + (*z)*(*z));
137 const double __cd = (D * cd - (*z)) / __D;
138
139 for (int i = 0; i != N; ++i) {
140 try {
142 }
143 catch(const exception& error) {}
144 }
145 }
146
147 } else {
148
149 for (int i = 0; i != N; ++i) {
151 }
152 }
153
154 h0.SetBinContent(ix, iy, Y);
155 }
156 }
157
158 out.Write();
159 out.Close();
160}
#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.
Custom class for integrated values of the PDF of the arrival time of Cherenkov light.
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).