34int main(
int argc,
char **argv)
53 JParser<> zap(
"Auxiliary program to determine PDF of L1 hit.");
67 catch(
const exception &error) {
77 JFunction1D_t::JSupervisor
supervisor(
new JFunction1D_t::JDefaultResult(zero));
79 const JPDFType_t pdf_t[] = {
80 DIRECT_LIGHT_FROM_MUON,
81 SCATTERED_LIGHT_FROM_MUON,
82 DIRECT_LIGHT_FROM_DELTARAYS,
83 SCATTERED_LIGHT_FROM_DELTARAYS,
84 DIRECT_LIGHT_FROM_EMSHOWERS,
85 SCATTERED_LIGHT_FROM_EMSHOWERS
88 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
92 for (
int i = 0; i != N; ++i) {
96 const string file_name = getFilename(inputFile, pdf_t[i]);
98 NOTICE(
"loading input from file " << file_name <<
"... " << flush);
100 pdf[i].load(file_name.c_str());
119 JModule module = getModule<JKM3NeT_t>(1);
121 module.rotate(JRotation3D(dir));
130 for (
double t1 =
histogram.getLowerLimit(); t1 <=
histogram.getUpperLimit(); t1 += 0.1) {
132 const double t2 = t1 + T_ns;
134 JFunction1D_t::result_type y1;
135 JFunction1D_t::result_type y2;
137 for (
int i = 0; i != N; ++i) {
139 JFunction1D_t::result_type
p1;
140 JFunction1D_t::result_type p2;
144 for (
const auto& pmt :
module) {
145 p1 += pdf[i](R, pmt.getTheta(), pmt.getPhi(), t1);
146 p2 += pdf[i](R, pmt.getTheta(), pmt.getPhi(), t2);
149 if (is_deltarays(pdf_t[i])) {
150 p1 *= JDeltaRays::getEnergyLossFromMuon(E);
151 p2 *= JDeltaRays::getEnergyLossFromMuon(E);
152 }
else if (is_bremsstrahlung(pdf_t[i])) {
164 y1.v += R_Hz * 1e-9 * (t1 -
histogram.getLowerLimit());
165 y2.v += R_Hz * 1e-9 * (t2 -
histogram.getLowerLimit());
167 zsp[t1] = y1.f * (1.0 -
exp(y1.v - y2.v));
172 for (
int ix = 1;
ix <= h0.GetNbinsX(); ++
ix) {
174 const double t1 = h0.GetBinCenter(
ix);
178 const JFunction1D_t::result_type result =
zsp(t1);
180 const double W =
exp(-result.v) * result.f / (1.0 -
exp(-result.V));
182 h0.SetBinContent(
ix, W);
184 catch(
const exception&) {}